:root {
  --navy: #06163b;
  --deep: #08265a;
  --ice: #dff8ff;
  --cyan: #61e7ff;
  --gold: #ffd85d;
  --panel: rgba(235, 250, 255, .92);
  --shadow: 0 14px 34px rgba(0, 26, 73, .3);
  --hex-w: 54px;
  --hex-h: 60px;
  color-scheme: dark;
  font-family: ui-rounded, "SF Pro Rounded", "Avenir Next", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--navy);
  color: white;
  overscroll-behavior: none;
  user-select: none;
}
button, input { font: inherit; }
button { color: inherit; border: 0; cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }

#app-shell, .screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
}
.screen { display: none; overflow: hidden; }
.screen.active { display: flex; flex-direction: column; }
.safe-top { padding-top: max(12px, env(safe-area-inset-top)); }
.safe-bottom { padding-bottom: max(9px, env(safe-area-inset-bottom)); }

.map-backdrop, .game-backdrop, .league-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.map-backdrop {
  background:
    linear-gradient(180deg, rgba(8, 33, 89, .02), rgba(4, 31, 82, .46)),
    url("assets/arctic-map-bg.png") center 43% / cover no-repeat,
    linear-gradient(#58cfff, #0878c4 58%, #053b88);
}
.map-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 10%, transparent 0 25%, rgba(4, 25, 72, .26) 90%);
}

.top-hud, .game-header, .league-header {
  position: relative;
  z-index: 5;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 14px;
}
.round-button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(#4bd9ff, #1477c9);
  border: 2px solid rgba(255,255,255,.78);
  box-shadow: 0 6px 0 #075292, 0 10px 18px rgba(0, 28, 77, .28);
  font-size: 24px;
  font-weight: 900;
}
.dark-button { background: linear-gradient(#275a93, #102f65); }
.hud-currency { display: flex; gap: 8px; }
.currency-pill, .game-coins {
  height: 40px;
  min-width: 94px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 22px;
  background: rgba(5, 36, 91, .78);
  border: 2px solid rgba(181, 238, 255, .62);
  box-shadow: inset 0 2px rgba(255,255,255,.13), 0 5px 12px rgba(0,22,65,.25);
}
.coin-icon { color: #ffe378; filter: drop-shadow(0 2px #a96c0c); }

.brand-card {
  position: relative;
  z-index: 3;
  width: min(92vw, 420px);
  margin: 2px auto 8px;
  padding: 12px 18px 13px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 25px;
  background: linear-gradient(180deg, rgba(8, 58, 126, .76), rgba(6, 35, 91, .7));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.24);
  backdrop-filter: blur(12px);
}
.eyebrow { margin: 0 0 3px; font-size: 10px; letter-spacing: .16em; color: #9aefff; font-weight: 900; }
.brand-card h1 { margin: 0; font-size: clamp(25px, 7vw, 34px); line-height: 1; text-shadow: 0 3px 0 #104a91; }
.brand-subtitle { margin: 6px 0 0; font-weight: 750; font-size: 13px; }
.brand-signature { margin: 3px 0 0; color: #ffe494; font: italic 700 12px Georgia, serif; }

.map-scroll {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 0 12px 126px;
}
.map-scroll::-webkit-scrollbar { display: none; }
.journey-ribbon {
  position: sticky;
  top: 0;
  z-index: 6;
  width: min(92vw, 420px);
  margin: 0 auto 10px;
  padding: 10px 15px;
  color: #07336f;
  background: rgba(237, 252, 255, .93);
  border: 2px solid white;
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(0, 37, 91, .26);
}
.journey-ribbon > div:first-child { display: flex; justify-content: space-between; font-size: 12px; font-weight: 900; }
.progress-track, .goal-track {
  height: 11px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 10px;
  background: #b9d8e8;
  box-shadow: inset 0 2px 3px rgba(0, 52, 94, .22);
}
.progress-track span, .goal-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38e2f7, #4a8cff 55%, #b45dff);
  box-shadow: inset 0 2px rgba(255,255,255,.55);
  transition: width .45s cubic-bezier(.2,.8,.2,1);
}
.map-path {
  position: relative;
  width: min(94vw, 430px);
  min-height: 790px;
  margin: auto;
}
.map-path::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 54px;
  width: 12px;
  height: 650px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(180deg, rgba(223,248,255,.9) 0 17px, rgba(122,211,238,.65) 17px 29px);
  border-radius: 20px;
  filter: drop-shadow(0 3px 3px rgba(0,67,120,.35));
}
.stage-node {
  position: absolute;
  left: var(--node-x);
  top: var(--node-y);
  width: 104px;
  height: 76px;
  transform: translate(-50%, -50%);
  border-radius: 50% 48% 46% 53%;
  background: linear-gradient(145deg, #f8ffff 0 45%, #9bdbed 48% 73%, #4fa8d0 76%);
  border: 3px solid white;
  box-shadow: 0 10px 0 #277fb3, 0 17px 23px rgba(0,45,91,.36);
  color: #0a4683;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 5px;
  transition: transform .2s;
}
.stage-node strong { font-size: 24px; line-height: 1; }
.stage-node small { display: block; max-width: 88px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 9px; font-weight: 900; }
.stage-node.current { animation: floatNode 1.8s ease-in-out infinite; box-shadow: 0 10px 0 #b86c10, 0 0 0 7px rgba(255,219,93,.45), 0 18px 28px rgba(0,45,91,.4); }
.stage-node.completed::after { content: "✓"; position: absolute; right: -7px; top: -8px; width: 26px; height: 26px; border-radius: 50%; background: #44d67e; color: white; display: grid; place-items: center; border: 2px solid white; }
.stage-node.locked { filter: saturate(.35); color: #6c8191; }
.stage-node.locked::after { content: "🔒"; position: absolute; font-size: 22px; }
.stage-node.locked > * { opacity: .28; }
.map-chest {
  position: absolute;
  left: var(--chest-x);
  top: var(--chest-y);
  transform: translate(-50%, -50%);
  width: 60px;
  height: 48px;
  border-radius: 12px 12px 17px 17px;
  background: linear-gradient(#ffd75b 0 35%, #dc7f18 36% 100%);
  border: 3px solid #fff3a3;
  box-shadow: 0 7px 0 #8c4712, 0 12px 18px rgba(0,35,77,.35);
  font-size: 23px;
}
.map-chest.available { animation: chestGlow 1.3s infinite alternate; }
.map-chest.claimed { filter: grayscale(.7); opacity: .68; }
.memory-button {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 45px;
  transform: translateX(-50%);
  min-width: 205px;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 22px;
  background: linear-gradient(#fff4a5, #ffbf3d);
  color: #714208;
  border: 2px solid white;
  box-shadow: 0 6px 0 #ad6818, 0 10px 18px rgba(0,37,77,.25);
  font-weight: 950;
}

.bottom-nav {
  position: absolute;
  z-index: 12;
  left: 0; right: 0; bottom: 0;
  height: calc(82px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 38px;
  padding-top: 10px;
  background: linear-gradient(rgba(4,31,80,.82), rgba(3,17,51,.98));
  border-top: 1px solid rgba(155,227,255,.45);
  backdrop-filter: blur(16px);
}
.nav-button { width: 70px; background: none; display: grid; gap: 2px; place-items: center; font-weight: 800; color: #acd9ee; }
.nav-button span { font-size: 23px; }
.nav-button.active { color: white; }
.play-button {
  width: 84px;
  height: 62px;
  margin-top: -26px;
  border-radius: 31px;
  background: linear-gradient(#ffe882, #ffad29);
  color: #653c02;
  border: 3px solid #fff5c0;
  box-shadow: 0 8px 0 #b56412, 0 12px 24px rgba(0,17,51,.5);
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
}

/* Game */
.game-screen { background: linear-gradient(#136bb8, #087bc7 42%, #07508f); }
.game-backdrop {
  background:
    radial-gradient(ellipse at 50% 28%, rgba(134,242,255,.48), transparent 42%),
    linear-gradient(180deg, #72d9f1 0 32%, #139ccc 33% 60%, #0873b8 100%);
}
.game-backdrop::before, .game-backdrop::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  top: 22%;
  border-radius: 45%;
  background: linear-gradient(145deg, #f7ffff, #a5dce9 65%, #5ba7cb);
  box-shadow: inset -13px -16px 0 rgba(35,119,170,.26);
  transform: rotate(29deg);
}
.game-backdrop::before { left: -125px; }
.game-backdrop::after { right: -125px; transform: rotate(-29deg); }
.game-header { min-height: 62px; }
.stage-title { text-align: center; display: grid; line-height: 1.05; }
.stage-title span { font-size: 9px; letter-spacing: .15em; color: #b9f3ff; font-weight: 900; }
.stage-title strong { font-size: 18px; text-shadow: 0 2px #074776; }
.game-coins { min-width: 72px; height: 38px; font-size: 13px; }
.goal-card {
  position: relative;
  z-index: 4;
  width: min(92vw, 410px);
  margin: 2px auto 5px;
  padding: 8px 14px 10px;
  border-radius: 18px;
  background: rgba(238,251,255,.93);
  color: #07366d;
  border: 2px solid white;
  box-shadow: 0 8px 20px rgba(0,53,92,.25);
}
.goal-row { display: flex; align-items: center; justify-content: space-between; }
.goal-row > div:first-child { display: flex; gap: 8px; align-items: baseline; }
.goal-row span { font-size: 9px; font-weight: 950; letter-spacing: .08em; }
.goal-row strong { font-size: 14px; }
.chain-badge { opacity: 0; color: #7d33ad; font-size: 10px; font-weight: 950; transition: opacity .2s, transform .2s; }
.chain-badge.show { opacity: 1; transform: scale(1.08); }
.goal-track { margin-top: 5px; height: 9px; }

.board-wrap {
  position: relative;
  z-index: 3;
  width: min(96vw, 430px);
  height: min(46vh, 390px);
  min-height: 298px;
  margin: 0 auto;
  display: grid;
  place-items: center;
}
.ice-rim {
  position: absolute;
  width: min(94vw, 410px);
  height: 96%;
  border-radius: 42% 45% 40% 47%;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(21,142,197,.48), transparent 62%),
    linear-gradient(150deg, rgba(239,255,255,.95), rgba(118,209,232,.86));
  clip-path: polygon(6% 14%, 22% 3%, 50% 7%, 72% 1%, 95% 15%, 97% 44%, 89% 76%, 63% 96%, 35% 93%, 8% 80%, 1% 46%);
  filter: drop-shadow(0 14px 16px rgba(0,59,98,.32));
}
.hex-board {
  position: relative;
  width: 330px;
  height: 348px;
  transform-origin: center;
}
.hex-cell {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--hex-w);
  height: var(--hex-h);
  transform: translate(-50%, -50%);
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  background: linear-gradient(145deg, rgba(238,253,255,.9), rgba(139,205,221,.88));
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.52);
  transition: filter .2s, transform .2s, opacity .2s;
}
.hex-cell::after {
  content: "";
  position: absolute;
  inset: 6px;
  clip-path: inherit;
  border: 2px dashed rgba(50,132,170,.24);
}
.hex-cell.valid { filter: drop-shadow(0 0 9px #fff67a); animation: validPulse .8s infinite alternate; }
.hex-cell.invalid, .hex-cell.blocked { filter: saturate(.25) brightness(.72); opacity: .6; }
.hex-cell.locked { background: linear-gradient(#9bc2d3, #6e94a9); }
.hex-cell.locked::after { content: "🔒"; inset: 0; display: grid; place-items: center; clip-path: none; border: 0; font-size: 19px; }
.cell-number { position: absolute; inset: auto 0 7px; text-align: center; z-index: 3; color: white; font-size: 9px; font-weight: 950; text-shadow: 0 1px 2px #174a66; }
.flower-cell { display: grid; place-items: center; font-size: 33px; filter: drop-shadow(0 4px 3px rgba(0,65,97,.3)); }
.flower-cell small { position: absolute; bottom: 4px; right: 5px; min-width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: #6a3ba2; font-size: 9px; font-weight: 950; }
.stack {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--hex-w);
  height: var(--hex-h);
  transform: translate(-50%, -50%);
  z-index: var(--z, 5);
  pointer-events: none;
  filter: drop-shadow(0 7px 5px rgba(0, 48, 84, .34));
}
.hex-layer {
  position: absolute;
  inset: 0;
  transform: translateY(calc(var(--depth) * -3.25px));
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  background:
    linear-gradient(155deg, rgba(255,255,255,.42), transparent 31%),
    var(--color);
  box-shadow:
    inset 0 3px rgba(255,255,255,.35),
    inset 0 -6px rgba(37,50,96,.22),
    0 4px 0 color-mix(in srgb, var(--color) 66%, #173a66);
}
.hex-layer:last-child::after {
  content: "";
  position: absolute;
  inset: 5px 8px 18px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  filter: blur(4px);
}
.stack.selected { filter: drop-shadow(0 0 10px #fff47a) drop-shadow(0 8px 5px rgba(0,48,84,.3)); }
.stack.protected::after {
  content: attr(data-protected);
  position: absolute;
  right: -5px;
  bottom: -8px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #304f84;
  border: 2px solid white;
  font-size: 10px;
  font-weight: 950;
}
.animation-layer { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.merge-ghost {
  position: absolute;
  width: 50px;
  height: 55px;
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  background: var(--color);
  animation: mergeFlight .42s cubic-bezier(.2,.8,.3,1) forwards;
  filter: drop-shadow(0 5px 7px rgba(0,44,77,.45));
}
.clear-burst {
  position: absolute;
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 8px solid var(--color);
  animation: clearBurst .55s ease-out forwards;
}

.candidate-panel {
  position: relative;
  z-index: 6;
  width: min(94vw, 420px);
  margin: 1px auto 0;
  padding: 6px 12px 8px;
  border-radius: 20px;
  background: rgba(4,42,91,.48);
  border: 1px solid rgba(199,244,255,.35);
  backdrop-filter: blur(8px);
}
.candidate-caption { display: flex; justify-content: space-between; align-items: baseline; padding: 0 5px 5px; }
.candidate-caption span { font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: .08em; }
.candidate-caption small { color: #b9edff; font-size: 9px; }
.candidate-tray { display: flex; justify-content: space-evenly; align-items: flex-end; min-height: 74px; }
.candidate-stack {
  position: relative;
  width: 66px;
  height: 62px;
  background: none;
  touch-action: none;
  transition: transform .18s, filter .18s;
}
.candidate-stack.selected { transform: translateY(-8px) scale(1.08); filter: drop-shadow(0 0 10px #fff47a); }
.candidate-stack .stack { left: 50%; top: 58%; transform: translate(-50%, -50%) scale(.93); }
.candidate-stack .slot-label { position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); font-size: 8px; color: #bcecff; font-weight: 900; }

.booster-dock {
  position: relative;
  z-index: 7;
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: flex-start;
  padding-top: 7px;
  min-height: calc(78px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(3,31,74,.25), rgba(3,22,59,.85));
}
.booster-button {
  position: relative;
  width: 84px;
  min-height: 56px;
  padding: 6px 5px;
  border-radius: 16px;
  background: linear-gradient(#f4fdff, #a6ddea);
  color: #0b4978;
  border: 2px solid white;
  box-shadow: 0 5px 0 #4a98b6, 0 8px 12px rgba(0,26,66,.3);
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
}
.booster-button.featured { background: linear-gradient(#fff4b1, #ffc94b); box-shadow: 0 5px 0 #bd731d, 0 8px 12px rgba(0,26,66,.3); }
.booster-icon { grid-row: span 2; font-size: 23px; }
.booster-button strong { font-size: 10px; text-align: left; }
.booster-button small { font-weight: 950; text-align: left; }
.booster-button.active { box-shadow: 0 0 0 4px #fff47a, 0 5px 0 #4a98b6; }

/* League */
.league-screen { background: linear-gradient(#4cc9ee, #0c75ba 54%, #062b69); }
.league-sky { background: radial-gradient(circle at 50% 0, #c5fbff 0, transparent 36%), linear-gradient(160deg, #5ee7ee, #237ac2 55%, #102c70); }
.league-header { justify-content: space-between; min-height: 82px; }
.league-header > div:nth-child(2) { text-align: center; }
.league-header span { font-size: 9px; letter-spacing: .12em; font-weight: 900; color: #c4f8ff; }
.league-header h2 { margin: 2px 0 0; font-size: 25px; }
.league-shield { width: 45px; height: 50px; display: grid; place-items: center; background: linear-gradient(#e9fdff,#79ccea); color: #15548b; clip-path: polygon(50% 0,96% 17%,84% 75%,50% 100%,16% 75%,4% 17%); font-weight: 950; }
.league-content { position: relative; z-index: 2; flex: 1; overflow-y: auto; padding: 0 14px 130px; scrollbar-width: none; }
.league-content::-webkit-scrollbar { display: none; }
.league-hero { text-align: center; }
.league-hero p { margin: 4px 0; font-size: 11px; color: #d3f8ff; }
.league-hero > strong { display: block; font-size: 19px; }
.podium { height: 150px; display: flex; justify-content: center; align-items: flex-end; gap: 5px; margin-top: 5px; }
.podium-card { width: 29%; padding: 9px 3px; border-radius: 18px 18px 5px 5px; background: linear-gradient(#effeff,#7bccec); color: #0c477c; box-shadow: 0 7px 0 #206b9f; }
.podium-card.first { min-height: 128px; background: linear-gradient(#fff4a2,#ffc23c); box-shadow: 0 7px 0 #b66a15; }
.podium-card.second { min-height: 105px; }
.podium-card.third { min-height: 88px; }
.podium-card b, .podium-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.standings-panel {
  margin-top: 12px;
  border-radius: 25px;
  padding: 14px 11px;
  background: rgba(239,252,255,.94);
  color: #0a3b70;
  box-shadow: var(--shadow);
}
.standings-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 7px 8px; }
.standings-heading span { font-size: 8px; letter-spacing: .1em; color: #3683a6; font-weight: 950; }
.standings-heading h3 { margin: 2px 0; }
.standings-heading b { font-size: 9px; color: #7b51aa; }
.league-list { display: grid; gap: 5px; }
.league-row {
  display: grid;
  grid-template-columns: 29px 1fr auto;
  align-items: center;
  min-height: 42px;
  padding: 5px 10px;
  border-radius: 13px;
  background: rgba(180,226,239,.45);
  font-size: 12px;
}
.league-row.is-player { background: linear-gradient(90deg, #ffe178, #ffbc4a); box-shadow: inset 0 0 0 2px white; }
.league-row .rank { font-weight: 950; }
.league-row .name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 850; }
.league-row .score { font-weight: 950; }
.league-reward { display: flex; align-items: center; gap: 12px; margin: 12px 0; padding: 12px; border-radius: 18px; background: rgba(7,40,96,.72); }
.league-reward div:nth-child(2) { display: grid; }
.league-reward span { font-size: 10px; color: #aeefff; }
.mini-chest { width: 48px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(#ffe875,#df851b); color: white; font-size: 20px; box-shadow: 0 5px 0 #8e4b10; }

/* Modal, toast, particles */
.modal-layer { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(2,14,45,.72); backdrop-filter: blur(8px); }
.modal-layer.open { display: flex; }
.modal-card {
  width: min(92vw, 390px);
  max-height: 86vh;
  overflow-y: auto;
  padding: 24px 20px 20px;
  text-align: center;
  border-radius: 28px;
  background: linear-gradient(#f7ffff,#c9eff7);
  color: #093a70;
  border: 3px solid white;
  box-shadow: 0 15px 0 #4b9dbb, 0 26px 50px rgba(0,18,55,.45);
}
.modal-card.grand { background: linear-gradient(#fff8b8,#ffd24f 58%,#f6a82f); box-shadow: 0 15px 0 #a76317, 0 26px 50px rgba(0,18,55,.45); }
.modal-icon { font-size: 55px; filter: drop-shadow(0 5px 4px rgba(0,51,84,.22)); }
.modal-card h2 { margin: 8px 0 7px; font-size: 28px; }
.modal-card p { line-height: 1.45; white-space: pre-line; }
.modal-actions { display: flex; gap: 9px; margin-top: 17px; }
.modal-actions button {
  flex: 1;
  min-height: 48px;
  border-radius: 16px;
  background: linear-gradient(#53def9,#1786cf);
  border: 2px solid white;
  box-shadow: 0 5px 0 #0d5d9c;
  font-weight: 950;
}
.modal-actions .secondary { background: linear-gradient(#e9f5f7,#a5cbd7); color: #164e70; box-shadow: 0 5px 0 #658fa0; }
.modal-actions .danger { background: linear-gradient(#ff8585,#dc475c); box-shadow: 0 5px 0 #8c2637; }
.settings-grid { display: grid; gap: 12px; text-align: left; }
.settings-grid label { display: grid; gap: 5px; font-size: 11px; font-weight: 900; }
.settings-grid input[type="text"] { width: 100%; padding: 11px 12px; border: 2px solid #86c9dc; border-radius: 13px; background: white; color: #10395f; font-weight: 800; user-select: text; }
.setting-toggle { display: flex !important; grid-template-columns: 1fr auto; align-items: center; justify-content: space-between; padding: 8px 0; }
.setting-toggle input { width: 25px; height: 25px; }
.toast {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translate(-50%, 30px);
  padding: 10px 16px;
  max-width: 86vw;
  border-radius: 18px;
  background: rgba(3,24,65,.93);
  border: 1px solid rgba(180,239,255,.6);
  box-shadow: 0 8px 24px rgba(0,17,49,.36);
  opacity: 0;
  pointer-events: none;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  transition: opacity .22s, transform .22s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confetti-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.confetti { position: absolute; top: -20px; width: 9px; height: 15px; background: var(--c); animation: confettiFall 2.3s linear forwards; }

@keyframes floatNode { 0%,100% { transform: translate(-50%,-50%); } 50% { transform: translate(-50%,calc(-50% - 8px)); } }
@keyframes chestGlow { to { filter: drop-shadow(0 0 13px #fff184); transform: translate(-50%,-55%) scale(1.04); } }
@keyframes validPulse { to { transform: translate(-50%,-50%) scale(1.05); } }
@keyframes mergeFlight { from { transform: translate(var(--from-x),var(--from-y)) scale(1); } to { transform: translate(var(--to-x),var(--to-y)) scale(.75); opacity: .5; } }
@keyframes clearBurst { from { transform: translate(-50%,-50%) scale(.25); opacity: 1; } to { transform: translate(-50%,-50%) scale(2); opacity: 0; } }
@keyframes confettiFall { to { transform: translate(var(--drift),110vh) rotate(720deg); } }

@media (max-height: 740px) {
  .game-header { min-height: 54px; }
  .goal-card { padding-block: 6px; }
  .board-wrap { height: 42vh; min-height: 270px; }
  .hex-board { transform: scale(.89); }
  .candidate-panel { padding-block: 4px; }
  .candidate-tray { min-height: 62px; }
  .booster-dock { min-height: calc(68px + env(safe-area-inset-bottom)); }
  .brand-card { padding-block: 8px; }
}
@media (max-width: 374px) {
  :root { --hex-w: 50px; --hex-h: 56px; }
  .hex-board { transform: scale(.91); }
  .booster-button { width: 78px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
