/* بطولة السنوكر — registration pages. Maqar's blues (navy #0A2342 · #163C6B · #156496 · cyan #21A9DB · sky #5FC9F3 ·
   ice #EAF6FD) on a billiard table under a lamp. Two looks: .night (/adults) and .day (/school). */

@font-face { font-family: 'Kufi'; src: url('/fonts/kufi.ttf') format('truetype'); font-weight: 600 900; font-display: swap; }
@font-face { font-family: 'Alexandria'; src: url('/fonts/alexandria.ttf') format('truetype'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow.ttf') format('truetype'); font-weight: 900; font-style: italic; font-display: swap; }

:root {
  --navy: #0A2342; --navy2: #163C6B; --blue: #156496; --cyan: #21A9DB; --sky: #5FC9F3; --ice: #EAF6FD;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

.night {
  --bg: #040B18; --ink: #FFFFFF; --ink-soft: #A7C6E4; --ink-faint: #6E8FB2;
  --accent: #21A9DB; --accent2: #5FC9F3;
  --card: rgba(16, 44, 84, .55); --card-line: rgba(95, 201, 243, .22); --field: rgba(255, 255, 255, .07);
  --field-line: rgba(95, 201, 243, .28); --title-a: #FFFFFF; --title-b: #CFEAFB; --shadow: rgba(0, 0, 0, .55);
  color-scheme: dark;
}

.day {
  --bg: #F2F8FD; --ink: #0A2342; --ink-soft: #3E6286; --ink-faint: #7C98B5;
  --accent: #156496; --accent2: #21A9DB;
  --card: rgba(255, 255, 255, .82); --card-line: rgba(21, 100, 150, .16); --field: #FFFFFF;
  --field-line: rgba(21, 100, 150, .25); --title-a: #0A2342; --title-b: #156496; --shadow: rgba(10, 35, 66, .28);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  min-height: 100vh; min-height: 100dvh;
  font-family: 'Alexandria', system-ui, sans-serif; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button { font: inherit; }

/* ── the sky behind everything ── */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.night .sky {
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(33, 169, 219, .30), transparent 60%),
    radial-gradient(90% 60% at 50% 110%, rgba(22, 60, 107, .55), transparent 70%),
    linear-gradient(180deg, #071733 0%, #050F22 45%, #030914 100%);
}
.day .sky {
  background:
    radial-gradient(110% 60% at 50% -12%, rgba(95, 201, 243, .45), transparent 62%),
    radial-gradient(80% 50% at 100% 100%, rgba(33, 169, 219, .16), transparent 70%),
    linear-gradient(180deg, #FFFFFF 0%, #EEF7FD 55%, #E1F1FB 100%);
}
.sky .glow { position: absolute; width: 140vmax; height: 140vmax; left: 50%; top: -95vmax; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(95, 201, 243, .16), transparent); }
.sky .beam { position: absolute; left: 50%; top: -10vh; width: 120vw; height: 95vh; transform: translateX(-50%);
  background: conic-gradient(from 180deg at 50% 0%, transparent 155deg, rgba(234, 246, 253, .07) 172deg,
  rgba(234, 246, 253, .11) 180deg, rgba(234, 246, 253, .07) 188deg, transparent 205deg);
  filter: blur(6px); }
.day .sky .beam { background: conic-gradient(from 180deg at 50% 0%, transparent 155deg, rgba(21, 100, 150, .05) 172deg,
  rgba(21, 100, 150, .08) 180deg, rgba(21, 100, 150, .05) 188deg, transparent 205deg); }

/* ── the page ── */
.page {
  position: relative; z-index: 1; width: 100%; max-width: 480px; margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(26px + env(safe-area-inset-bottom));
}
.top { display: flex; justify-content: center; padding-top: 4px; }
.logo { width: min(62vw, 270px); height: auto; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .25)); }
.day .logo { filter: none; }

.hero { text-align: center; margin-top: 18px; }
.tag {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 6px;
  font-family: 'Kufi'; font-weight: 800; font-size: 15px; letter-spacing: .5px; color: var(--accent2);
}
.tag b { padding: 5px 16px 6px; border-radius: 999px; border: 1.5px solid var(--accent); color: var(--ink);
  background: linear-gradient(180deg, rgba(33, 169, 219, .22), rgba(33, 169, 219, .06)); font-weight: 800; }
.tag i { width: 26px; height: 1.5px; background: linear-gradient(90deg, transparent, var(--accent)); }
.tag i:last-child { transform: scaleX(-1); }

.title { margin: 0; font-family: 'Kufi'; line-height: 1; }
.title .t1 { display: block; font-weight: 700; font-size: clamp(26px, 7.4vw, 34px); color: var(--accent2); letter-spacing: .3px; }
.title .t2 {
  display: block; margin-top: 2px; padding-bottom: .12em; font-weight: 900; font-size: clamp(62px, 19vw, 92px); line-height: 1.12;
  background: linear-gradient(180deg, var(--title-a) 30%, var(--title-b) 100%); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.night .title .t2 { filter: drop-shadow(0 0 22px rgba(33, 169, 219, .35)) drop-shadow(0 4px 0 rgba(0, 0, 0, .25)); }
.day .title .t2 { filter: drop-shadow(0 6px 14px rgba(21, 100, 150, .18)); }

.when { display: inline-flex; align-items: center; gap: 12px; margin-top: 4px; direction: rtl; }
.when .wday {
  font-family: 'Kufi'; font-weight: 800; font-size: 17px; color: #fff; padding: 8px 16px 9px; border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--blue)); box-shadow: 0 8px 20px rgba(21, 100, 150, .35);
}
.when .num {
  font-family: 'Barlow', 'Alexandria'; font-style: italic; font-weight: 900; font-size: 58px; line-height: 1; letter-spacing: 1px;
  color: var(--ink); direction: ltr; unicode-bidi: isolate;
}

/* ── the break (as on the poster): floating balls, motion streaks, the cue ball's comet tail ── */
.burst { position: relative; width: calc(100% + 32px); margin: 8px -16px 0; aspect-ratio: 1080 / 500; cursor: pointer; overflow: hidden; }
.burst .pool { position: absolute; left: 4%; right: 4%; top: 18%; bottom: -6%; border-radius: 50%; filter: blur(22px); pointer-events: none;
  background: radial-gradient(closest-side, rgba(33, 140, 220, .32), rgba(21, 100, 150, .10) 60%, transparent); }
.day .burst .pool { background: radial-gradient(closest-side, rgba(33, 169, 219, .22), rgba(21, 100, 150, .06) 60%, transparent); }
.hb { position: absolute; aspect-ratio: 1; will-change: transform, opacity; }
.hb img { display: block; width: 100%; height: 100%; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .55)) drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.day .hb img { filter: drop-shadow(0 8px 10px rgba(10, 35, 66, .28)) drop-shadow(0 2px 3px rgba(10, 35, 66, .16)); }
.hb.far img { filter: blur(.7px) drop-shadow(0 6px 8px rgba(0, 0, 0, .35)); opacity: .92; }
.hb.idle { animation: float 4.2s ease-in-out infinite alternate; }
@keyframes float { from { translate: 0 -1.5px; } to { translate: 0 2px; } }
.streak { position: absolute; transform-origin: 0 50%; border-radius: 999px; filter: blur(2px); pointer-events: none;
  background: linear-gradient(90deg, rgba(95, 201, 243, 0), rgba(95, 201, 243, .55)); }
.day .streak { background: linear-gradient(90deg, rgba(21, 100, 150, 0), rgba(21, 100, 150, .35)); }
.comet { position: absolute; transform-origin: 0 50%; border-radius: 999px; filter: blur(4px); pointer-events: none;
  background: linear-gradient(90deg, rgba(234, 246, 253, 0), rgba(95, 201, 243, .35) 55%, rgba(234, 246, 253, .85)); }
.day .comet { background: linear-gradient(90deg, rgba(21, 100, 150, 0), rgba(33, 169, 219, .35) 55%, rgba(21, 100, 150, .55)); }

/* ── notes from the organisers ── */
.notes { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.notes:empty { display: none; }
.note {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px;
  font-family: 'Kufi'; font-weight: 700; font-size: 15.5px; line-height: 1.5; color: var(--ink);
  background: linear-gradient(90deg, rgba(33, 169, 219, .20), rgba(33, 169, 219, .07)); border: 1px solid rgba(33, 169, 219, .45);
}
.day .note { background: linear-gradient(90deg, rgba(33, 169, 219, .16), rgba(33, 169, 219, .05)); }
.note .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 0 rgba(95, 201, 243, .7); animation: ping 1.8s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(95, 201, 243, .7); } 80%, 100% { box-shadow: 0 0 0 10px rgba(95, 201, 243, 0); } }

/* ── the form ── */
.card {
  margin-top: 16px; padding: 20px 16px 16px; border-radius: 24px; color: #fff;
  background: linear-gradient(160deg, rgba(22, 60, 107, .94), rgba(10, 35, 66, .97)); border: 1.5px solid rgba(95, 201, 243, .35);
  box-shadow: 0 22px 44px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .14);
  --ink: #fff; --ink-soft: #CFE6F7; --ink-faint: #8FB0CF; --field: rgba(255, 255, 255, .08); --field-line: rgba(95, 201, 243, .35);
}
.day .card { box-shadow: 0 22px 44px rgba(10, 35, 66, .28), inset 0 1px 0 rgba(255, 255, 255, .14); }
.cta { margin: 0 2px; font-family: 'Kufi'; font-weight: 900; font-size: 30px; line-height: 1.25; }
.cta-sub { margin: 2px 2px 14px; font-weight: 600; font-size: 15px; color: #CFE6F7; }
.label { display: block; font-weight: 700; font-size: 13px; color: #9CC3E3; margin: 0 4px 6px; }
.field input {
  width: 100%; height: 56px; padding: 0 16px; border-radius: 16px; border: 1.5px solid var(--field-line); background: var(--field);
  color: var(--ink); font: 600 18px 'Alexandria', system-ui, sans-serif; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: var(--ink-faint); font-weight: 500; }
.field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(33, 169, 219, .22); }
.error { margin: 8px 4px 0; font-size: 14px; font-weight: 600; color: #FF8A8A; }

.go {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  height: 58px; margin-top: 12px; border: 0; border-radius: 16px; cursor: pointer; color: #fff;
  font-family: 'Kufi'; font-weight: 800; font-size: 19px;
  background: linear-gradient(135deg, #2BB6E8 0%, #1A86C4 45%, #156496 100%);
  box-shadow: 0 12px 26px rgba(21, 100, 150, .45), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.go svg { width: 26px; height: 26px; flex: none; }
.go::after { content: ''; position: absolute; inset: 0 auto 0 -60%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-18deg); animation: shine 3.6s 2.2s infinite; }
@keyframes shine { 0% { left: -60%; } 35%, 100% { left: 130%; } }
.go:active { transform: scale(.98); }
.go:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.go[disabled] { filter: grayscale(.6) brightness(.85); cursor: default; }
.hint { margin: 10px 4px 0; font-size: 13px; line-height: 1.6; color: var(--ink-soft); text-align: center; }

.closed { text-align: center; padding: 26px 18px 24px; }
.closed-icon { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center;
  color: var(--sky); background: rgba(33, 169, 219, .14); border: 1px solid rgba(33, 169, 219, .35); }

.closed-icon svg { width: 26px; height: 26px; }
.closed h2 { margin: 0 0 6px; font-family: 'Kufi'; font-weight: 900; font-size: 24px; }
.closed p { margin: 0; color: var(--ink-soft); line-height: 1.7; font-size: 15px; }

.foot { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; font-size: 12.5px; color: var(--ink-faint); }
.foot i { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-faint); opacity: .7; }
.foot span:first-child { font-family: 'Kufi'; font-weight: 700; }

/* ── the intro (Maqar's launch animation) ── */
.intro { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(70% 55% at 50% 32%, #061232 0%, #02050F 72%); transition: opacity .6s ease, visibility .6s; }
.intro video { height: 100%; width: 100%; object-fit: cover; }
@media (min-aspect-ratio: 1/2) {
  .intro video { width: auto; max-width: 100%; object-fit: contain;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%); }
}
.intro .skip { position: absolute; left: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); padding: 8px 16px; border-radius: 999px;
  border: 1px solid rgba(95, 201, 243, .35); background: rgba(10, 35, 66, .55); color: #CFE6F7; font: 600 13px 'Alexandria', sans-serif;
  cursor: pointer; opacity: 0; transition: opacity .4s; }
.intro.can-skip .skip { opacity: 1; }
.intro.out { opacity: 0; visibility: hidden; pointer-events: none; }
html:not(.js) .intro { display: none; }

/* ── the page coming in after the intro ── */
.js .page > *, .js .hero > * { opacity: 0; }
.ready .top { animation: drop .8s var(--ease-out) both; }
.ready .hero > * { animation: rise .9s var(--ease-out) both; }
.ready .hero > :nth-child(1) { animation-delay: .08s; }
.ready .hero > :nth-child(2) { animation-delay: .16s; }
.ready .hero > :nth-child(3) { animation-delay: .30s; }
.ready .hero { opacity: 1; }
.ready .title .t2 { animation: reveal 1.1s .22s var(--ease-out) both; }
.ready .burst { animation: fade .6s .2s both; }
.ready .notes { animation: rise .9s .55s var(--ease-out) both; }
.ready .card { animation: rise .9s .62s var(--ease-out) both; }
.ready .foot { animation: fade 1s .9s both; }
@keyframes drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes reveal { from { clip-path: inset(0 0 100% 0); transform: translateY(12px); } to { clip-path: inset(0 0 -20% 0); transform: none; } }

@media (min-width: 760px) {
  .page { padding-top: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .ready .page > *, .ready .hero > *, .ready .title .t2 { animation: none !important; opacity: 1 !important; }
  .go::after, .note .dot { animation: none; }
}
