/* Pocket Arcade
   Touch-locked layout, hub cards, the game header and every overlay.
   No web fonts, no images, no external anything. */

:root {
  --font: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --night: #1d1458;
  --ink: #2b2060;
  --gold: #ffd84a;
  --play-a: #1d1458;
  --play-b: #2a1670;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body { height: 100%; margin: 0; }
html { background: var(--night); }

/* The page itself never scrolls, zooms, selects text or shows the iOS callout. */
body {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  font-family: var(--font);
  color: #fff;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}

[hidden] { display: none !important; }

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

h1, h2, h3, p { margin: 0; }
img, svg, canvas { display: block; }

#app {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  background:
    radial-gradient(110% 70% at 0% 0%, rgba(122, 80, 255, .78), transparent 60%),
    radial-gradient(95% 62% at 100% 100%, rgba(255, 84, 150, .55), transparent 60%),
    linear-gradient(165deg, #1d1458, #2b1672 55%, #1a1147);
}
/* Drifting dots. They live in their own clipped box so nothing ever overflows #app
   (an overflowing child would let the browser scroll the whole app out of place). */
.backdrop { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; pointer-events: none; }
.backdrop i {
  position: absolute;
  top: -40px;
  right: -40px;
  bottom: -40px;
  left: -40px;
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1.6px, transparent 2.2px);
  background-size: 38px 38px;
  animation: drift 26s linear infinite;
}
@keyframes drift { to { transform: translate3d(38px, 38px, 0); } }

/* ---------- screens ---------- */

.screen {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: scale(.97);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .2s ease, transform .2s ease;
}
#play { background: linear-gradient(170deg, var(--play-a), var(--play-b)); }

/* ---------- hub ---------- */

.hub-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(var(--safe-t) + 12px) calc(var(--safe-r) + 16px) 8px calc(var(--safe-l) + 16px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
  flex: none;
  pointer-events: none; /* no long-press "save image" sheet on iOS */
  -webkit-user-drag: none;
}
.brand h1 {
  font-size: 25px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .2px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .25);
  white-space: nowrap;
}
.brand h1 span { color: var(--gold); }
.hub-tools { display: flex; gap: 10px; flex: none; }

.round-btn {
  position: relative;
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .17);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .14);
  color: #fff;
  transition: transform .08s;
}
.round-btn svg { width: 26px; height: 26px; }
.round-btn:active { transform: scale(.93); }
.round-btn.is-small { width: 42px; height: 42px; }
.round-btn.is-small svg { width: 23px; height: 23px; }
.round-btn .ico-off { display: none; }
.round-btn.is-muted { color: #ffc2cd; }
.round-btn.is-muted .ico-on { display: none; }
.round-btn.is-muted .ico-off { display: block; }

.hold-btn .ring {
  position: absolute;
  top: -4px;
  right: -4px;
  bottom: -4px;
  left: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  transform: rotate(-90deg);
  pointer-events: none;
}
.hold-btn .ring circle { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; }
/* touch-action none: nothing may interrupt the two-second hold */
.hold-btn { touch-action: none; }
.hold-btn.is-holding { background: rgba(255, 255, 255, .3); transform: scale(1.06); }

/* session timer */
.timer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 calc(var(--safe-r) + 16px) 6px calc(var(--safe-l) + 16px);
  padding: 6px 12px 6px 9px;
  border-radius: 999px;
  background: rgba(14, 8, 52, .5);
}
.timer svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.timer-track { flex: 1; height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.timer-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4fdc7c, #b5f25c);
  transition: width .3s linear;
}
.timer.is-mid .timer-fill { background: linear-gradient(90deg, #ffd84a, #ffa62b); }
.timer.is-low .timer-fill { background: linear-gradient(90deg, #ff8a7a, #ff4d6d); }
.timer-text { min-width: 38px; text-align: right; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer.is-slim { margin: 0 calc(var(--safe-r) + 12px) 6px calc(var(--safe-l) + 12px); padding: 3px 10px 3px 8px; }
.timer.is-slim .timer-track { height: 8px; }
.timer.is-slim svg { width: 15px; height: 15px; }

.grid {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(176px, 236px);
  align-content: center;
  gap: 16px 14px;
  padding: 12px calc(var(--safe-r) + 16px) calc(var(--safe-b) + 20px) calc(var(--safe-l) + 16px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
@media (min-width: 620px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(176px, 290px); gap: 20px 18px; }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1100px; }
}
/* More cards than fit on screen: line them up from the top so every one can be
   scrolled to (centring would push the first row out of reach). */
.grid.is-scrolling { align-content: start; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 8px 8px 10px;
  border-radius: 26px;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: 0 7px 0 var(--lip), 0 16px 22px rgba(8, 4, 40, .45);
  text-align: center;
  transition: transform .08s, box-shadow .08s;
  animation: card-in .4s cubic-bezier(.2, 1.3, .4, 1) both;
}
.card:nth-child(2) { animation-delay: .04s; }
.card:nth-child(3) { animation-delay: .08s; }
.card:nth-child(4) { animation-delay: .12s; }
.card:nth-child(5) { animation-delay: .16s; }
.card:nth-child(6) { animation-delay: .2s; }
.card:nth-child(n + 7) { animation-delay: .24s; }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.94); } }
.card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .38), inset 0 -3px 0 rgba(0, 0, 0, .08);
  pointer-events: none;
}
.card:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 var(--lip), 0 6px 10px rgba(8, 4, 40, .4);
}
.card-art {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  border-radius: 19px;
  background: rgba(255, 255, 255, .2);
}
.card-title {
  margin-top: 7px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge {
  position: absolute;
  top: -7px;
  right: -5px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px 4px 6px;
  border-radius: 999px;
  background: #fff;
  color: #4a3200;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .22);
  transform: rotate(4deg);
}
.badge svg { width: 17px; height: 17px; color: #ffb400; }
.badge b { font-variant-numeric: tabular-nums; }
.badge.is-empty { padding: 4px 6px; }
.badge.is-empty svg { color: #d8d2ea; }

.hub-empty {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 45%;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  opacity: .85;
}

/* ---------- play screen ---------- */

.play-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-t) + 8px) calc(var(--safe-r) + 10px) 9px calc(var(--safe-l) + 10px);
}
.big-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 54px;
  border-radius: 18px;
  background: var(--face);
  box-shadow: 0 5px 0 var(--lip), 0 9px 12px rgba(0, 0, 0, .28);
  color: #fff;
  transition: transform .07s, box-shadow .07s;
}
.big-btn svg { width: 32px; height: 32px; }
.big-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--lip), 0 3px 6px rgba(0, 0, 0, .28); }
.big-btn.home { --face: linear-gradient(#ffe066, #ffab2e); --lip: #c2701a; color: #5c3300; }
.big-btn.restart { --face: linear-gradient(#69e2ff, #3b9cff); --lip: #2468c9; width: 50px; height: 50px; border-radius: 17px; }
.big-btn.restart svg { width: 29px; height: 29px; }

.scores { flex: 1; min-width: 0; display: flex; justify-content: center; gap: 6px; }
.pill {
  flex: 1 1 0;
  min-width: 0;
  max-width: 132px;
  padding: 5px 6px 6px;
  border-radius: 16px;
  background: rgba(12, 6, 46, .46);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .1);
  text-align: center;
}
.pill-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  opacity: .78;
}
.pill-label svg { width: 11px; height: 11px; color: var(--gold); }
.pill-value {
  display: block;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.pill.is-best .pill-value { color: var(--gold); }
/* Games without a score (creative toys) show their name instead of the score pills. */
.play-title {
  align-self: center;
  min-width: 0;
  font-size: 19px;
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#play.is-scoreless .pill { display: none; }

.stage-pad {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 0 calc(var(--safe-r) + 6px) calc(var(--safe-b) + 6px) calc(var(--safe-l) + 6px);
}
.stage { position: relative; flex: 1; min-width: 0; min-height: 0; }

/* The game surface: no scrolling, zooming, selection or callouts, ever. */
.game-canvas {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 22px;
  background: #0d0830;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .14), 0 14px 30px rgba(0, 0, 0, .38);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ---------- overlays ---------- */

.modal {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-t) + 16px) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 16px) calc(var(--safe-l) + 16px);
  background: rgba(14, 7, 52, .64);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: fade .2s both;
}
@keyframes fade { from { opacity: 0; } }
#levels { z-index: 21; }
#lock { z-index: 30; }
#settings { z-index: 40; }
#gate { z-index: 41; }

.sheet {
  position: relative;
  width: min(344px, 100%);
  max-height: 100%;
  padding: 24px 20px 22px;
  border-radius: 32px;
  background: linear-gradient(#ffffff, #f1edff);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 9px 0 rgba(0, 0, 0, .2), 0 30px 60px rgba(0, 0, 0, .4);
  animation: pop .34s cubic-bezier(.2, 1.35, .4, 1) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.72); } }
.sheet h2 { font-size: 28px; font-weight: 900; line-height: 1.1; }

.x-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e7e1fb;
  color: #6a5aa8;
}
.x-btn svg { width: 20px; height: 20px; }
.x-btn:active { transform: scale(.92); }

/* result card */
.result-sheet h2 { color: #17a34f; font-size: 30px; }
#result[data-mood="soft"] .result-sheet h2 { color: #5a43e0; }
.result-note { margin-top: 4px; font-size: 15px; font-weight: 800; color: #8478b6; }
.stars { display: flex; justify-content: center; gap: 6px; margin: 14px 0 2px; }
.star { color: #ddd6f3; }
.star svg { width: 60px; height: 60px; }
.star:nth-child(2) { transform: translateY(-9px); }
.star:nth-child(2) svg { width: 70px; height: 70px; }
.star.on { color: #ffc21a; filter: drop-shadow(0 4px 0 rgba(203, 131, 0, .55)); animation: star-in .45s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: calc(.4s + var(--i) * .24s); }
@keyframes star-in { from { opacity: .001; transform: scale(.2) rotate(-40deg); } }
.star.on:nth-child(2) { animation-name: star-in-mid; }
@keyframes star-in-mid { from { opacity: .001; transform: translateY(-9px) scale(.2) rotate(-40deg); } to { transform: translateY(-9px); } }
.result-score { margin-top: 10px; font-size: 48px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.result-best {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  background: #ece7ff;
  color: #6a5aa8;
  font-size: 14px;
  font-weight: 800;
}
.result-best svg { width: 16px; height: 16px; color: #ffb400; }
.result-best.is-new { background: linear-gradient(#ffe066, #ffb62e); color: #5c3300; animation: wiggle .7s ease-in-out .5s 2; }
.result-best.is-new svg { color: #fff; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg) scale(1.06); } 75% { transform: rotate(4deg) scale(1.06); } }

/* One big green button on its own row, the smaller choices in a row beneath it. */
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 10px; margin-top: 20px; }
.act {
  flex: 0 1 88px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: 68px;
  padding: 0 6px;
  border-radius: 22px;
  background: linear-gradient(#9a86ff, #6c50f5);
  box-shadow: 0 5px 0 #4a32c2;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform .07s, box-shadow .07s;
}
.act svg { width: 29px; height: 29px; }
.act.primary {
  flex: 1 0 100%;
  flex-direction: row;
  gap: 10px;
  height: 74px;
  border-radius: 26px;
  background: linear-gradient(#63e884, #1fbf5a);
  box-shadow: 0 6px 0 #13863b;
  font-size: 23px;
  font-weight: 900;
}
.act.primary svg { width: 38px; height: 38px; }
.act:active { transform: translateY(4px); box-shadow: 0 1px 0 #4a32c2; }
.act.primary:active { box-shadow: 0 2px 0 #13863b; }

/* level picker */
.levels-sheet h2 { margin-bottom: 16px; }
.levels-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.lv {
  position: relative;
  min-height: 54px;
  aspect-ratio: 1 / 1.08;
  display: grid;
  place-items: center;
  padding-bottom: 9px;
  border-radius: 16px;
  background: linear-gradient(#9a86ff, #6c50f5);
  box-shadow: 0 4px 0 #4a32c2;
  color: #fff;
  font-size: 21px;
}
.lv b { font-weight: 900; }
.lv svg { width: 22px; height: 22px; }
.lv:active { transform: translateY(3px); box-shadow: 0 1px 0 #4a32c2; }
.lv.is-current { background: linear-gradient(#63e884, #1fbf5a); box-shadow: 0 4px 0 #13863b; }
.lv.is-locked { padding-bottom: 0; background: #e2ddf4; box-shadow: 0 4px 0 #c4bce0; color: #a79fca; }
.mini-stars { position: absolute; left: 0; right: 0; bottom: 5px; display: flex; justify-content: center; gap: 1px; }
.mini-stars i { color: rgba(255, 255, 255, .34); }
.mini-stars i.on { color: var(--gold); }
.mini-stars svg { width: 11px; height: 11px; }

/* time's up */
.lock {
  background: radial-gradient(120% 80% at 50% 0%, #3b2a9c, #150d45 70%);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.lock-body { display: flex; flex-direction: column; align-items: center; text-align: center; }
.lock-body h2 { margin-top: 26px; font-size: 34px; font-weight: 900; }
.lock-body p { margin: 8px 0 34px; font-size: 17px; font-weight: 700; opacity: .85; }
.lock-body small { margin-top: 12px; font-size: 13px; font-weight: 700; opacity: .6; }
.moon {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  box-shadow: inset -22px 12px 0 0 #ffe9a6;
  transform: rotate(-18deg);
  animation: bob 4s ease-in-out infinite;
}
.moon i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: twinkle 2.4s ease-in-out infinite; }
.moon i:nth-child(1) { left: 6px; top: 16px; }
.moon i:nth-child(2) { left: 30px; top: 58px; width: 5px; height: 5px; animation-delay: .8s; }
.moon i:nth-child(3) { left: -14px; top: 66px; width: 6px; height: 6px; animation-delay: 1.5s; }
@keyframes bob { 50% { transform: rotate(-18deg) translateY(-8px); } }
@keyframes twinkle { 50% { opacity: .25; transform: scale(.6); } }

/* parent gate */
.gate-kicker { font-size: 14px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: #8478b6; }
.gate-sum { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 10px 0 18px; font-size: 40px; font-weight: 900; }
.gate-in {
  min-width: 78px;
  padding: 2px 10px;
  border-radius: 16px;
  background: #ece7ff;
  box-shadow: inset 0 0 0 3px #cfc5f7;
  font-variant-numeric: tabular-nums;
}
.gate-in.is-empty { color: #b3a9dc; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.keypad button {
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(#9a86ff, #6c50f5);
  box-shadow: 0 4px 0 #4a32c2;
  color: #fff;
  font-size: 25px;
  font-weight: 900;
}
.keypad button.is-soft { background: #e2ddf4; box-shadow: 0 4px 0 #c4bce0; color: #6a5aa8; }
.keypad button svg { width: 28px; height: 28px; }
.keypad button:active { transform: translateY(3px); box-shadow: 0 1px 0 #4a32c2; }
.keypad button.is-soft:active { box-shadow: 0 1px 0 #c4bce0; }
.sheet.is-shaking { animation: shake .36s; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }

/* parent settings */
.settings-sheet { display: flex; flex-direction: column; width: min(400px, 100%); padding: 0; text-align: left; overflow: hidden; }
.settings-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 12px 22px; }
.settings-head h2 { font-size: 23px; }
.settings-body {
  flex: 1;
  min-height: 0;
  padding: 0 22px 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.settings-body section + section { margin-top: 20px; }
.settings-body h3 { margin-bottom: 8px; font-size: 13px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: #8478b6; }
.toggle-list { border-radius: 18px; background: #ece7ff; overflow: hidden; }
.toggle-row { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 12px; text-align: left; font-size: 16px; font-weight: 800; }
.toggle-row + .toggle-row { box-shadow: inset 0 1px 0 #dcd4f8; }
.toggle-dot { width: 26px; height: 26px; border-radius: 9px; flex: none; }
.toggle-name { flex: 1; min-width: 0; }
.switch { position: relative; width: 52px; height: 31px; flex: none; border-radius: 999px; background: #c9c1e6; transition: background .15s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 25px; height: 25px; border-radius: 50%; background: #fff; box-shadow: 0 2px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.toggle-row[aria-checked="true"] .switch { background: #2fca63; }
.toggle-row[aria-checked="true"] .switch i { transform: translateX(21px); }
.toggle-row[aria-checked="false"] .toggle-name { opacity: .5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border-radius: 999px; background: #ece7ff; color: #5a4a98; font-size: 15px; font-weight: 800; }
.chip.is-on { background: #6c50f5; color: #fff; }
.fine { margin-top: 8px; font-size: 13.5px; font-weight: 600; line-height: 1.4; color: #6f659c; }
.status[data-state="ok"] { color: #128a40; }
.status[data-state="warn"] { color: #b45309; }
.text-btn { padding: 11px 18px; border-radius: 15px; background: #ece7ff; color: #5a4a98; font-size: 15px; font-weight: 800; }
.text-btn:active, .chip:active { transform: scale(.96); }
.text-btn.is-go { background: #2fca63; color: #fff; box-shadow: 0 4px 0 #1b9446; }
.text-btn.is-danger { background: #ffe3e6; color: #c81e3a; }
.confirm p { margin-bottom: 10px; font-size: 15px; font-weight: 700; }
.confirm .text-btn + .text-btn { margin-left: 8px; }

/* confetti + toast */
#confetti { position: absolute; top: 0; left: 0; z-index: 50; width: 100%; height: 100%; pointer-events: none; }
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-b) + 26px);
  z-index: 60;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(14, 8, 52, .92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  animation: toast-in .22s both;
}
.toast.is-out { opacity: 0; transition: opacity .25s; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-height: 430px) {
  .hub-bar { padding-top: calc(var(--safe-t) + 6px); padding-bottom: 2px; }
  .play-bar { padding-top: calc(var(--safe-t) + 4px); padding-bottom: 5px; }
  .big-btn { height: 46px; }
  .big-btn.restart { height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .backdrop i, .moon, .moon i { animation: none; }
  .screen, .screen.is-active { transition: none; }
}
