/* ==========================================================================
   Move the Car — stylesheet
   ========================================================================== */

:root {
  --ink: #1e2d44;
  --ink-soft: #5d7291;
  --ink-faint: #8ba0bd;
  --sky: #8ed4ff;
  --paper: #ffffff;
  --gold: #ffc02e;
  --gold-deep: #d98b0a;
  --danger: #e05661;
  --font: "Nunito", "SF Pro Rounded", "Segoe UI Variable", "Segoe UI",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
          "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, sans-serif;
  --radius: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #0d1d30;
}

body {
  font-family: var(--font);
  color: var(--ink);
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

[hidden] { display: none !important; }

button { font-family: inherit; }

/* ------------------------------- backdrop -------------------------------- */
.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 18% 12%, #164a72 0%, rgba(22, 74, 114, 0) 60%),
    radial-gradient(70% 55% at 85% 20%, #3a2a63 0%, rgba(58, 42, 99, 0) 62%),
    linear-gradient(165deg, #0a1726 0%, #0d2038 48%, #08131f 100%);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
}
.orb-a { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: #1f7fbf; }
.orb-b { width: 38vmax; height: 38vmax; right: -10vmax; bottom: -14vmax; background: #a04f9d; opacity: .35; }
.orb-c { width: 30vmax; height: 30vmax; right: 12vmax; top: 30vmax; background: #2c9c86; opacity: .28; }
.grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: .5;
}

/* --------------------------------- stage --------------------------------- */
.stage {
  position: relative;
  height: min(100vh, 940px, calc(100vw * 16 / 9));
  height: min(100dvh, 940px, calc(100vw * 16 / 9));
  width: auto;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 30px;
  background: #bfe8ff;
  box-shadow:
    0 40px 90px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(255, 255, 255, .10),
    0 0 0 8px rgba(255, 255, 255, .04);
  container-type: size;
  isolation: isolate;
}

.game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: pointer;
}

@media (max-width: 620px) {
  .stage {
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
  }
}
/* rotate hint for phones held sideways */
.rotate-hint {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  place-items: center;
  text-align: center;
  padding: 28px;
  background:
    radial-gradient(80% 50% at 50% 20%, #164a72 0%, rgba(22, 74, 114, 0) 65%),
    linear-gradient(165deg, #0a1726, #0d2038 60%, #08131f);
  color: #eaf6ff;
}
.rotate-hint svg {
  width: 64px;
  height: 64px;
  stroke: #8ed4ff;
  margin-bottom: 12px;
  animation: rotate-phone 2.4s ease-in-out infinite;
}
.rotate-hint p {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 900;
}
.rotate-hint small {
  font-size: 12px;
  font-weight: 600;
  color: #92abc5;
}
@keyframes rotate-phone {
  0%, 20% { transform: rotate(0deg); }
  55%, 80% { transform: rotate(90deg); }
  100% { transform: rotate(360deg); }
}
@media (orientation: landscape) and (max-height: 540px) and (max-width: 960px) and (hover: none) and (pointer: coarse) {
  .rotate-hint { display: grid; }
}

/* --------------------------------- HUD ----------------------------------- */
.hud {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: calc(var(--safe-top) + 10px) 12px 6px;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-mid {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: rgba(255, 255, 255, .66);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 16px;
  padding: 5px 14px 6px;
  box-shadow: 0 6px 18px rgba(30, 70, 120, .13);
  width: fit-content;
  margin: 0 auto;
}
.hud-level {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .01em;
  color: #243650;
  line-height: 1.1;
}
.hud-sub {
  font-size: 11px;
  font-weight: 800;
  color: #5f7492;
  line-height: 1.2;
}
.hud-sub .sep { margin: 0 5px; opacity: .5; }

.icon-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 14px;
  background: rgba(255, 255, 255, .68);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  color: #2b3f5c;
  box-shadow: 0 5px 14px rgba(30, 70, 120, .14);
  cursor: pointer;
  transition: transform .12s ease, background .2s ease;
}
.icon-btn svg { width: 21px; height: 21px; }
.ico-sound-off { display: none; }
.muted-sound .ico-sound-on { display: none; }
.muted-sound .ico-sound-off { display: block; }
.icon-btn:active { transform: scale(.91); background: rgba(255,255,255,.95); }

/* ------------------------------- controls -------------------------------- */
.controls {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 16px calc(var(--safe-bottom) + 16px);
  background: linear-gradient(to top, rgba(255, 255, 255, .78) 0%, rgba(255, 255, 255, .30) 45%, rgba(255,255,255,0) 100%);
}
.ctrl {
  position: relative;
  min-width: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px 12px 7px;
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 4px 0 rgba(193, 214, 236, .75), 0 10px 20px rgba(40, 80, 140, .14);
  color: #3b506e;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease;
}
.ctrl svg { width: 22px; height: 22px; }
.ctrl:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(193, 214, 236, .75); }
.ctrl-hint {
  background: linear-gradient(180deg, #ffdb74 0%, #ffb02d 100%);
  border-color: #ffe9a8;
  color: #6b4400;
  box-shadow: 0 4px 0 #d68c08, 0 12px 22px rgba(255, 170, 20, .32);
}
.ctrl-hint:active { box-shadow: 0 1px 0 #d68c08; }

/* -------------------------------- screens -------------------------------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --------------------------------- home ---------------------------------- */
.screen-home {
  justify-content: space-between;
  padding: calc(var(--safe-top) + 14px) 20px calc(var(--safe-bottom) + 16px);
  background:
    radial-gradient(130% 52% at 50% -6%, #ffffff 0%, rgba(255, 255, 255, 0) 52%),
    radial-gradient(90% 42% at 88% 8%, #fff0b8 0%, rgba(255, 240, 184, 0) 60%),
    radial-gradient(70% 40% at 8% 18%, #c9ecff 0%, rgba(201, 236, 255, 0) 65%),
    linear-gradient(180deg, #8ed4ff 0%, #b8e8ff 38%, #eaf9ff 68%, #fff7e4 100%);
  gap: 4px;
}
.screen-home::before,
.screen-home::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  filter: blur(0.5px);
  pointer-events: none;
}
.screen-home::before {
  width: 92px; height: 34px; left: -18px; top: 16%;
  box-shadow: 52px -16px 0 -6px rgba(255,255,255,.55), 104px 4px 0 -10px rgba(255,255,255,.45);
}
.screen-home::after {
  width: 74px; height: 28px; right: -14px; top: 27%;
  box-shadow: -46px 18px 0 -6px rgba(255,255,255,.4);
}

.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 900;
  color: #335a7d;
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(255, 255, 255, .8);
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.brand img { width: 24px; height: 24px; display: block; }
.home-tools { display: flex; align-items: center; gap: 7px; }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .62);
  backdrop-filter: blur(10px);
  color: #33506f;
  font-size: 11.5px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30, 80, 130, .10);
  transition: transform .12s ease;
}
.chip-btn svg { width: 16px; height: 16px; }
.chip-btn:active { transform: scale(.94); }
.chip-btn.icon-only { width: 36px; padding: 0; justify-content: center; }

.home-hero {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  z-index: 1;
  padding: 4px 0;
  text-align: center;
}
.home-hero .btn-play {
  width: 100%;
  max-width: 340px;
  margin-top: 16px;
}
.logo-wrap {
  position: relative;
  width: 180px;
  width: min(44cqw, 190px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}
.logo-halo {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 243, 183, .95) 0%, rgba(255, 210, 80, .45) 48%, rgba(255, 210, 80, 0) 72%);
  filter: blur(6px);
  animation: halo 5s ease-in-out infinite;
}
.logo {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 16px 22px rgba(26, 76, 130, .26));
  animation: floaty 4.6s ease-in-out infinite;
  pointer-events: none;
}
.float-dot {
  position: absolute;
  border-radius: 50%;
  animation: drift 6s ease-in-out infinite;
  opacity: .9;
}
.fd1 { width: 11px; height: 11px; background: #ff6f6f; left: -4%; top: 24%; animation-delay: -.4s; }
.fd2 { width: 8px; height: 8px; background: #58dc9a; right: 0%; top: 34%; animation-delay: -2.2s; }
.fd3 { width: 9px; height: 9px; background: #ffd24a; right: 12%; bottom: 6%; animation-delay: -3.6s; }

.kicker {
  margin: 0;
  font-size: 10px;
  font-size: clamp(9px, 2.5cqw, 11px);
  font-weight: 900;
  letter-spacing: .28em;
  text-indent: .28em;
  color: #3a7baa;
  opacity: .9;
}
.title {
  margin: 2px 0 0;
  font-size: 34px;
  font-size: clamp(28px, 9.2cqw, 40px);
  line-height: 1.06;
  font-weight: 900;
  letter-spacing: -.01em;
  color: #17314e;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .75), 0 12px 24px rgba(30, 90, 140, .16);
}
.tagline {
  margin: 4px 0 0;
  max-width: 19em;
  font-size: 13px;
  font-size: clamp(12px, 3.5cqw, 14.5px);
  line-height: 1.45;
  font-weight: 600;
  color: #43688c;
}
.stars-line {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .85);
  color: #7a5c00;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
}
.stars-line svg { width: 14px; height: 14px; fill: var(--gold); filter: drop-shadow(0 1px 1px rgba(190, 130, 0, .35)); }

.home-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  padding-top: 2px;
}
.home-row { display: flex; gap: 9px; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 18px;
  font-weight: 900;
  font-size: 15px;
  line-height: 1.1;
  color: #23344d;
  padding: 13px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .2s ease;
  text-align: center;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary {
  background: linear-gradient(180deg, #ffdc77 0%, #ffc02e 45%, #ffab1a 100%);
  color: #5b3a00;
  box-shadow:
    0 5px 0 #d78907,
    0 14px 28px rgba(255, 166, 18, .38),
    inset 0 1px 0 rgba(255, 255, 255, .75);
}
.btn-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #d78907, 0 8px 16px rgba(255, 166, 18, .3); }
.btn-play {
  width: 100%;
  height: 62px;
  font-size: 18px;
  font-size: clamp(17px, 4.6cqw, 20px);
  border-radius: 20px;
  letter-spacing: .01em;
}
.play-ico { width: 19px; height: 19px; fill: currentColor; margin-top: 1px; }
.btn-soft {
  flex: 1;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .95);
  color: #334964;
  font-size: 13.5px;
  padding: 12px 10px;
  box-shadow: 0 4px 0 rgba(188, 211, 236, .7), 0 10px 20px rgba(40, 90, 150, .10);
  border-radius: 16px;
}
.btn-soft svg { width: 18px; height: 18px; opacity: .85; }
.btn-soft:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(188, 211, 236, .7); }
.btn-danger {
  background: linear-gradient(180deg, #ff838b, #ef4d5b);
  color: #fff;
  box-shadow: 0 5px 0 #c4343f, 0 12px 22px rgba(230, 70, 85, .28);
}
.btn-danger:active { transform: translateY(3px); box-shadow: 0 1px 0 #c4343f; }
.btn-danger-soft {
  background: #ffeff1;
  color: #c13a48;
  border: 1px solid #ffd5da;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 13px;
  align-self: flex-start;
  box-shadow: none;
}
.btn-danger-soft:active { transform: scale(.97); }

.link-btn {
  appearance: none;
  border: 0;
  background: none;
  color: #43678a;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  opacity: .8;
  padding: 4px;
  cursor: pointer;
  align-self: center;
}
.credit {
  margin: 8px 0 0;
  text-align: center;
  font-size: 9.5px;
  line-height: 1.4;
  font-weight: 700;
  color: rgba(38, 78, 118, .55);
  position: relative;
  z-index: 1;
}

/* -------------------------------- levels --------------------------------- */
.screen-levels {
  background:
    radial-gradient(120% 40% at 50% 0%, #fffdf4 0%, rgba(255,253,244,0) 55%),
    linear-gradient(180deg, #eaf7ff 0%, #f6fbff 38%, #eef6ff 100%);
}
.sub-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-top) + 12px) 14px 4px;
}
.sub-header h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 900;
  flex: 1;
  color: #243a56;
}
.star-total {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 12px;
  background: #fff8e2;
  border: 1px solid #ffe8a8;
  color: #8d6400;
  font-size: 11.5px;
  font-weight: 900;
  white-space: nowrap;
}
.star-total svg { width: 14px; height: 14px; fill: var(--gold); }
.levels-sub {
  margin: 0 20px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #647c9b;
}
.level-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 4px 16px calc(var(--safe-bottom) + 24px);
  overflow-y: auto;
  align-content: start;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.level-grid::-webkit-scrollbar { display: none; }
.level-btn {
  position: relative;
  aspect-ratio: 1 / 1.08;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 14px;
  background: #fff;
  color: #2b3f5c;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 3px 0 #dbe7f5, 0 6px 14px rgba(50, 100, 160, .08);
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease;
}
.level-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #dbe7f5; }
.level-btn .lv-stars { display: flex; gap: 1px; line-height: 0; }
.level-btn .pip { width: 10px; height: 10px; fill: #dbe5f1; transition: fill .2s ease; }
.level-btn .pip.on { fill: var(--gold); }
.level-btn.perfect { border-color: #ffe08a; background: linear-gradient(180deg, #fffdf5, #fff8e6); }
.level-btn.locked {
  background: #eef4fb;
  border-color: transparent;
  box-shadow: none;
  color: #9fb3ca;
  cursor: default;
}
.level-btn .lock-pip { width: 12px; height: 12px; fill: #b3c4d8; }
.level-btn.current { border-color: #4aa3f0; box-shadow: 0 0 0 2px rgba(74, 163, 240, .35), 0 4px 0 #cfe2f6; }

.home-scene {
  position: relative;
  z-index: 1;
  width: min(100%, 344px);
  margin: 0 auto;
  opacity: .98;
  pointer-events: none;
}
.home-scene svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 16px rgba(30, 70, 120, .10));
}

/* --------------------------------- modals -------------------------------- */
.modal-layer {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 20px) 16px calc(var(--safe-bottom) + 20px);
}
.scrim {
  position: absolute;
  inset: 0;
  background: rgba(13, 30, 52, .55);
  backdrop-filter: blur(7px) saturate(120%);
  -webkit-backdrop-filter: blur(7px) saturate(120%);
  animation: fade .25s ease;
}
.modal-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 100%;
  display: flex;
  justify-content: center;
}
.panel {
  width: min(352px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 22px 20px 20px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(8, 26, 50, .45), inset 0 1px 0 #fff;
  animation: pop .38s cubic-bezier(.18, 1.25, .38, 1);
  scrollbar-width: none;
}
.panel::-webkit-scrollbar { display: none; }
.panel-title {
  margin: 0;
  font-size: clamp(19px, 5.2cqw, 23px);
  font-weight: 900;
  letter-spacing: -.01em;
  color: #1c2f49;
}
.panel-sub {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
  color: #5a7190;
}
.panel-note {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  font-weight: 700;
  color: #8a9cb4;
}
.panel-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.panel-row { display: flex; gap: 8px; }
.panel-foot {
  margin: 16px 0 0;
  text-align: center;
  font-size: 10.5px;
  font-weight: 800;
  color: #9aaec6;
  letter-spacing: .04em;
}

.panel-win { text-align: center; }
.win-stars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  margin: -2px 0 4px;
}
.win-stars svg {
  width: 52px;
  height: 52px;
  fill: #e3ebf6;
  transform: scale(.66) translateY(8px);
  opacity: .65;
  transition: transform .42s cubic-bezier(.18, 1.6, .4, 1), opacity .3s ease, fill .3s ease;
}
.win-stars svg:nth-child(2) { width: 64px; height: 64px; margin-bottom: 2px; }
.win-stars svg.on {
  fill: var(--gold);
  opacity: 1;
  transform: scale(1) translateY(0);
  filter: drop-shadow(0 6px 10px rgba(255, 175, 20, .38));
}
.stat-row {
  display: flex;
  gap: 7px;
  margin: 14px 0 0;
}
.stat {
  flex: 1;
  padding: 8px 4px 7px;
  border-radius: 14px;
  background: #f4f8fd;
  border: 1px solid #e9f1fa;
}
.stat b {
  display: block;
  font-size: 19px;
  font-weight: 900;
  color: #20344f;
  line-height: 1.15;
}
.stat span {
  display: block;
  margin-top: 1px;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #8b9db5;
}
.panel-lose { text-align: center; }
.lose-badge { width: 66px; height: 66px; margin: 0 auto 6px; }
.lose-badge svg { width: 100%; height: 100%; filter: drop-shadow(0 8px 14px rgba(220, 80, 90, .18)); }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.panel-head .icon-btn { width: 34px; height: 34px; border-radius: 11px; background: #f2f7fd; box-shadow: none; }
.panel-head .icon-btn svg { width: 17px; height: 17px; }
.panel-settings { text-align: left; }
.settings-block { margin-top: 16px; }
.settings-block h3,
.settings-row h3 {
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: #7f92ab;
}
.settings-block .muted { margin: 0 0 9px; }
.muted {
  font-size: 11.5px;
  line-height: 1.5;
  font-weight: 600;
  color: #788ca6;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 15px;
  background: #f5f9fe;
  border: 1px solid #e9f1fa;
}
.settings-row h3 { margin-bottom: 2px; }
.settings-row .muted { margin: 0; }
.lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.lang-btn {
  appearance: none;
  border: 1.5px solid #e5eef8;
  background: #f8fbff;
  color: #3b5473;
  border-radius: 12px;
  padding: 9px 10px;
  font-size: 12.5px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.lang-btn .dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.lang-btn.active {
  border-color: #ffc94e;
  background: #fffaeb;
  color: #8a5c00;
}
.lang-btn.active .dot { background: #ffb01f; }
.lang-btn:last-child:nth-child(odd) { grid-column: span 2; }
.switch {
  width: 50px;
  height: 30px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #dce7f4;
  position: relative;
  cursor: pointer;
  transition: background .2s ease;
  padding: 0;
}
.switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(30, 70, 120, .25);
  transition: transform .2s cubic-bezier(.3, 1.4, .5, 1);
}
.switch[aria-checked="true"] { background: linear-gradient(180deg, #6fdc9d, #34b96e); }
.switch[aria-checked="true"] span { transform: translateX(20px); }

.panel-tutorial { text-align: left; }
.panel-tutorial .panel-title { text-align: center; margin-bottom: 4px; }
.steps {
  list-style: none;
  margin: 6px 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.steps li {
  display: flex;
  gap: 10px;
  background: #f6faff;
  border: 1px solid #e9f2fb;
  border-radius: 15px;
  padding: 10px 12px;
}
.step-num {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd971, #ffb01f);
  color: #6b4400;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 2px 0 #d98b0a;
  margin-top: 1px;
}
.steps h3 {
  margin: 0 0 3px;
  font-size: 13.5px;
  font-weight: 900;
  color: #24384f;
}
.steps p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  font-weight: 600;
  color: #6a809c;
}
.panel-tutorial .btn { width: 100%; }
.panel-confirm { text-align: center; }
.panel-confirm .panel-actions { margin-top: 18px; }

/* --------------------------------- toast --------------------------------- */
.toast {
  position: absolute;
  z-index: 50;
  left: 50%;
  top: calc(var(--safe-top) + 72px);
  transform: translate(-50%, -10px);
  max-width: 82%;
  padding: 9px 16px;
  border-radius: 13px;
  background: rgba(24, 40, 63, .92);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 12px 28px rgba(10, 25, 50, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------ animations ------------------------------- */
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-9px) rotate(1deg); }
}
@keyframes halo {
  0%, 100% { opacity: .75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(4px, -9px) scale(1.12); }
  66% { transform: translate(-4px, -4px) scale(.94); }
}
@keyframes pop {
  0% { opacity: 0; transform: translateY(18px) scale(.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* compact phones */
@media (max-height: 680px) {
  .logo-wrap { width: min(36cqw, 150px); }
  .title { font-size: clamp(25px, 8cqw, 34px); }
  .tagline { font-size: 12px; }
  .btn-play { height: 54px; }
  .credit { font-size: 9px; }
}


/* Hub link & desktop hover enhancements */
.chip-btn.hub-link {
  text-decoration: none;
}
@media (hover: hover) {
  .chip-btn:hover, .icon-btn:hover {
    background: rgba(255, 255, 255, .92);
    transform: translateY(-1px);
  }
  .ctrl:hover {
    transform: translateY(-1px);
  }
  .btn-primary:hover {
    filter: brightness(1.03);
  }
  .btn-soft:hover {
    background: #ffffff;
  }
  .level-btn:not(.locked):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #dbe7f5, 0 8px 16px rgba(50, 100, 160, .14);
  }
}

html.is-embedded .rotate-hint { display: none !important; }
