:root {
  --orange: #FF8A3D;
  --orange-deep: #E85B1E;
  --amber: #FFC24A;
  --cream: #FFF4E6;
  --ink: #2A1410;
  --slate: #4A5A86;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1A0D12;
  color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

body { position: fixed; inset: 0; }

.game { position: fixed; inset: 0; overflow: hidden; background: #2A1219; }

.court {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ---------------- HUD ---------------- */

.hud {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 10px) 14px 0;
  pointer-events: none;
}

.scoreboard {
  position: relative;
  width: 100%;
  max-width: 440px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px 9px;
  border-radius: 20px;
  background:
    radial-gradient(120% 190% at 0% 0%, rgba(255, 138, 61, 0.26), rgba(255, 138, 61, 0) 46%),
    radial-gradient(120% 190% at 100% 0%, rgba(94, 116, 180, 0.3), rgba(94, 116, 180, 0) 46%),
    linear-gradient(180deg, rgba(46, 22, 20, 0.9), rgba(18, 10, 16, 0.84));
  border: 1px solid rgba(255, 216, 177, 0.28);
  box-shadow:
    0 14px 32px rgba(18, 4, 8, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.scoreboard::before {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 138, 61, 0) 0%, #FF8A3D 22%, #FFC24A 50%, #8EA4DC 78%, rgba(94, 116, 180, 0) 100%);
  opacity: 0.9;
}

.scoreboard::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -34px;
  width: 78px;
  height: 116px;
  transform: rotate(18deg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.duelist {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.duelist-ai { justify-content: flex-end; }

.duelist-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}

.duelist-ai .duelist-body { align-items: flex-end; }

.portrait {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #2A1410;
  border: 2px solid rgba(255, 243, 220, 0.94);
  box-shadow:
    0 5px 12px rgba(10, 3, 5, 0.42),
    0 0 0 3px rgba(255, 138, 61, 0.16);
}

.portrait-ai { box-shadow: 0 5px 12px rgba(10, 3, 5, 0.42), 0 0 0 3px rgba(142, 164, 220, 0.16); }

.portrait canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.duelist-top { display: flex; align-items: center; gap: 4px; }

.duelist-ai .duelist-top { flex-direction: row-reverse; }

.duelist-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #FFF4E5;
  white-space: nowrap;
}

.duelist-tag {
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  color: #FFC58F;
  background: rgba(255, 138, 61, 0.16);
  border: 1px solid rgba(255, 138, 61, 0.34);
  white-space: nowrap;
}

.duelist-tag-ai { color: #BCCBF0; background: rgba(94, 116, 180, 0.2); border-color: rgba(142, 164, 220, 0.4); }

.duelist-scoreline { display: flex; align-items: baseline; gap: 2px; line-height: 1; }

.score-cap { font-size: 8px; font-weight: 600; color: rgba(255, 236, 212, 0.42); }

.score {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #FFF8EE;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.duelist-ai .score { color: #E7EDFF; }

.score.pop { animation: scorePop 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.35); }
@keyframes scorePop {
  0% { transform: scale(1); }
  45% { transform: scale(1.38); color: var(--amber); }
  100% { transform: scale(1); }
}

.pips {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
  height: 5px;
}

.pips-ai { flex-direction: row-reverse; }

.pips i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 236, 210, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 236, 210, 0.12);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.pips-you i.on {
  background: #FFC24A;
  box-shadow: 0 0 7px rgba(255, 194, 74, 0.85);
}

.pips-ai i.on {
  background: #AFC4F2;
  box-shadow: 0 0 7px rgba(175, 196, 242, 0.8);
}

.pips i.pop { animation: pipPop 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.4); }

@keyframes pipPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.7); }
  100% { transform: scale(1); }
}

.center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  min-width: 40px;
}

.vs {
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #FFF8EE;
  background: linear-gradient(180deg, #FFA95A, #E85B1E);
  box-shadow: 0 3px 8px rgba(210, 70, 18, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transform: skewX(-6deg);
}

.race {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: rgba(255, 238, 216, 0.52);
  transition: color 0.2s ease;
}

.race.hot { color: #FFC24A; font-weight: 800; }

.hud-badges {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--safe-top) + 16.8vh);
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 22px;
  padding: 0 16px;
  pointer-events: none;
}

.hud-slot { flex: 1 1 0; display: flex; align-items: center; min-width: 0; }
.hud-slot-l { justify-content: flex-start; }
.hud-slot-r { justify-content: flex-end; }

.match-point,
.rally-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transform: skewX(-5deg);
}

.match-point[hidden],
.rally-chip[hidden] { display: none; }

.match-point {
  color: #FFF7E9;
  background: linear-gradient(180deg, #FF9A4D 0%, #E84319 100%);
  border: 1px solid rgba(255, 225, 181, 0.72);
  box-shadow: 0 5px 14px rgba(224, 67, 17, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: matchPulse 1s ease-in-out infinite;
}

.match-point .mp-icon { width: 12px; height: 12px; }

@keyframes matchPulse {
  0%, 100% { box-shadow: 0 5px 14px rgba(224, 67, 17, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 0 0 rgba(255, 138, 61, 0.4); }
  50% { box-shadow: 0 5px 14px rgba(224, 67, 17, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 0 7px rgba(255, 138, 61, 0); }
}

.rally-chip {
  color: #FFE9C6;
  background: linear-gradient(180deg, rgba(70, 34, 26, 0.9), rgba(34, 18, 22, 0.9));
  border: 1px solid rgba(255, 194, 74, 0.36);
  box-shadow: 0 5px 14px rgba(14, 4, 8, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.rally-chip .mp-icon { width: 13px; height: 13px; color: #FFC24A; }
.rally-chip strong { font-size: 14px; line-height: 1; color: #FFD37A; font-variant-numeric: tabular-nums; }
.rally-chip.pop { animation: chipPop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.4); }

@keyframes chipPop {
  0% { transform: skewX(-5deg) scale(1); }
  45% { transform: skewX(-5deg) scale(1.16); }
  100% { transform: skewX(-5deg) scale(1); }
}

/* ---------------- Opening VS card ---------------- */

.duel-intro {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  text-align: center;
  transition: opacity 0.22s ease;
}

.duel-intro.show { animation: introShow 2.7s cubic-bezier(0.22, 0.8, 0.28, 1) forwards; }

.duel-intro::before {
  content: "";
  position: absolute;
  left: -18%;
  right: -18%;
  top: 50%;
  height: clamp(148px, 23vh, 208px);
  transform: translateY(-55%) skewY(-4deg);
  background: linear-gradient(90deg,
    rgba(232, 91, 30, 0) 0%,
    rgba(232, 91, 30, 0.42) 17%,
    rgba(255, 138, 61, 0.88) 37%,
    rgba(255, 194, 74, 0.94) 50%,
    rgba(94, 116, 180, 0.9) 64%,
    rgba(53, 65, 107, 0.48) 84%,
    rgba(53, 65, 107, 0) 100%);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
}

.duel-intro::after {
  content: "";
  position: absolute;
  left: -20%;
  right: -20%;
  top: 50%;
  height: clamp(148px, 23vh, 208px);
  transform: translateY(-55%) skewY(-4deg);
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.13) 0 1px, rgba(255, 255, 255, 0) 1px 22px);
  opacity: 0.5;
}

.intro-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0 20px;
  transform: translateY(-2px);
}

.intro-kicker {
  margin: 0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: rgba(255, 244, 224, 0.72);
  text-shadow: 0 2px 8px rgba(70, 24, 6, 0.6);
}

.intro-title {
  margin: 0;
  font-size: clamp(31px, 9.6vw, 44px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-indent: 0.06em;
  color: #FFF9EC;
  text-shadow:
    0 2px 0 rgba(122, 44, 10, 0.55),
    0 10px 26px rgba(60, 18, 4, 0.55);
}

.intro-faceoff {
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #FFF4DE;
  text-shadow: 0 2px 8px rgba(60, 18, 4, 0.65);
}

.intro-name-ai { color: #E4ECFF; }

.intro-vs {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.06em;
  color: #4A1B0A;
  background: linear-gradient(180deg, #FFF3D2, #FFC24A);
  box-shadow: 0 3px 10px rgba(74, 22, 4, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.intro-meta {
  margin: 1px 0 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(255, 242, 220, 0.72);
  text-shadow: 0 2px 8px rgba(60, 18, 4, 0.6);
}

@keyframes introShow {
  0% { opacity: 0; transform: scale(1.05); }
  12% { opacity: 1; transform: scale(1); }
  72% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.015); }
}


.rally {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #FFE4BC;
  background: rgba(28, 13, 15, 0.62);
  border: 1px solid rgba(255, 198, 120, 0.24);
  box-shadow: 0 5px 14px rgba(16, 4, 8, 0.28);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.rally[hidden] { display: none; }
.rally .mp-icon { width: 13px; height: 13px; color: var(--amber); }

.court-call {
  position: fixed;
  left: 50%;
  top: 55%;
  z-index: 4;
  margin: 0;
  padding: 0 18px;
  transform: translate(-50%, -50%);
  font-size: clamp(17px, 4.8vw, 22px);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #FFF8EC;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  text-shadow:
    0 2px 0 rgba(120, 42, 12, 0.55),
    0 8px 26px rgba(0, 0, 0, 0.55);
  transition: opacity 0.22s ease;
}

.court-call.show { opacity: 1; animation: callFloat 1.5s ease-in-out infinite; }
@keyframes callFloat {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, calc(-50% - 5px)); }
}

.toast {
  position: fixed;
  left: 50%;
  top: 37%;
  z-index: 7;
  margin: 0;
  transform: translate(-50%, -50%) scale(0.7);
  font-size: clamp(28px, 8.4vw, 40px);
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #FFF7E8;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  text-shadow:
    0 3px 0 #C94A17,
    0 0 30px rgba(255, 138, 61, 0.65),
    0 12px 30px rgba(0, 0, 0, 0.35);
}

.toast.show { animation: toastPop 1.35s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes toastPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.62) rotate(-3deg); }
  16% { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(1deg); }
  28% { transform: translate(-50%, -50%) scale(0.98) rotate(0deg); }
  62% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(1.04); }
}

/* ---------------- Controls ---------------- */

.controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-bottom) + 16px);
  z-index: 6;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px;
  pointer-events: none;
}

.hint {
  margin: 0;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 11px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 241, 224, 0.84);
  background: rgba(30, 14, 16, 0.5);
  border: 1px solid rgba(255, 225, 193, 0.18);
  box-shadow: 0 6px 16px rgba(12, 3, 6, 0.24);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.hint.gone { opacity: 0; transform: translateY(6px); }

.swing {
  pointer-events: auto;
  width: 86px;
  height: 86px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 235, 208, 0.92);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #FFF9F0;
  background: radial-gradient(circle at 34% 27%, #FFC24A 0%, #FF8A3D 44%, #E85B1E 100%);
  box-shadow:
    0 12px 26px rgba(204, 66, 16, 0.44),
    inset 0 3px 8px rgba(255, 255, 255, 0.4),
    inset 0 -7px 12px rgba(150, 44, 9, 0.32);
  font-family: inherit;
  cursor: pointer;
  touch-action: none;
  transition: transform 0.09s ease, box-shadow 0.09s ease;
}

.swing:active,
.swing.pressed {
  transform: scale(0.93);
  box-shadow:
    0 6px 14px rgba(204, 66, 16, 0.4),
    inset 0 4px 10px rgba(130, 38, 8, 0.35);
}

.swing.ready {
  animation: swingReady 0.85s ease-in-out infinite;
}

@keyframes swingReady {
  0%, 100% {
    box-shadow:
      0 12px 26px rgba(204, 66, 16, 0.44),
      inset 0 3px 8px rgba(255, 255, 255, 0.4),
      inset 0 -7px 12px rgba(150, 44, 9, 0.32),
      0 0 0 0 rgba(255, 205, 120, 0.5);
  }
  50% {
    box-shadow:
      0 12px 26px rgba(204, 66, 16, 0.44),
      inset 0 3px 8px rgba(255, 255, 255, 0.4),
      inset 0 -7px 12px rgba(150, 44, 9, 0.32),
      0 0 0 11px rgba(255, 205, 120, 0);
  }
}

.swing.smash {
  background: radial-gradient(circle at 34% 27%, #FFE49A 0%, #FF9C3F 42%, #E84319 100%);
  border-color: #FFF3CF;
}

.swing.smash span {
  letter-spacing: 0.2em;
  text-shadow: 0 1px 4px rgba(130, 36, 8, 0.4);
}

.swing .mp-icon {
  width: 33px;
  height: 33px;
  filter: drop-shadow(0 2px 2px rgba(120, 40, 8, 0.28));
}

.swing span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
}

/* ---------------- Result ---------------- */

.result {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 34%, rgba(96, 33, 14, 0.5), rgba(14, 6, 9, 0.84));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.3s ease;
}

.result[hidden] { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.result-card {
  position: relative;
  width: min(86vw, 360px);
  padding: 26px 24px 22px;
  overflow: hidden;
  border-radius: 28px;
  text-align: center;
  color: var(--ink);
  background: linear-gradient(180deg, #FFF9EF 0%, #FFE9CB 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 32px 70px rgba(16, 4, 8, 0.55),
    inset 0 2px 0 rgba(255, 255, 255, 0.9);
  animation: cardIn 0.42s cubic-bezier(0.18, 0.9, 0.28, 1.18);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.result-card::before {
  content: "";
  position: absolute;
  left: -20%;
  right: -20%;
  top: -48%;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(255, 194, 74, 0.5), rgba(255, 138, 61, 0) 68%);
  pointer-events: none;
}

.result-badge {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #FFF9EF;
  border: 3px solid #FFF6E4;
  background: radial-gradient(circle at 35% 28%, #FFC24A, #FF8A3D 55%, #E85B1E);
  box-shadow: 0 12px 24px rgba(224, 82, 25, 0.34), inset 0 2px 6px rgba(255, 255, 255, 0.5);
}

.result-badge.lose {
  background: radial-gradient(circle at 35% 28%, #B8C6E8, #6879AE 60%, #3D4A74);
  box-shadow: 0 12px 24px rgba(45, 58, 100, 0.35), inset 0 2px 6px rgba(255, 255, 255, 0.4);
}

.result-badge .mp-icon { width: 40px; height: 40px; }

.result-card h2 {
  position: relative;
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: #3A1A12;
}

.result-sub {
  position: relative;
  margin: 7px 0 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #8A4A2A;
  font-variant-numeric: tabular-nums;
}

.result-line {
  position: relative;
  height: 1px;
  margin: 18px 12px 14px;
  background: linear-gradient(90deg, transparent, rgba(138, 74, 42, 0.25), transparent);
}

.result-stat {
  position: relative;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #96613F;
}

.result-stat strong {
  font-size: 18px;
  color: #E85B1E;
  font-variant-numeric: tabular-nums;
  margin: 0 2px;
}

.again {
  position: relative;
  width: 100%;
  height: 52px;
  margin-top: 20px;
  border: 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #FFF9F0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #FFA452 0%, #F06A22 100%);
  box-shadow: 0 9px 18px rgba(216, 80, 24, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition: transform 0.08s ease;
}

.again .mp-icon { width: 21px; height: 21px; }
.again:active { transform: translateY(1px) scale(0.99); }

@media (max-height: 700px) {
  .swing { width: 74px; height: 74px; }
  .swing .mp-icon { width: 29px; height: 29px; }
  .hint { font-size: 10px; padding: 7px 10px; }
  .score { font-size: 21px; }
  .portrait { width: 36px; height: 36px; }
  .duelist-name { font-size: 10px; }
  .result-card { padding: 22px 22px 18px; }
  .result-badge { width: 64px; height: 64px; margin-bottom: 9px; }
  .result-badge .mp-icon { width: 34px; height: 34px; }
  .result-card h2 { font-size: 25px; }
  .again { height: 48px; margin-top: 16px; }
}

@media (max-width: 340px) {
  .hud { padding-left: 10px; padding-right: 10px; }
  .controls { padding: 0 12px; }
  .duelist-name { font-size: 10px; }
  .scoreboard { padding: 6px 7px; }
  .portrait { width: 34px; height: 34px; }
  .duelist-tag { display: none; }
  .pips { gap: 2px; }
  .pips i { width: 4px; height: 4px; }
  .swing { width: 72px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .court-call.show { animation: none; }
  .duel-intro.show { animation: introFade 1.8s ease forwards; }
  .match-point { animation: none; }
  @keyframes introFade {
    0% { opacity: 0; }
    20% { opacity: 1; }
    76% { opacity: 1; }
    100% { opacity: 0; }
  }
  .score.pop { animation: none; }
  .result-card { animation: none; }
  .toast.show { animation: toastFade 1.1s ease forwards; }
  @keyframes toastFade {
    0% { opacity: 0; }
    12% { opacity: 1; }
    74% { opacity: 1; }
    100% { opacity: 0; }
  }
}
