@import url("https://fonts.googleapis.com/css2?family=Black+Han+Sans&family=Do+Hyeon&family=Noto+Sans+KR:wght@400;700;900&display=swap");

:root {
  color-scheme: dark;
  --font-logo: "Black Han Sans", "Noto Sans KR", sans-serif;
  --font-display: "Do Hyeon", "Noto Sans KR", sans-serif;
  --font-ui: "Noto Sans KR", system-ui, sans-serif;
  --bg: #07090d;
  --panel: rgba(15, 19, 27, 0.86);
  --panel-strong: rgba(19, 23, 32, 0.96);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f7fb;
  --muted: #99a3b3;
  --cyan: #49d9ff;
  --amber: #ffcc4a;
  --orange: #ff7a30;
  --red: #ff334f;
}

* {
  box-sizing: border-box;
}

html,
body,
.app {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

button,
input,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
  padding: 28px;
}

.title-screen,
.select-screen,
.leaderboard-screen,
.gameover-screen {
  background:
    linear-gradient(180deg, rgba(255, 51, 79, 0.1), transparent 34%),
    radial-gradient(circle at 20% 10%, rgba(73, 217, 255, 0.16), transparent 28%),
    linear-gradient(135deg, #0c1119, #090a0d 52%, #130d10);
}

.gameover-screen {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  padding: clamp(16px, 2.2vw, 34px);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.08) 42%, rgba(0, 0, 0, 0.68)),
    radial-gradient(circle at 75% 44%, rgba(255, 38, 34, 0.22), transparent 42%),
    url("./assets/gameover/background.png") center / cover no-repeat;
}

.gameover-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.45)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px);
  pointer-events: none;
}

.title-screen {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 7, 11, 0.95), rgba(5, 7, 11, 0.42) 46%, rgba(5, 7, 11, 0.9)),
    url("./assets/cover-bg.png") center / cover no-repeat;
}

.cover-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.22) 48%, rgba(0, 0, 0, 0.82) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px);
  pointer-events: none;
}

.title-ranking-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
}

.title-menu {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(920px, 100%);
  padding: 0 18px;
  transform: translateY(-2vh);
}

.game-logo-img {
  display: block;
  width: min(760px, 90vw);
  height: auto;
  margin: 0 0 12px;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.52));
}

.cover-copy {
  margin-bottom: 20px;
  color: #f4f7fb;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.title-menu .button-row {
  justify-content: center;
  align-items: center;
}

.image-button {
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
}

.image-button img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.42));
  transition: transform 0.14s ease, filter 0.14s ease;
}

.image-button:hover img {
  transform: translateY(-2px) scale(1.025);
  filter: drop-shadow(0 16px 22px rgba(255, 51, 79, 0.38));
}

.start-image-button {
  width: min(300px, 45vw);
}

.cover-start-text {
  display: inline-grid;
  place-items: center;
  min-height: 54px;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
  font-family: var(--font-display);
  font-size: clamp(30px, 4.8vw, 52px);
  font-weight: 400;
  letter-spacing: 0;
  text-decoration: none;
  text-shadow:
    0 0 14px rgba(255, 255, 255, 0.36),
    0 5px 0 rgba(0, 0, 0, 0.72);
}

.cover-start-text:hover {
  color: #ffe76f;
}

.game-start-image-button {
  width: min(360px, 100%);
  margin-top: 16px;
}

.topbar,
.leaderboard-header,
.hud,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  max-width: 1220px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--amber);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-family: var(--font-logo);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 112px);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 40px;
  letter-spacing: 0;
}

.quote {
  color: #c8d0dc;
  font-size: 18px;
}

.select-screen {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  height: 100vh;
  min-height: 0;
  padding: 24px 28px 20px;
  background:
    linear-gradient(90deg, rgba(2, 4, 8, 0.94), rgba(2, 4, 8, 0.42) 46%, rgba(2, 4, 8, 0.96)),
    linear-gradient(180deg, rgba(255, 51, 79, 0.14), transparent 35%),
    url("./assets/cover-bg.png") center / cover no-repeat;
}

.select-arena {
  display: grid;
  grid-template-columns: 500px minmax(0, 1fr);
  gap: 20px;
  max-width: 1640px;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  align-items: stretch;
  overflow: hidden;
}

.select-header {
  width: min(1560px, 100%);
  margin: 0 auto 10px;
}

.select-header h1 {
  margin: 0;
  color: #e9edf1;
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.88;
  text-shadow:
    0 5px 0 rgba(140, 9, 23, 0.9),
    0 0 18px rgba(255, 51, 79, 0.36);
}

.select-header p {
  margin: 8px 0 0;
  color: #ff3d4f;
  font-family: var(--font-display);
  font-size: 22px;
}

.character-roster {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 0;
}

.roster-image-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  transition: transform 0.14s ease, filter 0.14s ease, opacity 0.14s ease;
}

.roster-image-button img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.roster-image-button:not(.selected) {
  opacity: 0.74;
}

.roster-image-button.selected {
  z-index: 2;
  filter:
    drop-shadow(0 0 16px rgba(255, 51, 79, 0.42))
    drop-shadow(9px 0 0 rgba(0, 0, 0, 0.46));
  transform: translateX(10px) scale(1.015);
}

.roster-image-button:hover {
  opacity: 1;
  transform: translateX(6px);
}

.selected-character-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 410px;
  gap: 18px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.fighter-stage {
  position: relative;
  display: grid;
  place-items: center;
  align-content: end;
  min-height: 0;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  pointer-events: none;
}

.fighter-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: contrast(1.08) saturate(1.08);
}

.fighter-art {
  position: relative;
  z-index: 2;
  width: auto;
  height: 100%;
  filter: drop-shadow(26px 18px 0 rgba(0,0,0,0.66)) contrast(1.1) saturate(1.1);
  animation: fighterSelectSlide 360ms cubic-bezier(0.2, 0.92, 0.18, 1) both;
  will-change: transform, opacity;
}

@keyframes fighterSelectSlide {
  from {
    opacity: 0.55;
    transform: translateX(48px) scale(0.985);
  }

  70% {
    opacity: 1;
    transform: translateX(-6px) scale(1.006);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fighter-art {
    animation: none;
  }
}

.fighter-stage .brush-splash {
  position: absolute;
  z-index: 1;
  width: min(950px, 136%);
  height: auto !important;
  max-width: none;
  opacity: 0.95;
  filter: drop-shadow(0 0 34px rgba(0,0,0,0.72));
}

.fighter-info {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  align-self: center;
  min-height: min(520px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 51, 79, 0.16), transparent 44%),
    rgba(0, 0, 0, 0.7);
  clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%, 0 20px);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.72);
}

.panel-label {
  margin: 0;
  color: #ff3d4f;
  font-family: var(--font-display);
  font-size: 18px;
}

.nameplate-image {
  display: block;
  width: min(100%, 440px);
  height: auto;
  margin: -6px 0 -4px;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.62));
}

.fighter-info h3 {
  margin: -4px 0 4px;
  color: #dfe5ed;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
}

.fighter-info .quote {
  color: #f0f4f8;
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.55;
}

.fighter-info dl {
  display: grid;
  gap: 10px;
  margin: 8px 0 0;
}

.fighter-info dl div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.fighter-info dt {
  color: #9ea8b8;
  font-family: var(--font-display);
}

.effect-tag {
  color: #ffdf68;
  font-size: 0.72em;
  font-weight: 800;
}

.fighter-info dd {
  margin: 0;
  color: #ff4d5f;
  font-family: var(--font-ui);
  font-weight: 900;
}

.effect {
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid rgba(255, 204, 74, 0.35);
  border-radius: 6px;
  color: var(--amber);
  background: rgba(255, 204, 74, 0.08);
  font-family: var(--font-display);
  font-weight: 800;
}

.primary-button,
.ghost-button,
.icon-button,
.skill-button,
.audio-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-display);
  font-weight: 800;
}

.primary-button {
  padding: 0 18px;
  border-color: rgba(255, 51, 79, 0.7);
  background: linear-gradient(180deg, #ff3e57, #b7152d);
}

.ghost-button {
  padding: 0 16px;
}

.icon-button,
.audio-button {
  width: 42px;
  padding: 0;
}

.character-body .primary-button {
  margin-top: auto;
}

.game-screen {
  height: 100vh;
  padding: 0;
  overflow: hidden;
}

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% -10%, rgba(73, 217, 255, 0.16), transparent 34%),
    linear-gradient(180deg, #0c1118, #090a0d 62%, #170a0e);
  background-size: 48px 48px, 48px 48px, auto, auto;
}

.stage.hit {
  animation: hitShake 0.22s linear;
}

@keyframes hitShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

.fx-canvas,
.words-layer {
  position: absolute;
  inset: 0;
}

.fx-canvas {
  pointer-events: none;
}

.hud {
  position: absolute;
  z-index: 6;
  top: 16px;
  left: 18px;
  right: 18px;
}

.hud-left,
.hud-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hud-left span {
  min-width: 76px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.34);
  font-family: var(--font-ui);
  text-align: center;
  font-weight: 700;
}

.skill-button {
  min-width: 132px;
  padding: 0 14px;
  color: #ffdf68;
  background: rgba(255, 255, 255, 0.05);
}

.skill-button.used {
  color: #8f96a3;
  background: rgba(255, 255, 255, 0.05);
}

.skill-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  font-family: var(--font-display);
  font-size: clamp(24px, 4.4vw, 44px);
  font-weight: 800;
  color: rgba(255, 223, 104, 0.9);
  text-shadow: 0 0 24px rgba(255, 223, 104, 0.55), 0 3px 0 rgba(0, 0, 0, 0.72);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
}

.skill-flash.play {
  animation: skillFlashPop 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes skillFlashPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  38% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); }
}

.audio-button {
  position: absolute;
  z-index: 7;
  left: 18px;
  bottom: 116px;
}

.audio-panel {
  position: absolute;
  z-index: 8;
  left: 18px;
  bottom: 164px;
  display: grid;
  gap: 10px;
  width: 230px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.audio-panel label {
  display: grid;
  gap: 6px;
  color: #d8dee8;
  font-size: 14px;
}

.word {
  position: absolute;
  min-width: max-content;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: #ecfbff;
  background: rgba(10, 14, 20, 0.68);
  font-family: var(--font-ui);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.05;
  text-shadow: 0 0 10px rgba(73, 217, 255, 0.28);
  transform: translate3d(0, 0, 0);
}

.word.match {
  border-color: rgba(255, 204, 74, 0.8);
  box-shadow: 0 0 16px rgba(255, 204, 74, 0.34);
}

.word.target {
  border-color: rgba(255, 51, 79, 0.95);
  box-shadow: 0 0 22px rgba(255, 51, 79, 0.48);
}

.word.danger-1 { color: #fff0b0; }
.word.danger-2 { color: #ffc078; }
.word.danger-3 { color: #ff7b83; }

.defense-line {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 86px;
  height: 4px;
  background: var(--red);
  box-shadow: 0 0 20px var(--red), 0 0 60px rgba(255, 51, 79, 0.4);
}

.input-panel {
  position: absolute;
  z-index: 6;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.input-display {
  min-height: 54px;
  padding: 12px 16px;
  border: 1px solid rgba(73, 217, 255, 0.34);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.54);
  color: var(--text);
  font-size: 26px;
  font-weight: 500;
}

.input-display.invalid {
  border-color: rgba(255, 51, 79, 0.9);
}

.input-display.invalid .game-input {
  color: #ffb8c0;
}

.game-input {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  direction: ltr;
  unicode-bidi: plaintext;
  caret-color: var(--cyan);
}

.game-input::placeholder {
  color: rgba(244, 247, 251, 0.28);
}

.lives {
  min-width: 172px;
  color: var(--red);
  font-size: 28px;
  text-align: right;
  text-shadow: 0 0 16px rgba(255, 51, 79, 0.45);
}

.overlay {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
}

#countdownOverlay {
  color: var(--text);
  font-size: clamp(44px, 10vw, 108px);
  font-weight: 950;
  text-shadow: 0 0 28px rgba(255, 51, 79, 0.55);
}

.modal,
.gameover-panel,
.ranking-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
}

.modal {
  width: min(420px, calc(100vw - 40px));
  padding: 28px;
  text-align: center;
}

.gameover-layout {
  display: grid;
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(340px, 0.74fr) minmax(720px, 1.06fr);
  align-items: center;
  gap: clamp(18px, 2.4vw, 42px);
  width: min(1680px, 100%);
  height: min(900px, 100%);
  margin: 0 auto;
}

.gameover-portrait {
  position: relative;
  display: grid;
  place-items: end center;
  min-height: 0;
  height: 100%;
  overflow: visible;
  background: none;
}

.gameover-panel {
  position: relative;
  min-height: min(720px, calc(100vh - 72px));
  padding: clamp(42px, 4.1vw, 72px) clamp(58px, 5.4vw, 102px);
  border: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.18)),
    url("./assets/gameover/ui/result-panel.png") center / 100% 100% no-repeat;
  box-shadow: none;
}

.gameover-panel .eyebrow {
  margin: 0 0 6px;
  color: #ff322f;
  font-family: var(--font-display);
  font-size: clamp(14px, 1.2vw, 19px);
  font-weight: 400;
  text-align: center;
  text-shadow: 0 0 12px rgba(255, 30, 24, 0.8);
}

.gameover-panel h2 {
  margin: 0;
  color: #f5f3ef;
  font-family: var(--font-display);
  font-size: clamp(52px, 4.8vw, 86px);
  font-weight: 400;
  line-height: 0.95;
  text-align: center;
  text-shadow:
    0 2px 0 #270000,
    0 0 22px rgba(255, 42, 34, 0.72);
}

.gameover-panel .quote {
  margin: 12px 0 24px;
  color: rgba(244, 247, 251, 0.78);
  font-size: clamp(16px, 1.35vw, 22px);
  font-weight: 400;
  text-align: center;
  word-break: keep-all;
}

.gameover-panel .eyebrow,
.gameover-panel h2,
.gameover-panel .quote,
.gameover-panel .result-stats,
.gameover-panel .score-form,
.gameover-panel .submit-message,
.gameover-panel .button-row {
  transform: translateX(-38px);
}

.gameover-portrait::after {
  content: "";
  position: absolute;
  inset: auto 0 2% 0;
  height: 32%;
  background: radial-gradient(ellipse at 52% 85%, rgba(255, 36, 28, 0.22), transparent 62%);
  pointer-events: none;
}

.gameover-portrait img {
  position: relative;
  z-index: 1;
  width: min(48vw, 620px);
  max-width: none;
  height: min(88vh, 850px);
  object-fit: contain;
  object-position: center bottom;
  filter:
    drop-shadow(0 0 24px rgba(255, 35, 28, 0.34))
    drop-shadow(0 28px 34px rgba(0, 0, 0, 0.75));
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 12px 14px;
  margin: 18px 0 16px;
}

.stat {
  min-height: 80px;
  padding: 16px 20px 14px;
  border: 0;
  background: url("./assets/gameover/ui/stat-card.png") center / 100% 100% no-repeat;
  color: rgba(244, 247, 251, 0.72);
  font-size: 15px;
  font-weight: 400;
}

.stat:nth-child(5) {
  grid-column: 1 / -1;
  width: 52%;
}

.stat span {
  display: block;
  font-family: var(--font-display);
}

.stat strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-ui);
  color: #f2f0eb;
  font-size: clamp(23px, 2.1vw, 34px);
  font-weight: 400;
  line-height: 1;
  text-shadow: 0 0 14px rgba(255, 40, 34, 0.36);
}

.score-form {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 12px;
  margin: 14px 0 0;
}

.nickname-frame {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 62px;
  padding: 0 22px;
  background: url("./assets/gameover/ui/input-frame.png") center / 100% 100% no-repeat;
}

.score-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 20px;
  outline: none;
}

.score-form input:-webkit-autofill,
.score-form input:-webkit-autofill:hover,
.score-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px transparent inset;
  transition: background-color 9999s ease-out;
}

.score-form input::placeholder {
  color: rgba(244, 247, 251, 0.46);
}

.score-form input:focus {
  background: transparent;
}

.score-form input:-internal-autofill-selected {
  background-color: transparent !important;
}

.nickname-frame:focus-within {
  filter: drop-shadow(0 0 12px rgba(255, 54, 48, 0.34));
}

.score-form input {
  border: 0;
  border-radius: 0;
}

.gameover-panel .primary-button,
.gameover-panel .ghost-button,
.score-form .primary-button {
  width: 230px;
  min-width: 230px;
  min-height: 68px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: url("./assets/gameover/ui/button-primary.png") center / 100% 100% no-repeat;
  box-shadow: none;
  color: #f7f3ec;
  font-family: var(--font-display);
  font-size: clamp(19px, 1.45vw, 25px);
  font-weight: 400;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.8), 0 0 12px rgba(255, 255, 255, 0.18);
  white-space: nowrap;
}

.gameover-panel .button-row {
  display: grid;
  grid-template-columns: repeat(3, 230px);
  justify-content: space-between;
  gap: 18px;
  margin-top: 4px;
}

.gameover-panel .ghost-button {
  background-image: url("./assets/gameover/ui/button-secondary.png");
}

.submit-message {
  min-height: 6px;
  color: var(--amber);
}

.ranking-modal {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 39, 32, 0.18), transparent 36%),
    rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}

.ranking-modal-card {
  width: min(940px, calc(100vw - 44px));
  max-height: min(76vh, 720px);
  overflow: hidden;
  padding: 34px 70px 38px;
  background:
    linear-gradient(180deg, rgba(7, 8, 10, 0.7), rgba(7, 8, 10, 0.94)),
    url("./assets/gameover/ui/result-panel.png") center / 100% 100% no-repeat;
}

.ranking-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(650px, 100%);
  margin-right: auto;
  margin-left: auto;
  margin-bottom: 18px;
}

.ranking-modal h3 {
  margin: 0;
  color: #f5f3ef;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 400;
}

.ranking-modal .ghost-button {
  width: 106px;
  min-width: 106px;
  min-height: 48px;
  border: 0;
  background: url("./assets/gameover/ui/button-secondary.png") center / 100% 100% no-repeat;
  color: var(--text);
  font-family: var(--font-display);
}

.ranking-modal .ranking-list {
  width: min(650px, 100%);
  max-height: min(54vh, 520px);
  overflow: auto;
  margin: 0 auto;
}

.ranking-modal .ranking-row,
.ranking-head {
  grid-template-columns: 52px 140px 96px 96px 70px;
  width: min(650px, 100%);
  min-height: 44px;
  padding: 8px 10px;
  font-size: 15px;
}

.ranking-head {
  margin-right: auto;
  margin-left: auto;
  color: rgba(244, 247, 251, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  font-family: var(--font-display);
}

.ranking-panel,
.leaderboard-header,
.ranking-list {
  width: min(1100px, 100%);
  margin: 18px auto 0;
}

.ranking-panel {
  padding: 20px;
}

.leaderboard-header {
  margin-top: 8px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 58px minmax(140px, 1fr) 110px 130px 92px;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-ui);
}

.ranking-row.highlight {
  background: rgba(255, 204, 74, 0.1);
  color: var(--amber);
}

.ranking-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .screen {
    padding: 14px;
  }

  .gameover-screen {
    overflow: hidden;
    height: 100vh;
    min-height: 100vh;
  }

  .gameover-layout {
    grid-template-columns: 1fr;
    height: 100%;
    min-height: 0;
    align-content: center;
    gap: 0;
  }

  .select-arena {
    grid-template-columns: minmax(250px, 0.96fr) minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    height: 100%;
  }

  .selected-character-panel {
    grid-template-columns: 1fr;
    height: 100%;
    min-height: 0;
  }

  .select-header h1 {
    font-size: clamp(30px, 8vw, 44px);
  }

  .select-header {
    margin-bottom: 6px;
  }

  .select-header p {
    margin-top: 4px;
    font-size: 16px;
  }

  .character-roster {
    grid-template-columns: 1fr;
    gap: 4px;
    align-content: start;
    max-width: none;
    width: 100%;
    margin: 0 auto;
  }

  .roster-image-button img {
    max-height: calc((100vh - 112px) / 4);
    object-fit: contain;
  }

  .fighter-stage {
    height: 100%;
    min-height: 0;
  }

  .fighter-info {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(100%, 300px);
    min-height: 0;
    padding: 14px;
    gap: 7px;
    font-size: 12px;
    background:
      linear-gradient(135deg, rgba(255, 51, 79, 0.18), transparent 50%),
      rgba(0, 0, 0, 0.66);
  }

  .fighter-info .quote {
    font-size: 13px;
    line-height: 1.35;
  }

  .fighter-info h3 {
    font-size: 20px;
  }

  .fighter-info dl {
    gap: 5px;
    margin-top: 0;
  }

  .fighter-info dl div {
    grid-template-columns: 54px 1fr;
    padding-bottom: 5px;
  }

  .panel-label {
    font-size: 14px;
  }

  .nameplate-image {
    width: min(100%, 260px);
  }

  .game-start-image-button {
    width: min(210px, 100%);
    margin-top: 4px;
  }

  .gameover-layout {
    grid-template-columns: 1fr;
  }

  .gameover-portrait {
    position: absolute;
    z-index: 0;
    inset: 0;
    height: 100%;
    min-height: 0;
    opacity: 0.42;
    place-items: start center;
    pointer-events: none;
  }

  .gameover-portrait img {
    width: auto;
    height: min(78vh, 720px);
    transform: translateY(-6%);
  }

  .gameover-panel {
    z-index: 2;
    width: min(100%, 660px);
    min-height: 0;
    margin: 0 auto;
    padding: 30px 34px;
  }

  .gameover-panel .eyebrow,
  .gameover-panel h2,
  .gameover-panel .quote,
  .gameover-panel .result-stats,
  .gameover-panel .score-form,
  .gameover-panel .submit-message,
  .gameover-panel .button-row {
    width: min(100%, 476px);
    margin-left: 0;
    margin-right: auto;
    transform: none;
  }

  .gameover-panel h2 {
    font-size: clamp(42px, 9vw, 56px);
    text-align: center;
  }

  .gameover-panel .quote {
    margin: 8px 0 12px;
    font-size: 15px;
  }

  .result-stats {
    gap: 6px 8px;
    margin: 10px 0;
  }

  .stat {
    min-height: 58px;
    padding: 10px 14px;
    font-size: 13px;
  }

  .stat strong {
    font-size: 22px;
  }

  .stat:nth-child(5) {
    width: 100%;
  }

  .gameover-panel .score-form {
    grid-template-columns: 1fr 150px;
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 0;
  }

  .gameover-panel .primary-button,
  .gameover-panel .ghost-button,
  .score-form .primary-button {
    width: 150px;
    min-width: 150px;
    min-height: 62px;
    font-size: 16px;
  }

  .gameover-panel .button-row {
    grid-template-columns: repeat(3, 150px);
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
  }

  .gameover-panel .submit-message {
    min-height: 4px;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 12px;
  }

  .ranking-row {
    grid-template-columns: 44px 72px 72px 82px 64px;
    gap: 6px;
    font-size: 12px;
  }

  .ranking-modal-card {
    width: min(560px, calc(100vw - 24px));
    padding: 28px 24px 32px;
  }

  .ranking-modal-header,
  .ranking-modal .ranking-list,
  .ranking-modal .ranking-row,
  .ranking-head {
    width: min(420px, 100%);
  }

  .ranking-modal .ranking-row,
  .ranking-head {
    grid-template-columns: 38px 74px 64px 70px 54px;
    gap: 4px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .ranking-modal .ghost-button {
    width: 88px;
    min-width: 88px;
    min-height: 42px;
  }

  .input-panel,
  .score-form {
    grid-template-columns: 1fr;
  }

  .lives {
    text-align: left;
  }
}
