/* =====================================================================
   games.css — Game Galaxy (games.php and games_live.php)
   A space theme on the site's own colours: night #0B0B15, the four skill
   colours and gold for stars.
   ===================================================================== */
:root {
  --gl-night: #0B0B15; --gl-deep: #08080F; --gl-card: #15152A; --gl-card2: #1d1d38;
  --gl-ink: #f4f3ff; --gl-muted: #a9aacb; --gl-line: rgba(255, 255, 255, .1);
  --gl-gold: #fbbf24; --gl-L: #10b981; --gl-R: #3b82f6; --gl-W: #8b5cf6; --gl-S: #f97316; --gl-red: #f43f5e;
  --gl-display: 'Fredoka', 'Baloo 2', 'Inter', system-ui, sans-serif;
}
body.gl-page { background: var(--gl-night); }
.gl { position: relative; min-height: 100vh; color: var(--gl-ink); font-family: 'Inter', system-ui, sans-serif; padding: 124px 16px 60px; overflow: hidden; isolation: isolate; }
@media (max-width: 1023px) { .gl { padding-top: 78px; } }
.gl *, .gl-stage *, .gl-sheet * { box-sizing: border-box; }
.gl-sky, .gl-stage::before { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 72% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 38% 66%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 88% 48%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 88%, #fff 50%, transparent 51%), radial-gradient(1.3px 1.3px at 58% 32%, #c4b5fd 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 82%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 6% 52%, #93c5fd 50%, transparent 51%),
    radial-gradient(60% 40% at 15% 10%, rgba(124, 58, 237, .28), transparent 70%),
    radial-gradient(50% 40% at 90% 30%, rgba(37, 99, 235, .22), transparent 70%),
    radial-gradient(60% 50% at 50% 100%, rgba(16, 185, 129, .12), transparent 70%);
  background-size: 260px 260px, 310px 310px, 230px 230px, 370px 370px, 290px 290px, 410px 410px, 330px 330px, 270px 270px, 100% 100%, 100% 100%, 100% 100%;
  animation: gl-twinkle 8s ease-in-out infinite alternate; }
.gl-sky { position: fixed; }
@keyframes gl-twinkle { from { opacity: .75; } to { opacity: 1; } }

/* ── buttons ── */
.gl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 16px; border: 0;
  font: 700 16px/1 var(--gl-display); letter-spacing: .01em; color: #1a1033; background: #fff; cursor: pointer; text-decoration: none;
  transition: transform .15s, box-shadow .2s, filter .2s; }
.gl-btn:hover { transform: translateY(-2px); }
.gl-btn:active { transform: translateY(1px) scale(.98); }
.gl-btn:disabled { opacity: .45; cursor: default; transform: none; }
.gl-btn.sun { background: linear-gradient(135deg, #fde68a, var(--gl-gold) 45%, #f97316); box-shadow: 0 8px 24px -8px rgba(251, 191, 36, .7), inset 0 -3px 0 rgba(0, 0, 0, .15); }
.gl-btn.ghost { background: rgba(255, 255, 255, .08); color: var(--gl-ink); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22); }
.gl-btn.big { min-height: 60px; font-size: 21px; padding: 0 36px; border-radius: 20px; }
.gl-btn.up { background: linear-gradient(135deg, #6ee7b7, var(--gl-L)); }
.gl-btn.down { background: linear-gradient(135deg, #fdba74, var(--gl-S)); }
.gl-btn:focus-visible, .gl-opt:focus-visible, .gl-pack:focus-visible, .gl-pl:focus-visible, .gl-tile:focus-visible { outline: 3px solid var(--gl-gold); outline-offset: 3px; }
.gl-x { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: var(--gl-ink); font: 700 18px/1 system-ui; cursor: pointer; }
.gl-x:hover { background: rgba(255, 255, 255, .18); }
.gl-muted { color: var(--gl-muted); font-size: 14px; }
.gl-muted a, .gl-xp a { color: var(--gl-gold); }

/* ── hero ── */
.gl-hero { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr; gap: 10px 28px; align-items: center; }
.gl-logo { position: relative; width: 150px; animation: gl-float 6s ease-in-out infinite; }
.gl-logo .gl-planet { width: 100%; height: auto; filter: drop-shadow(0 14px 30px rgba(139, 92, 246, .45)); }
.gl-logostar { position: absolute; top: 2px; right: 6px; color: var(--gl-gold); font-style: normal; font-size: 30px; animation: gl-spinstar 5s linear infinite; text-shadow: 0 0 12px rgba(251, 191, 36, .8); }
@keyframes gl-spinstar { 50% { transform: scale(1.25) rotate(20deg); } }
@keyframes gl-float { 50% { transform: translateY(-8px); } }
.gl-kicker { margin: 0; font: 700 12px/1 var(--gl-display); letter-spacing: .18em; text-transform: uppercase; color: #c4b5fd; }
.gl-hero h1 { margin: 6px 0 6px; font: 700 clamp(38px, 7vw, 64px)/1 var(--gl-display); letter-spacing: -.01em; }
.gl-hero h1 span { background: linear-gradient(90deg, var(--gl-gold), var(--gl-S) 40%, var(--gl-W) 70%, var(--gl-R)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gl-lead { margin: 0 0 14px; color: var(--gl-muted); font-size: 16px; max-width: 520px; }
.gl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; background: rgba(255, 255, 255, .07); border: 1px solid var(--gl-line); font: 700 15px/1 var(--gl-display); color: var(--gl-ink); }
.gl-chip small { font: 500 12px/1 'Inter', sans-serif; color: var(--gl-muted); }
.gl-chip.gold { color: var(--gl-gold); border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .08); }
.gl-chip.btn { cursor: pointer; }
.gl-heroact { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
@media (max-width: 640px) {
  .gl-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .gl-logo { width: 120px; } .gl-chips, .gl-heroact { justify-content: center; } .gl-heroact .gl-btn { flex: 1 1 100%; }
}

/* ── today's mission ── */
.gl-mission { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 1100px; margin: 26px auto 8px; padding: 12px 18px 12px 12px; border-radius: 22px; border: 0; cursor: pointer; text-align: left; color: var(--gl-ink);
  background: linear-gradient(110deg, rgba(251, 191, 36, .16), rgba(139, 92, 246, .14) 60%, rgba(59, 130, 246, .12)); box-shadow: inset 0 0 0 1.5px rgba(251, 191, 36, .35); transition: transform .2s; }
.gl-mission:hover { transform: translateY(-2px); }
.gl-mission.done { box-shadow: inset 0 0 0 1.5px rgba(16, 185, 129, .5); background: linear-gradient(110deg, rgba(16, 185, 129, .16), rgba(59, 130, 246, .1)); }
.gl-mplanet { width: 58px; flex: none; } .gl-mplanet svg { width: 100%; height: auto; }
.gl-mtext { flex: 1; display: grid; gap: 3px; font-size: 14px; color: var(--gl-muted); }
.gl-mtext b { font: 700 17px/1.1 var(--gl-display); color: var(--gl-gold); }
.gl-mission.done .gl-mtext b { color: #6ee7b7; }
.gl-mtext em { font-style: normal; color: var(--gl-ink); font-weight: 600; }
.gl-mgo { font: 700 16px/1 var(--gl-display); color: var(--gl-gold); white-space: nowrap; }

/* ── the galaxy of planets ── */
.gl-galaxy { position: relative; max-width: 1100px; margin: 18px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 18px; padding: 10px 0 40px; }
.gl-orbit { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .35; }
.gl-orbit path { fill: none; stroke: #c4b5fd; stroke-width: .35; stroke-dasharray: 1 2.2; vector-effect: non-scaling-stroke; }
.gl-pl { display: grid; justify-items: center; gap: 4px; padding: 12px 8px 16px; border: 0; border-radius: 26px; background: none; color: var(--gl-ink); cursor: pointer; text-align: center; transition: background .25s, transform .25s; }
.gl-pl:nth-child(3n+3) { transform: translateY(26px); } .gl-pl:nth-child(3n+1) { transform: translateY(10px); }
.gl-pl:hover { background: rgba(255, 255, 255, .05); }
.gl-plart { width: 150px; animation: gl-float 7s ease-in-out infinite; animation-delay: calc(var(--i) * -0.8s); }
.gl-plart svg { width: 100%; height: auto; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .5)); transition: transform .35s cubic-bezier(.3, 1.5, .5, 1); }
.gl-pl:hover .gl-plart svg { transform: scale(1.08) rotate(-4deg); }
.gl-plname { font: 700 21px/1.1 var(--gl-display); }
.gl-plsub { font-size: 13px; color: var(--gl-muted); max-width: 220px; }
.gl-plstars { margin-top: 4px; padding: 4px 12px; border-radius: 99px; background: rgba(251, 191, 36, .1); color: var(--gl-gold); font: 700 14px/1.2 var(--gl-display); }
.gl-plstars small { color: rgba(251, 191, 36, .6); }
@media (max-width: 760px) {
  .gl-galaxy { grid-template-columns: 1fr 1fr; gap: 14px 10px; }
  .gl-pl:nth-child(n) { transform: none; } .gl-pl:nth-child(even) { transform: translateY(34px); }
  .gl-plart { width: 118px; } .gl-plname { font-size: 18px; } .gl-plsub { font-size: 12px; }
}
.gl-credits { max-width: 1100px; margin: 40px auto 0; font-size: 11.5px; color: rgba(169, 170, 203, .7); text-align: center; }

/* ── a planet's games (bottom sheet on phones, dialog on computers) ── */
body.gl-lock { overflow: hidden; }
.gl-sheet { position: fixed; inset: 0; z-index: 8000; display: flex; align-items: flex-end; justify-content: center; background: rgba(5, 5, 12, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: gl-fade .25s; color: var(--gl-ink); font-family: 'Inter', system-ui, sans-serif; }
.gl-sheetin { position: relative; width: 100%; max-width: 760px; max-height: 90vh; overflow-y: auto; padding: 22px 18px 30px; border-radius: 28px 28px 0 0; background: linear-gradient(180deg, #1c1b3a, var(--gl-card) 30%); box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); animation: gl-up .35s cubic-bezier(.2, .9, .3, 1.15); }
@media (min-width: 800px) { .gl-sheet { align-items: center; } .gl-sheetin { border-radius: 28px; padding: 28px; } }
.gl-sheetin > .gl-x { position: absolute; top: 14px; right: 14px; }
.gl-sheethead { display: flex; align-items: center; gap: 16px; margin: 0 40px 14px 0; }
.gl-sheetplanet { width: 96px; flex: none; animation: gl-float 6s ease-in-out infinite; } .gl-sheetplanet svg { width: 100%; height: auto; }
.gl-sheethead h2 { margin: 0; font: 700 28px/1.1 var(--gl-display); } .gl-sheethead p { margin: 4px 0 0; color: var(--gl-muted); font-size: 14px; }
.gl-games { display: grid; gap: 14px; }
.gl-game { padding: 16px; border-radius: 22px; background: rgba(255, 255, 255, .045); border: 1px solid var(--gl-line); }
.gl-gamehead { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.gl-gameic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 14px; font-size: 24px; background: linear-gradient(135deg, rgba(139, 92, 246, .35), rgba(59, 130, 246, .25)); }
.g-pin .gl-gameic { background: linear-gradient(135deg, rgba(244, 63, 94, .35), rgba(249, 115, 22, .25)); }
.g-hl .gl-gameic { background: linear-gradient(135deg, rgba(16, 185, 129, .35), rgba(59, 130, 246, .25)); }
.g-conn .gl-gameic { background: linear-gradient(135deg, rgba(251, 191, 36, .35), rgba(139, 92, 246, .25)); }
.gl-gamehead h3 { margin: 0; font: 700 19px/1.1 var(--gl-display); } .gl-gamehead p { margin: 3px 0 0; font-size: 13px; color: var(--gl-muted); }
.gl-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.gl-pack { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--gl-line); background: rgba(255, 255, 255, .05); color: var(--gl-ink); font: 600 15px/1.2 'Inter', sans-serif; text-align: left; cursor: pointer; transition: background .2s, transform .15s; }
.gl-pack:hover { background: rgba(139, 92, 246, .2); transform: translateY(-1px); }
.gl-pack small { color: var(--gl-muted); font-weight: 500; }
.gl-classlist { display: contents; }
.gl-stars { display: inline-flex; gap: 1px; font-style: normal; white-space: nowrap; }
.gl-stars i { font-style: normal; color: rgba(255, 255, 255, .18); font-size: 15px; }
.gl-stars i.on { color: var(--gl-gold); text-shadow: 0 0 8px rgba(251, 191, 36, .6); }
.gl-stars.big i { font-size: 34px; }

/* ── the full-screen game stage ── */
.gl-stage { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; color: var(--gl-ink); font-family: 'Inter', system-ui, sans-serif;
  background: radial-gradient(80% 60% at 50% 0%, #241a52, var(--gl-night) 70%); animation: gl-fade .25s; -webkit-tap-highlight-color: transparent; }
.gl-stage::before { content: ''; position: fixed; }
.gl-loading, .gl-count { margin: auto; display: grid; justify-items: center; gap: 14px; text-align: center; padding: 20px; }
.gl-spin { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .15); border-top-color: var(--gl-gold); animation: gl-rot 1s linear infinite; }
@keyframes gl-rot { to { transform: rotate(360deg); } }
.gl-count b { font: 700 120px/1 var(--gl-display); color: var(--gl-gold); text-shadow: 0 0 40px rgba(251, 191, 36, .6); animation: gl-zoom .6s cubic-bezier(.2, 1.6, .4, 1); }
.gl-rocket { font-size: 54px; animation: gl-shakey .2s linear infinite; }
@keyframes gl-zoom { from { transform: scale(2.2); opacity: 0; } }
@keyframes gl-shakey { 50% { transform: translate(1px, -1px) rotate(-2deg); } }

/* launch pad */
.gl-launch { position: relative; margin: auto; width: 100%; max-width: 560px; padding: 70px 18px 40px; display: grid; justify-items: center; text-align: center; gap: 8px; }
.gl-launch > .gl-x { position: absolute; top: 16px; left: 16px; }
.gl-launchplanet { width: 170px; animation: gl-float 6s ease-in-out infinite; } .gl-launchplanet svg { width: 100%; height: auto; filter: drop-shadow(0 18px 40px rgba(139, 92, 246, .45)); }
.gl-launch h2 { margin: 4px 0 0; font: 700 34px/1.1 var(--gl-display); }
.gl-launchpack { margin: 0 0 14px; font: 600 18px/1.3 var(--gl-display); color: #c4b5fd; }
.gl-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin-bottom: 18px; }
.gl-modes button { display: grid; justify-items: center; gap: 3px; padding: 14px 6px; border-radius: 18px; border: 1.5px solid var(--gl-line); background: rgba(255, 255, 255, .05); color: var(--gl-ink); cursor: pointer; transition: all .2s; }
.gl-modes button span { font-size: 26px; } .gl-modes button b { font: 700 17px/1 var(--gl-display); } .gl-modes button small { font-size: 12px; color: var(--gl-muted); }
.gl-modes button[aria-checked="true"] { border-color: var(--gl-gold); background: rgba(251, 191, 36, .1); box-shadow: 0 0 0 4px rgba(251, 191, 36, .12); transform: translateY(-2px); }
.gl-bigstars { margin: 4px 0; } .gl-rules { color: var(--gl-muted); max-width: 400px; margin: 0 0 18px; }

/* top bar */
.gl-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: linear-gradient(180deg, rgba(11, 11, 21, .92), rgba(11, 11, 21, .6)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.gl-topmid { flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.gl-score { display: grid; justify-items: end; line-height: 1; min-width: 64px; }
.gl-score small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--gl-muted); }
.gl-score b { font: 700 26px/1 var(--gl-display); color: var(--gl-gold); }
.gl-dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.gl-dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .14); transition: all .3s; }
.gl-dots i.now { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.gl-dots i.ok { background: var(--gl-L); } .gl-dots i.no { background: var(--gl-red); } .gl-dots i.mid { background: var(--gl-gold); }
.gl-clock { display: flex; align-items: baseline; gap: 2px; padding: 4px 14px; border-radius: 99px; background: rgba(255, 255, 255, .08); font: 700 24px/1 var(--gl-display); }
.gl-clock small { font-size: 13px; color: var(--gl-muted); } .gl-clock.hot { background: rgba(244, 63, 94, .25); color: #fecdd3; animation: gl-pulse .6s infinite alternate; }
@keyframes gl-pulse { to { transform: scale(1.06); } }
.gl-lives { font-size: 20px; letter-spacing: 2px; } .gl-count2 { font: 700 18px/1 var(--gl-display); color: var(--gl-muted); }
.gl-streak { padding: 4px 10px; border-radius: 99px; background: rgba(249, 115, 22, .2); color: #fed7aa; font: 700 15px/1 var(--gl-display); }
.gl-hlq { font: 700 18px/1.2 var(--gl-display); text-align: center; }
.bump { animation: gl-bump .35s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes gl-bump { 40% { transform: scale(1.3); } }
.gl-timebar { height: 6px; margin: 0 16px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.gl-timebar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gl-L), var(--gl-gold), var(--gl-S)); border-radius: 6px; }

/* question card */
.gl-card-wrap { flex: 1; display: flex; justify-content: center; padding: 18px 16px 40px; }
.gl-card { width: 100%; max-width: 680px; display: grid; gap: 16px; align-content: start; }
.gl-card.in { animation: gl-in .4s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes gl-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.gl-media { display: grid; place-items: center; min-height: 80px; }
.gl-flag { width: min(300px, 78vw, 46vh); height: auto; aspect-ratio: 4 / 3; border-radius: 10px; box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .12); background: #222; object-fit: cover; }
.gl-shape { width: min(270px, 70vw, 40vh); height: auto; filter: drop-shadow(0 10px 26px rgba(139, 92, 246, .5)); }
.gl-shape path { fill: url(#gl-shapegrad); stroke: #ede9fe; stroke-width: 2; stroke-linejoin: round; animation: gl-draw 1.1s ease-out; stroke-dasharray: 4000; }
@keyframes gl-draw { from { stroke-dashoffset: 4000; fill-opacity: 0; } 70% { fill-opacity: 0; } }
.gl-lm { width: min(220px, 60vw, 34vh); height: auto; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .5)); }
.gl-media .gl-planet { width: min(220px, 60vw); height: auto; }
.gl-emoji { font-size: clamp(56px, 16vw, 92px); line-height: 1.1; letter-spacing: .06em; text-align: center; animation: gl-wobble 3s ease-in-out infinite; }
@keyframes gl-wobble { 50% { transform: rotate(-3deg) scale(1.04); } }
.gl-q { margin: 0; font: 600 clamp(21px, 4.6vw, 28px)/1.3 var(--gl-display); text-align: center; }
.gl-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gl-opts.n2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .gl-opts { grid-template-columns: 1fr; gap: 8px; } .gl-opt { min-height: 54px; font-size: 16px; } .gl-card { gap: 12px; } .gl-card.flagopts .gl-opts { grid-template-columns: 1fr 1fr; } }
.gl-opt { position: relative; display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 14px; border-radius: 18px; border: 0; cursor: pointer; text-align: left; color: var(--gl-ink);
  font: 600 17px/1.25 'Inter', sans-serif; background: var(--gl-card2); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .1), inset 5px 0 0 var(--c); transition: transform .12s, background .2s, opacity .3s; }
.gl-opt.c0 { --c: var(--gl-S); } .gl-opt.c1 { --c: var(--gl-W); } .gl-opt.c2 { --c: var(--gl-R); } .gl-opt.c3 { --c: var(--gl-L); }
.gl-opt:hover:not(:disabled) { transform: translateY(-2px); background: #26264a; }
.gl-opt:active:not(:disabled) { transform: scale(.98); }
.gl-opt kbd { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: var(--c); color: #0b0b15; font: 700 15px/1 var(--gl-display); }
.gl-opt.right { background: rgba(16, 185, 129, .25); box-shadow: inset 0 0 0 2px var(--gl-L); animation: gl-bump .4s; }
.gl-opt.right::after { content: '✓'; margin-left: auto; font: 700 22px/1 var(--gl-display); color: #6ee7b7; }
.gl-opt.wrong { background: rgba(244, 63, 94, .2); box-shadow: inset 0 0 0 2px var(--gl-red); }
.gl-opt.wrong::after { content: '✕'; margin-left: auto; font: 700 20px/1 var(--gl-display); color: #fda4af; }
.gl-opt.dim { opacity: .4; }
.gl-opt:disabled { cursor: default; }
.gl-optflag { width: 100%; max-width: 160px; height: auto; aspect-ratio: 4 / 3; border-radius: 6px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); object-fit: cover; }
.gl-card.flagopts .gl-opt { justify-content: center; padding: 10px; }
.gl-card.flagopts .gl-opt kbd { position: absolute; top: 6px; left: 8px; width: 24px; height: 24px; font-size: 12px; border-radius: 8px; z-index: 1; }
.shake { animation: gl-shake .45s; }
@keyframes gl-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.gl-fb { padding: 14px 16px; border-radius: 18px; display: grid; gap: 6px; animation: gl-in .3s; }
.gl-fb.ok { background: rgba(16, 185, 129, .12); box-shadow: inset 0 0 0 1.5px rgba(16, 185, 129, .45); }
.gl-fb.no { background: rgba(244, 63, 94, .1); box-shadow: inset 0 0 0 1.5px rgba(244, 63, 94, .4); }
.gl-fb > b { font: 700 20px/1.1 var(--gl-display); } .gl-fb.ok > b { color: #6ee7b7; } .gl-fb.no > b { color: #fda4af; }
.gl-fb p { margin: 0; color: #d4d4ea; font-size: 15px; line-height: 1.5; }
.gl-right strong { color: #fff; }
.gl-fb .gl-btn { justify-self: end; margin-top: 4px; }
.gl-typeform { display: flex; gap: 8px; }
.gl-typeform input { flex: 1; min-width: 0; min-height: 54px; padding: 0 16px; border-radius: 16px; border: 2px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: #fff; font: 600 18px 'Inter', sans-serif; outline: none; }
.gl-typeform input:focus { border-color: var(--gl-gold); }
.gl-hint { justify-self: center; padding: 8px 14px; border-radius: 99px; border: 1px dashed rgba(251, 191, 36, .5); background: none; color: var(--gl-gold); font: 600 14px 'Inter', sans-serif; cursor: pointer; }
.gl-hint:disabled { opacity: .4; cursor: default; }
.gl-hinttext { margin: 0; text-align: center; color: var(--gl-gold); }

/* floating points and star bursts */
.gl-float { position: fixed; z-index: 9500; transform: translate(-50%, 0); font: 700 24px/1 var(--gl-display); pointer-events: none; animation: gl-floatup 1s ease-out forwards; }
.gl-float.good { color: var(--gl-gold); text-shadow: 0 0 12px rgba(251, 191, 36, .8); }
@keyframes gl-floatup { to { transform: translate(-50%, -60px); opacity: 0; } }
.gl-burst { position: fixed; z-index: 9500; pointer-events: none; }
.gl-burst i { position: absolute; font-style: normal; font-size: 16px; animation: gl-burst .8s ease-out forwards; }
@keyframes gl-burst { to { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; } }
.gl-confetti { position: fixed; inset: 0; z-index: 9600; pointer-events: none; overflow: hidden; }
.gl-confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: gl-fall linear forwards; }
@keyframes gl-fall { to { transform: translateY(105vh) rotate(var(--r)); } }
@keyframes gl-fade { from { opacity: 0; } }
@keyframes gl-up { from { transform: translateY(40px); opacity: 0; } }

/* ── Pin It ── */
.gl-pinwrap { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 8px 12px 14px; max-width: 1200px; width: 100%; margin: 0 auto; min-height: 0; }
.gl-pinq { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; background: rgba(255, 255, 255, .05); }
.gl-pinq h2 { margin: 0; font: 600 21px/1.2 var(--gl-display); } .gl-pinq p { margin: 2px 0 0; font-size: 13px; color: var(--gl-muted); }
.gl-pinmedia { flex: none; width: 64px; } .gl-pinmedia .gl-flag { width: 64px; border-radius: 5px; } .gl-pinmedia .gl-lm { width: 64px; }
.gl-pinres { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 12px; border-radius: 12px; animation: gl-in .3s; }
.gl-pinres.ok { background: rgba(16, 185, 129, .15); } .gl-pinres.mid { background: rgba(251, 191, 36, .14); } .gl-pinres.no { background: rgba(244, 63, 94, .13); }
.gl-pinres strong { color: var(--gl-gold); } .gl-pinres small { flex: 1 1 100%; color: #d4d4ea; font-size: 13px; }
.gl-pinmap { flex: 1; min-height: 260px; position: relative; }
@media (max-width: 760px) { .gl-pinmap { flex: none; height: min(56vh, 112vw); } }
.gl-map { position: relative; width: 100%; height: 100%; min-height: 260px; border-radius: 18px; overflow: hidden; background: #0e2350; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.gl-mapsvg { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.gl-mapsvg .sea { fill: #0f2a5c; } .gl-mapsvg .grat { fill: none; stroke: #fff; stroke-opacity: .06; stroke-width: calc(.8px / var(--k, 1)); }
.gl-mapsvg .land { fill: #3aa679; stroke: #0b1d3a; stroke-width: calc(.6px / var(--k, 1)); transition: fill .3s; }
.gl-mapsvg .land.hi { fill: var(--gl-gold); }
.gl-mapsvg .mk > * { transform: scale(calc(1 / var(--k, 1))); }
.gl-mapsvg .pin { fill: var(--gl-red); stroke: #fff; stroke-width: 1.4; } .gl-mapsvg .pinhole { fill: #fff; }
.gl-mapsvg .halo { fill: var(--gl-gold); fill-opacity: .3; animation: gl-halo 1.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes gl-halo { from { opacity: 1; } to { opacity: 0; r: 18; } }
.gl-mapsvg .dot { fill: var(--gl-gold); stroke: #fff; stroke-width: 1.4; }
.gl-mapsvg text { fill: #fff; font: 700 13px var(--gl-display), sans-serif; text-anchor: middle; paint-order: stroke; stroke: #0b0b15; stroke-width: 3px; }
.gl-mapsvg .gap { stroke: #fff; stroke-width: calc(1.6px / var(--k, 1)); stroke-dasharray: calc(5px / var(--k, 1)) calc(4px / var(--k, 1)); }
.gl-mapsvg .mk.live .pin { fill: var(--c, #8b5cf6); }
.gl-mapbtns { position: absolute; right: 10px; top: 10px; display: grid; gap: 6px; }
.gl-mapbtns button { width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(11, 11, 21, .75); color: #fff; font: 700 20px/1 system-ui; cursor: pointer; }
.gl-pinbar { display: flex; justify-content: center; } .gl-pinbar .gl-btn { min-width: 240px; }

/* ── Higher or Lower ── */
.gl-hl { flex: 1; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "a vs b" "btn btn btn" "hint hint hint"; gap: 14px; align-items: center; width: 100%; max-width: 980px; margin: 0 auto; padding: 16px; }
.gl-hlcard { display: grid; justify-items: center; gap: 8px; padding: 22px 14px; border-radius: 26px; background: var(--gl-card2); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .08); text-align: center; animation: gl-in .35s; transition: box-shadow .3s, background .3s; }
.gl-hlcard.a { grid-area: a; } .gl-hlcard.b { grid-area: b; }
.gl-hlcard h3 { margin: 0; font: 600 21px/1.2 var(--gl-display); }
.gl-hlpic { height: 130px; display: grid; place-items: center; } .gl-hlpic .gl-planet, .gl-hlpic .gl-lm { width: 130px; height: 130px; }
.gl-hlemoji { font-size: 84px; line-height: 1; } .gl-hlflag { width: 150px; height: auto; border-radius: 8px; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .7); }
.gl-hlval { margin: 0; } .gl-hlval b { font: 700 32px/1 var(--gl-display); color: var(--gl-gold); } .gl-hlval small { color: var(--gl-muted); }
.gl-hlval.hidden b { color: var(--gl-muted); font-size: 44px; }
.gl-hlcard.win { box-shadow: inset 0 0 0 2.5px var(--gl-L); background: rgba(16, 185, 129, .12); }
.gl-hlcard.lose { box-shadow: inset 0 0 0 2.5px var(--gl-red); background: rgba(244, 63, 94, .12); animation: gl-shake .45s; }
.gl-vs { grid-area: vs; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--gl-W), var(--gl-R)); font: 700 18px/1 var(--gl-display); box-shadow: 0 0 0 6px rgba(139, 92, 246, .2); }
.gl-hlbtns { grid-area: btn; display: flex; gap: 12px; justify-content: center; } .gl-hlbtns .gl-btn { flex: 1; max-width: 260px; min-height: 58px; font-size: 19px; }
.gl-hlhint { grid-area: hint; margin: 0; text-align: center; color: var(--gl-muted); font-size: 14px; }
@media (max-width: 640px) {
  .gl-hl { grid-template-columns: 1fr; grid-template-areas: "a" "vs" "b" "btn" "hint"; gap: 8px; padding: 10px 14px; }
  .gl-vs { justify-self: center; width: 42px; height: 42px; font-size: 15px; margin: -18px 0; z-index: 2; }
  .gl-hlcard { grid-template-columns: 84px 1fr; justify-items: start; text-align: left; padding: 12px 14px; gap: 2px 14px; }
  .gl-hlpic { grid-row: span 2; height: 84px; } .gl-hlpic .gl-planet, .gl-hlpic .gl-lm { width: 84px; height: 84px; } .gl-hlemoji { font-size: 58px; } .gl-hlflag { width: 84px; }
  .gl-hlcard h3 { font-size: 18px; align-self: end; } .gl-hlval b { font-size: 26px; }
}

/* ── Connections ── */
.gl-conn { width: 100%; max-width: 620px; margin: 0 auto; padding: 12px 14px 30px; display: grid; gap: 10px; }
.gl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.gl-tile { aspect-ratio: 1.25; display: grid; place-items: center; padding: 4px; border-radius: 14px; border: 0; background: var(--gl-card2); color: var(--gl-ink); font: 700 clamp(10.5px, 2.9vw, 15px)/1.15 var(--gl-display); text-transform: uppercase; letter-spacing: .01em; overflow-wrap: anywhere; hyphens: auto; min-width: 0; cursor: pointer; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .08); transition: transform .12s, background .2s; word-break: break-word; }
.gl-tile.long { font-size: clamp(9px, 2.4vw, 12.5px); }
.gl-tile:hover { transform: translateY(-2px); } .gl-tile.on { background: linear-gradient(135deg, var(--gl-W), #6d28d9); color: #fff; transform: scale(.96); }
.gl-solved { display: grid; gap: 8px; }
.gl-group { padding: 12px; border-radius: 14px; text-align: center; color: #1a1033; animation: gl-bump .45s; }
.gl-group b { display: block; font: 700 16px/1.2 var(--gl-display); text-transform: uppercase; } .gl-group span { font-size: 14px; }
.gl-group.c0 { background: #fcd34d; } .gl-group.c1 { background: #6ee7b7; } .gl-group.c2 { background: #93c5fd; } .gl-group.c3 { background: #c4b5fd; }
.gl-conninfo { margin: 4px 0 0; text-align: center; color: var(--gl-muted); min-height: 20px; }
.gl-mist { display: flex; gap: 8px; justify-content: center; } .gl-mist i { width: 14px; height: 14px; border-radius: 50%; background: var(--gl-W); transition: all .3s; } .gl-mist i.gone { background: rgba(255, 255, 255, .12); transform: scale(.7); }
.gl-connbtns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.gl-solved.end { margin: 10px 0; width: 100%; }

/* ── Emoji Idioms ── */
.gl-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; }
.gl-word { display: inline-flex; gap: 3px; }
.gl-word i { width: 22px; height: 30px; display: grid; place-items: center; border-radius: 6px; background: rgba(255, 255, 255, .08); border-bottom: 3px solid rgba(255, 255, 255, .25); font: 700 17px/1 var(--gl-display); font-style: normal; text-transform: uppercase; }
.gl-word i.on { background: rgba(251, 191, 36, .2); border-color: var(--gl-gold); color: #fff; animation: gl-bump .3s; }
.gl-word i.p { width: auto; background: none; border: 0; }
.gl-emobtns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.gl-emomsg { margin: 0; text-align: center; color: var(--gl-muted); min-height: 20px; }
@media (max-width: 420px) { .gl-word i { width: 18px; height: 26px; font-size: 14px; } }

/* ── end screen ── */
.gl-stage.end { align-items: center; }
.gl-end { width: 100%; max-width: 640px; margin: auto; padding: 50px 18px 50px; display: grid; justify-items: center; text-align: center; gap: 8px; }
.gl-endstars { display: flex; gap: 6px; margin-bottom: 4px; }
.gl-endstars i { font-style: normal; font-size: 64px; line-height: 1; color: rgba(255, 255, 255, .12); }
.gl-endstars i:nth-child(2) { font-size: 84px; margin-top: -14px; }
.gl-endstars i.on { color: var(--gl-gold); text-shadow: 0 0 24px rgba(251, 191, 36, .8); animation: gl-starpop .55s cubic-bezier(.2, 1.8, .4, 1) both; animation-delay: var(--d); }
@keyframes gl-starpop { from { transform: scale(0) rotate(-90deg); opacity: 0; } }
.gl-end h2 { margin: 0; font: 700 40px/1.1 var(--gl-display); }
.gl-endline { margin: 0; font-size: 18px; color: #d4d4ea; }
.gl-newbest { margin: 4px 0; padding: 6px 14px; border-radius: 99px; background: rgba(251, 191, 36, .12); color: var(--gl-gold); font-weight: 700; }
.gl-endnote { margin: 0; color: var(--gl-muted); font-size: 14px; }
.gl-xp { margin: 6px 0; color: var(--gl-muted); } .gl-xp b { color: #6ee7b7; }
.gl-endbtns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.gl-review { width: 100%; margin-top: 22px; text-align: left; border-radius: 20px; background: rgba(255, 255, 255, .04); border: 1px solid var(--gl-line); padding: 6px 16px 14px; }
.gl-review summary { cursor: pointer; padding: 10px 0; font: 700 17px/1.2 var(--gl-display); color: #c4b5fd; }
.gl-review ol { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.gl-review li { display: grid; gap: 3px; } .gl-review li b { font-weight: 600; }
.gl-review li span { color: #6ee7b7; font-weight: 600; } .gl-review li em { color: #fda4af; font-style: normal; font-size: 14px; } .gl-review li small { color: var(--gl-muted); font-size: 13.5px; }
.gl-revflag { width: 40px; height: auto; vertical-align: middle; border-radius: 3px; }

/* =====================================================================
   2026-10-25 — grammar blanks, class-game doors, the Grammar Arcade
   ===================================================================== */
/* "___" in a question becomes a blank line; after the answer it is filled in */
.gl-gap { display: inline-block; min-width: 3.4em; height: .95em; margin: 0 .18em; border-bottom: 3px solid currentColor; vertical-align: baseline; opacity: .75; border-radius: 1px; }
.gl-fill { display: inline-block; margin: 0 .12em; padding: 0 .28em; border-radius: 8px; background: rgba(16, 185, 129, .2); color: #6ee7b7; box-shadow: inset 0 -3px 0 rgba(16, 185, 129, .7); font-weight: 700; }
/* class games: two big doors on the Galaxy home */
.gl-class { max-width: 1100px; margin: 18px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gl-door { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 22px; color: var(--gl-ink); text-decoration: none; transition: transform .2s, box-shadow .2s;
  background: linear-gradient(120deg, rgba(251, 191, 36, .18), rgba(249, 115, 22, .1)); box-shadow: inset 0 0 0 1.5px rgba(251, 191, 36, .45); }
.gl-door.host { background: linear-gradient(120deg, rgba(139, 92, 246, .22), rgba(59, 130, 246, .12)); box-shadow: inset 0 0 0 1.5px rgba(167, 139, 250, .45); }
.gl-door:hover { transform: translateY(-2px); }
.gl-dooric { width: 54px; height: 54px; flex: none; display: grid; place-items: center; border-radius: 16px; background: rgba(255, 255, 255, .1); font-size: 28px; }
.gl-door > span:nth-child(2) { flex: 1; display: grid; gap: 3px; } .gl-door b { font: 700 20px/1.1 var(--gl-display); } .gl-door small { color: var(--gl-muted); font-size: 13.5px; line-height: 1.35; }
.gl-door em { font: 700 24px/1 var(--gl-display); font-style: normal; color: var(--gl-gold); } .gl-door.host em { color: #c4b5fd; }
@media (max-width: 640px) { .gl-class { grid-template-columns: 1fr; } }
/* the Grammar Arcade */
.gl-arcade { max-width: 1100px; margin: 26px auto 6px; }
.gl-sechead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 12px; }
.gl-sechead h2 { margin: 0; font: 700 26px/1.1 var(--gl-display); } .gl-sechead p { margin: 0; color: var(--gl-muted); font-size: 14px; }
.gl-arcgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gl-arc { position: relative; display: grid; gap: 6px; align-content: start; padding: 16px 16px 14px; border-radius: 22px; color: var(--gl-ink); text-decoration: none; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 30%, #15152a), #15152a 75%); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent); transition: transform .2s; }
.gl-arc::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--c); opacity: .22; z-index: -1; }
.gl-arc:hover { transform: translateY(-3px) rotate(-.4deg); }
.gl-arcic { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; font-size: 28px; background: color-mix(in srgb, var(--c) 45%, transparent); box-shadow: 0 8px 18px -8px var(--c); }
.gl-arc b { font: 700 19px/1.15 var(--gl-display); margin-top: 4px; } .gl-arc small { color: #cfd0ea; font-size: 13px; line-height: 1.4; }
.gl-arcfoot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 6px; }
.gl-arcfoot em { white-space: nowrap; flex: none; }
.gl-arcfoot i { font-style: normal; font-size: 12px; color: var(--gl-muted); } .gl-arcfoot em { font: 700 14px/1 var(--gl-display); font-style: normal; padding: 7px 12px; border-radius: 99px; background: var(--c); color: #fff; }
@media (max-width: 640px) { .gl-arcgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .gl-arc { padding: 12px; } .gl-arc small { font-size: 12px; } .gl-arcic { width: 44px; height: 44px; font-size: 24px; } }
/* Grammaria: the topic finder in the planet sheet */
.gl-pack.gr { background: rgba(59, 130, 246, .1); border-color: rgba(96, 165, 250, .35); }
.gl-grtopic { display: grid; gap: 8px; margin-top: 12px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px dashed rgba(96, 165, 250, .45); }
.gl-grtopic label { font: 700 15px/1.2 var(--gl-display); color: #bfdbfe; }
.gl-grtopic input, .gl-grtopic select { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, .16); background: #0f0f22; color: #fff; font: 500 15px 'Inter', sans-serif; outline: none; }
.gl-grtopic select { padding: 4px; } .gl-grtopic option { padding: 7px 8px; border-radius: 8px; } .gl-grtopic option:checked { background: #2563eb; color: #fff; }
.gl-grtopic input:focus, .gl-grtopic select:focus { border-color: var(--gl-gold); }
.gl-grtopic .gl-btn { justify-self: end; }
.gl-grtopic { margin: 0 0 4px; }
.gl-gror { margin: 12px 0 8px; color: var(--gl-muted); font-size: 13.5px; }
a.gl-pack { text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  .gl *, .gl-stage *, .gl-sheet *, .gl-sky { animation: none !important; transition: none !important; }
}
