:root {
  --bg-obsidian: #0f0c11;
  --lacquer: rgba(18, 13, 18, 0.84);
  --lacquer-deep: rgba(14, 10, 15, 0.92);
  --gold: #eab952;
  --gold-bright: #ffe294;
  --gold-dim: rgba(234, 185, 82, 0.35);
  --parchment: #f4ead5;
  --parchment-muted: #c8bca4;
  --tiger: #e8453c;
  --crane: #2dd4a8;
  --dragon: #f2b838;
  --font-display: 'Cinzel', Georgia, serif;
  --font-kanji: 'Noto Serif SC', 'Songti SC', Georgia, serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-obsidian);
  color: var(--parchment);
  font-family: var(--font-ui);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #140f14;
}

#arena-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.vignette-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 56%,
    rgba(10, 6, 12, 0.56) 100%
  );
  z-index: 2;
}

/* ==================== TOP HUD ==================== */
.top-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 16px;
  padding: 14px 24px 10px;
  background: linear-gradient(180deg, rgba(12, 8, 14, 0.84) 0%, rgba(12, 8, 14, 0.35) 70%, transparent 100%);
  pointer-events: none;
}

.top-hud > * {
  pointer-events: auto;
}

.fighter-hud {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fighter-hud--cpu {
  justify-content: flex-end;
}

.fighter-badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-kanji);
  font-size: 26px;
  font-weight: 900;
  border: 2px solid var(--gold);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
}

.fighter-badge--player {
  background: radial-gradient(circle at 30% 30%, #d93b32, #6e1513);
  color: #fff2d6;
  box-shadow: 0 0 20px rgba(232, 69, 60, 0.45);
}

.fighter-badge--cpu {
  background: radial-gradient(circle at 30% 30%, #24404a, #101620);
  color: #88ffe0;
  border-color: #46c9a5;
  box-shadow: 0 0 20px rgba(45, 212, 168, 0.35);
}

.fighter-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fighter-meta--right {
  align-items: flex-end;
}

.fighter-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fighter-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--parchment);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
}

.fighter-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(232, 69, 60, 0.28);
  border: 1px solid rgba(232, 69, 60, 0.6);
  color: #ffb8b2;
  white-space: nowrap;
}

.fighter-tag--cpu {
  background: rgba(45, 212, 168, 0.2);
  border-color: rgba(45, 212, 168, 0.55);
  color: #9bfce2;
}

.victory-orbs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.orb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(20, 16, 22, 0.75);
  border: 2px solid rgba(234, 185, 82, 0.45);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  transition: transform 0.35s cubic-bezier(0.22, 1.4, 0.36, 1), background 0.3s, box-shadow 0.3s;
}

.orb.lit--player {
  background: radial-gradient(circle at 35% 30%, #fff0b8, #e8453c 65%, #8a1612);
  border-color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(232, 69, 60, 0.85), 0 0 6px #ffd97a;
  transform: scale(1.18);
}

.orb.lit--cpu {
  background: radial-gradient(circle at 35% 30%, #d8fff4, #2dd4a8 65%, #116652);
  border-color: #a8ffea;
  box-shadow: 0 0 14px rgba(45, 212, 168, 0.85), 0 0 6px #b5ffec;
  transform: scale(1.18);
}

.score-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  color: var(--gold-bright);
  min-width: 18px;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.center-hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.game-emblem-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.22em;
  color: var(--gold-bright);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85), 0 0 18px rgba(234, 185, 82, 0.35);
}

.round-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 4px 14px;
  border-radius: 99px;
  background: rgba(16, 11, 18, 0.76);
  border: 1px solid var(--gold-dim);
  color: var(--parchment);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.round-pill.sudden {
  background: rgba(145, 18, 30, 0.85);
  border-color: #ff7c7c;
  color: #fff2cc;
  box-shadow: 0 0 18px rgba(232, 69, 60, 0.65);
}

.hud-tools {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.icon-btn {
  background: rgba(18, 13, 20, 0.65);
  border: 1px solid rgba(234, 185, 82, 0.28);
  color: var(--parchment-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(6px);
}

.icon-btn:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
  background: rgba(34, 24, 34, 0.85);
}

/* ==================== CINEMATIC BATTLE CALLOUT ==================== */
.battle-callout {
  position: absolute;
  top: 108px;
  left: 50%;
  transform: translateX(-50%) scale(1);
  z-index: 12;
  text-align: center;
  pointer-events: none;
  padding: 10px 28px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, transparent, rgba(14, 9, 16, 0.82) 18%, rgba(14, 9, 16, 0.82) 82%, transparent);
  border-top: 1px solid rgba(234, 185, 82, 0.45);
  border-bottom: 1px solid rgba(234, 185, 82, 0.45);
  transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.22, 1.35, 0.36, 1);
  min-width: 360px;
}

.battle-callout.hidden {
  opacity: 0;
  transform: translateX(-50%) scale(0.88);
}

.callout-round-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 2px;
}

.callout-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  letter-spacing: 0.1em;
  color: #fff6df;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.95), 0 0 22px var(--callout-glow, rgba(234, 185, 82, 0.7));
}

.callout-detail {
  font-size: 13px;
  color: #e8dcc6;
  margin-top: 3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

/* ==================== PLANNING DOCK ==================== */
.planning-dock {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(1140px, calc(100vw - 28px));
  z-index: 15;
  background: linear-gradient(180deg, rgba(22, 15, 22, 0.88) 0%, rgba(12, 9, 14, 0.94) 100%);
  border: 1px solid rgba(234, 185, 82, 0.42);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 232, 175, 0.16);
  backdrop-filter: blur(12px);
  padding: 12px 16px 14px;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.planning-dock.dock-hidden {
  transform: translate(-50%, 120%);
  opacity: 0;
  pointer-events: none;
}

.planning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(234, 185, 82, 0.16);
}

.triangle-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 600;
}

.legend-chip {
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}

.legend-chip--tiger {
  background: rgba(232, 69, 60, 0.22);
  color: #ff9c94;
  border: 1px solid rgba(232, 69, 60, 0.45);
}

.legend-chip--crane {
  background: rgba(45, 212, 168, 0.18);
  color: #88ffe0;
  border: 1px solid rgba(45, 212, 168, 0.42);
}

.legend-chip--dragon {
  background: rgba(242, 184, 56, 0.2);
  color: #ffe38f;
  border: 1px solid rgba(242, 184, 56, 0.45);
}

.legend-arrow {
  color: var(--parchment-muted);
  font-size: 11px;
}

.legend-divider {
  color: rgba(234, 185, 82, 0.35);
  margin: 0 4px;
}

.legend-tie {
  color: var(--parchment-muted);
  font-size: 11px;
}

.cpu-sealed-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  color: #a6f2de;
  background: rgba(16, 46, 42, 0.55);
  border: 1px solid rgba(45, 212, 168, 0.35);
  padding: 4px 11px;
  border-radius: 99px;
}

.wax-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e8453c;
  box-shadow: 0 0 8px #e8453c;
  animation: pulse-wax 2s ease-in-out infinite;
}

@keyframes pulse-wax {
  0%, 100% { opacity: 0.7; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.25); }
}

.planning-body {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

/* 3 Move Cards */
.move-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.move-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.035);
  color: var(--parchment);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  position: relative;
  overflow: hidden;
}

.move-card:hover {
  transform: translateY(-2px);
}

.move-card:active {
  transform: translateY(0) scale(0.985);
}

.move-card--tiger {
  border-color: rgba(232, 69, 60, 0.42);
  background: linear-gradient(135deg, rgba(232, 69, 60, 0.14), rgba(20, 12, 15, 0.65));
}
.move-card--tiger:hover {
  border-color: #ff7a6b;
  box-shadow: 0 6px 24px rgba(232, 69, 60, 0.35);
}

.move-card--crane {
  border-color: rgba(45, 212, 168, 0.4);
  background: linear-gradient(135deg, rgba(45, 212, 168, 0.13), rgba(11, 22, 22, 0.65));
}
.move-card--crane:hover {
  border-color: #7dffe0;
  box-shadow: 0 6px 24px rgba(45, 212, 168, 0.32);
}

.move-card--dragon {
  border-color: rgba(242, 184, 56, 0.42);
  background: linear-gradient(135deg, rgba(242, 184, 56, 0.14), rgba(16, 16, 28, 0.68));
}
.move-card--dragon:hover {
  border-color: #ffe28a;
  box-shadow: 0 6px 24px rgba(242, 184, 56, 0.34);
}

.move-card-art {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.move-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.move-key-hint {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(12, 10, 14, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--gold-bright);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.move-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.move-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.move-kanji {
  font-family: var(--font-kanji);
  font-size: 17px;
  font-weight: 900;
}

.move-card--tiger .move-kanji { color: #ff7c70; }
.move-card--crane .move-kanji { color: #72ffdb; }
.move-card--dragon .move-kanji { color: #ffdd78; }

.move-card-sub {
  font-size: 11px;
  color: var(--parchment-muted);
}

.move-card-matchup {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 600;
}

.beats-tag { color: #9cf2b6; }
.loses-tag { color: #e89b9b; opacity: 0.85; }

/* 5-Round Sequence Bar */
.sequence-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.sequence-slots-wrap {
  flex: 1;
  min-width: 340px;
}

.sequence-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-bottom: 6px;
}

.sequence-hint {
  font-weight: 500;
  color: var(--parchment-muted);
  letter-spacing: 0.03em;
}

.sequence-slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.seq-slot {
  height: 58px;
  border-radius: 10px;
  border: 1.5px dashed rgba(234, 185, 82, 0.32);
  background: rgba(255, 255, 255, 0.025);
  color: var(--parchment-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 8px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.seq-slot.active-next {
  border-style: solid;
  border-color: var(--gold-bright);
  background: rgba(234, 185, 82, 0.1);
  box-shadow: 0 0 16px rgba(234, 185, 82, 0.24);
}

.seq-slot.filled {
  border-style: solid;
  justify-content: flex-start;
  background: rgba(22, 16, 24, 0.85);
}

.seq-slot.filled--tiger { border-color: rgba(232, 69, 60, 0.75); }
.seq-slot.filled--crane { border-color: rgba(45, 212, 168, 0.72); }
.seq-slot.filled--dragon { border-color: rgba(242, 184, 56, 0.75); }

.seq-slot:hover {
  transform: translateY(-2px);
}

.slot-round-badge {
  position: absolute;
  top: -8px;
  left: 8px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 1px 6px;
  border-radius: 4px;
  background: #1b141d;
  border: 1px solid rgba(234, 185, 82, 0.45);
  color: var(--gold-bright);
}

.slot-empty-text {
  font-size: 11px;
  opacity: 0.62;
}

.slot-thumb {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.slot-move-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}

.slot-move-name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--parchment);
}

.slot-move-kanji {
  font-size: 10px;
  color: var(--parchment-muted);
}

/* Action Buttons */
.sequence-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.secondary-btn {
  height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(234, 185, 82, 0.34);
  background: rgba(28, 20, 30, 0.78);
  color: var(--parchment);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  border-color: var(--gold-bright);
  background: rgba(46, 33, 46, 0.9);
  color: var(--gold-bright);
}

.fight-btn {
  height: 58px;
  padding: 0 28px;
  border-radius: 12px;
  border: 2px solid rgba(234, 185, 82, 0.35);
  background: rgba(64, 24, 24, 0.48);
  color: rgba(244, 234, 213, 0.42);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: not-allowed;
  transition: all 0.25s ease;
}

.fight-btn:not(:disabled),
.fight-btn--ready {
  cursor: pointer;
  border-color: var(--gold-bright);
  background: linear-gradient(135deg, #d9342b 0%, #9c1a16 60%, #751010 100%);
  color: #fff6dc;
  box-shadow: 0 0 28px rgba(232, 69, 60, 0.6), 0 6px 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 232, 165, 0.55);
  animation: fight-pulse 1.9s ease-in-out infinite;
}

.fight-btn:not(:disabled):hover,
.fight-btn--ready:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 38px rgba(255, 130, 64, 0.8), 0 10px 26px rgba(0, 0, 0, 0.65);
}

@keyframes fight-pulse {
  0%, 100% { box-shadow: 0 0 24px rgba(232, 69, 60, 0.55), 0 6px 18px rgba(0, 0, 0, 0.6); }
  50% { box-shadow: 0 0 38px rgba(242, 184, 56, 0.78), 0 6px 22px rgba(0, 0, 0, 0.65); }
}

.fight-btn-kanji {
  font-family: var(--font-kanji);
  font-size: 24px;
  font-weight: 900;
  color: var(--gold-bright);
}

.fight-btn-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

/* ==================== LIVE BATTLE STRIP ==================== */
.battle-strip {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 14;
  width: min(980px, calc(100vw - 28px));
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.battle-strip.hidden {
  opacity: 0;
  transform: translate(-50%, 36px);
  pointer-events: none;
}

.battle-strip-track {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.round-chip {
  flex: 1;
  min-width: 146px;
  max-width: 190px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(16, 11, 18, 0.82);
  border: 1px solid rgba(234, 185, 82, 0.25);
  backdrop-filter: blur(10px);
  transition: all 0.28s ease;
}

.round-chip.current {
  border-color: var(--gold-bright);
  background: rgba(34, 22, 28, 0.92);
  box-shadow: 0 0 22px rgba(234, 185, 82, 0.35);
  transform: translateY(-4px) scale(1.03);
}

.round-chip.win {
  border-color: rgba(232, 69, 60, 0.68);
  background: rgba(48, 16, 20, 0.84);
}

.round-chip.loss {
  border-color: rgba(45, 212, 168, 0.62);
  background: rgba(14, 34, 34, 0.84);
}

.round-chip.tie {
  border-color: rgba(234, 220, 196, 0.5);
}

.round-chip.void {
  opacity: 0.42;
}

.round-chip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 6px;
}

.chip-status {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9.5px;
}

.chip-status--win { background: rgba(232, 69, 60, 0.35); color: #ffb3ad; }
.chip-status--loss { background: rgba(45, 212, 168, 0.3); color: #9effe6; }
.chip-status--tie { background: rgba(244, 234, 213, 0.2); color: #f4ead5; }
.chip-status--active { background: rgba(234, 185, 82, 0.28); color: var(--gold-bright); }

.round-chip-duel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.chip-move {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
}

.chip-move img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  object-fit: cover;
}

.chip-sealed {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2a212e, #151019);
  border: 1px solid rgba(234, 185, 82, 0.35);
  display: grid;
  place-items: center;
  font-family: var(--font-kanji);
  color: var(--gold);
  font-size: 13px;
}

.chip-vs {
  font-size: 10px;
  font-weight: 800;
  color: rgba(244, 234, 213, 0.45);
}

/* ==================== MODALS & VICTORY FANFARE ==================== */
.modal-backdrop,
.victory-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 6, 12, 0.56);
  backdrop-filter: blur(4px);
  transition: opacity 0.35s ease;
}

.victory-overlay {
  background: radial-gradient(circle at center, rgba(16, 10, 14, 0.24), rgba(10, 6, 12, 0.58));
  backdrop-filter: blur(1.5px);
}

.modal-backdrop.hidden,
.victory-overlay.hidden,
.hidden {
  display: none !important;
}

.scroll-modal,
.victory-card {
  position: relative;
  width: min(640px, 100%);
  padding: 26px 30px 24px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(28, 19, 26, 0.94) 0%, rgba(15, 11, 17, 0.96) 100%);
  border: 2px solid var(--gold);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.8), 0 0 40px rgba(234, 185, 82, 0.22);
  text-align: center;
  animation: modal-rise 0.42s cubic-bezier(0.22, 1.25, 0.36, 1);
}

@keyframes modal-rise {
  from { opacity: 0; transform: translateY(24px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--parchment-muted);
  font-size: 18px;
  cursor: pointer;
}
.modal-close:hover { color: var(--gold-bright); }

.sudden-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--gold-bright);
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid rgba(234, 185, 82, 0.45);
  background: rgba(234, 185, 82, 0.1);
  margin-bottom: 10px;
}

.modal-heading {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #fff4d6;
  margin-bottom: 8px;
}

.modal-sub {
  font-size: 13.5px;
  color: var(--parchment-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.sudden-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.sudden-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1.5px solid rgba(234, 185, 82, 0.4);
  background: rgba(255, 255, 255, 0.04);
  color: var(--parchment);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sudden-btn img {
  width: 76px;
  height: 76px;
  border-radius: 10px;
  object-fit: cover;
}

.sudden-btn span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
}

.sudden-btn small {
  font-size: 11px;
  color: var(--parchment-muted);
}

.sudden-btn--tiger:hover { border-color: var(--tiger); box-shadow: 0 0 22px rgba(232, 69, 60, 0.45); transform: translateY(-3px); }
.sudden-btn--crane:hover { border-color: var(--crane); box-shadow: 0 0 22px rgba(45, 212, 168, 0.45); transform: translateY(-3px); }
.sudden-btn--dragon:hover { border-color: var(--dragon); box-shadow: 0 0 22px rgba(242, 184, 56, 0.45); transform: translateY(-3px); }

/* Victory Card */
.victory-card {
  width: min(680px, 100%);
  background: linear-gradient(180deg, rgba(30, 19, 24, 0.88) 0%, rgba(14, 10, 16, 0.92) 100%);
}

.victory-card.defeat-theme {
  border-color: #46c9a5;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(45, 212, 168, 0.25);
}

.chop-seal {
  width: 72px;
  height: 72px;
  margin: -52px auto 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, #df3229, #8d1411);
  border: 3px solid var(--gold-bright);
  box-shadow: 0 8px 28px rgba(223, 50, 41, 0.65);
  display: grid;
  place-items: center;
  font-family: var(--font-kanji);
  font-size: 40px;
  font-weight: 900;
  color: #fff4d6;
  transform: rotate(-4deg);
}

.defeat-theme .chop-seal {
  background: linear-gradient(135deg, #217a67, #0f3a34);
  border-color: #9bfce2;
  box-shadow: 0 8px 28px rgba(45, 212, 168, 0.5);
}

.victory-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin-bottom: 4px;
}

.victory-headline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 36px;
  letter-spacing: 0.08em;
  color: #fff6de;
  text-shadow: 0 3px 20px rgba(234, 185, 82, 0.55);
}

.victory-scoreline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  color: var(--gold-bright);
  margin: 4px 0 6px;
}

.victory-subtitle {
  font-size: 13.5px;
  color: var(--parchment-muted);
  margin-bottom: 16px;
}

.victory-recap {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.recap-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-width: 98px;
}

.recap-pill--win { border-color: rgba(232, 69, 60, 0.65); background: rgba(232, 69, 60, 0.14); }
.recap-pill--loss { border-color: rgba(45, 212, 168, 0.6); background: rgba(45, 212, 168, 0.12); }
.recap-pill--tie { border-color: rgba(244, 234, 213, 0.35); }

.recap-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.recap-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
}

.recap-icons img {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  object-fit: cover;
}

.recap-outcome {
  font-size: 10px;
  font-weight: 700;
  color: var(--parchment);
}

.victory-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.restore-victory-btn {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  padding: 10px 22px;
  border-radius: 99px;
  border: 1.5px solid var(--gold);
  background: rgba(18, 12, 18, 0.88);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
}

/* Rules Modal */
.rules-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  margin: 14px 0 16px;
}

.rule-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rule-item img {
  width: 56px;
  height: 56px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}

.rule-item h3 {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--parchment);
  margin-bottom: 3px;
}

.rule-item h3 span {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  margin-left: 6px;
}

.rule-item p {
  font-size: 12.5px;
  color: var(--parchment-muted);
  line-height: 1.4;
}

.rules-foot {
  font-size: 12.5px;
  color: var(--parchment-muted);
  line-height: 1.5;
  padding-top: 10px;
  border-top: 1px solid rgba(234, 185, 82, 0.18);
}

@media (max-width: 860px) {
  .move-cards {
    grid-template-columns: 1fr;
  }
  .move-card-art {
    width: 48px;
    height: 48px;
  }
  .sequence-slots {
    grid-template-columns: repeat(5, minmax(56px, 1fr));
  }
  .slot-move-meta {
    display: none;
  }
  .fighter-name {
    font-size: 13px;
  }
  .game-emblem-title {
    font-size: 14px;
  }
}
