/* GalactoPop — interface styles */
:root {
  --bg: #070A18;
  --txt: #EEF3FF;
  --dim: #9BA8D0;
  --line: rgba(170, 200, 255, 0.18);
  --glass: rgba(15, 21, 52, 0.66);
  --cyan: #0FC4FF; --coral: #FF2F64; --lime: #86F21C; --amber: #FFA60A; --violet: #A04DFF; --pink: #FF4FE0;
  --n1: #2A5BFF; --n2: #00D8C8; --n3: #9A45FF;      /* the three drifting clouds; set per theme by the renderer */
  --hud: 1;
  --st: env(safe-area-inset-top, 0px); --sr: env(safe-area-inset-right, 0px);
  --sb: env(safe-area-inset-bottom, 0px); --sl: env(safe-area-inset-left, 0px);
  --bl: 0px; --bw: 320px; --bt: 90px; --bb: 600px;
  --font: "SF Pro Rounded", ui-rounded, "Nunito", "Arial Rounded MT Bold", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* On a screen that shows more than sRGB (most phones and laptops of the last few years) the
 * accent colours use the wider range, as the game's own picture does: the same numbers, read
 * as Display-P3. "vivid" is set by the game when the picture is in wide colour (the Vivid
 * colour setting, on such a screen); a browser that does not know color() ignores the lines. */
@media (color-gamut: p3) {
  body.vivid {
    --cyan: color(display-p3 0.059 0.769 1); --coral: color(display-p3 1 0.184 0.392); --lime: color(display-p3 0.525 0.949 0.11);
    --amber: color(display-p3 1 0.651 0.039); --violet: color(display-p3 0.627 0.302 1); --pink: color(display-p3 1 0.31 0.878);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; background: var(--bg); color: var(--txt);
  font-family: var(--font); font-size: 16px; line-height: 1.35;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: none; overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
canvas#bg, canvas#game { position: fixed; left: 0; top: 0; display: block; }
canvas#bg { z-index: 0; }

/* Drifting clouds of colour between the painted sky and the game. They only ever move
   and fade, so the browser's compositor animates them without redrawing anything. Each
   is painted small and stretched (it is a soft blur anyway), which keeps it cheap. */
#sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#sky i { position: absolute; display: block; width: 30vmax; height: 30vmax; border-radius: 50%; will-change: transform, opacity; }
#sky .c1 { left: -10vmax; top: -15vmax; background: radial-gradient(closest-side, var(--n1) 0%, transparent 70%); opacity: 0.42; transform: scale(4); animation: drift1 41s ease-in-out infinite alternate; }
#sky .c2 { right: -15vmax; top: 50vmax; background: radial-gradient(closest-side, var(--n2) 0%, transparent 68%); opacity: 0.3; transform: scale(4.6); animation: drift2 53s ease-in-out infinite alternate; }
#sky .c3 { left: 15vmax; bottom: -30vmax; background: radial-gradient(closest-side, var(--n3) 0%, transparent 70%); opacity: 0.4; transform: scale(3.8); animation: drift3 67s ease-in-out infinite alternate; }
@keyframes drift1 { from { transform: translate3d(0, 0, 0) scale(4); opacity: 0.3; } to { transform: translate3d(34vmax, 22vmax, 0) scale(5); opacity: 0.5; } }
@keyframes drift2 { from { transform: translate3d(0, 0, 0) scale(4.6); opacity: 0.36; } to { transform: translate3d(-40vmax, -18vmax, 0) scale(3.6); opacity: 0.22; } }
@keyframes drift3 { from { transform: translate3d(0, 0, 0) scale(3.8); opacity: 0.44; } to { transform: translate3d(38vmax, -30vmax, 0) scale(4.8); opacity: 0.28; } }
body.nomotion #sky i { animation: none; }
canvas#game { z-index: 1; touch-action: none; }
body.playing canvas#game { cursor: none; }
[hidden] { display: none !important; }
#probe { position: fixed; visibility: hidden; pointer-events: none; padding: var(--st) var(--sr) var(--sb) var(--sl); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0, 0, 20, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.lbl { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
#hud button { pointer-events: auto; }
#hud-top {
  position: absolute; left: var(--bl); width: var(--bw); top: calc(var(--st) + 8px);
  height: calc(52px * var(--hud)); border-radius: calc(16px * var(--hud));
  display: flex; align-items: center; gap: calc(10px * var(--hud)); padding: 0 calc(8px * var(--hud));
}
.stat { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.stat.mid { flex: 1; align-items: center; text-align: center; }
.stat.end { align-items: flex-end; text-align: right; }
.stat .lbl { font-size: calc(9.5px * var(--hud)); white-space: nowrap; }
.num { font-weight: 900; font-size: calc(22px * var(--hud)); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.num.sm { font-size: calc(15px * var(--hud)); font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
#h-score.bump { animation: bump 0.22s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.14); color: #fff; } 100% { transform: scale(1); } }
.hud-btns { display: flex; align-items: center; gap: calc(6px * var(--hud)); }

.ibtn {
  width: calc(38px * var(--hud)); height: calc(38px * var(--hud)); border-radius: 12px; flex: none;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line);
  transition: transform 0.08s, background 0.15s;
}
.ibtn svg { width: 56%; height: 56%; fill: currentColor; }
.ibtn:hover { background: rgba(255, 255, 255, 0.16); }
.ibtn:active { transform: scale(0.92); }

.abtn {
  position: relative; flex: none; width: calc(42px * var(--hud)); height: calc(42px * var(--hud)); border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.16), rgba(10, 14, 40, 0.75));
  transition: transform 0.08s;
}
.abtn svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.abtn .ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 4; }
.abtn .ring { fill: none; stroke: var(--ab, var(--cyan)); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 0.2s; }
.abtn canvas { position: absolute; inset: 14%; width: 72%; height: 72%; opacity: 0.55; transition: opacity 0.2s; }
.abtn kbd {
  position: absolute; right: -4px; bottom: -4px; font: 800 10px var(--font); padding: 1px 5px; border-radius: 6px;
  background: #0B1020; border: 1px solid var(--line); color: var(--dim);
}
.abtn:active { transform: scale(0.93); }
.abtn.ready { animation: ready 0.9s ease-in-out infinite; }
.abtn.ready canvas { opacity: 1; }
.abtn.ready .ring { filter: drop-shadow(0 0 6px var(--ab, var(--cyan))); }
@keyframes ready { 0%, 100% { box-shadow: 0 0 0 0 var(--abg, rgba(15, 196, 255, 0.6)); } 50% { box-shadow: 0 0 0 10px rgba(70, 207, 255, 0); } }
body.touch #btn-ability, body.touch .abtn kbd { display: none; }
body.nomotion .abtn.ready { animation: none; box-shadow: 0 0 0 3px var(--ab, var(--cyan)); }

#gauge {
  position: absolute; left: var(--bl); width: var(--bw); top: calc(var(--st) + 8px + 58px * var(--hud));
  height: calc(16px * var(--hud)); border-radius: 99px; overflow: hidden; padding: 0;
}
#gauge-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, var(--cyan), var(--violet) 55%, var(--pink));
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}
#gauge-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  background-size: 200% 100%; animation: shine 2.2s linear infinite;
}
@keyframes shine { from { background-position: 200% 0; } to { background-position: -100% 0; } }
body.nomotion #gauge-fill::after { animation: none; opacity: 0; }
#gauge.boss #gauge-fill { background: linear-gradient(90deg, #FF2F64, #FF7A3C 60%, #FFC24A); }      /* a Warden's health */
#gauge-txt {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: calc(9.5px * var(--hud)); font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase;
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 30, 0.9);
}

.side {
  position: absolute; width: 214px; top: var(--bt); border-radius: 20px; padding: 16px; display: none;
}
body.wide .side { display: block; }
#side-l { left: calc(var(--bl) - 232px); }
#side-r { left: calc(var(--bl) + var(--bw) + 18px); }
.side canvas { width: 110px; height: 100px; display: block; margin: -6px auto 2px; }
.side h3 { font-size: 20px; font-weight: 900; text-align: center; }
.side .role { text-align: center; color: var(--dim); font-size: 12.5px; margin-bottom: 12px; }
.side .ab b { display: block; font-size: 15px; margin: 2px 0 6px; }
.side .bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.side .bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--ab, var(--cyan)); transition: width 0.2s; }
.side .desc { font-size: 12.5px; color: var(--dim); margin-top: 10px; }
.side dl { margin: 0; display: grid; gap: 12px; }
.side dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.side dt { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.side dd { margin: 0; font-weight: 900; font-size: 17px; font-variant-numeric: tabular-nums; }
.keys { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 7px; font-size: 12.5px; color: var(--dim); }
.keys span { display: flex; justify-content: space-between; gap: 8px; }
.keys b { color: var(--txt); font-weight: 800; }

#hint {
  position: absolute; left: calc(var(--bl) + var(--bw) / 2); transform: translateX(-50%);
  top: calc(var(--bt) + 5px); max-width: calc(var(--bw) - 20px); width: max-content;
  padding: 8px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 700; text-align: center;
  border-color: rgba(15, 196, 255, 0.55); animation: hintin 0.3s ease-out;
}
@keyframes hintin { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* in a boss fight the top of the board is the Warden's face: hints sit just under the line instead */
body.bossfight #hint { top: calc(var(--dl) + 12px); border-radius: 18px; }

#touchbar {
  position: absolute; left: 0; right: 0; bottom: 0; display: none; align-items: center; justify-content: space-between;
  padding: 6px calc(14px + var(--sr)) calc(8px + var(--sb)) calc(14px + var(--sl)); gap: 12px; height: calc(74px + var(--sb));
}
body.touch #touchbar { display: flex; }
.tbtn {
  flex: 1; max-width: 190px; height: 58px; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; font-size: 14px;
  border: 1px solid var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform 0.06s, filter 0.1s;
}
.tbtn svg { width: 22px; height: 22px; }
.tbtn.pull { background: linear-gradient(180deg, rgba(15, 196, 255, 0.36), rgba(15, 196, 255, 0.12)); }
.tbtn.launch { background: linear-gradient(180deg, rgba(255, 123, 229, 0.34), rgba(169, 139, 255, 0.12)); }
.tbtn:active { transform: scale(0.95); filter: brightness(1.4); }
.abtn.big { width: 60px; height: 60px; }

/* ---------- sector card ---------- */
#card { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; pointer-events: none; padding: 20px; }
/* The card itself takes taps (anywhere on it starts play); the rest of the screen does not,
   so a tap on the board or a touch button passes straight through and cannot dismiss it. */
.card-in {
  border-radius: 24px; padding: 22px 28px; text-align: center; max-width: min(92vw, 440px);
  animation: cardin 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
  pointer-events: auto; cursor: pointer; touch-action: manipulation;
}
#card.out .card-in { animation: cardout 0.3s ease-in forwards; pointer-events: none; }
@keyframes cardin { from { opacity: 0; transform: scale(0.8) translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cardout { to { opacity: 0; transform: scale(1.06) translateY(-10px); } }
.card-in h2 { font-size: clamp(28px, 7vw, 42px); font-weight: 900; font-style: italic; letter-spacing: -0.01em; line-height: 1.05;
  background: linear-gradient(180deg, #fff 30%, #9FE5FF); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: 0 0.3em 0.2em; margin: 0 calc(4px - 0.3em) -0.2em; }      /* (room for slanted letters and tails, the title taking the width it always did: see .logo span) */
#card-new { display: flex; gap: 14px; align-items: center; text-align: left; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
#card-new canvas { width: 84px; height: 56px; flex: none; }
#card-new b { display: block; font-size: 20px; }
#card-new p { font-size: 13.5px; color: var(--dim); }
.newtag { display: inline-block; font-size: 10px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: #0B1020; background: var(--amber); padding: 2px 8px; border-radius: 99px; }
.goal { margin-top: 10px; font-size: 13.5px; color: var(--dim); }
/* a Warden's card: who it is (in its own words), then how to beat it */
.lore { margin-top: 12px; font-size: 14.5px; font-style: italic; color: #DCE4FF; }
#card.warden .card-in h2 { background: linear-gradient(180deg, #fff 25%, #FFB27C); -webkit-background-clip: text; background-clip: text; color: transparent; }
#card.warden .goal { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14.5px; font-weight: 700; color: #F2F5FF; }
/* the card's start button: its fill is the time left before play starts by itself */
.cgo {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 48px; margin-top: 16px; padding: 8px 16px; border-radius: 14px;
  font-weight: 900; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: #fff;
  background: rgba(255, 255, 255, 0.07); border: 1.5px solid rgba(255, 255, 255, 0.3);
  transition: opacity 0.3s, transform 0.08s;
}
.cgo i { position: absolute; inset: 0; transform-origin: left center; background: linear-gradient(90deg, rgba(15, 196, 255, 0.6), rgba(160, 77, 255, 0.6)); }
.cgo span, .cgo kbd { position: relative; }
.cgo kbd { font: inherit; font-size: 11px; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 7px; background: rgba(0, 0, 20, 0.35); border: 1px solid rgba(255, 255, 255, 0.35); }
.cgo.wait { opacity: 0.45; pointer-events: none; }      /* its first moments: not yet */
.cgo:active { transform: scale(0.97); }
/* results and name entry ignore input for a moment after they appear, so a tap or key meant for the game cannot dismiss them */
.arming { pointer-events: none; }
.btns.arming .btn { opacity: 0.6; }

/* ---------- screens ---------- */
#screens { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
.screen {
  position: absolute; inset: 0; overflow-y: auto; pointer-events: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch;
  display: flex; justify-content: center; align-items: flex-start;
  padding: calc(var(--st) + 22px) calc(var(--sr) + 18px) calc(var(--sb) + 24px) calc(var(--sl) + 18px);
  background: radial-gradient(120% 90% at 50% 0%, rgba(7, 10, 24, 0.1), rgba(7, 10, 24, 0.72));
  animation: scr 0.28s ease-out;
}
@keyframes scr { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
body.nomotion .screen, body.nomotion .card-in { animation: none; }
.screen.overlay { align-items: center; background: rgba(5, 7, 20, 0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.wrap { width: 100%; max-width: 440px; margin: auto 0; display: flex; flex-direction: column; align-items: center; }
.wrap.wide { max-width: 860px; align-items: stretch; margin: 0; }

.logo { font-size: clamp(46px, 13.5vw, 96px); font-weight: 900; font-style: italic; line-height: 0.95; letter-spacing: -0.035em; text-align: center; white-space: nowrap; padding: 6px 10px 0; }
/* Each word is painted through the shapes of its own letters, and only inside its own box. Slanted
   letters lean out past the right of that box and a tail hangs below it, so the box is made roomier
   than the word on those sides, and pulled back by as much, so that nothing else on the page moves.
   (It used to fit the word closely: the last "o" of Galacto and the last "p" of Pop were sliced off
   straight, and so were the tails of g, j, p and y in the headings that are painted the same way.) */
.logo span { display: inline-block; -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0 0.24em 0.26em 0.06em; margin: 0 -0.2em -0.18em -0.02em; }
.logo .l1 { background-image: linear-gradient(180deg, #FFFFFF 18%, #9FE8FF 52%, #0FC4FF 100%); filter: drop-shadow(0 3px 0 #0F2F86) drop-shadow(0 0 26px rgba(15, 196, 255, 0.75)); }
.logo .l2 { background-image: linear-gradient(180deg, #FFF3B8 12%, #FFA60A 50%, #FF2F64 100%); filter: drop-shadow(0 3px 0 #8E1036) drop-shadow(0 0 26px rgba(255, 47, 100, 0.75)); margin-left: -0.06em; animation: popword 2.6s ease-in-out infinite; }
@keyframes popword { 0%, 86%, 100% { transform: scale(1) rotate(0); } 90% { transform: scale(1.1) rotate(-2deg); } 94% { transform: scale(0.97) rotate(1deg); } }
body.nomotion .logo .l2 { animation: none; }
.bricks { display: flex; gap: 6px; margin-top: 8px; }
.bricks i { width: 34px; height: 16px; border-radius: 6px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 rgba(0, 0, 40, 0.25), 0 0 14px currentColor; animation: hop 2.4s ease-in-out infinite; }
.bricks i:nth-child(1) { background: var(--coral); color: rgba(255, 47, 100, 0.75); }
.bricks i:nth-child(2) { background: var(--cyan); color: rgba(15, 196, 255, 0.75); animation-delay: 0.12s; }
.bricks i:nth-child(3) { background: var(--lime); color: rgba(134, 242, 28, 0.75); animation-delay: 0.24s; }
.bricks i:nth-child(4) { background: var(--amber); color: rgba(255, 166, 10, 0.75); animation-delay: 0.36s; }
@keyframes hop { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-7px); } }
body.nomotion .bricks i { animation: none; }
.tag { margin: 10px 0 20px; font-weight: 800; letter-spacing: 0.3em; text-transform: uppercase; font-size: 12.5px; color: var(--dim); }

.menu { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 50px; padding: 10px 18px; border-radius: 16px; font-weight: 800; letter-spacing: 0.02em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  border: 1px solid var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform 0.08s, filter 0.15s, box-shadow 0.15s;
}
.btn:hover { filter: brightness(1.2); }
.btn:active { transform: scale(0.97); }
.btn small { font-weight: 700; font-size: 12.5px; opacity: 0.78; letter-spacing: 0.02em; }
.btn.sm { min-height: 40px; padding: 6px 14px; font-size: 14px; border-radius: 12px; }
.btn.ghost { background: none; border-style: dashed; color: var(--dim); }
.btn.danger { border-color: rgba(255, 47, 100, 0.6); color: #FFB3C4; }
.btn.primary {
  color: #0A1030; border: 0;
  background: linear-gradient(120deg, #4FDBFF 0%, #A47BFF 55%, #FF74E4 100%);
  box-shadow: 0 10px 34px rgba(120, 140, 255, 0.5), inset 0 1.5px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 0 rgba(20, 10, 80, 0.18);
}
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 12px 44px rgba(140, 150, 255, 0.7), inset 0 1.5px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 0 rgba(20, 10, 80, 0.18); }
.btn.xl { min-height: 72px; border-radius: 22px; position: relative; }
/* the lens, on the Voyage button: the shards recovered so far */
#m-lens { position: absolute; left: 12px; top: 50%; width: 50px; height: 50px; transform: translateY(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(10, 16, 48, 0.9) 66%, rgba(10, 16, 48, 0) 70%); }
#m-wardens svg { color: #FFB27C; }
.btn.xl b { font-size: 26px; font-weight: 900; font-style: italic; letter-spacing: 0.01em; line-height: 1.1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  padding: 12px 14px; border-radius: 18px; min-height: 68px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: transform 0.08s, filter 0.15s;
}
.tile svg { grid-row: 1 / 3; width: 30px; height: 30px; }
.tile b { font-size: 16.5px; font-weight: 900; align-self: end; }
.tile small { font-size: 11.5px; color: var(--dim); font-weight: 700; align-self: start; line-height: 1.2; }
.tile.wide { grid-column: 1 / -1; }
.tile:hover { filter: brightness(1.25); }
.tile:active { transform: scale(0.97); }
#m-endless svg { color: var(--coral); } #m-daily svg { color: var(--amber); } #m-puzzles svg { color: var(--lime); } #m-practice svg { color: var(--cyan); }
.shipcard { display: flex; align-items: center; gap: 12px; width: 100%; border-radius: 18px; padding: 8px 14px 8px 8px; text-align: left; transition: transform 0.08s, filter 0.15s; }
.shipcard:hover { filter: brightness(1.2); }
.shipcard:active { transform: scale(0.98); }
.shipcard canvas { width: 72px; height: 66px; flex: none; }
.shipcard .txt { flex: 1; display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.shipcard small { font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.shipcard b { font-size: 19px; font-weight: 900; }
.shipcard em { font-style: normal; font-size: 13px; color: var(--cyan); font-weight: 700; }
.chev { font-size: 12.5px; font-weight: 800; color: var(--dim); padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line); }
.row3 { display: flex; flex-wrap: wrap; gap: 10px; }
.row3 .btn { flex: 1 1 auto; white-space: nowrap; padding-left: 10px; padding-right: 10px; }
/* The title's small buttons: How to play, Settings, Share, About — four in one row on a phone, drawn a
   little tighter the narrower the phone, and two rows of two on the very narrowest. With "Install app"
   on offer there are five: three and two (five in a row would run off the side). */
@media (max-width: 480px) {
  #s-title .row3 { gap: 8px; }
  #s-title .row3 .btn { padding-left: 8px; padding-right: 8px; }
  #s-title .row3:has(#m-install:not([hidden])) .btn { flex-basis: 30%; }
}
@media (min-width: 481px) {          /* on a wider screen the five are drawn a little smaller and sit in one row */
  #s-title .row3:has(#m-install:not([hidden])) { gap: 8px; }
  #s-title .row3:has(#m-install:not([hidden])) .btn { font-size: 13px; padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 380px) { #s-title .row3 .btn { font-size: 13px; padding-left: 5px; padding-right: 5px; } }
@media (max-width: 345px) { #s-title .row3 .btn { flex-basis: 40%; } }
/* About */
.about .aname { font-size: 15px; color: var(--dim); margin-bottom: 8px; }
.about .aname b { font-size: 22px; font-weight: 900; font-style: italic; color: #fff; margin-right: 10px; }
.about .atext { font-size: 14.5px; line-height: 1.5; color: #D5DDF6; margin-top: 8px; }
.about .arow { margin-top: 16px; }
.about a.btn { text-decoration: none; color: inherit; }
#ab-stats { display: inline-flex; margin-top: 12px; }
#s-about .foot { margin-top: 16px; }
.foot { margin-top: 16px; font-size: 12px; color: var(--dim); text-align: center; }

.shead { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; width: 100%; }
.shead h2 { font-size: clamp(24px, 6vw, 34px); font-weight: 900; font-style: italic; }
.lead { color: var(--dim); font-size: 14.5px; margin-bottom: 14px; }

.ships { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.ship {
  position: relative; border-radius: 22px; padding: 16px; text-align: center; display: flex; flex-direction: column; align-items: center;
  background: var(--glass); border: 1.5px solid var(--line); transition: transform 0.1s, border-color 0.2s, box-shadow 0.2s;
}
.ship canvas { width: 150px; height: 138px; }
.ship h3 { font-size: 24px; font-weight: 900; }
.ship .role { color: var(--dim); font-size: 13px; }
.ship .abn { margin-top: 10px; font-weight: 900; color: var(--c, var(--cyan)); letter-spacing: 0.04em; }
.ship p.d { font-size: 13.5px; color: var(--dim); margin-top: 4px; }
.ship:hover { transform: translateY(-2px); }
.ship.sel { border-color: var(--c, var(--cyan)); box-shadow: 0 0 0 2px var(--c, var(--cyan)), 0 14px 44px rgba(0, 0, 30, 0.5); }
.ship .pick { margin-top: 12px; font-size: 12px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; padding: 5px 14px; border-radius: 99px; border: 1px solid var(--line); color: var(--dim); }
.ship.sel .pick { background: var(--c, var(--cyan)); color: #0B1020; border-color: transparent; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.pz {
  border-radius: 16px; padding: 10px 6px 8px; text-align: center; background: var(--glass); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform 0.08s, filter 0.15s;
}
.pz b { font-size: 22px; font-weight: 900; line-height: 1.1; }
.pz small { font-size: 10.5px; color: var(--dim); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.pz .st { display: flex; gap: 2px; margin-top: 2px; }
.pz .st i, .stars i { width: 14px; height: 14px; background: rgba(255, 255, 255, 0.16); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.pz .st i.on, .stars i.on { background: var(--amber); }
.pz:hover { filter: brightness(1.25); }
.pz:active { transform: scale(0.96); }
.pz.done { border-color: rgba(184, 237, 89, 0.5); }
.weekly { border-radius: 18px; padding: 12px 14px; margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.weekly .wl { flex: 1 1 180px; }
.weekly .wl b { display: block; font-size: 16px; }
.weekly .wl small { color: var(--dim); font-size: 12.5px; }
.weekly .wk { display: flex; gap: 8px; flex-wrap: wrap; }
.weekly .pz { min-width: 58px; padding: 6px 6px 5px; }
.weekly .pz b { font-size: 17px; }

.set { width: 100%; border-radius: 22px; padding: 6px 18px 14px; }
.set h3 { font-size: 11px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); margin: 16px 0 4px; }
.rowi { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 46px; border-bottom: 1px solid rgba(170, 200, 255, 0.08); font-weight: 700; }
.rowi:last-child { border-bottom: 0; }
.set .status { margin: 8px 0 2px; font-size: 12.5px; line-height: 1.45; color: var(--dim); font-weight: 600; }
.rowi > span { flex: none; }
select {
  font: inherit; font-weight: 700; color: var(--txt); background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 10px; max-width: 58%; -webkit-user-select: auto; user-select: auto;
}
select option { background: #121838; color: var(--txt); }
.keybtn { min-width: 96px; font-variant-numeric: tabular-nums; }
.keybtn.listen { border-color: var(--cyan); color: var(--cyan); animation: bestp 0.5s ease-in-out infinite alternate; }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; max-width: 58%; height: 26px; background: none; touch-action: pan-y; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
input[type=range]::-moz-range-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; margin-top: -8px; background: #fff; border: 0; box-shadow: 0 2px 10px rgba(0, 0, 40, 0.6); }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 10px rgba(0, 0, 40, 0.6); }
input.sw { -webkit-appearance: none; appearance: none; width: 50px; height: 30px; border-radius: 99px; background: rgba(255, 255, 255, 0.16); position: relative; transition: background 0.18s; cursor: pointer; flex: none; margin: 0; }
input.sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.18s; box-shadow: 0 2px 6px rgba(0, 0, 40, 0.5); }
input.sw:checked { background: linear-gradient(90deg, var(--cyan), var(--violet)); }
input.sw:checked::after { transform: translateX(20px); }

.help { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.hcard { border-radius: 20px; padding: 16px 18px; }
.hcard.span2 { grid-column: 1 / -1; }
.hcard h3 { font-size: 12px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); margin-bottom: 10px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; color: #D5DDF6; }
.steps b { color: #fff; }
.note { margin-top: 12px; font-size: 13px; color: var(--dim); }
.ctl { width: 100%; border-collapse: collapse; font-size: 13px; }
.ctl th { text-align: left; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); padding: 4px 6px 6px 0; }
.ctl td { padding: 7px 6px 7px 0; border-top: 1px solid rgba(170, 200, 255, 0.1); vertical-align: top; }
.ctl td:first-child { font-weight: 900; color: #fff; }
.blist { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px 18px; }
.bitem { display: flex; gap: 12px; align-items: center; }
.bitem canvas { width: 66px; height: 44px; flex: none; }
.bitem b { display: block; font-size: 15px; }
.bitem span { font-size: 12.5px; color: var(--dim); line-height: 1.3; display: block; }

.panel { width: 100%; max-width: 380px; border-radius: 26px; padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 10px; text-align: center; margin: auto; animation: cardin 0.4s cubic-bezier(0.2, 1.3, 0.4, 1); }
body.nomotion .panel { animation: none; }
.panel h2 { font-size: clamp(28px, 8vw, 40px); font-weight: 900; font-style: italic; line-height: 1.05;
  background: linear-gradient(180deg, #fff 30%, #9FE5FF); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: 0 0.3em 0.2em; margin: 0 calc(6px - 0.3em) calc(4px - 0.2em); }      /* (room for slanted letters and tails, the title taking the width it always did: see .logo span) */
.panel.bad h2 { background-image: linear-gradient(180deg, #fff 30%, #FF9AA8); }
.rank { font-weight: 900; color: var(--cyan); font-size: 14px; letter-spacing: 0.03em; min-height: 1.35em; }
/* results: the shard this sector gave up, going into the lens */
.shard { display: flex; align-items: center; gap: 14px; text-align: left; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); }
.shard canvas { width: 76px; height: 76px; flex: none; }
.shard p { display: flex; flex-direction: column; gap: 2px; }
.shard b { font-size: 16px; font-weight: 900; }
.shard span { font-size: 13px; color: var(--dim); font-weight: 700; }
.glimpse { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 0 4px; }
.glimpse b { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); font-weight: 900; }
.glimpse span { font-size: 14.5px; line-height: 1.42; color: #DCE4FF; font-style: italic; }
/* the story so far */
/* ---------- how to play, shown once (js/howto.js) ---------- */
.panel.howto { max-width: 400px; gap: 12px; }
.panel.howto h2 { font-size: clamp(24px, 6.4vw, 32px); }
/* the little scene: the game's own bricks and ship, moved about by howto.js */
.hw-stage { position: relative; flex: none; margin: 0 auto; border-radius: 16px; overflow: hidden; transition: opacity 0.4s;
  background: linear-gradient(180deg, rgba(8, 12, 40, 0.92), rgba(24, 14, 62, 0.8)); box-shadow: inset 0 0 0 1px var(--line), inset 0 3px 0 rgba(255, 255, 255, 0.16); }
.hw-stage.dim { opacity: 0; }
.hw-b { position: absolute; left: 0; top: 0; width: 52px; height: 36px; transition: transform 0.26s cubic-bezier(0.3, 0.9, 0.4, 1), opacity 0.3s; will-change: transform; }
.hw-b.fly { transition: transform 0.2s cubic-bezier(0.5, 0, 0.9, 0.6), opacity 0.3s; }
.hw-ship { position: absolute; left: 0; top: 0; width: 92px; height: 84px; transition: transform 0.2s cubic-bezier(0.3, 0.9, 0.4, 1); }
.hw-finger { position: absolute; left: -23px; top: -23px; width: 46px; height: 46px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.2) 68%, rgba(255, 255, 255, 0.06));
  box-shadow: 0 0 0 2.5px rgba(255, 255, 255, 0.95), 0 0 20px rgba(110, 220, 255, 0.9);
  transition: transform 0.4s cubic-bezier(0.45, 0, 0.3, 1), opacity 0.18s; }
.hw-finger b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; font-weight: 900; font-style: normal; line-height: 1; color: #0A1030; }
.hw-burst { position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(closest-side, #fff 0%, #FFF3A8 24%, rgba(255, 190, 70, 0.7) 46%, rgba(255, 110, 60, 0) 72%); }
.hw-burst.go { animation: hwburst 0.5s ease-out; }
@keyframes hwburst { 0% { opacity: 0.95; scale: 0.3; } 100% { opacity: 0; scale: 1.25; } }
/* (reduced motion: nothing moves, and two arrows mark the swipes) */
.hw-arrow { position: absolute; left: -15px; top: -30px; width: 30px; height: 60px; pointer-events: none; filter: drop-shadow(0 0 8px rgba(110, 220, 255, 0.9)); }
.hw-arrow::before { content: ""; position: absolute; left: 12px; top: 0; width: 6px; height: 44px; border-radius: 3px; background: #fff; }
.hw-arrow::after { content: ""; position: absolute; left: 3px; top: 34px; width: 0; height: 0; border-style: solid; border-width: 22px 12px 0 12px; border-color: #fff transparent transparent transparent; }
.hw-arrow.up::before { top: 16px; }
.hw-arrow.up::after { top: 0; border-width: 0 12px 22px 12px; border-color: transparent transparent #fff transparent; }
.hw-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; counter-reset: hw; }
.hw-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 13px; border: 1px solid transparent;
  font-size: 15px; line-height: 1.38; color: #DCE4FF; transition: background 0.25s, border-color 0.25s; }
.hw-steps li.on { background: rgba(15, 196, 255, 0.13); border-color: rgba(15, 196, 255, 0.5); }
.hw-steps li b { color: #fff; }
.hw-t { display: block; flex: 1; min-width: 0; }
.hw-steps:not(.hw-keys) li::before { counter-increment: hw; content: counter(hw); flex: none; width: 23px; height: 23px; margin-top: -1px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 900; color: #0A1030; background: linear-gradient(120deg, #4FDBFF 0%, #A47BFF 100%); }
.hw-k { flex: none; display: flex; gap: 4px; min-width: 70px; justify-content: flex-end; }
.hw-k kbd { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; display: inline-grid; place-items: center; font: inherit; font-size: 14px; font-weight: 900; color: #fff;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.4); box-shadow: 0 3px 0 rgba(0, 0, 20, 0.45); transition: transform 0.08s, background 0.12s, box-shadow 0.08s; }
.hw-k kbd.on { color: #0A1030; background: linear-gradient(120deg, #4FDBFF 0%, #A47BFF 100%); border-color: transparent; transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 20, 0.45); }
#hw-more { margin-top: 0; text-align: center; }
/* a short screen: the scene is drawn smaller and the footnote goes, so the button is in reach without scrolling */
@media (max-height: 700px) {
  .panel.howto { gap: 8px; padding-top: 16px; padding-bottom: 16px; }
  .hw-stage { zoom: 0.74; }
  .hw-steps li { font-size: 14px; padding: 6px 8px; }
  #hw-more { display: none; }
}
#help-howto { margin-top: 12px; }

.panel.story { max-width: 420px; gap: 12px; }
.panel.story canvas { width: 132px; height: 132px; margin: 0 auto; }
.panel.story h2 { font-size: clamp(24px, 6.4vw, 32px); }
#sy-lines p { font-size: 15px; line-height: 1.45; color: #DCE4FF; margin-top: 10px; }
#sy-lines p:first-child { margin-top: 0; }
/* the Wardens, to fight again */
.wlist { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.wcard { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px 16px; border-radius: 18px; background: var(--glass); border: 1.5px solid var(--line); transition: transform 0.08s, filter 0.15s; }
.wcard:hover { filter: brightness(1.2); } .wcard:active { transform: scale(0.98); }
.wcard small { font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.wcard b { font-size: 21px; font-weight: 900; font-style: italic; }
.wcard p { font-size: 13px; color: var(--dim); line-height: 1.35; }
.wcard em { font-style: normal; font-size: 12.5px; font-weight: 800; color: var(--amber); margin-top: 4px; }
.wcard[disabled] { opacity: 0.45; cursor: default; filter: none; transform: none; }

/* ---------- high scores ---------- */
.tabs, .scope { display: flex; gap: 8px; width: 100%; }
.tabs { margin-bottom: 8px; }
/* (four boards: on a narrow phone the tabs close up a little so each name stays on its button) */
@media (max-width: 420px) { .tabs { gap: 6px; } .tabs button { font-size: 14px; letter-spacing: 0; padding: 0 4px; } }
.scope { margin-bottom: 12px; }
.tabs button, .scope button {
  flex: 1; min-height: 44px; border-radius: 13px; font-weight: 900; letter-spacing: 0.03em; white-space: nowrap;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); color: var(--dim); transition: transform 0.08s, background 0.15s;
}
.tabs button:active, .scope button:active { transform: scale(0.96); }
.tabs button.on { color: #0A1030; border-color: transparent; background: linear-gradient(120deg, #4FDBFF 0%, #A47BFF 55%, #FF74E4 100%); }
.scope button { min-height: 36px; font-size: 13px; }
.scope button.on { color: var(--txt); border-color: var(--cyan); background: rgba(15, 196, 255, 0.16); }
/* difficulty: the same three buttons on the title screen and over the boards, each in its own colour */
.scope.diffs { margin-bottom: 8px; }
.scope button[data-diff="easy"].on { border-color: var(--lime); background: rgba(134, 242, 28, 0.14); }
.scope button[data-diff="hard"].on { border-color: var(--coral); background: rgba(255, 47, 100, 0.18); }
.diff { width: 100%; display: flex; flex-direction: column; gap: 5px; }
.diff .scope { margin: 0; }
.diff small { color: var(--dim); font-size: 12px; font-weight: 700; text-align: center; line-height: 1.3; min-height: 1.3em; text-shadow: 0 1px 6px rgba(4, 6, 20, 0.9); }
#s-scores { background: rgba(5, 7, 20, 0.66); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.board { width: 100%; border-radius: 22px; padding: 8px 10px 10px; }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li {
  display: grid; grid-template-columns: 2.1em minmax(0, 1fr) auto auto; align-items: baseline; column-gap: 10px;
  padding: 8px 8px; border-bottom: 1px solid rgba(170, 200, 255, 0.08); font-weight: 900; font-variant-numeric: tabular-nums;
}
.board li:last-child { border-bottom: 0; }
.board .rk { color: var(--dim); text-align: right; font-size: 14px; }
.board .nm { letter-spacing: 0.14em; font-size: 17px; white-space: pre; overflow: hidden; }
.board .dt { color: var(--dim); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.board .sc { font-size: 17px; text-align: right; }
.board li:nth-child(1) .nm, .board li:nth-child(1) .sc { color: #FFD75A; text-shadow: 0 0 14px rgba(255, 200, 60, 0.6); }
.board li:nth-child(2) .nm, .board li:nth-child(2) .sc { color: #DCE6FF; }
.board li:nth-child(3) .nm, .board li:nth-child(3) .sc { color: #FFAE7A; }
.board li.me { background: rgba(15, 196, 255, 0.16); border-radius: 11px; border-bottom-color: transparent; }
.board li.empty { display: block; padding: 28px 10px; text-align: center; color: var(--dim); font-weight: 700; }
.report { margin: 2px 0 10px; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); }
.report .note { margin: 0 0 8px; }
.report ol { list-style: none; margin: 0 0 10px; padding: 0; max-height: 240px; overflow-y: auto; -webkit-overflow-scrolling: touch; font-size: 12.5px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.report li { padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); color: var(--txt); overflow-wrap: anywhere; }
.report li:last-child { border-bottom: 0; }
.board .note { margin: 8px 6px 2px; text-align: center; }
.board .note.what { margin: 6px 8px 4px; font-size: 12.5px; }
.board .note:empty { display: none; }
.board .btn { display: block; margin: 8px auto 6px; }
.scope[hidden] + .board { margin-top: 4px; }
.who { width: 100%; margin-top: 12px; padding: 2px 14px; border-radius: 16px; border-bottom: 1px solid var(--line); }
.who b { letter-spacing: 0.14em; color: var(--amber); margin-left: 4px; white-space: pre; }

/* ---------- name entry ---------- */
.slots { display: flex; justify-content: center; gap: 5px; margin: 4px 0 10px; }
.slots i {
  flex: 0 1 36px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 25px;
  background: rgba(6, 10, 34, 0.72); border: 1px solid var(--line); color: var(--amber); text-shadow: 0 0 12px rgba(255, 166, 10, 0.55);
}
.slots i.cur { border-color: var(--amber); box-shadow: 0 0 0 2px rgba(255, 166, 10, 0.3); animation: curs 0.9s steps(2, jump-none) infinite; }
@keyframes curs { from { background: rgba(255, 166, 10, 0.28); } to { background: rgba(6, 10, 34, 0.72); } }
body.nomotion .slots i.cur { animation: none; background: rgba(255, 166, 10, 0.2); }
.slots.no { animation: nope 0.3s; }
#nm-note { margin: -2px 0 8px; }
@keyframes nope { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.nkeys { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 4px; }
.nkeys button {
  min-height: 41px; border-radius: 10px; font-weight: 900; font-size: 17px;
  background: rgba(255, 255, 255, 0.09); border: 1px solid var(--line); transition: transform 0.06s, background 0.12s;
}
.nkeys button:active { transform: scale(0.9); background: rgba(15, 196, 255, 0.35); }
.nkeys .w2 { grid-column: span 2; }
.nkeys .w7 { grid-column: 1 / -1; min-height: 36px; font-size: 12.5px; letter-spacing: 0.2em; color: var(--dim); }

.rows { display: grid; gap: 2px; margin: 4px 0; }
.rows div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 2px; border-bottom: 1px solid rgba(170, 200, 255, 0.1); font-size: 15px; }
.rows span { color: var(--dim); font-weight: 700; }
.rows b { font-variant-numeric: tabular-nums; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 2px 0; }
.total span { font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; color: var(--dim); }
.total b { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; }
/* shield pips: one small shield each, the lost ones dimmed (top bar, results, the sector card) */
.pips { display: inline-flex; gap: 3px; margin-left: 7px; vertical-align: -1px; transform-origin: 0 50%; }       /* (its flash grows away from the word beside it) */
.pips i { width: 9px; height: 11px; background: var(--cyan); -webkit-clip-path: polygon(50% 0, 100% 16%, 100% 56%, 50% 100%, 0 56%, 0 16%); clip-path: polygon(50% 0, 100% 16%, 100% 56%, 50% 100%, 0 56%, 0 16%); }
.pips i.off { background: rgba(255, 255, 255, 0.24); }
#h-shield i { width: calc(8px * var(--hud)); height: calc(10px * var(--hud)); }
.pips.hit { animation: pipshit 0.8s ease-out; }
@keyframes pipshit { 0%, 55% { transform: scale(1.7); filter: brightness(2.4); } 100% { transform: none; filter: none; } }
body.nomotion .pips.hit { animation: none; }
.cshield { margin-top: 8px; font-size: 12.5px; font-weight: 700; color: #BFE9FF; }
.fate { font-size: 14px; font-weight: 800; color: #FFC9D2; line-height: 1.35; }
.spect { color: var(--cyan); font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; font-size: 13px; }
.acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.acts .btn { flex: 0 1 auto; min-height: 32px; padding: 5px 14px; font-size: 13px; }
/* The results hold more than they did (the shield, a spectacular clear, a name to add, Share):
   drawn a little closer together, so that the fullest of them — a spectacular sector with a
   shard, by a player with no name yet — still fits on a phone without scrolling. */
#s-result .panel { gap: 8px; padding-top: 18px; padding-bottom: 16px; }
#s-result .rows div { padding-top: 5px; padding-bottom: 5px; }
#s-result .shard { padding: 8px 12px; }
#s-result .shard canvas { width: 64px; height: 64px; }
#sc-share { margin-top: 10px; width: 100%; }
.best { color: var(--amber); font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; font-size: 13px; animation: bestp 0.8s ease-in-out infinite alternate; }
@keyframes bestp { from { transform: scale(1); } to { transform: scale(1.08); } }
.btns { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.stars { display: flex; justify-content: center; gap: 8px; margin: 2px 0 6px; }
.stars i { width: 38px; height: 38px; transition: background 0.2s, transform 0.3s cubic-bezier(0.2, 1.6, 0.4, 1); }
.stars i.on { transform: scale(1.15); filter: drop-shadow(0 0 10px rgba(255, 189, 74, 0.8)); }

/* The astronaut, out from behind the name of the game to wave (an easter egg: see
   js/astro.js). The script places him; he never takes a tap meant for what is under him. */
#astro-front { position: absolute; left: 0; top: 0; pointer-events: none; transform-origin: 0 0; will-change: transform; }
#astro-front[hidden] { display: none; }
#astro-front canvas { position: absolute; display: block; filter: drop-shadow(0 6px 16px rgba(4, 8, 30, 0.55)); }

/* A passing note. It is as wide as its words need, up to most of the screen (it used to be
   boxed into half the screen's width, which stood a longer note up as a tall bubble), and
   it never takes a tap meant for what is under it. */
#toast {
  position: fixed; left: 0; right: 0; bottom: calc(var(--sb) + 22px); margin: 0 auto; z-index: 20;
  width: -webkit-fit-content; width: fit-content; max-width: min(90vw, 440px);
  padding: 10px 18px; border-radius: 20px; font-weight: 800; font-size: 14px; line-height: 1.35; text-align: center;
  pointer-events: none;
}

@media (max-width: 380px) {
  .tile { padding: 10px; column-gap: 8px; }
  .tile svg { width: 24px; height: 24px; }
  .tile b { font-size: 15px; }
  .stat.end { display: none; }
}
@media (max-height: 640px) and (orientation: landscape) {
  .screen { padding-top: calc(var(--st) + 10px); }
  .logo { font-size: clamp(34px, 11vh, 64px); }
  .tag { margin: 4px 0 10px; }
  .btn.xl { min-height: 56px; }
}
