:root {
  color-scheme: dark;
  --ink: #f8fbff;
  --muted: #a9bfd9;
  --panel: rgba(13, 27, 54, 0.86);
  --line: rgba(255, 255, 255, 0.18);
  --cyan: #59d7ff;
  --green: #6fe38a;
  --red: #ff6978;
  --gold: #ffd05a;
  --soil: #6b4527;
  --grass: #73c84f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overscroll-behavior: none;
  background: #0a162a;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

.game-shell {
  min-height: 100vh;
  padding: clamp(10px, 2vw, 24px);
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(6, 12, 26, 0.2), rgba(6, 12, 26, 0.76)),
    linear-gradient(135deg, #0d1830 0%, #15274a 50%, #07111f 100%);
}

.game-frame {
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 20px));
  position: relative;
  overflow: hidden;
  border: 3px solid rgba(11, 19, 34, 0.95);
  border-radius: 8px;
  background: #1d7dda;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

.hud {
  height: 52px;
  padding: 8px 18px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto minmax(150px, 1fr);
  align-items: center;
  gap: 12px;
  background: rgba(8, 24, 58, 0.74);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.brand strong {
  font-size: 1.08rem;
}

.brand span,
.mode-pill {
  color: #d9e9ff;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.hud-score {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff6d6;
  font-weight: 950;
  white-space: nowrap;
}

.heart {
  color: #ff6b9c;
}

.coin-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid #ffe08a;
  background:
    radial-gradient(circle at 35% 28%, #fff7c8 0 18%, transparent 19%),
    linear-gradient(135deg, #ffdf61, #d89518);
  box-shadow: inset -2px -2px 0 rgba(133, 85, 9, 0.28), 0 1px 0 rgba(255, 255, 255, 0.28);
}

.mode-pill {
  justify-self: end;
  white-space: nowrap;
}

.session-card,
.request-card {
  position: absolute;
  z-index: 6;
  top: 66px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(5, 16, 35, 0.28);
}

.session-card {
  width: 160px;
}

.session-card {
  left: 24px;
  padding: 14px;
  display: grid;
  gap: 6px;
}

.session-card strong,
.request-card span {
  color: #bfd6ef;
  font-size: 0.68rem;
  font-weight: 900;
}

.session-card span {
  font-size: 0.88rem;
  font-weight: 850;
}

.session-card span:nth-child(2) {
  color: var(--gold);
}

.session-card span:nth-child(3) {
  color: #ff8ab2;
}

.session-card span:nth-child(4) {
  color: var(--green);
}

.session-card span:nth-child(5) {
  color: var(--red);
}

.session-card span:nth-child(6) {
  color: #d7bbff;
}

.request-card {
  right: 24px;
  width: clamp(180px, 24vw, 320px);
  max-width: calc(100% - 48px);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  text-align: right;
  overflow: hidden;
}

.request-card strong {
  max-width: 100%;
  font-size: clamp(0.9rem, 1.75vw, 1.12rem);
  line-height: 1.08;
  color: #d9c6ff;
  white-space: nowrap;
  overflow-wrap: normal;
  overflow-x: auto;
  scrollbar-width: none;
}

.request-card strong::-webkit-scrollbar {
  display: none;
}

#targetChord,
#detectedChord,
#detectedNotes,
.gate-label,
.review-item strong {
  white-space: nowrap;
  overflow-wrap: normal;
}

.world {
  height: 488px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(#167be2 0%, #56a9ef 60%, #a4d3f4 100%);
}

.skyline {
  position: absolute;
  inset: 0 0 176px;
}

.cloud,
.cloud::before,
.cloud::after {
  position: absolute;
  display: block;
  background: rgba(240, 247, 255, 0.9);
  border-radius: 999px;
  content: "";
}

.cloud {
  width: 58px;
  height: 18px;
  filter: drop-shadow(0 4px 4px rgba(22, 70, 130, 0.18));
  animation: drift 12s linear infinite;
}

.cloud::before {
  width: 26px;
  height: 26px;
  left: 9px;
  bottom: 5px;
}

.cloud::after {
  width: 34px;
  height: 34px;
  right: 7px;
  bottom: 2px;
}

.cloud-a {
  left: 38%;
  top: 64px;
}

.cloud-b {
  left: 54%;
  top: 80px;
  transform: scale(0.84);
  animation-duration: 15s;
}

.cloud-c {
  left: 78%;
  top: 45px;
  transform: scale(0.58);
  animation-duration: 18s;
}

.balloon {
  position: absolute;
  left: 58%;
  top: 120px;
  width: 18px;
  height: 28px;
  border-radius: 999px 999px 900px 900px;
  background: linear-gradient(90deg, #58ccff, #318bd8);
  box-shadow: inset -4px 0 0 rgba(255, 255, 255, 0.22);
  animation: float 3.4s ease-in-out infinite;
}

.balloon::after {
  position: absolute;
  left: 8px;
  top: 28px;
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.64);
  content: "";
}

.sea {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 132px;
  height: 98px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 12px),
    linear-gradient(#1c9fe2, #1d85ca);
  border-top: 2px solid rgba(255, 255, 255, 0.55);
}

.wave {
  position: absolute;
  width: 54px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
}

.wave-a {
  left: 54%;
  top: 42px;
}

.wave-b {
  left: 82%;
  top: 58px;
  width: 34px;
  animation-duration: 11s;
}

.sail {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 24px solid rgba(245, 252, 255, 0.9);
}

.sail::after {
  position: absolute;
  left: -11px;
  top: 23px;
  width: 24px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  content: "";
}

.sail-a {
  left: 24%;
  top: 42px;
}

.sail-b {
  left: 78%;
  top: 20px;
  transform: scale(0.78);
  animation-duration: 16s;
}

.land {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 160px;
  background:
    linear-gradient(180deg, #83df58 0 44px, #57c047 45px 70px, #7a4a27 71px 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 40%, rgba(0, 0, 0, 0.08));
  border-top: 6px solid #e6d78d;
}

.land::after {
  position: absolute;
  left: 0;
  right: 0;
  top: 44px;
  height: 5px;
  background: #d8ca7b;
  content: "";
  z-index: 2;
}

.land::before {
  position: absolute;
  left: 0;
  right: 0;
  top: 70px;
  height: 5px;
  background: rgba(72, 37, 18, 0.62);
  content: "";
  z-index: 1;
}

.scenery-lane {
  position: absolute;
  inset: 0;
}

.hill {
  position: absolute;
  bottom: 78px;
  border-radius: 50% 50% 0 0;
  background: #3ba638;
  opacity: 0.2;
  z-index: 0;
}

.hill-a {
  left: 38%;
  width: 190px;
  height: 30px;
}

.hill-b {
  left: 76%;
  width: 160px;
  height: 24px;
  background: #2f9636;
  animation-duration: 12s;
}

.tree {
  position: absolute;
  bottom: 76px;
  width: 14px;
  height: 35px;
  border-radius: 999px;
  background: #35a046;
  z-index: 1;
}

.tree::after {
  position: absolute;
  left: 5px;
  bottom: -18px;
  width: 4px;
  height: 22px;
  background: #8c653c;
  content: "";
}

.tree-a {
  left: 28%;
}

.tree-b {
  left: 62%;
  transform: scale(0.72);
  animation-duration: 9s;
}

.tree-c {
  left: 92%;
  transform: scale(0.6);
  animation-duration: 10s;
}

.tree-d {
  left: 118%;
  transform: scale(0.78);
  animation-duration: 8s;
}

.player {
  position: absolute;
  left: 10%;
  bottom: 70px;
  width: 54px;
  height: 78px;
  z-index: 4;
}

.player.crossing {
  animation: player-hop 860ms ease-in-out forwards;
}

.player.crossing .leg-left {
  animation: run-left 260ms ease-in-out infinite alternate;
}

.player.crossing .leg-right {
  animation: run-right 260ms ease-in-out infinite alternate;
}

.player.crossing .arm {
  animation: arm-run 260ms ease-in-out infinite alternate;
}

.cap {
  position: absolute;
  left: 6px;
  top: 0;
  width: 34px;
  height: 18px;
  border-radius: 18px 18px 7px 7px;
  background: #ef3b3f;
  z-index: 3;
}

.cap::after {
  position: absolute;
  right: -16px;
  top: 9px;
  width: 22px;
  height: 8px;
  border-radius: 999px;
  background: #ef3b3f;
  content: "";
}

.head {
  position: absolute;
  left: 7px;
  top: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffc98f;
  box-shadow: inset -4px -3px 0 rgba(220, 139, 73, 0.22);
  z-index: 2;
}

.face {
  position: absolute;
  left: 18px;
  top: 27px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #172238;
  box-shadow: 13px 0 0 #172238, 7px 9px 0 -2px #d66f61;
  z-index: 4;
}

.body {
  position: absolute;
  left: 12px;
  top: 45px;
  width: 28px;
  height: 29px;
  border-radius: 10px 10px 8px 8px;
  background: linear-gradient(#2f80e7, #1f62c2);
  z-index: 2;
}

.arm {
  position: absolute;
  left: 38px;
  top: 48px;
  width: 8px;
  height: 24px;
  border-radius: 999px;
  background: #ffc78e;
  transform-origin: top;
  z-index: 1;
}

.leg {
  position: absolute;
  top: 71px;
  width: 9px;
  height: 13px;
  border-radius: 999px;
  background: #1d3358;
  transform-origin: top;
}

.leg-left {
  left: 15px;
}

.leg-right {
  left: 31px;
}

.challenge {
  position: absolute;
  bottom: 78px;
  width: 170px;
  height: 112px;
  z-index: 3;
  transition: left 960ms cubic-bezier(0.36, 0, 0.18, 1), transform 960ms cubic-bezier(0.36, 0, 0.18, 1), opacity 420ms ease;
}

.challenge.active {
  left: 23%;
}

.challenge.preview {
  left: 74%;
  transform: scale(0.86);
  opacity: 0.78;
}

.challenge.passed {
  left: -18%;
  opacity: 0;
}

.challenge.entering {
  left: 23%;
  transform: scale(1);
  opacity: 1;
}

.challenge.resetting {
  left: 74%;
  transform: scale(0.86);
  opacity: 0;
  transition: none;
}

.gate {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 78px;
  height: 78px;
  z-index: 3;
}

.world.advancing .scenery-lane {
  animation: scene-step 960ms cubic-bezier(0.36, 0, 0.18, 1);
}

.gate-label {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  min-width: 118px;
  width: max-content;
  max-width: min(260px, 44vw);
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(12, 54, 97, 0.94);
  color: #72ffe0;
  text-align: center;
  font-size: clamp(0.98rem, 1.8vw, 1.28rem);
  font-weight: 950;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  overflow-wrap: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gate-box {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 78px;
  height: 72px;
  border: 3px solid #7a4328;
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(255, 218, 156, 0.3), transparent 38%),
    repeating-linear-gradient(90deg, #b96b38 0 18px, #96532f 19px 23px);
  box-shadow: inset 0 -6px 0 rgba(88, 43, 21, 0.24), 0 5px 0 rgba(0, 0, 0, 0.12);
}

.gate-face {
  position: absolute;
  left: 50%;
  top: 30px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #172238;
  transform: translateX(-18px);
  box-shadow: 35px 0 0 #172238, 18px 13px 0 -3px #f2d7bd;
}

.feedback-strip {
  min-height: 90px;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 200px minmax(180px, 1fr) 280px;
  align-items: center;
  gap: 14px;
  background: rgba(6, 18, 38, 0.82);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.feedback-strip.collapsed {
  min-height: 46px;
  padding-block: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.feedback-strip.collapsed .technique-card,
.feedback-strip.collapsed .feedback-detail {
  display: none;
}

.technique-card {
  display: grid;
  gap: 4px;
}

.feedback-detail {
  min-width: 0;
}

.feedback-strip span,
.note-readout small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.feedback-strip strong {
  color: #fff9d9;
}

.judgement {
  min-height: 34px;
  color: var(--gold);
  font-size: clamp(1rem, 2vw, 1.32rem);
  font-weight: 950;
}

#lessonHint {
  margin: 2px 0 0;
  color: #d9e9ff;
  font-size: 0.9rem;
  line-height: 1.35;
}

.feedback-toggle {
  justify-self: end;
  min-width: 126px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #06142a;
  border-color: transparent;
  background: var(--cyan);
  white-space: nowrap;
}

.feedback-strip.collapsed .feedback-toggle {
  min-width: 42px;
  width: 42px;
  padding-inline: 0;
}

.feedback-strip.collapsed .feedback-toggle span:last-child {
  display: none;
}

.feedback-toggle span {
  color: inherit;
  font-weight: 900;
  text-transform: none;
}

.feedback-toggle span:first-child {
  font-size: 1rem;
  line-height: 1;
}

.judgement.correct {
  color: var(--green);
}

.judgement.close {
  color: var(--gold);
}

.judgement.wrong {
  color: var(--red);
}

.controls {
  min-height: 66px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(7, 17, 34, 0.88);
}

button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  padding: 0 15px;
  color: var(--ink);
  background: #173357;
  cursor: pointer;
  font-weight: 850;
}

button:hover {
  border-color: var(--cyan);
}

button.primary {
  color: #06142a;
  border-color: transparent;
  background: var(--cyan);
}

button:disabled,
select:disabled {
  cursor: default;
  opacity: 0.62;
}

.toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  color: #d9e9ff;
  font-weight: 800;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
}

.select-control,
.range-control {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  color: #d9e9ff;
  font-weight: 850;
}

.select-control span,
.range-control span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.select-control select {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: #102947;
}

.range-control input {
  width: 110px;
  accent-color: var(--cyan);
}

.status-panel {
  min-height: 116px;
  padding: 12px 18px 18px;
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.4fr 1.1fr;
  gap: 10px;
  background: rgba(5, 12, 26, 0.96);
}

.note-readout {
  min-height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 6px;
  background: rgba(16, 35, 59, 0.7);
  overflow: auto;
}

.note-readout strong {
  min-width: 0;
  color: #fff9d9;
  white-space: nowrap;
  overflow-wrap: normal;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.2;
}

.countdown-overlay {
  position: absolute;
  inset: 52px 0 0;
  z-index: 18;
  display: grid;
  place-items: center;
  background: rgba(4, 10, 23, 0.2);
  pointer-events: none;
}

.countdown-overlay.hidden {
  display: none;
}

.countdown-overlay strong {
  min-width: 128px;
  height: 128px;
  padding: 0 34px;
  border-radius: 64px;
  display: grid;
  place-items: center;
  color: #08162d;
  background:
    radial-gradient(circle at 36% 28%, #fffdf0 0 18%, transparent 19%),
    linear-gradient(135deg, #ffe67a, #ff9e2d);
  font-size: clamp(2.9rem, 8vw, 5.6rem);
  font-weight: 950;
  white-space: nowrap;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34), inset -6px -7px 0 rgba(128, 75, 0, 0.18);
  animation: countdown-pop 860ms ease both;
}

.confirm-overlay,
.bank-overlay,
.results-overlay,
.history-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 10, 23, 0.66);
  overscroll-behavior: contain;
  overflow: hidden;
}

.confirm-overlay {
  z-index: 30;
}

.confirm-overlay.hidden,
.bank-overlay.hidden,
.results-overlay.hidden,
.history-overlay.hidden {
  display: none;
}

.confirm-panel {
  width: min(420px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 10px;
  background: rgba(9, 24, 47, 0.98);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
}

.confirm-panel span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.confirm-panel strong {
  color: #fff6d6;
  font-size: 1.18rem;
}

.confirm-panel p {
  margin: 0;
  color: #d9e9ff;
  line-height: 1.45;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.bank-panel,
.results-panel,
.history-panel {
  width: min(1040px, 100%);
  max-height: min(720px, calc(100vh - 44px));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto auto minmax(160px, 1fr);
  background: rgba(9, 24, 47, 0.96);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
  overflow: hidden;
  overscroll-behavior: contain;
}

.bank-panel {
  grid-template-rows: auto auto minmax(160px, 1fr);
}

.bank-head,
.results-head,
.history-head {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  background: rgba(20, 58, 102, 0.8);
}

.bank-head div,
.results-head div,
.history-head div {
  display: grid;
  gap: 2px;
}

.bank-head span,
.results-head span,
.history-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.bank-head strong,
.results-head strong,
.history-head strong {
  font-size: 1.2rem;
}

.bank-actions,
.history-actions {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.bank-actions span,
.history-actions span {
  margin-right: auto;
  color: #fff6d6;
  font-weight: 900;
}

.bank-mode-tabs {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.bank-mode-tabs button {
  min-height: 38px;
  white-space: nowrap;
}

.history-sort-control {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d9e9ff;
  font-weight: 850;
}

.history-sort-control span {
  margin-right: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.history-sort-control select {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: #102947;
}

.bank-options {
  padding: 14px 18px 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  min-height: 0;
}

.bank-group {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(12, 31, 55, 0.86);
  overflow: visible;
}

.bank-summary {
  min-height: 84px;
  padding: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(104px, auto);
  gap: 10px 14px;
  align-items: start;
  cursor: pointer;
}

.bank-summary input,
.bank-detail-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
}

.bank-summary-text {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.bank-summary-text strong,
.bank-detail-option strong {
  color: #fff6d6;
  white-space: nowrap;
}

.bank-summary-text span {
  min-width: 0;
  color: #d9e9ff;
  font-size: 0.84rem;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.bank-expand {
  min-height: 34px;
  padding: 0 11px;
  color: var(--cyan);
  background: rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  justify-self: end;
  align-self: center;
}

.bank-detail-list {
  max-height: min(370px, 44vh);
  padding: 0 14px 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  overflow: auto;
}

.bank-quick-actions {
  padding: 0 14px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bank-quick-actions button {
  min-height: 34px;
  padding: 0 11px;
  color: #06142a;
  border-color: transparent;
  background: var(--cyan);
  white-space: nowrap;
}

.bank-quick-actions span {
  color: #d9e9ff;
  font-size: 0.78rem;
  font-weight: 850;
}

.bank-detail-option {
  min-width: 0;
  border-radius: 7px;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: auto minmax(52px, max-content) minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.bank-detail-option span {
  color: #bcd4ee;
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bank-detail-option small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.result-stats {
  padding: 12px 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.result-stats span {
  border-radius: 7px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.result-stats b {
  display: block;
  margin-top: 4px;
  color: #fff6d6;
  font-size: 1.18rem;
}

.cycle-summary {
  margin: 14px 18px 0;
  border: 1px solid rgba(89, 215, 255, 0.36);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
  background: rgba(18, 56, 92, 0.82);
}

.cycle-summary.hidden {
  display: none;
}

.cycle-summary > div:first-child {
  display: grid;
  gap: 2px;
}

.cycle-summary span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.cycle-summary strong,
.cycle-wrong-item strong {
  color: #fff6d6;
}

.cycle-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.cycle-stats span {
  border-radius: 7px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.08);
}

.cycle-stats b {
  display: block;
  margin-top: 3px;
  color: #72ffe0;
  font-size: 1.08rem;
}

.cycle-wrong-list {
  display: grid;
  gap: 8px;
}

.cycle-wrong-item {
  border-left: 4px solid var(--red);
  border-radius: 7px;
  padding: 9px 10px;
  display: grid;
  gap: 4px;
  background: rgba(0, 0, 0, 0.16);
}

.cycle-wrong-item span,
.cycle-empty {
  color: #d9e9ff;
  font-size: 0.82rem;
  line-height: 1.35;
}

.review-list {
  padding: 14px 18px 18px;
  display: grid;
  gap: 10px;
  overflow: auto;
  overscroll-behavior: contain;
}

.review-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 5px solid var(--red);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 5px;
  background: rgba(12, 31, 55, 0.86);
}

.review-item.correct {
  border-left-color: var(--green);
}

.review-item strong {
  color: #fff6d6;
  overflow-x: auto;
}

.review-item span,
.review-empty {
  color: #d9e9ff;
  font-size: 0.86rem;
  line-height: 1.35;
}

.review-item span {
  white-space: nowrap;
  overflow-x: auto;
}

.history-list {
  padding: 16px 18px 22px;
  display: grid;
  gap: 14px;
  overflow: auto;
  overscroll-behavior: contain;
}

.history-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(12, 31, 55, 0.86);
  overflow: clip;
}

.history-summary {
  min-height: 122px;
  height: auto;
  padding: 18px 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, auto);
  gap: 14px;
  align-items: center;
  overflow: visible;
}

.history-main {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.history-summary strong {
  color: #fff6d6;
  font-size: 1rem;
  line-height: 1.25;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.history-meta span {
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  color: #d9e9ff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.history-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.history-detail-toggle,
.history-delete {
  min-height: 34px;
  white-space: nowrap;
}

.history-detail-toggle {
  color: #06142a;
  border-color: transparent;
  background: var(--cyan);
}

.history-delete {
  color: #ffe3e6;
  background: rgba(255, 107, 129, 0.14);
}

.history-attempts {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 14px 14px;
  display: grid;
  gap: 8px;
  max-height: min(420px, 46vh);
  overflow: auto;
  overscroll-behavior: contain;
}

.history-attempt {
  border-left: 4px solid var(--red);
  border-radius: 7px;
  padding: 9px 10px;
  display: grid;
  gap: 4px;
  background: rgba(255, 255, 255, 0.055);
}

.history-attempt.correct {
  border-left-color: var(--green);
}

.history-attempt strong {
  color: #fff6d6;
}

.history-attempt span,
.history-empty {
  color: #d9e9ff;
  font-size: 0.82rem;
  line-height: 1.35;
}

.history-attempt span {
  white-space: nowrap;
  overflow-x: auto;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(9px);
  }
}

@keyframes drift {
  0% {
    margin-left: 0;
  }
  100% {
    margin-left: -46px;
  }
}

@keyframes lane-scroll {
  0% {
    translate: 0 0;
  }
  100% {
    translate: -360px 0;
  }
}

@keyframes player-hop {
  0% {
    transform: translate(0, 0) scale(1, 1);
  }
  8% {
    transform: translate(0, 0) scale(1.04, 0.96);
  }
  20% {
    transform: translate(0, -86px) scale(0.98, 1.04);
  }
  48% {
    transform: translate(0, -108px) scale(0.98, 1.04);
  }
  68% {
    transform: translate(0, -88px) scale(0.98, 1.04);
  }
  84% {
    transform: translate(0, 0) scale(1.04, 0.96);
  }
  100% {
    transform: translate(0, 0) scale(1, 1);
  }
}

@keyframes scene-step {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-120px);
  }
}

@keyframes run-left {
  from {
    transform: rotate(18deg);
  }
  to {
    transform: rotate(-16deg);
  }
}

@keyframes run-right {
  from {
    transform: rotate(-18deg);
  }
  to {
    transform: rotate(16deg);
  }
}

@keyframes arm-run {
  from {
    transform: rotate(-22deg);
  }
  to {
    transform: rotate(24deg);
  }
}

@keyframes countdown-pop {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  18% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 780px) {
  .game-frame {
    min-height: 700px;
  }

  .hud {
    grid-template-columns: 1fr auto auto;
  }

  .mode-pill {
    display: none;
  }

  .session-card,
  .request-card {
    top: 62px;
  }

  .session-card {
    left: 10px;
    width: 132px;
  }

  .request-card {
    right: 10px;
    width: min(300px, calc(100% - 162px));
  }

  .world {
    height: 420px;
  }

  .feedback-strip,
  .status-panel,
  .result-stats,
  .cycle-stats {
    grid-template-columns: 1fr;
  }

  .history-summary {
    grid-template-columns: 1fr;
  }

  .history-card-actions {
    justify-content: flex-start;
  }

  .challenge.active,
  .challenge.entering {
    left: 29%;
  }
}

/* Hosted navigation only. Original game layout and art remain scoped here. */
.site-game-bar{display:flex;flex-wrap:wrap;align-items:center;gap:12px 24px;padding:12px 20px;background:#0a162a;color:#e5edf8;font-size:14px;line-height:1.6}.site-game-bar a{color:#fff;text-underline-offset:4px;display:inline-flex;align-items:center;min-height:44px}.site-game-bar span{flex:1;min-width:220px}.site-game-bar a:focus-visible{outline:2px solid #fff;outline-offset:3px}
