:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --ink: #f6fbff;
  --muted: #9db0c8;
  --panel: rgba(8, 18, 33, 0.92);
  --cyan: #48dcff;
  --yellow: #ffd34f;
  --red: #ff5368;
  --green: #69efa1;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(31, 91, 133, 0.32), transparent 34rem),
    #050b14;
  color: var(--ink);
  overflow-x: hidden;
}

body {
  display: grid;
  place-items: center;
  padding: 18px;
}

button { font: inherit; }

.game-shell {
  width: min(1280px, 100%);
  user-select: none;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.brand, .hud-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 30px;
  border: 2px solid var(--cyan);
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 1px;
  transform: skew(-8deg);
}

.pill, .lives {
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  background: rgba(11, 24, 42, .82);
  color: #dceaff;
  font-size: 14px;
}

.lives { color: var(--red); letter-spacing: 3px; }
.speed { color: var(--yellow); min-width: 90px; text-align: center; }

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(91, 208, 255, .25);
  border-radius: 18px;
  background: #091321;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42), inset 0 0 0 1px rgba(255,255,255,.04);
  touch-action: manipulation;
}

canvas { display: block; width: 100%; height: 100%; }

.progress-track {
  position: absolute;
  top: 14px;
  left: 50%;
  width: min(46%, 520px);
  height: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(5, 14, 25, .68);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12);
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--yellow));
  border-radius: inherit;
  transition: width .1s linear;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: hidden;
  touch-action: pan-y;
  background: radial-gradient(circle at center, rgba(8, 24, 42, .46), rgba(2, 8, 16, .86));
  backdrop-filter: blur(5px);
  z-index: 5;
}

.start-panel {
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(3, 11, 22, .15), rgba(2, 8, 16, .54)),
    url("./assets/game-cover.jpg?v=20260724-adventure-home-v21") center / cover no-repeat;
  backdrop-filter: none;
}

.start-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 28%, rgba(54, 210, 255, .18), transparent 32%),
    linear-gradient(90deg, rgba(2, 10, 19, .26), transparent 30% 70%, rgba(24, 5, 8, .3));
}

.hidden { display: none !important; }

.panel-card {
  position: relative;
  width: min(760px, 92%);
  max-height: calc(100% - 16px);
  min-height: 0;
  padding: 38px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  border: 1px solid rgba(85, 218, 255, .3);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(19, 42, 69, .96), rgba(6, 16, 30, .98));
  box-shadow: 0 24px 80px rgba(0,0,0,.45), inset 0 1px rgba(255,255,255,.08);
  text-align: center;
}

.start-panel .hero-card {
  width: min(710px, 90%);
  border-color: rgba(112, 229, 255, .46);
  background:
    linear-gradient(145deg, rgba(8, 25, 43, .83), rgba(5, 13, 25, .9));
  box-shadow:
    0 28px 90px rgba(0, 0, 0, .58),
    0 0 55px rgba(34, 200, 255, .14),
    inset 0 1px rgba(255, 255, 255, .13);
  backdrop-filter: blur(9px) saturate(1.18);
}

.hero-card h1 {
  margin: 6px 0 12px;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1;
  letter-spacing: -3px;
  background: linear-gradient(100deg, #fff, var(--cyan) 52%, var(--yellow));
  -webkit-background-clip: text;
  color: transparent;
  filter: drop-shadow(0 5px 18px rgba(40, 210, 255, .2));
}

.eyebrow {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.lead { margin: 12px auto 24px; color: #c7d7e9; font-size: 18px; }
.lead.small { max-width: 560px; font-size: 16px; line-height: 1.7; }
.subtle { min-height: 18px; color: var(--muted); font-size: 13px; }
.developer-credit {
  margin: 4px 0 -20px;
  color: rgba(226, 242, 255, .78);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
}

.cover-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin: -8px 0 15px;
}

.cover-badges span {
  padding: 6px 10px;
  border: 1px solid rgba(255, 211, 79, .38);
  border-radius: 999px;
  background: rgba(255, 211, 79, .1);
  color: #ffe992;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .4px;
}

.nickname-field {
  display: grid;
  grid-template-columns: auto minmax(180px, 300px);
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 14px;
  color: #dff7ff;
  font-size: 13px;
  font-weight: 900;
}

.nickname-field input {
  width: 100%;
  border: 1px solid rgba(96, 221, 255, .42);
  border-radius: 12px;
  outline: 0;
  padding: 10px 13px;
  background: rgba(3, 13, 25, .72);
  color: white;
  font: inherit;
  font-weight: 750;
  box-shadow: inset 0 1px rgba(255,255,255,.06);
}

.nickname-field input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 211, 79, .12);
}

.nickname-field input::placeholder { color: #7f95aa; font-weight: 600; }

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 24px 0;
  text-align: left;
}

.rules-grid div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.07);
}

.rules-grid b { color: white; font-size: 14px; }
.rules-grid span { color: var(--muted); font-size: 12px; }

.primary-button {
  min-width: 190px;
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  background: linear-gradient(100deg, #35c9ff, #56efad);
  color: #05111d;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(56, 213, 255, .24);
  transition: transform .15s ease, filter .15s ease;
}

.primary-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.primary-button:active { transform: translateY(1px) scale(.98); }

.lobby-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.puzzle-mode-button {
  min-width: min(520px, 88vw);
  margin-top: 7px;
  padding: 9px 20px;
  border: 2px solid #f2bd43;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(40, 74, 83, .96), rgba(5, 28, 42, .96));
  color: #fff1a8;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 4px 0 #70430d, 0 0 18px rgba(255, 210, 78, .18);
}

.puzzle-mode-button:disabled {
  cursor: not-allowed;
  filter: grayscale(.8);
  opacity: .68;
  box-shadow: 0 3px 0 #313c43;
}

.secondary-button {
  min-width: 116px;
  border: 1px solid rgba(117, 222, 255, .34);
  border-radius: 999px;
  padding: 13px 19px;
  background: rgba(8, 25, 43, .74);
  color: #e8f7ff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255,255,255,.06);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.secondary-button:hover {
  transform: translateY(-2px);
  border-color: var(--yellow);
  background: rgba(20, 48, 70, .9);
}

.equipment-card { width: min(820px, 96%); }
.equipment-card h2, .help-card h2 { margin: 7px 0; font-size: 34px; }
.helmet-collection {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin: 18px 0 13px;
}

.helmet-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 13px;
  padding: 8px;
  background: rgba(255,255,255,.045);
  color: #cde0ef;
  text-align: left;
  cursor: pointer;
}

.helmet-item:disabled { opacity: .38; cursor: not-allowed; filter: grayscale(1); }
.helmet-item.equipped { border-color: var(--yellow); background: rgba(255,211,79,.12); color: #fff4b5; }
.helmet-name { font-size: 11px; font-weight: 850; line-height: 1.25; }
.helmet-state { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.mini-helmet {
  width: 48px;
  height: 48px;
  background-image: url("./assets/helmet-sprite-sheet.png");
  background-repeat: no-repeat;
  background-size: 192px 144px;
  background-position:
    calc(var(--helmet-column) * -48px)
    calc(var(--helmet-row) * -48px);
  filter: drop-shadow(0 5px 8px rgba(255, 201, 73, .18));
  image-rendering: pixelated;
}
.equipment-status { min-height: 20px; margin: 0 0 14px; color: var(--yellow); font-size: 12px; font-weight: 800; }
.help-list { margin: 20px 0; text-align: left; }
.help-list p { margin: 9px 0; padding: 11px 13px; border-radius: 11px; background: rgba(255,255,255,.045); color: #c6d8e7; line-height: 1.55; }
.help-list b { color: var(--cyan); }

.compact-card { width: min(520px, 90%); }
.compact-card h2, .reward-card h2 { margin: 8px 0; font-size: 36px; }
.message-icon { margin-bottom: 8px; font-size: 52px; }

.quiz-card { width: min(720px, 94%); text-align: left; }
.quiz-head { display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.quiz-head h2 { margin: 5px 0 0; }
.score-badge { padding: 8px 12px; border-radius: 999px; background: rgba(105,239,161,.12); color: var(--green); font-weight: 800; }
.quiz-progress { height: 7px; margin: 20px 0 28px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.quiz-progress div { width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width .25s ease; }
.question { min-height: 58px; margin: 0 0 18px; color: white; font-size: clamp(20px, 2.3vw, 28px); font-weight: 750; line-height: 1.4; }
.quiz-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.option-button {
  min-height: 56px;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 13px;
  background: rgba(255,255,255,.05);
  color: white;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.option-button:hover { border-color: var(--cyan); transform: translateY(-1px); }
.option-button.correct { border-color: var(--green); background: rgba(105,239,161,.15); }
.option-button.wrong { border-color: var(--red); background: rgba(255,83,104,.14); }
.option-button:disabled { cursor: default; }
.quiz-feedback { min-height: 42px; margin: 16px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.quiz-feedback.good { color: var(--green); }
.quiz-feedback.bad { color: #ff9bab; }

.reward-card { overflow: hidden; width: min(590px, 92%); }
.reward-card > * { position: relative; z-index: 1; }
.reward-rays {
  position: absolute;
  inset: -50%;
  z-index: 0;
  opacity: .14;
  background: repeating-conic-gradient(from 0deg, var(--yellow) 0 7deg, transparent 7deg 15deg);
  animation: spin 20s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.helmet-preview {
  width: 170px;
  height: 170px;
  margin: -7px auto 4px;
  background-image: url("./assets/helmet-sprite-sheet.png");
  background-repeat: no-repeat;
  background-size: 680px 510px;
  background-position:
    calc(var(--helmet-column, 0) * -170px)
    calc(var(--helmet-row, 0) * -170px);
  filter: drop-shadow(0 12px 30px rgba(255,202,73,.3));
  image-rendering: pixelated;
}

.run-stats {
  position: absolute;
  top: 34px;
  left: 50%;
  z-index: 4;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.run-stats span {
  min-width: 92px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(5, 15, 27, .72);
  color: #e9f7ff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 5px 18px rgba(0,0,0,.2);
}

#runComboLabel {
  color: #ffe27a;
  transition: transform .15s ease, color .15s ease;
}

#runComboLabel.combo-hot {
  color: #ff9b63;
  transform: scale(1.08);
}

#runCrystalLabel { color: #8cf7ff; }

.records-card {
  width: min(980px, 97%);
  max-height: 92%;
  overflow-y: auto;
}

.records-card h2,
.shop-card h2,
.result-card h2 {
  margin: 7px 0 12px;
  font-size: clamp(28px, 4vw, 42px);
}

.shop-card {
  width: min(940px, 97%);
  max-height: 92%;
  overflow-y: auto;
}

.shop-balance {
  width: max-content;
  margin: 4px auto 16px;
  padding: 9px 16px;
  border: 1px solid rgba(91, 237, 255, .35);
  border-radius: 999px;
  background: rgba(55, 205, 235, .1);
  color: #a8f8ff;
  font-size: 17px;
  font-weight: 950;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 0 0 18px;
}

.shop-item {
  display: flex;
  min-height: 255px;
  flex-direction: column;
  align-items: center;
  padding: 13px 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
}

.shop-item.equipped {
  border-color: var(--core-primary);
  box-shadow: inset 0 0 22px rgba(95, 230, 255, .18);
}

.shop-effect-preview {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  margin-bottom: 8px;
  border: 3px solid var(--core-primary);
  border-radius: 50%;
  background: radial-gradient(circle, var(--core-secondary), transparent 62%);
  color: var(--core-primary);
  font-size: 34px;
  text-shadow: 0 0 14px var(--core-secondary);
  box-shadow: 0 0 24px var(--core-primary);
}

.shop-item h3 {
  margin: 2px 0 6px;
  color: white;
  font-size: 16px;
}

.shop-item p {
  min-height: 48px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.shop-item button {
  width: 100%;
  min-width: 0;
  margin-top: auto;
  padding: 9px 6px;
  font-size: 10px;
}

.trophy-room-panel {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 223, 153, .17), transparent 32%),
    linear-gradient(180deg, rgba(0, 13, 8, .46), rgba(0, 5, 3, .94));
}

.trophy-room-card {
  width: min(1040px, 98%);
  max-height: 96%;
  padding: 18px 24px 16px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(7, 48, 31, .97), rgba(1, 18, 12, .99)),
    repeating-linear-gradient(90deg, transparent 0 78px, rgba(255, 209, 88, .025) 78px 80px);
  border-color: rgba(223, 172, 54, .42);
  box-shadow: 0 30px 80px rgba(0,0,0,.62), inset 0 0 60px rgba(255, 206, 82, .045);
}

.trophy-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
}

.trophy-room-head h2 {
  margin: 3px 0 0;
  font-size: clamp(25px, 4vw, 40px);
}

.trophy-room-summary {
  flex: 0 0 auto;
  padding: 9px 15px;
  border: 1px solid rgba(255, 215, 89, .36);
  border-radius: 999px;
  background: rgba(255, 211, 72, .11);
  color: #ffe98f;
  font-size: 13px;
  font-weight: 950;
}

.trophy-scene {
  --trophy-radius: 280px;
  position: relative;
  height: 330px;
  margin: 8px 0 4px;
  overflow: hidden;
  perspective: 920px;
  perspective-origin: 50% 43%;
  border: 1px solid rgba(113, 226, 255, .13);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 50% -15%, #e9d4ac 0 19%, transparent 19.5%),
    radial-gradient(ellipse at center 70%, rgba(18, 102, 68, .34), transparent 52%),
    linear-gradient(180deg, #032a1b 0%, #06402a 62%, #01140e 100%);
  cursor: grab;
  touch-action: pan-y;
}

.trophy-scene:active { cursor: grabbing; }

.trophy-scene::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 55px;
  right: 5%;
  bottom: 44px;
  left: 5%;
  border: 4px solid #c99a32;
  border-radius: 48% 48% 11px 11px / 24% 24% 11px 11px;
  background:
    repeating-linear-gradient(180deg, transparent 0 54px, rgba(246, 255, 232, .82) 54px 57px, rgba(255, 224, 139, .42) 57px 61px),
    linear-gradient(90deg, rgba(4, 47, 30, .96), rgba(10, 79, 51, .86) 42%, rgba(10, 79, 51, .86) 58%, rgba(4, 47, 30, .96));
  box-shadow:
    inset 0 0 0 5px rgba(255, 239, 190, .16),
    inset 0 10px 18px rgba(255, 252, 218, .62),
    0 0 24px rgba(255, 205, 91, .2);
  pointer-events: none;
}

.trophy-scene::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: -47px;
  left: -5%;
  width: 110%;
  height: 105px;
  border-radius: 0 0 50% 50%;
  background:
    radial-gradient(circle at 22% 69%, #fff8df 0 4px, #dcae57 5px 7px, transparent 8px),
    radial-gradient(circle at 39% 76%, #fff8df 0 4px, #dcae57 5px 7px, transparent 8px),
    radial-gradient(circle at 61% 76%, #fff8df 0 4px, #dcae57 5px 7px, transparent 8px),
    radial-gradient(circle at 78% 69%, #fff8df 0 4px, #dcae57 5px 7px, transparent 8px),
    linear-gradient(180deg, #dcc59a, #b99b69);
  box-shadow: 0 7px 13px rgba(0,0,0,.42);
  pointer-events: none;
}

.trophy-room-glow {
  position: absolute;
  z-index: 2;
  top: 61px;
  left: 50%;
  width: 186px;
  height: 222px;
  transform: translateX(-50%);
  border: 4px solid #d7aa48;
  background: linear-gradient(90deg, #ead29f, #fff8de 44%, #fff8de 56%, #dec18b);
  box-shadow: 0 0 25px rgba(255, 231, 168, .72), inset 0 0 18px rgba(255,255,255,.82);
  opacity: .94;
  pointer-events: none;
}

.trophy-floor-grid {
  position: absolute;
  left: -15%;
  right: -15%;
  z-index: 2;
  bottom: -164px;
  height: 310px;
  transform: rotateX(67deg);
  transform-origin: 50% 0;
  background:
    repeating-linear-gradient(90deg, rgba(230, 188, 106, .14) 0 2px, transparent 2px 48px),
    repeating-linear-gradient(0deg, rgba(215, 175, 91, .13) 0 1px, transparent 1px 38px),
    linear-gradient(180deg, #2b2118, #090806);
  mask-image: linear-gradient(180deg, #000, transparent 92%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 92%);
  pointer-events: none;
}

.trophy-carousel {
  position: absolute;
  top: 47%;
  left: 50%;
  width: 150px;
  height: 216px;
  transform-style: preserve-3d;
  z-index: 4;
  transform: translate(-50%, -50%) translateZ(calc(-1 * var(--trophy-radius))) rotateY(var(--carousel-rotation, 0deg));
  transition: transform .72s cubic-bezier(.2,.8,.2,1);
}

.trophy-slot {
  position: absolute;
  inset: 0;
  display: block;
  padding: 8px;
  border: 0;
  background: transparent;
  color: white;
  transform: rotateY(var(--slot-angle)) translateZ(var(--trophy-radius));
  transform-style: preserve-3d;
  backface-visibility: hidden;
  cursor: pointer;
}

.trophy-slot-face {
  display: block;
  height: 100%;
  padding: 12px 8px 9px;
  border: 1px solid rgba(230, 185, 70, .72);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 248, 215, .17), rgba(3, 27, 18, .94)),
    radial-gradient(circle at 50% 20%, rgba(255, 220, 128, .16), transparent 46%);
  box-shadow: 0 15px 35px rgba(0,0,0,.42), inset 0 0 18px rgba(255,255,255,.035);
  transform: translateZ(1px);
}

.trophy-slot.selected .trophy-slot-face {
  border-color: #ffe28a;
  box-shadow: 0 18px 46px rgba(0,0,0,.54), 0 0 25px rgba(255, 220, 121, .6);
  transform: translateZ(14px) scale(1.06);
}

.trophy-model {
  display: block;
  position: relative;
  width: 92px;
  height: 126px;
  margin: 0 auto 5px;
  transform-style: preserve-3d;
  transform: rotateX(-5deg) rotateY(-12deg);
  filter: drop-shadow(0 14px 12px rgba(0,0,0,.45));
  animation: trophyFloat 3.2s ease-in-out infinite;
}

@keyframes trophyFloat {
  0%, 100% { transform: translateY(1px) rotateX(-5deg) rotateY(-12deg); }
  50% { transform: translateY(-5px) rotateX(-2deg) rotateY(10deg); }
}

.trophy-bowl {
  position: absolute;
  top: 7px;
  left: 19px;
  display: grid;
  width: 56px;
  height: 62px;
  place-items: center;
  border: 3px solid rgba(255,255,255,.42);
  border-top-width: 6px;
  border-radius: 12px 12px 27px 27px;
  background:
    linear-gradient(112deg, #fff7bd 0%, var(--trophy-color) 24%, #fff0a0 47%, var(--trophy-dark) 72%, var(--trophy-color) 100%);
  color: rgba(54, 31, 4, .78);
  font-size: 22px;
  font-weight: 1000;
  text-shadow: 0 1px rgba(255,255,255,.42);
  box-shadow: inset 8px 0 9px rgba(255,255,255,.24), inset -7px -5px 8px rgba(0,0,0,.22);
  transform: translateZ(12px);
}

.trophy-bowl::before,
.trophy-bowl::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 25px;
  height: 31px;
  border: 7px solid var(--trophy-color);
  border-radius: 50%;
  z-index: -1;
}

.trophy-bowl::before { left: -24px; }
.trophy-bowl::after { right: -24px; }

.trophy-stem {
  position: absolute;
  top: 65px;
  left: 40px;
  width: 15px;
  height: 37px;
  background: linear-gradient(90deg, var(--trophy-dark), #fff0a0, var(--trophy-color));
  box-shadow: inset 2px 0 rgba(255,255,255,.34);
}

.trophy-base {
  position: absolute;
  left: 20px;
  bottom: 4px;
  width: 56px;
  height: 23px;
  border: 2px solid rgba(255,255,255,.25);
  border-radius: 6px 6px 10px 10px;
  background: linear-gradient(180deg, var(--trophy-color), var(--trophy-dark));
  box-shadow: 0 7px 0 rgba(0,0,0,.28), inset 0 4px rgba(255,255,255,.23);
}

.trophy-slot.locked .trophy-model {
  filter: grayscale(1) brightness(.28) drop-shadow(0 12px 10px rgba(0,0,0,.55));
}

.trophy-slot.locked .trophy-slot-face {
  border-color: rgba(131, 157, 175, .15);
  background: linear-gradient(180deg, rgba(71, 88, 75, .08), rgba(1, 14, 9, .96));
}

.trophy-slot-name {
  display: block;
  overflow: hidden;
  color: #f1fbff;
  font-size: 11px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trophy-slot-state {
  display: block;
  margin-top: 3px;
  color: var(--trophy-color);
  font-size: 8px;
}

.trophy-controls {
  display: grid;
  grid-template-columns: 52px minmax(260px, 560px) 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.trophy-arrow {
  width: 50px;
  height: 50px;
  border: 1px solid rgba(235, 192, 81, .48);
  border-radius: 50%;
  background: rgba(255, 207, 87, .09);
  color: #ffe49a;
  font-size: 34px;
  cursor: pointer;
}

.trophy-arrow:active { transform: scale(.93); }

.trophy-detail { min-width: 0; }
.trophy-detail h3 { margin: 2px 0 3px; color: white; font-size: 19px; }
.trophy-detail p { margin: 0; color: var(--muted); font-size: 11px; }

.trophy-detail-state {
  color: #c9ab67;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 1px;
}

.trophy-detail-state.unlocked { color: #ffe477; }

.trophy-progress-track {
  height: 6px;
  margin: 8px 0 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.08);
}

#trophyProgressBar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2c9c68, #ffe168);
  box-shadow: 0 0 12px rgba(255, 218, 99, .36);
  transition: width .4s ease;
}

#trophyDetailProgress { color: #9eb6c8; font-size: 9px; }

.trophy-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin: 8px 0 10px;
}

.trophy-dot {
  width: 22px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(255,255,255,.15);
  cursor: pointer;
}

.trophy-dot.unlocked { background: rgba(255, 215, 83, .5); }
.trophy-dot.active { background: #ffe17c; box-shadow: 0 0 10px rgba(255, 218, 99, .6); }

.result-achievements {
  margin: -5px 0 14px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 215, 83, .32);
  border-radius: 12px;
  background: rgba(255, 205, 62, .08);
  color: #ffe694;
  font-size: 11px;
  font-weight: 900;
}

.records-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0 18px;
}

.records-summary div,
.result-stats div {
  padding: 12px 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 13px;
  background: rgba(255,255,255,.045);
}

.records-summary span,
.result-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.records-summary b,
.result-stats b {
  display: block;
  margin-top: 4px;
  color: white;
  font-size: 22px;
}

.records-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(68px, 1fr));
  gap: 7px;
  margin-bottom: 14px;
}

.record-level {
  min-height: 74px;
  padding: 8px 5px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px;
  background: rgba(255,255,255,.045);
  color: #d8e8f6;
  cursor: pointer;
}

.record-level:disabled {
  opacity: .28;
  cursor: not-allowed;
  filter: grayscale(1);
}

.record-level.cleared {
  border-color: rgba(72,220,255,.35);
  background: rgba(72,220,255,.075);
}

.record-level:hover:not(:disabled) {
  border-color: var(--yellow);
  transform: translateY(-1px);
}

.record-number {
  display: block;
  font-size: 11px;
  font-weight: 950;
}

.record-stars {
  display: block;
  margin: 5px 0 3px;
  color: var(--yellow);
  font-size: 13px;
  letter-spacing: 1px;
}

.record-detail {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.result-card {
  width: min(650px, 94%);
  overflow: hidden;
}

.result-stars {
  margin: 8px 0 2px;
  color: var(--yellow);
  font-size: clamp(48px, 8vw, 78px);
  letter-spacing: 8px;
  line-height: 1;
  filter: drop-shadow(0 8px 22px rgba(255, 211, 79, .3));
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin: 18px 0 12px;
}

.star-rules {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 20px;
}

.star-rules span {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 211, 79, .08);
  color: #ffe98e;
  font-size: 10px;
}

.sound-button {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 7;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(6,14,25,.58);
  color: #cfe0ef;
  font-size: 12px;
  cursor: pointer;
}

.home-return-button {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  min-width: 112px;
  padding: 9px 14px;
  border: 2px solid #ffd45b;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(22, 68, 91, .98), rgba(5, 25, 42, .98));
  color: #fff1a0;
  font-size: 12px;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 4px 0 #70430d, 0 7px 20px rgba(0, 0, 0, .4);
}

.home-return-button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #70430d, 0 4px 12px rgba(0, 0, 0, .35);
}

.crouch-button {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 4;
  width: 104px;
  height: 52px;
  border: 2px solid rgba(255, 211, 79, .7);
  border-radius: 16px;
  background: rgba(8, 18, 33, .72);
  color: #ffe27e;
  font-weight: 900;
  cursor: pointer;
  touch-action: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transition: transform .1s ease, background .1s ease;
}

.jump-button {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 4;
  width: 104px;
  height: 52px;
  border: 2px solid rgba(72, 220, 255, .72);
  border-radius: 16px;
  background: rgba(8, 18, 33, .72);
  color: #8cecff;
  font-weight: 900;
  cursor: pointer;
  touch-action: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transition: transform .1s ease, background .1s ease;
}

.jump-button:active {
  transform: translateY(3px) scale(.96);
  background: rgba(72, 220, 255, .2);
}

.move-button {
  position: absolute;
  bottom: 22px;
  z-index: 5;
  width: 82px;
  height: 52px;
  border: 2px solid rgba(109, 239, 179, .76);
  border-radius: 16px;
  background: rgba(7, 27, 36, .82);
  color: #9effc9;
  font-size: 23px;
  font-weight: 1000;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  box-shadow: 0 7px 22px rgba(0,0,0,.3);
}

.left-button { left: 18px; }
.right-button { left: 110px; }
.move-button.active,
.move-button:active {
  transform: translateY(3px) scale(.96);
  background: rgba(70, 225, 150, .23);
}

.stage.puzzle-controls .jump-button {
  right: 110px;
  left: auto;
}

.stage.puzzle-controls .crouch-button { right: 18px; }

.pause-button {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 4;
  min-width: 70px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(6,14,25,.68);
  color: #dceaff;
  font-weight: 800;
  cursor: pointer;
}

.pause-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.crouch-button.active,
.crouch-button:active {
  transform: translateY(3px) scale(.96);
  background: rgba(255, 211, 79, .2);
}

.tap-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(6,14,25,.52);
  color: rgba(230,241,252,.72);
  font-size: 12px;
  pointer-events: none;
}

@media (max-width: 720px), (max-height: 620px) {
  body { padding: 0; background: #050b14; }
  .game-shell { width: 100%; }
  .hud { padding: 7px 10px; margin: 0; }
  .brand span:last-child { display: none; }
  .brand-mark { width: 42px; height: 26px; }
  .pill, .lives { padding: 5px 8px; font-size: 11px; }
  .stage { height: calc(100vh - 40px); aspect-ratio: auto; border: 0; border-radius: 0; }
  .overlay { padding: 10px; }
  .panel-card { max-height: calc(100% - 8px); padding: 14px 18px; border-radius: 18px; overflow-y: auto; }
  .hero-card h1 { margin: 3px 0 5px; font-size: 30px; letter-spacing: -1px; }
  .eyebrow { font-size: 10px; }
  .lead { margin: 5px auto 8px; font-size: 13px; }
  .cover-badges { gap: 4px; margin: 0 0 7px; }
  .cover-badges span { padding: 4px 7px; font-size: 9px; }
  .nickname-field { grid-template-columns: auto minmax(150px, 230px); gap: 7px; margin-bottom: 7px; font-size: 10px; }
  .nickname-field input { padding: 7px 9px; border-radius: 9px; }
  .rules-grid { margin: 8px 0 10px; gap: 5px; }
  .rules-grid div { padding: 6px 9px; }
  .rules-grid b { font-size: 12px; }
  .rules-grid span { font-size: 10px; }
  .primary-button { padding: 10px 18px; }
  .secondary-button { min-width: 96px; padding: 9px 13px; font-size: 11px; }
  .lobby-actions { gap: 5px; }
  .subtle { display: none; }
  .developer-credit { margin: 5px 0 -6px; font-size: 9px; }
  .quiz-options { gap: 7px; }
  .option-button { min-height: 44px; padding: 8px 10px; font-size: 12px; }
  .question { min-height: 36px; margin-bottom: 10px; font-size: 18px; }
  .quiz-progress { margin: 10px 0 14px; }
  .quiz-feedback { margin-top: 8px; min-height: 28px; font-size: 11px; }
  .run-stats { top: 26px; gap: 4px; }
  .run-stats span { min-width: 70px; padding: 5px 7px; font-size: 9px; }
  .records-card { width: 99%; padding: 12px; }
  .shop-card { width: 99%; padding: 12px; }
  .shop-card .lead { display: none; }
  .shop-balance { margin-bottom: 8px; padding: 6px 12px; font-size: 12px; }
  .shop-grid { gap: 5px; margin-bottom: 10px; }
  .shop-item { min-height: 164px; padding: 7px 5px; border-radius: 10px; }
  .shop-effect-preview { width: 48px; height: 48px; margin-bottom: 4px; font-size: 22px; }
  .shop-item h3 { margin: 1px 0 4px; font-size: 10px; }
  .shop-item p { min-height: 38px; margin-bottom: 5px; font-size: 7px; }
  .shop-item button { padding: 6px 3px; font-size: 7px; }
  .trophy-room-card { width: 99%; padding: 9px 12px; overflow-y: auto; }
  .trophy-room-head h2 { font-size: 22px; }
  .trophy-room-summary { padding: 6px 10px; font-size: 9px; }
  .trophy-scene { --trophy-radius: 210px; height: 216px; margin-top: 4px; border-radius: 12px; }
  .trophy-carousel { width: 110px; height: 158px; top: 49%; }
  .trophy-slot { padding: 4px; }
  .trophy-slot-face { padding: 6px 4px; border-radius: 10px; }
  .trophy-model { width: 70px; height: 96px; margin-bottom: 1px; animation: none; transform: scale(.74) rotateX(-5deg) rotateY(-12deg); transform-origin: 50% 0; }
  .trophy-slot-name { font-size: 8px; }
  .trophy-slot-state { font-size: 6px; }
  .trophy-controls { grid-template-columns: 38px minmax(190px, 410px) 38px; gap: 7px; }
  .trophy-arrow { width: 36px; height: 36px; font-size: 25px; }
  .trophy-detail h3 { font-size: 13px; }
  .trophy-detail p { font-size: 8px; }
  .trophy-progress-track { margin: 5px 0 3px; }
  .trophy-dots { margin: 5px 0 7px; }
  .trophy-dot { width: 15px; height: 4px; }
  .records-summary { gap: 5px; margin: 7px 0 10px; }
  .records-summary div { padding: 7px 4px; }
  .records-summary span { font-size: 8px; }
  .records-summary b { font-size: 16px; }
  .records-grid { grid-template-columns: repeat(10, minmax(42px, 1fr)); gap: 3px; }
  .record-level { min-height: 50px; padding: 4px 2px; border-radius: 7px; }
  .record-number { font-size: 8px; }
  .record-stars { margin: 2px 0; font-size: 8px; letter-spacing: 0; }
  .record-detail { font-size: 6px; }
  .result-card { padding: 15px 18px; }
  .result-stars { margin: 2px 0; font-size: 44px; }
  .result-stats { gap: 5px; margin: 9px 0 7px; }
  .result-stats div { padding: 7px 4px; }
  .result-stats span { font-size: 8px; }
  .result-stats b { font-size: 16px; }
  .star-rules { gap: 3px; margin-bottom: 10px; }
  .star-rules span { padding: 4px 6px; font-size: 8px; }
  .tap-hint { bottom: 7px; font-size: 10px; }
  .crouch-button { right: 10px; bottom: 9px; width: 88px; height: 42px; border-radius: 12px; font-size: 12px; }
  .jump-button { left: 10px; bottom: 9px; width: 88px; height: 42px; border-radius: 12px; font-size: 12px; }
  .move-button { bottom: 9px; width: 62px; height: 42px; border-radius: 12px; }
  .left-button { left: 8px; }
  .right-button { left: 76px; }
  .stage.puzzle-controls .jump-button { right: 76px; left: auto; }
  .stage.puzzle-controls .crouch-button { right: 8px; width: 62px; }
  .pause-button { top: 8px; left: 8px; min-width: 58px; padding: 6px 10px; font-size: 10px; }
  .home-return-button { top: 8px; left: 8px; min-width: 92px; padding: 7px 10px; font-size: 10px; }
  .equipment-card { padding: 12px 14px; }
  .equipment-card h2, .help-card h2 { font-size: 23px; }
  .equipment-card .lead { display: none; }
  .helmet-collection { grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 8px 0; }
  .helmet-item { grid-template-columns: 28px 1fr; gap: 4px; min-height: 44px; padding: 5px; }
  .mini-helmet { width: 26px; height: 22px; border-width: 2px; }
  .mini-helmet::before { right: -5px; top: 8px; width: 16px; height: 6px; }
  .mini-helmet::after { left: 9px; top: -8px; width: 6px; height: 9px; }
  .helmet-name { font-size: 8px; }
  .helmet-state { display: none; }
  .equipment-status { margin-bottom: 7px; font-size: 10px; }
  .help-list { margin: 8px 0; }
  .help-list p { margin: 5px 0; padding: 7px 9px; font-size: 11px; }
}

@media (orientation: portrait) {
  .start-panel {
    background-image:
      linear-gradient(180deg, rgba(3, 11, 22, .16), rgba(2, 8, 16, .58)),
      url("./assets/game-cover-portrait.jpg?v=20260724-adventure-home-v21");
    background-position: center;
  }
  .start-panel .hero-card { width: min(92%, 520px); }
  .rules-grid { grid-template-columns: 1fr 1fr; }
  .helmet-collection { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 520px) {
  .records-grid { grid-template-columns: repeat(5, minmax(46px, 1fr)); }
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .trophy-scene { --trophy-radius: 175px; }
}

@media (max-height: 420px) {
  .rules-grid span { display: none; }
  .rules-grid div { min-height: 30px; justify-content: center; }
  .hero-card .primary-button { padding: 8px 18px; }
  .hero-card .secondary-button { padding: 7px 11px; }
  .trophy-room-card { max-height: calc(100% - 2px); padding: 5px 10px; }
  .trophy-room-head h2 { margin: 0; font-size: 17px; }
  .trophy-room-head .eyebrow { font-size: 7px; }
  .trophy-room-summary { padding: 4px 7px; font-size: 7px; }
  .trophy-scene {
    --trophy-radius: 155px;
    height: 150px;
    margin: 2px 0;
    border-radius: 10px;
  }
  .trophy-scene::before { top: 31px; bottom: 20px; border-width: 2px; }
  .trophy-scene::after { top: -34px; height: 66px; }
  .trophy-room-glow { top: 34px; width: 94px; height: 102px; border-width: 2px; }
  .trophy-floor-grid { bottom: -92px; height: 170px; }
  .trophy-carousel { top: 49%; width: 78px; height: 108px; }
  .trophy-slot { padding: 2px; }
  .trophy-slot-face { padding: 3px 2px; border-radius: 7px; }
  .trophy-model {
    width: 64px;
    height: 88px;
    margin-bottom: -18px;
    transform: scale(.55) rotateX(-5deg) rotateY(-12deg);
    transform-origin: 50% 0;
  }
  .trophy-slot-name { font-size: 6px; }
  .trophy-slot-state { font-size: 5px; }
  .trophy-controls { grid-template-columns: 28px minmax(150px, 360px) 28px; gap: 4px; }
  .trophy-arrow { width: 27px; height: 27px; font-size: 19px; }
  .trophy-detail-state { font-size: 6px; }
  .trophy-detail h3 { margin: 1px 0; font-size: 10px; }
  .trophy-detail p { display: none; }
  .trophy-progress-track { height: 4px; margin: 3px 0 1px; }
  .trophy-detail span { font-size: 6px; }
  .trophy-dots { gap: 3px; margin: 2px 0 3px; }
  .trophy-dot { width: 10px; height: 3px; }
  .trophy-room-card > .secondary-button { padding: 4px 9px; font-size: 8px; }
  .tap-hint { display: none; }
  .crouch-button { bottom: 7px; }
}

/* Adventure-cover home screen */
.start-panel {
  padding: 0;
  background:
    url("./assets/game-cover.jpg?v=20260724-adventure-home-v21") center / cover no-repeat;
}

.start-panel::before {
  background:
    linear-gradient(180deg, rgba(1, 15, 31, .08) 0%, transparent 30%, transparent 68%, rgba(1, 8, 16, .34) 100%);
  pointer-events: none;
}

.start-panel .hero-card {
  width: 100%;
  height: 100%;
  max-height: none;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.home-title {
  position: absolute;
  top: 3.5%;
  left: 50%;
  width: min(78%, 930px);
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.home-title .eyebrow {
  margin-bottom: 3px;
  color: #dffbff;
  font-size: clamp(8px, 1.05vw, 13px);
  letter-spacing: .28em;
  text-shadow: 0 2px 8px rgba(0, 31, 65, .9);
}

.home-title h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  font-size: clamp(36px, 6.2vw, 82px);
  line-height: .88;
  letter-spacing: .04em;
  background: linear-gradient(180deg, #fffbd0 0%, #ffe55e 28%, #ffb31e 65%, #e77a05 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 2px #fff1a0;
  color: transparent;
  filter:
    drop-shadow(0 3px 0 #b55e00)
    drop-shadow(0 7px 0 #69431d)
    drop-shadow(0 0 3px #53dcff)
    drop-shadow(0 0 13px rgba(60, 218, 255, .8));
}

.home-title h1 span:last-child {
  margin-top: .08em;
  font-size: 1.18em;
  letter-spacing: .18em;
  transform: translateX(.09em);
}

.home-title .lead {
  width: max-content;
  max-width: 92%;
  margin: 12px auto 0;
  padding: 5px 16px;
  border: 1px solid rgba(255, 229, 105, .52);
  border-radius: 999px;
  background: rgba(2, 22, 39, .66);
  color: #fff4b1;
  font-size: clamp(10px, 1.25vw, 16px);
  font-weight: 900;
  letter-spacing: .08em;
  box-shadow: 0 5px 18px rgba(0,0,0,.25);
}

.home-console {
  position: absolute;
  right: 2.2%;
  bottom: 1.3%;
  left: 2.2%;
  display: grid;
  justify-items: center;
}

.home-console .cover-badges {
  margin: 0 0 5px;
  gap: 5px;
}

.home-console .cover-badges span {
  padding: 4px 9px;
  border: 2px solid rgba(255, 207, 54, .88);
  background: linear-gradient(180deg, rgba(12, 77, 74, .88), rgba(2, 30, 36, .9));
  color: #fff0a3;
  font-size: clamp(7px, .86vw, 10px);
  box-shadow: 0 3px 0 rgba(107, 57, 4, .8), 0 0 12px rgba(63, 225, 255, .18);
}

.home-console .nickname-field {
  grid-template-columns: auto minmax(170px, 290px);
  gap: 8px;
  margin: 0 0 6px;
  color: #fff0a6;
  font-size: clamp(8px, 1vw, 12px);
  text-shadow: 0 2px 4px #000;
}

.home-console .nickname-field input {
  padding: 7px 12px;
  border: 2px solid #eebc37;
  border-radius: 999px;
  background: rgba(2, 18, 30, .82);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.5), 0 0 13px rgba(255, 204, 61, .22);
}

.start-panel .lobby-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(54px, 72px)) minmax(230px, 360px) repeat(3, minmax(54px, 72px));
  align-items: end;
  justify-content: center;
  gap: clamp(5px, 1vw, 12px);
  width: 100%;
}

.start-panel .home-menu-button {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 76px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffe493;
  font-size: clamp(7px, .82vw, 10px);
  line-height: 1.1;
  text-shadow: 0 2px 4px #000;
  box-shadow: none;
}

.start-panel .home-menu-button::before {
  content: attr(data-icon);
  display: grid;
  width: clamp(40px, 4.6vw, 58px);
  height: clamp(40px, 4.6vw, 58px);
  flex: 0 0 auto;
  place-items: center;
  border: 4px solid #f4bd32;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,.72), transparent 18%),
    linear-gradient(145deg, #55d7ff, #125e9f 62%, #07345f);
  color: #fff1a0;
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 1000;
  text-shadow: 0 2px 0 #6d4207, 0 0 6px #fff;
  box-shadow:
    inset 0 0 0 3px rgba(255, 246, 172, .38),
    0 4px 0 #7e4f10,
    0 6px 15px rgba(0,0,0,.48);
}

.start-panel .home-menu-button:hover {
  background: transparent;
  transform: translateY(-3px);
}

.start-panel .home-menu-button:hover::before {
  filter: brightness(1.14);
  box-shadow:
    inset 0 0 0 3px rgba(255, 246, 172, .55),
    0 4px 0 #7e4f10,
    0 0 18px rgba(255, 218, 85, .62);
}

.start-panel #startButton {
  position: relative;
  min-width: 0;
  height: clamp(50px, 6.3vw, 78px);
  padding: 0 28px 3px;
  border: 5px solid #f5c945;
  border-radius: 20px;
  background:
    radial-gradient(circle at 25% 15%, rgba(255,255,255,.72), transparent 17%),
    linear-gradient(180deg, #82ff72 0%, #2dcc4a 48%, #109333 100%);
  color: white;
  font-size: clamp(19px, 2.5vw, 34px);
  font-weight: 1000;
  letter-spacing: .08em;
  text-shadow: 0 3px 0 #155e27, 0 0 4px #083d16;
  box-shadow:
    inset 0 0 0 4px rgba(255,255,255,.34),
    0 6px 0 #875414,
    0 10px 24px rgba(0,0,0,.5),
    0 0 20px rgba(110, 255, 94, .42);
}

.start-panel #startButton::before {
  content: "▶";
  margin-right: .42em;
  color: #fff9a7;
  font-size: .75em;
}

.start-panel #startButton:hover {
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.08);
}

.home-console .subtle {
  min-height: 13px;
  margin: 5px 0 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(1, 13, 23, .56);
  color: #d8e9f6;
  font-size: clamp(7px, .76vw, 9px);
  text-shadow: 0 1px 2px #000;
}

.home-console .developer-credit {
  margin: 2px 0 0;
  color: rgba(255, 238, 171, .92);
  font-size: clamp(7px, .76vw, 9px);
  text-shadow: 0 2px 4px #000;
}

@media (max-width: 720px), (max-height: 620px) {
  .start-panel .hero-card {
    width: 100%;
    height: 100%;
    max-height: none;
    padding: 0;
    overflow: visible;
    border-radius: 0;
  }

  .home-title { top: 2.4%; }
  .home-title .eyebrow { font-size: 6px; }
  .home-title h1 {
    margin: 0;
    font-size: clamp(27px, 9.6vh, 54px);
    letter-spacing: .04em;
    -webkit-text-stroke-width: 1px;
  }
  .home-title .lead {
    margin-top: 5px;
    padding: 3px 10px;
    font-size: clamp(6px, 2.1vh, 10px);
  }
  .home-console { right: 1.2%; bottom: .5%; left: 1.2%; }
  .home-console .cover-badges { gap: 3px; margin-bottom: 3px; }
  .home-console .cover-badges span { padding: 2px 5px; font-size: 6px; border-width: 1px; }
  .home-console .nickname-field {
    grid-template-columns: auto minmax(120px, 210px);
    gap: 5px;
    margin-bottom: 3px;
    font-size: 6px;
  }
  .home-console .nickname-field input { padding: 3px 8px; border-width: 1px; font-size: 7px; }
  .start-panel .lobby-actions {
    grid-template-columns: repeat(3, minmax(34px, 48px)) minmax(150px, 230px) repeat(3, minmax(34px, 48px));
    gap: 4px;
  }
  .start-panel .home-menu-button {
    min-width: 0;
    height: 46px;
    padding: 0;
    gap: 1px;
    font-size: 5px;
  }
  .start-panel .home-menu-button::before {
    width: 34px;
    height: 34px;
    border-width: 2px;
    font-size: 15px;
    box-shadow: inset 0 0 0 2px rgba(255,246,172,.38), 0 2px 0 #7e4f10, 0 4px 8px rgba(0,0,0,.45);
  }
  .start-panel #startButton {
    height: 43px;
    padding: 0 12px 2px;
    border-width: 3px;
    border-radius: 13px;
    font-size: 15px;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.34), 0 3px 0 #875414, 0 5px 12px rgba(0,0,0,.48);
  }
  .home-console .subtle,
  .home-console .developer-credit { display: block; min-height: 0; margin-top: 2px; font-size: 5px; }
  .puzzle-mode-button { min-width: 300px; margin-top: 3px; padding: 4px 12px; font-size: 7px; }
}

@media (orientation: portrait) {
  .start-panel {
    background:
      url("./assets/game-cover-portrait.jpg?v=20260724-adventure-home-v21") center / cover no-repeat;
  }

  .start-panel::before {
    background:
      linear-gradient(180deg, rgba(0, 14, 30, .07) 0%, transparent 58%, rgba(2, 7, 14, .42) 100%);
  }

  .start-panel .hero-card { width: 100%; }
  .home-title {
    top: 3.8%;
    width: 94%;
  }
  .home-title .eyebrow { font-size: clamp(7px, 2.2vw, 11px); }
  .home-title h1 {
    font-size: clamp(46px, 12vw, 78px);
    -webkit-text-stroke-width: 2px;
  }
  .home-title .lead {
    margin-top: 10px;
    padding: 5px 12px;
    font-size: clamp(9px, 2.6vw, 14px);
  }
  .home-console {
    right: 5%;
    bottom: 2%;
    left: 5%;
  }
  .home-console .cover-badges { max-width: 390px; }
  .home-console .cover-badges span { padding: 4px 7px; font-size: 8px; }
  .home-console .nickname-field {
    grid-template-columns: auto minmax(170px, 250px);
    margin-bottom: 9px;
    font-size: 10px;
  }
  .home-console .nickname-field input { padding: 7px 11px; font-size: 10px; }
  .start-panel .lobby-actions {
    grid-template-columns: repeat(3, minmax(64px, 78px));
    grid-template-rows: auto auto auto;
    gap: 7px 13px;
  }
  .start-panel #startButton {
    grid-column: 1 / -1;
    grid-row: 1;
    width: min(310px, 88vw);
    height: 64px;
    justify-self: center;
    font-size: 25px;
  }
  .start-panel #settingsButton { grid-column: 1; grid-row: 2; }
  .start-panel #helpButton { grid-column: 2; grid-row: 2; }
  .start-panel #recordsButton { grid-column: 3; grid-row: 2; }
  .start-panel #equipmentButton { grid-column: 1; grid-row: 3; }
  .start-panel #shopButton { grid-column: 2; grid-row: 3; }
  .start-panel #trophyRoomButton { grid-column: 3; grid-row: 3; }
  .start-panel .home-menu-button {
    height: 72px;
    font-size: 8px;
  }
  .start-panel .home-menu-button::before {
    width: 52px;
    height: 52px;
    border-width: 3px;
    font-size: 22px;
  }
  .home-console .subtle,
  .home-console .developer-credit { display: block; font-size: 7px; }
  .puzzle-mode-button { min-width: min(310px, 88vw); font-size: 10px; }
}

@media (orientation: portrait) and (max-height: 720px) {
  .home-title { top: 2.4%; }
  .home-title h1 { font-size: 40px; }
  .home-title .lead { margin-top: 5px; }
  .home-console .cover-badges { display: none; }
  .home-console .nickname-field { margin-bottom: 4px; }
  .start-panel .lobby-actions { gap: 4px 9px; }
  .start-panel #startButton { height: 48px; font-size: 19px; }
  .start-panel .home-menu-button { height: 55px; }
  .start-panel .home-menu-button::before { width: 39px; height: 39px; font-size: 17px; }
}

/* Confirmed pixel-art achievement trophies */
.trophy-pixel-model {
  --trophy-art-size: 116px;
  width: var(--trophy-art-size);
  height: calc(var(--trophy-art-size) + 26px);
  margin: -6px auto -5px;
  isolation: isolate;
  transform: translateY(1px);
  animation: trophyPixelFloat 3.2s ease-in-out infinite;
}

@keyframes trophyPixelFloat {
  0%, 100% { transform: translateY(1px); }
  50% { transform: translateY(-5px); }
}

.trophy-pixel-model::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 13px 7px 19px;
  border-radius: 48%;
  background: radial-gradient(circle, var(--trophy-color) 0, transparent 67%);
  filter: blur(13px);
  opacity: .42;
}

.trophy-pixel-image {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: var(--trophy-art-size);
  height: var(--trophy-art-size);
  border-radius: 8px;
  background: url("./assets/trophy-pixel-template.png?v=20260724-trophy-medal-up-v28") center / contain no-repeat;
  image-rendering: pixelated;
  -webkit-mask-image: radial-gradient(ellipse at 50% 48%, #000 0 62%, rgba(0,0,0,.96) 71%, transparent 92%);
  mask-image: radial-gradient(ellipse at 50% 48%, #000 0 62%, rgba(0,0,0,.96) 71%, transparent 92%);
}

.trophy-pixel-shield {
  position: absolute;
  z-index: 2;
  top: calc(var(--trophy-art-size) * .225);
  left: 50%;
  display: grid;
  width: calc(var(--trophy-art-size) * .2);
  height: calc(var(--trophy-art-size) * .2);
  place-items: center;
  overflow: hidden;
  transform: translateX(-50%);
  border: 2px solid #ffe58b;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,.7), transparent 18%),
    radial-gradient(circle, var(--trophy-color), var(--trophy-dark) 76%);
  box-shadow:
    inset 2px 2px rgba(255,255,255,.23),
    inset -2px -2px rgba(0,0,0,.3),
    0 0 7px var(--trophy-color);
}

.trophy-pixel-emblem {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #fff6b8;
  font-size: 11px;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(29, 17, 3, .92), 0 0 5px rgba(255,255,255,.42);
}

.trophy-variant-6 .trophy-pixel-emblem {
  font-size: 8px;
  letter-spacing: -1px;
}

.trophy-pixel-gem {
  display: none;
}

.trophy-slot.selected .trophy-pixel-model::before {
  opacity: .72;
}

.trophy-slot.locked .trophy-pixel-shield,
.trophy-slot.locked .trophy-pixel-gem {
  box-shadow: none;
}

@media (max-width: 720px), (max-height: 620px) {
  .trophy-pixel-model {
    --trophy-art-size: 88px;
    margin: -5px auto -10px;
    transform: scale(.86);
  }

  .trophy-pixel-shield {
    border-width: 1px;
  }

  .trophy-pixel-emblem { font-size: 9px; }
  .trophy-variant-6 .trophy-pixel-emblem { font-size: 7px; }
}

@media (max-height: 420px) {
  .trophy-pixel-model {
    --trophy-art-size: 72px;
    margin: -4px auto -22px;
    transform: scale(.74);
  }

  .trophy-pixel-emblem { font-size: 7px; }
  .trophy-variant-6 .trophy-pixel-emblem { font-size: 5px; }
}

/* Portrait gameplay keeps the 16:9 world ratio instead of stretching it. */
@media (orientation: portrait) {
  .stage {
    background:
      radial-gradient(circle at 45% 61%, rgba(40, 115, 158, .2), transparent 34%),
      linear-gradient(180deg, #06111f, #02070d 72%);
  }

  #gameCanvas {
    position: absolute;
    top: 52%;
    left: 0;
    width: 142%;
    max-width: none;
    height: auto;
    aspect-ratio: 16 / 9;
    transform: translateY(-50%);
    transform-origin: 0 50%;
    background: #07111d;
    box-shadow: 0 0 42px rgba(54, 185, 236, .12);
  }
}

/* Adventure expansion: boss runs, skills, English chests and endless mode. */
.endless-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 0 0 16px;
  padding: 15px 17px;
  border: 1px solid rgba(190, 126, 255, .38);
  border-radius: 16px;
  background:
    radial-gradient(circle at 84% 30%, rgba(180, 87, 255, .2), transparent 36%),
    linear-gradient(135deg, rgba(50, 30, 91, .58), rgba(13, 27, 44, .82));
  text-align: left;
}

.endless-card h3 {
  margin: 3px 0 4px;
  color: #fff1a8;
  font-size: 20px;
}

.endless-card p {
  margin: 0;
  color: #c5d5e5;
  font-size: 11px;
  line-height: 1.55;
}

.endless-card button {
  min-width: 220px;
}

.endless-card button:disabled {
  opacity: .48;
  filter: grayscale(.45);
}

.shop-section-title {
  margin: 5px 0 10px;
  color: #fff0aa;
  font-size: 16px;
  text-align: left;
}

.skill-loadout-status {
  margin: -4px 0 11px;
  color: #bcd2e6;
  font-size: 11px;
  text-align: left;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 18px;
}

.skill-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  text-align: left;
}

.skill-item.equipped {
  border-color: var(--skill-color);
  box-shadow: inset 0 0 24px rgba(201, 151, 255, .18);
}

.skill-icon {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border: 2px solid var(--skill-color);
  border-radius: 18px;
  background: radial-gradient(circle, rgba(201, 151, 255, .28), #07101c 68%);
  color: white;
  font-size: 30px;
  text-shadow: 0 0 14px var(--skill-color);
  box-shadow: 0 0 18px rgba(201, 151, 255, .25);
}

.skill-copy h4 {
  margin: 0 0 4px;
  color: white;
  font-size: 14px;
}

.skill-copy p {
  min-height: 32px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.skill-count {
  display: block;
  margin-bottom: 7px;
  color: #ffe58b;
  font-size: 10px;
  font-weight: 900;
}

.skill-actions {
  display: flex;
  gap: 6px;
}

.skill-actions button {
  min-width: 0;
  flex: 1;
  padding: 7px 5px;
  font-size: 9px;
}

#runSkillLabel {
  color: #d9b6ff;
}

#runSkillLabel.skill-active {
  border-color: rgba(196, 130, 255, .48);
  color: #f0d5ff;
  box-shadow: 0 0 18px rgba(171, 91, 255, .18);
}

.adventure-extra-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
  text-align: left;
}

.adventure-extra-card {
  padding: 12px;
  border: 1px solid rgba(103, 226, 255, .18);
  border-radius: 15px;
  background: rgba(6, 20, 34, .76);
}

.adventure-extra-card h3 { margin: 4px 0 8px; color: #fff; }
.adventure-extra-card p { margin: 5px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.daily-task-grid { display: grid; gap: 6px; }
.daily-task {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 8px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  color: #e9f8ff;
  font-size: 10px;
}
.daily-task b { color: #ffe27a; }
.daily-task-progress { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.09); }
.daily-task-progress span { display: block; height: 100%; background: linear-gradient(90deg, #45d8ff, #68ef9f); }
.challenge-controls { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.challenge-controls input {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(111,225,255,.28);
  border-radius: 10px;
  background: rgba(1,12,23,.72);
  color: #fff;
}
.challenge-controls .primary-button { grid-column: 1 / -1; min-width: 0; padding: 9px; }
.challenge-controls .secondary-button { min-width: 88px; padding: 9px; }
.challenge-code { min-height: 17px; color: #ffe27a !important; font-weight: 900; word-break: break-all; }

.pet-collection {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.pet-item {
  padding: 9px 6px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  color: #d8ebf7;
  cursor: pointer;
}
.pet-item:disabled { opacity: .38; cursor: not-allowed; filter: grayscale(1); }
.pet-item.equipped { border-color: #ffe166; background: rgba(255,211,79,.12); }
.pet-icon { display: block; margin-bottom: 4px; font-size: 28px; }
.pet-name { display: block; font-size: 9px; font-weight: 900; }
.pet-bonus { display: block; margin-top: 3px; color: #8ff5be; font-size: 7px; }

.item-button {
  position: absolute;
  right: 112px;
  bottom: 18px;
  z-index: 5;
  width: 88px;
  height: 48px;
  border: 3px solid #ffd45b;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffcf4d, #d87516);
  color: #281405;
  font-size: 11px;
  font-weight: 1000;
  box-shadow: 0 5px 0 #713505, 0 0 18px rgba(255, 195, 58, .4);
}
.item-button:active { transform: translateY(3px); box-shadow: 0 2px 0 #713505; }
.item-button.used { opacity: .45; filter: grayscale(.7); }

@media (max-width: 760px) {
  .adventure-extra-grid { grid-template-columns: 1fr; }
  .pet-collection { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px), (max-height: 620px) {
  .item-button { right: 104px; bottom: 9px; width: 76px; height: 42px; font-size: 9px; }
  .adventure-extra-card { padding: 8px; }
  .adventure-extra-card h3 { font-size: 13px; }
  .pet-icon { font-size: 20px; }
}

.word-chest-card {
  position: relative;
  border-color: rgba(255, 210, 72, .4);
  background:
    radial-gradient(circle at 50% 0, rgba(255, 202, 57, .2), transparent 38%),
    rgba(5, 15, 27, .96);
  box-shadow: 0 24px 90px rgba(0,0,0,.58), 0 0 36px rgba(255, 190, 48, .13);
}

.word-chest-card::before {
  content: "▰";
  position: absolute;
  top: -38px;
  left: 50%;
  color: #ffd354;
  font-size: 64px;
  text-shadow: 0 0 24px rgba(255, 195, 53, .72);
  transform: translateX(-50%);
}

.word-chest-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

.boss-chip {
  color: #ffb98c !important;
  border-color: rgba(255, 111, 63, .42) !important;
}

@media (max-width: 760px) {
  .endless-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .endless-card button {
    width: 100%;
    min-width: 0;
  }

  .skill-grid {
    grid-template-columns: 1fr;
  }

  .skill-item {
    grid-template-columns: 52px minmax(0, 1fr);
    padding: 9px;
  }

  .skill-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 24px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .endless-card {
    margin-bottom: 8px;
    padding: 8px 10px;
  }

  .endless-card h3 {
    font-size: 13px;
  }

  .endless-card p,
  .skill-loadout-status {
    font-size: 7px;
  }

  .skill-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 8px;
  }

  .skill-item {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
  }

  .skill-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 18px;
  }

  .skill-copy h4 {
    font-size: 9px;
  }

  .skill-copy p {
    display: none;
  }

  .skill-count {
    margin-bottom: 4px;
    font-size: 7px;
  }

  .skill-actions button {
    padding: 5px 3px;
    font-size: 7px;
  }

  .run-stats span {
    min-width: 62px;
    padding-inline: 6px;
  }
}
