:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #768094;
  --orange: #21a765;
  --orange-dark: #137f4b;
  --cream: #f2fbf4;
  --paper: #fefffb;
  --blue: #2d6cf5;
  --line: #dce9df;
  --soft-line: #e6f1e8;
  --success: #137a42;
  --danger: #c94c2b;
  --shadow: #18362012;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  min-height: -webkit-fill-available;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: -webkit-fill-available;
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

button,
input {
  font: inherit;
}

button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  opacity: .62;
  cursor: wait;
  transform: none !important;
  box-shadow: none !important;
}

.hidden {
  display: none !important;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  outline: 0;
}

input:focus {
  border-color: var(--orange);
}

.version-chip {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.changelog-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  padding: 0;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 22px #1720331f;
}

.version-text {
  width: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

.version-text:focus-visible {
  outline: 2px solid #9ee7b5;
  outline-offset: 3px;
  border-radius: 5px;
}

.home-team-link {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  display: flex;
  align-items: center;
  height: 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.phone-shell {
  --page-pad-x: 18px;
  --page-pad-top: 22px;
  --page-pad-bottom: 32px;
  position: relative;
  width: min(100%, 480px);
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  margin: auto;
  padding: var(--page-pad-top) var(--page-pad-x) max(var(--page-pad-bottom), env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.view {
  display: none;
  min-height: calc(100vh - var(--page-pad-top) - var(--page-pad-bottom));
  min-height: calc(100svh - var(--page-pad-top) - var(--page-pad-bottom));
  min-height: calc(100dvh - var(--page-pad-top) - var(--page-pad-bottom));
}

.view.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#playView.active {
  padding-bottom: 224px;
}

#playView.active.result-mode {
  padding-bottom: 156px;
}

.brand-block {
  padding-top: 46px;
}

.label {
  display: block;
  color: var(--orange);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2 {
  letter-spacing: 0;
}

.brand-title {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 104px;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: clamp(44px, 12vw, 62px);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: 0 8px 14px #17203314;
  white-space: nowrap;
}

.brand-title::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 48%;
  height: 19px;
  border-radius: 999px;
  background: #bcefc8;
  opacity: .82;
  transform: translateY(-50%) rotate(-2deg);
  z-index: -1;
}

.brand-title::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 4px;
  height: 8px;
  border-radius: 999px;
  background: var(--orange);
}

h2 {
  font-size: 36px;
  line-height: 1.08;
  font-weight: 900;
}

h3 {
  font-size: 15px;
}

.brand-block p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.score-model,
.field,
.signal-card,
.answer-result,
.settle-hero,
.rank-panel {
  background: #fff;
  border: 1px solid #efe6db;
  border-radius: 18px;
  box-shadow: 0 12px 30px var(--shadow);
}

.score-model {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.score-lanes {
  display: grid;
  gap: 10px;
}

.score-lane {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-items: stretch;
}

.score-chip {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 7px;
  border: 1px solid #e8edf6;
  border-radius: 14px;
  padding: 8px;
  background: #f7faff;
  text-align: center;
}

.score-visual {
  min-height: 44px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 6px;
  border-radius: 12px;
  padding: 7px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e5edf6;
}

.score-visual i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e7f8ed;
  color: var(--orange);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.score-visual em {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.score-visual.full-card em {
  font-size: 11px;
}

.score-visual.time-card {
  grid-template-columns: 1fr;
  justify-items: center;
}

.score-visual.time-card i {
  width: 32px;
  height: 24px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--blue);
}

.score-visual.time-card em {
  color: var(--muted);
  font-size: 11px;
}

.score-chip .score-points {
  color: var(--blue);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.score-chip.best {
  border-color: #bdeecd;
  background: #effbf3;
}

.score-chip.best .score-points {
  color: var(--orange);
}

.round-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.round-note strong {
  color: var(--ink);
  font-size: 14px;
}

.field {
  display: block;
  padding: 16px;
}

.field span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.text-answer input {
  min-height: 48px;
  padding: 13px;
}

.stack-actions {
  display: grid;
  gap: 8px;
}

.primary {
  min-height: 48px;
  padding: 13px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 7px 0 var(--orange-dark);
}

.primary:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 var(--orange-dark);
}

.stack-actions button:not(.primary),
.play-controls button,
.shareButton {
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #e8edf6;
  background: #fff;
  color: #30405f;
  font-weight: 800;
  box-shadow: 0 6px 16px #1720330a;
}

#historyButton,
#homeRankingButton,
#quitButton,
#finishHomeButton {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.quiz-top {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.game-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.game-title strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

#questionCounter {
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
}

.hint-line {
  display: grid;
  place-items: center;
  min-height: 54px;
  border: 1px solid #c9f2d4;
  border-radius: 999px;
  padding: 11px 22px;
  background: #fff;
  box-shadow: 0 12px 28px #30221110;
}

.hint-line span {
  color: var(--orange);
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  white-space: normal;
}

.signal-card {
  position: relative;
  min-height: clamp(260px, 42svh, 430px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-color: #e7edf7;
  background:
    radial-gradient(circle at 50% 45%, #fffdf9 0 22%, #eaf8ef 58%, #eef5ff 100%);
}

.signal-card::before,
.signal-card::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 47%;
  width: 170px;
  height: 96px;
  border: 2px solid #21a76555;
  border-radius: 999px;
  opacity: .35;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.signal-card::after {
  width: 230px;
  height: 130px;
  border-color: #2d6cf533;
}

.vinyl-stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(72vw, 276px);
  aspect-ratio: 1;
}

.vinyl-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 78%;
  height: 24px;
  border-radius: 999px;
  background: #17203318;
  filter: blur(7px);
  transform: translateX(-50%);
}

.vinyl-disc {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #0d1220 0 4%, transparent 4.4%),
    radial-gradient(circle at 50% 50%, #21a765 0 20%, transparent 20.5%),
    repeating-radial-gradient(circle at 50% 50%, #1c2538 0 2px, #090d16 2px 7px, #20283b 7px 8px),
    linear-gradient(135deg, #28334c, #05070d 42%, #1b2438 70%, #060810);
  box-shadow:
    inset 0 0 0 9px #111827,
    inset 0 0 26px #ffffff12,
    0 24px 50px #1720332b;
  transform: rotate(0deg);
}

.signal-card.playing .vinyl-disc {
  animation: spin-record 1.8s linear infinite;
}

.vinyl-disc::before {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  background:
    conic-gradient(from 20deg, #ffffff00 0 38deg, #ffffff24 40deg 52deg, #ffffff00 58deg 180deg, #ffffff18 190deg 206deg, #ffffff00 214deg 360deg);
  mix-blend-mode: screen;
}

.vinyl-disc::after {
  content: "";
  position: absolute;
  inset: 45%;
  border-radius: 50%;
  background: #fffdf9;
  box-shadow: 0 0 0 5px #172033, 0 0 0 12px #8ce2a9;
}

.vinyl-ring {
  position: absolute;
  inset: 14%;
  border: 1px solid #ffffff1f;
  border-radius: 50%;
}

.vinyl-ring.r2 {
  inset: 27%;
}

.vinyl-ring.r3 {
  inset: 39%;
}

.vinyl-hole {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 9%;
  height: 9%;
  border-radius: 50%;
  background: #fffdf9;
  transform: translate(-50%, -50%);
}

@keyframes spin-record {
  to {
    transform: rotate(360deg);
  }
}

.play-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.play-controls[hidden],
.answer-area[hidden] {
  display: none;
}

.play-controls button {
  min-height: 44px;
  border-color: #bdeecd;
  background: #effbf3;
  color: #176b43;
  font-size: 14px;
}

.play-controls button.active {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
  box-shadow: 0 8px 20px #21a76524;
}

.answer-area {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: grid;
  gap: 10px;
  padding: 14px 20px 24px;
  padding-bottom: max(18px, calc(12px + env(safe-area-inset-bottom)));
  background: var(--paper);
  border-top: 1px solid var(--soft-line);
  box-shadow: 0 -12px 28px #1720330d;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.answer-wrap {
  width: min(100%, 480px);
  margin: auto;
}

.answer-area p {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.answer-area p:empty {
  display: none;
}

.record {
  width: 100%;
  height: 64px;
  border-radius: 17px;
  background: var(--ink);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}

.record.recording {
  background: #178957;
  animation: blink .8s infinite;
}

@keyframes blink {
  50% {
    opacity: .7;
  }
}

.text-answer {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
  margin-top: 10px;
}

.text-answer[hidden] {
  display: none;
}

.text-answer .primary {
  margin: 0;
  box-shadow: none;
}

.switch {
  margin: 10px;
  color: var(--blue);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
}

.round-dots {
  display: flex;
  gap: 8px;
  margin: 0;
}

.round-dots span {
  height: 7px;
  flex: 1;
  border-radius: 9px;
  background: #ede9e1;
  color: transparent;
  overflow: hidden;
}

.round-dots .active,
.round-dots .hit {
  background: var(--orange);
}

.round-dots .miss {
  background: #172033;
}

.steps {
  display: flex;
  gap: 8px;
  margin: 0;
}

.step {
  height: 7px;
  flex: 1;
  border-radius: 9px;
  background: #ede9e1;
}

.step.on {
  background: var(--orange);
}

.answer-result {
  padding: 16px;
  color: var(--ink);
  text-align: center;
}

.answer-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f4ed;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.answer-result-row + .answer-result-row {
  margin-top: 8px;
}

.answer-result-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  text-align: left;
  overflow-wrap: anywhere;
}

.answer-result-copy b {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 900;
}

.answer-result-copy em {
  min-width: 0;
  font-size: 15px;
  font-style: normal;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.answer-result-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.answer-result-row.hit .answer-result-copy {
  color: var(--success);
}

.answer-result-row.hit .answer-result-icon {
  background: var(--success);
}

.answer-result-row.miss .answer-result-copy {
  color: var(--danger);
}

.answer-result-row.miss .answer-result-icon {
  background: var(--danger);
}

.answer-result-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  margin-top: 12px;
}

#playView.result-mode .answer-result-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 10px;
  margin: 0;
  padding: 14px 20px 24px;
  padding-bottom: max(18px, calc(12px + env(safe-area-inset-bottom)));
  background: var(--paper);
  border-top: 1px solid var(--soft-line);
  box-shadow: 0 -12px 28px #1720330d;
}

.answer-result-actions button {
  min-height: 44px;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 900;
}

#playView.result-mode .answer-result-actions button {
  width: min(100%, 480px);
  min-height: 52px;
}

.answer-result-actions .result-full-song {
  background: #f0fbf4;
  color: var(--success);
  border: 1px solid #cfeedd;
}

.answer-result-actions .result-full-song[data-play-state="playing"] {
  background: #fff7e8;
  color: #a45f00;
  border-color: #ffd795;
}

.answer-result-actions .result-full-song[data-play-state="ended"] {
  background: #eef8ff;
  color: #2168b8;
  border-color: #cce6ff;
}

.answer-result-actions .result-next {
  background: var(--ink);
  color: #fff;
}

.answer-result-actions button:disabled {
  opacity: .72;
}

.settle-hero {
  min-height: 520px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 22px 20px;
  text-align: center;
  background:
    linear-gradient(180deg, #ffffff 0%, #eaf8ef 100%);
}

.settle-hero.final {
  min-height: 360px;
  background:
    linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
}

.settle-hero h2 {
  color: var(--ink);
}

.settle-art {
  position: relative;
  width: min(100%, 306px);
  aspect-ratio: 1 / 1;
  margin: 2px auto 4px;
  overflow: hidden;
  border-radius: 20px;
  background: #eaf4ee;
  box-shadow: 0 16px 38px #17203318;
}

.settle-art-bg {
  position: absolute;
  inset: -34px;
  width: calc(100% + 68px);
  height: calc(100% + 68px);
  object-fit: cover;
  filter: blur(24px) saturate(1.18);
  opacity: .72;
  transform: scale(1.04);
}

.settle-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #ffffff14 0%, #17203312 62%, #17203336 100%);
  pointer-events: none;
}

.settle-art-main-frame {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  display: block;
  width: 78%;
  height: 78%;
  max-width: 250px;
  max-height: 250px;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  overflow: hidden;
  border: 8px solid #fffdf9;
  border-radius: 18px;
  box-shadow: 0 16px 34px #17203332;
}

.settle-art-main {
  position: absolute;
  left: var(--settle-crop-x, 50%);
  top: var(--settle-crop-y, 40%);
  display: block;
  width: calc(100% * var(--settle-crop-scale, 1.44));
  height: calc(100% * var(--settle-crop-scale, 1.44));
  transform: translate(-50%, -50%);
  object-fit: cover;
}

.settle-score-row {
  display: inline-flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
}

.settle-score-row strong {
  color: var(--orange);
  font-size: 68px;
  font-weight: 900;
  line-height: 1;
}

.settle-score-row span {
  font-size: 18px;
  font-weight: 900;
}

.settle-hero p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.settle-meter {
  height: 13px;
  border-radius: 999px;
  background: #ede9e1;
  overflow: hidden;
}

.settle-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #21a765, #7ade9c);
  transition: width 420ms ease;
}

.tier-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  color: #9aa2b2;
  font-size: 11px;
  font-weight: 900;
}

.tier-labels span.active {
  color: var(--orange);
}

.review-panel ol {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.review-panel li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 82px;
  gap: 12px;
  align-items: center;
  min-height: 0;
  padding: 13px 12px;
  border: 1px solid #f0e8df;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffefb 0%, #f8fff9 100%);
}

.review-panel li.full {
  border-color: #bdeecd;
  background: #effbf3;
}

.review-panel li.partial {
  border-color: #c8d9ff;
  background: #f3f7ff;
}

.review-panel li.miss {
  border-color: #f1d3c9;
  background: #fff8f5;
}

.review-panel li strong {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #bdeecd;
  border-radius: 999px;
  background: #fff;
  color: #176b43;
  font-size: 12px;
  font-weight: 900;
}

.review-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.review-copy small {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.review-copy small em {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 999px;
  background: #eef8f1;
  color: #176b43;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

.review-status {
  display: grid;
  justify-items: center;
  gap: 4px;
  justify-self: end;
  align-self: center;
  white-space: nowrap;
  min-width: 78px;
  padding: 9px 8px;
  border-radius: 16px;
  text-align: center;
}

.review-status b {
  color: inherit;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.review-status em {
  color: inherit;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.review-panel li.full .review-status {
  background: #e6f8ec;
  color: #21a765;
}

.review-panel li.partial .review-status {
  background: #e8f0ff;
  color: #2d6cf5;
}

.review-panel li.miss .review-status {
  background: #ffece5;
  color: #c94c2b;
}

.rank-panel {
  padding: 16px;
}

.panel-head.top {
  padding-top: 26px;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rank-panel:not(.review-panel) ol {
  display: grid;
  gap: 0;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.rank-panel:not(.review-panel) li {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 14px 0;
  border-bottom: 1px solid #f1eee9;
}

.rank-panel:not(.review-panel) li:last-child {
  border-bottom: 0;
}

.rank-panel:not(.review-panel) li.me {
  margin: 8px 0;
  border: 2px solid #21a765;
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, #effbf3 0%, #ffffff 100%);
  box-shadow: 0 12px 28px #21a76520;
}

.rank-panel:not(.review-panel) li strong {
  color: var(--ink);
  font-size: 14px;
}

.rank-panel:not(.review-panel) li span {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.rank-panel:not(.review-panel) small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.rank-me-badge {
  display: inline-grid;
  place-items: center;
  min-height: 20px;
  margin-left: 7px;
  padding: 0 8px;
  border-radius: 999px;
  background: #ff8a1f;
  color: #fff;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
  vertical-align: 1px;
}

.rank-panel:not(.review-panel) b {
  color: var(--orange);
  font-size: 18px;
  font-weight: 900;
}

.modal-rank-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: #17203366;
}

.modal-card {
  position: relative;
  width: min(100%, 430px);
  max-height: min(78vh, 620px);
  overflow: hidden;
  background: #fffdf9;
  border: 1px solid #eee1d6;
  border-radius: 18px;
  box-shadow: 0 24px 80px #17203333;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 18px 12px;
  border-bottom: 1px solid #f0e8df;
}

.modal-head b {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.modal-head button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  padding: 0;
  background: var(--ink);
  color: #fff;
  font-size: 21px;
  line-height: 1;
}

.history-content {
  max-height: calc(min(78vh, 620px) - 70px);
  overflow: auto;
  padding: 4px 18px 18px;
}

.modal-head span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.changelog-list {
  max-height: calc(min(78vh, 620px) - 70px);
  overflow: auto;
  padding: 4px 18px 18px;
}

.changelog-item {
  padding: 14px 0;
  border-bottom: 1px solid #f1eee9;
}

.changelog-item:last-child {
  border-bottom: 0;
}

.changelog-item b {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.changelog-item p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.history-content ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-content li {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 14px 0;
  border-bottom: 1px solid #f1eee9;
}

.history-content li:last-child {
  border-bottom: 0;
}

.history-content li strong {
  color: var(--ink);
  font-size: 14px;
}

.history-content li span {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.history-content small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.history-content b {
  color: var(--orange);
  font-size: 18px;
  font-weight: 900;
}

.team-page {
  padding-top: 32px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.team-panel {
  margin-top: 38px;
}

.team-panel h1 {
  margin: 10px 0 22px;
  color: var(--ink);
  font-size: 42px;
  font-weight: 900;
  line-height: 1.08;
}

.team-list {
  display: grid;
  gap: 12px;
}

.team-list div {
  padding: 18px;
  border: 1px solid #efe6db;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px #3022110c;
}

.team-list span,
.team-list small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.team-list b {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 24px;
}

.team-list small {
  margin-top: 7px;
  line-height: 1.45;
}

.model-panel {
  margin-top: 26px;
  padding-bottom: 28px;
}

.model-list {
  display: grid;
  gap: 10px;
}

.model-row {
  padding: 14px;
  border: 1px solid #e7edf7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px #1720330a;
}

.model-row span,
.model-row small,
.model-row strong {
  display: block;
}

.model-row span {
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
}

.model-row b {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.model-row strong {
  margin-top: 4px;
  color: var(--blue);
  font-size: 13px;
  line-height: 1.35;
}

.model-row small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

@media (max-width: 520px) {
  .phone-shell {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .phone-shell {
    --page-pad-x: 16px;
    --page-pad-top: 18px;
    --page-pad-bottom: 26px;
  }

  .version-chip {
    top: 14px;
    left: 14px;
  }

  .home-team-link {
    top: 14px;
    right: 14px;
  }

  .brand-block {
    padding-top: 28px;
  }

  .brand-title {
    min-height: 90px;
    font-size: clamp(40px, 12vw, 50px);
  }

  .score-lane {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .play-controls {
    grid-template-columns: 1fr;
  }

  .settle-score-row strong {
    font-size: 58px;
  }

  .hint-line span {
    font-size: 20px;
  }

}

@media (max-width: 380px) {
  .phone-shell {
    --page-pad-x: 14px;
  }

  .version-chip {
    top: 12px;
    left: 12px;
    gap: 6px;
    font-size: 11px;
  }

  .home-team-link {
    top: 12px;
    right: 12px;
    height: 26px;
    font-size: 11px;
  }

  .changelog-icon {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }

  .score-model,
  .field,
  .rank-panel {
    padding: 14px;
  }

  .signal-card {
    min-height: clamp(230px, 38svh, 370px);
  }
}
