/* «To‘y osmoni» */
:root { --ink: #f4ead6; --ink2: rgba(244, 234, 214, .78); --gold: #e5c47f; --gold2: #c9a35a; --muted: #aab3d8; --night: #060918; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--ink); overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif; -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
body:active #gl { cursor: grabbing; }

/* ——— splash ——— */
#splash { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: radial-gradient(130% 70% at 50% 100%, #1d1c44 0%, #0b0e2a 46%, #05071a 100%); transition: opacity 1.1s ease; }
body.ready #splash { opacity: 0; pointer-events: none; }
.sp-in { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.sp-star { width: 86px; height: 86px; animation: spRot 9s linear infinite; filter: drop-shadow(0 0 10px rgba(229, 196, 127, .45)); }
.sp-star path { stroke-dasharray: 420; stroke-dashoffset: 420; animation: spDraw 2.2s ease-in-out infinite alternate; }
@keyframes spDraw { to { stroke-dashoffset: 0; } }
@keyframes spRot { to { transform: rotate(360deg); } }
.sp-dots { display: flex; gap: 9px; }
.sp-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); opacity: .25; animation: spDot 1.4s ease-in-out infinite; }
.sp-dots i:nth-child(2) { animation-delay: .2s; } .sp-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes spDot { 50% { opacity: 1; transform: translateY(-3px); } }

/* ——— start screen texts ——— */
#top { position: fixed; left: 50%; top: max(66px, calc(env(safe-area-inset-top) + 58px)); transform: translateX(-50%); z-index: 10; width: min(92vw, 560px); text-align: center; pointer-events: none;
  opacity: 0; transition: opacity 1.2s ease .5s, transform 1s ease; }
body.ready #top { opacity: 1; }
body.linked #top { opacity: 0; transform: translate(-50%, -14px); transition-delay: 0s; }
#top .k { font: 700 11.5px/1 'Nunito', system-ui, sans-serif; letter-spacing: .28em; color: var(--gold); opacity: .9; }
#top .sl { margin-top: 7px; font: italic 500 19px/1.25 'Cormorant Garamond', Georgia, serif; color: var(--ink); text-shadow: 0 1px 12px rgba(6, 9, 24, .9); letter-spacing: .01em; text-wrap: balance; }

#hint { position: fixed; left: 50%; bottom: max(26px, calc(env(safe-area-inset-bottom) + 18px)); transform: translateX(-50%); z-index: 10; width: min(92vw, 520px); text-align: center; pointer-events: none;
  opacity: 0; transition: opacity 1s ease 1.2s, transform 1s ease; }
body.ready #hint { opacity: 1; }
body.linked #hint { opacity: 0; transform: translate(-50%, 12px); transition-delay: 0s; }
#hint .h1 { display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px 10px; border-radius: 99px; background: rgba(8, 10, 28, .58); box-shadow: 0 0 0 1px rgba(229, 196, 127, .32) inset;
  font: 600 18px/1.2 'Cormorant Garamond', Georgia, serif; color: var(--ink); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
#hint .h1 svg { width: 38px; height: 14px; flex: none; fill: var(--gold); stroke: var(--gold); stroke-width: 1.4; }
#hint .h2 { margin-top: 9px; font: 600 12.5px/1.2 'Nunito', system-ui, sans-serif; color: var(--muted); letter-spacing: .02em; text-shadow: 0 1px 8px #000; }
body.touched #hint .h2 { opacity: .7; }

#gyro { position: fixed; left: 50%; bottom: max(108px, calc(env(safe-area-inset-bottom) + 100px)); transform: translateX(-50%); z-index: 11; display: inline-flex; align-items: center; gap: 7px;
  border: 0; border-radius: 99px; padding: 7px 14px 7px 10px; background: rgba(8, 10, 28, .45); color: var(--ink2); font: 700 12.5px/1 'Nunito', system-ui, sans-serif; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(170, 179, 216, .28) inset; opacity: 0; transition: opacity .8s ease 1.6s; }
#gyro[hidden] { display: none; }
#gyro svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
body.ready #gyro { opacity: 1; }
body.gyro-on #gyro { color: #1b1530; background: linear-gradient(90deg, #f0d79c, #d9b46a); box-shadow: none; }
body.linked #gyro { opacity: 0; pointer-events: none; transition-delay: 0s; }

/* ——— labels of the two stars and the Moon ——— */
#labels { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity 1.2s ease .8s; }
body.ready #labels { opacity: 1; }
.lbl { position: absolute; left: 0; top: 0; text-align: center; white-space: nowrap; transition: opacity .3s ease; will-change: transform; }
.lbl b { display: block; font: 400 30px/1 'Great Vibes', 'Marck Script', cursive; color: #fbe9c0; text-shadow: 0 0 14px rgba(255, 205, 120, .55), 0 1px 3px rgba(0, 0, 0, .8); }
.lbl small { display: block; margin-top: 3px; font: 700 9.5px/1 'Nunito', system-ui, sans-serif; letter-spacing: .24em; color: var(--muted); text-shadow: 0 1px 6px #000; }
.lbl.moon { font: 700 9.5px/1 'Nunito', system-ui, sans-serif; letter-spacing: .24em; color: rgba(235, 228, 210, .6); text-shadow: 0 1px 6px #000; }
body.linked #lb0, body.linked #lb1 { opacity: 0 !important; transition: opacity .9s ease .5s; }

#finger { position: fixed; left: 0; top: 0; z-index: 6; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle, rgba(255, 246, 220, .75) 0 18%, rgba(255, 230, 170, .25) 34%, rgba(255, 220, 150, 0) 70%); box-shadow: 0 0 0 1.5px rgba(255, 240, 210, .45); }
#finger.on { opacity: 1; }

/* ——— the card ——— */
#sheet { position: fixed; inset: 0; z-index: 20; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; pointer-events: none; visibility: hidden; scrollbar-width: none; }
#sheet::-webkit-scrollbar { display: none; }
#sheet.show { visibility: visible; }
body.scrolled #sheet { -webkit-mask-image: linear-gradient(180deg, transparent 0, transparent 44px, #000 96px); mask-image: linear-gradient(180deg, transparent 0, transparent 44px, #000 96px); }
#sheet .spacer { height: var(--sp, 60vh); }
.card { pointer-events: auto; position: relative; box-sizing: border-box; margin: 0 12px 22px; padding: 30px 22px 26px; border-radius: 28px; text-align: center; touch-action: pan-y;
  background: linear-gradient(180deg, rgba(17, 22, 56, .97) 0%, rgba(12, 15, 42, .985) 22%, rgba(8, 10, 30, .99) 100%);
  box-shadow: 0 0 0 1px rgba(229, 196, 127, .34) inset, 0 0 0 5px rgba(229, 196, 127, .05) inset, 0 -16px 50px -18px rgba(0, 0, 0, .75);
  transform: translateY(70px); opacity: 0; transition: transform 1.1s cubic-bezier(.2, .8, .2, 1), opacity .9s ease; -webkit-user-select: text; user-select: text; }
#sheet.show .card { transform: none; opacity: 1; }
.card::before { content: ""; position: absolute; inset: 9px; border-radius: 21px; border: 1px solid rgba(229, 196, 127, .14); pointer-events: none; }
.card .orn { width: 34px; height: 34px; margin: -4px auto 10px; color: var(--gold); filter: drop-shadow(0 0 8px rgba(229, 196, 127, .5)); }
.card .orn svg, .card .sep svg { width: 100%; height: 100%; display: block; }
.card .kick { font: 700 11px/1.2 'Nunito', system-ui, sans-serif; letter-spacing: .26em; color: var(--gold); margin-bottom: 10px; }
.card .hello { margin: 0; font: 600 25px/1.2 'Cormorant Garamond', Georgia, serif; color: var(--ink); }
.card .inv { margin: 8px auto 0; max-width: 330px; text-wrap: balance; font: italic 500 19px/1.35 'Cormorant Garamond', Georgia, serif; color: var(--ink2); }
.card .sep { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 24px auto 20px; color: var(--gold2); }
.card .sep i { height: 1px; flex: 1; max-width: 90px; background: linear-gradient(90deg, rgba(229, 196, 127, 0), rgba(229, 196, 127, .55)); }
.card .sep i:last-child { transform: scaleX(-1); }
.card .sep svg { width: 16px; height: 16px; flex: none; }
.card .date { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 2px 0 16px; }
.card .date b { font: 600 68px/0.9 'Cormorant Garamond', Georgia, serif; font-variant-numeric: lining-nums; color: #f6e1ad; text-shadow: 0 0 22px rgba(229, 196, 127, .35); }
.card .date span { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.card .date em { font: italic 600 28px/1.05 'Cormorant Garamond', Georgia, serif; color: var(--ink); }
.card .date small { margin-top: 5px; font: 700 13px/1.2 'Nunito', system-ui, sans-serif; color: var(--muted); }
.card .cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 330px; margin: 0 auto; }
.card .cd div { padding: 11px 0 9px; border-radius: 14px; background: rgba(255, 255, 255, .035); box-shadow: 0 0 0 1px rgba(229, 196, 127, .22) inset; }
.card .cd b { display: block; font: 600 30px/1 'Cormorant Garamond', Georgia, serif; color: #f6e1ad; font-variant-numeric: lining-nums tabular-nums; }
.card .cd small { display: block; margin-top: 5px; font: 700 10.5px/1 'Nunito', system-ui, sans-serif; color: var(--muted); letter-spacing: .04em; }
.card .dline { margin: 12px 0 0; font: 600 15px/1.3 'Cormorant Garamond', Georgia, serif; color: var(--ink2); }
.card .today { margin: 4px 0 0; font: italic 600 22px/1.3 'Cormorant Garamond', Georgia, serif; color: #f6e1ad; }
.card .hall { margin: 0; font: 600 27px/1.15 'Cormorant Garamond', Georgia, serif; color: var(--ink); }
.card .addr { margin: 6px 0 0; font: 500 17px/1.3 'Cormorant Garamond', Georgia, serif; color: var(--ink2); }
.card .btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.card .tpl-btn { background: rgba(255, 255, 255, .05); color: #f3dfb0; box-shadow: 0 0 0 1px rgba(229, 196, 127, .5) inset; font-size: 14px; padding: 10px 18px; }
.card .tpl-btn.pri { background: linear-gradient(90deg, #f0d79c, #d6af64); color: #22182b; box-shadow: 0 10px 22px -12px rgba(229, 196, 127, .8); }
.card .skyl { margin: 0; font: italic 600 19px/1.3 'Cormorant Garamond', Georgia, serif; color: #f6e1ad; text-wrap: balance; }
.card .real { margin: 8px auto 0; text-wrap: balance; max-width: 340px; font: 500 16px/1.4 'Cormorant Garamond', Georgia, serif; color: var(--ink2); }
.card .pair { margin: 10px 0 0; font: 700 12px/1.5 'Nunito', system-ui, sans-serif; color: var(--muted); letter-spacing: .03em; }
.card .pair i { font-style: normal; margin: 0 8px; color: var(--gold2); }
.card .seat { margin: 0; text-wrap: balance; font: 600 25px/1.2 'Cormorant Garamond', Georgia, serif; color: var(--ink); }
.card .wait { margin: 8px 0 0; font: italic 500 19px/1.3 'Cormorant Garamond', Georgia, serif; color: var(--ink2); }
.card .ayah { margin: 22px auto 0; padding: 18px 14px 16px; max-width: 340px; border-radius: 18px; background: radial-gradient(120% 100% at 50% 0%, rgba(229, 196, 127, .1), rgba(229, 196, 127, 0) 70%); }
.card .ayah .ar { margin: 0; font: 400 34px/1.5 'Amiri', serif; color: #f6e1ad; text-shadow: 0 0 18px rgba(229, 196, 127, .3); }
.card .ayah .tr { margin: 6px 0 0; text-wrap: balance; font: italic 500 18px/1.35 'Cormorant Garamond', Georgia, serif; color: var(--ink); }
.card .ayah small { display: block; margin-top: 6px; font: 700 11px/1.3 'Nunito', system-ui, sans-serif; color: var(--muted); letter-spacing: .04em; }
.card .sign { margin: 20px 0 0; font: 400 38px/1.15 'Great Vibes', 'Marck Script', cursive; color: #f6e1ad; text-shadow: 0 0 16px rgba(229, 196, 127, .35); overflow-wrap: anywhere; }
.card .again { margin-top: 18px; border: 0; background: none; color: var(--muted); font: 700 13px/1 'Nunito', system-ui, sans-serif; letter-spacing: .06em; padding: 10px 14px; cursor: pointer; }
html[lang="ru"] .card .hello, html[lang="ru"] .card .seat { font-size: 24px; }

#scrollHint { position: fixed; left: 12px; right: 12px; bottom: 0; z-index: 25; height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: max(8px, env(safe-area-inset-bottom)); box-sizing: border-box; border-radius: 0 0 28px 28px; pointer-events: none; opacity: 0; transition: opacity .8s ease; color: var(--gold);
  background: linear-gradient(180deg, rgba(8, 10, 30, 0), rgba(8, 10, 30, .97) 58%); }
#scrollHint svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; animation: bob 1.6s ease-in-out infinite; }
#scrollHint span { font: 700 10.5px/1 'Nunito', system-ui, sans-serif; letter-spacing: .2em; color: var(--muted); }
body.formed #scrollHint { opacity: 1; transition-delay: 2.2s; }
body.scrolled #scrollHint { opacity: 0 !important; transition-delay: 0s; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* ——— wide screens: the card on the right, the sky on the left ——— */
body.wide .card { width: min(460px, 40vw); margin: 0 30px 34px auto; padding: 34px 30px 28px; }
body.wide #scrollHint { left: auto; right: 30px; width: min(460px, 40vw); }
body.wide #top .sl { font-size: 22px; }
body.wide .lbl b { font-size: 34px; }

/* no WebGL: just the card on a night gradient */
body.nogl { background: radial-gradient(140% 80% at 50% 100%, #2a2350 0%, #0d1030 45%, #05071a 100%); }
body.nogl #gl, body.nogl #top, body.nogl #hint, body.nogl #labels { display: none; }
body.nogl #sheet .spacer { height: 80px; }
@media (max-width: 360px) { .card { padding: 26px 16px 22px; } .card .date b { font-size: 58px; } #top .sl { font-size: 17px; } #hint .h1 { font-size: 16.5px; } }
