:root {
  color-scheme: dark;
  --void: #03070b;
  --ink: #071017;
  --panel: rgba(10, 21, 28, 0.88);
  --panel-strong: rgba(14, 28, 36, 0.97);
  --line: rgba(133, 234, 229, 0.18);
  --line-strong: rgba(112, 255, 177, 0.48);
  --mint: #70ffb1;
  --cyan: #32d9ff;
  --red: #ff4a40;
  --orange: #ffa629;
  --white: #eafdf8;
  --muted: #78969a;
  --steel: #1b2c33;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--void);
}

body {
  color: var(--white);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

.app-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(rgba(3, 9, 13, 0.3), rgba(3, 9, 13, 0.94)),
    repeating-linear-gradient(90deg, transparent 0 95px, rgba(66, 205, 186, 0.035) 96px),
    repeating-linear-gradient(0deg, transparent 0 95px, rgba(66, 205, 186, 0.025) 96px),
    radial-gradient(circle at 52% 42%, #11242b 0, #071118 36%, #03070b 76%);
}

.app-shell::after {
  position: absolute;
  z-index: 100;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.17;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 50%, transparent 50%);
  background-size: 100% 4px;
  mix-blend-mode: overlay;
}

.ambient-layer {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-orb {
  position: absolute;
  width: 44vw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.13;
}

.ambient-orb--red {
  top: -22vw;
  left: -15vw;
  background: var(--red);
}

.ambient-orb--cyan {
  right: -16vw;
  bottom: -26vw;
  background: var(--cyan);
}

.data-line {
  position: absolute;
  width: 1px;
  height: 160%;
  background: linear-gradient(transparent, var(--mint), transparent);
  opacity: 0.14;
  transform: rotate(28deg);
}

.data-line--one {
  top: -30%;
  left: 27%;
}

.data-line--two {
  top: -20%;
  right: 18%;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
}

.screen.is-active {
  display: flex;
}

.eyebrow {
  margin: 0;
  color: var(--mint);
  font: 700 0.72rem/1.3 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.brand-lockup,
.game-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--white);
  text-decoration: none;
}

.brand-lockup strong,
.game-brand strong {
  display: block;
  font: 800 0.85rem/1.15 var(--mono);
  letter-spacing: 0.08em;
}

.brand-lockup small,
.game-brand small {
  display: block;
  margin-top: 0.22rem;
  color: var(--muted);
  font: 600 0.65rem/1 var(--mono);
  letter-spacing: 0.12em;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(112, 255, 177, 0.55);
  color: var(--mint);
  font-weight: 900;
  background: linear-gradient(145deg, rgba(112, 255, 177, 0.12), rgba(3, 8, 11, 0.8));
  box-shadow: inset 0 0 20px rgba(112, 255, 177, 0.08), 0 0 20px rgba(112, 255, 177, 0.1);
  clip-path: polygon(14% 0, 86% 0, 100% 14%, 100% 86%, 86% 100%, 14% 100%, 0 86%, 0 14%);
}

.brand-mark--small {
  width: 34px;
  height: 34px;
  font-size: 0.85rem;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  color: #bfe2df;
  background: rgba(8, 18, 24, 0.74);
  cursor: pointer;
  transition: 160ms ease;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--mint);
  background: rgba(21, 51, 52, 0.64);
  transform: translateY(-1px);
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 48px;
  border: 0;
  cursor: pointer;
  transition: 180ms ease;
}

.primary-button {
  position: relative;
  display: inline-flex;
  min-width: 220px;
  padding: 0.78rem 1.15rem;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  overflow: hidden;
  color: #03110c;
  background: linear-gradient(100deg, #54eca0, #8affc1 60%, #c0ffdb);
  box-shadow: 0 12px 36px rgba(63, 235, 157, 0.18);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.primary-button::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.62) 48%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 500ms ease;
}

.primary-button:hover::before {
  transform: translateX(120%);
}

.primary-button:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 16px 46px rgba(63, 235, 157, 0.27);
}

.primary-button span,
.primary-button small,
.primary-button i {
  position: relative;
  z-index: 1;
}

.primary-button span {
  font-weight: 900;
  letter-spacing: 0.08em;
}

.primary-button small {
  font: 700 0.58rem var(--mono);
  letter-spacing: 0.12em;
  opacity: 0.62;
}

.primary-button i {
  margin-left: auto;
  font: 400 1.6rem/1 var(--mono);
}

.secondary-button {
  display: inline-flex;
  padding: 0.7rem 1.1rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid rgba(115, 190, 190, 0.3);
  color: #c7e4e1;
  background: rgba(8, 18, 24, 0.72);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.secondary-button:hover {
  border-color: var(--mint);
  color: var(--white);
  background: rgba(20, 48, 49, 0.78);
  transform: translateY(-2px);
}

.text-button {
  color: #78969a;
  background: transparent;
}

.text-button:hover {
  color: var(--red);
}

.button-symbol {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid currentColor;
  font: 800 0.75rem var(--mono);
  border-radius: 50%;
}

/* Loading */
.loading-screen {
  position: absolute;
  z-index: 200;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center, rgba(20, 55, 54, 0.42), transparent 34%),
    #03070b;
  transition: opacity 450ms ease, visibility 450ms ease;
}

.loading-screen.is-active {
  display: flex;
}

.loading-screen.is-complete {
  opacity: 0;
  visibility: hidden;
}

.loading-screen h1 {
  margin: 0.6rem 0 0;
  font-size: clamp(2rem, 5vw, 3.8rem);
  letter-spacing: 0.32em;
  text-indent: 0.32em;
}

.loading-core {
  position: relative;
  display: grid;
  width: 130px;
  height: 130px;
  margin-bottom: 2rem;
  place-items: center;
}

.loading-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid transparent;
}

.loading-ring--outer {
  inset: 0;
  border-top-color: var(--mint);
  border-right-color: rgba(112, 255, 177, 0.3);
  animation: spin 2.2s linear infinite;
}

.loading-ring--inner {
  inset: 18px;
  border-bottom-color: var(--cyan);
  border-left-color: rgba(50, 217, 255, 0.35);
  animation: spin-reverse 1.45s linear infinite;
}

.loading-glyph {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 1px solid rgba(112, 255, 177, 0.4);
  color: var(--mint);
  font-size: 1.8rem;
  background: rgba(112, 255, 177, 0.06);
  box-shadow: 0 0 36px rgba(112, 255, 177, 0.15), inset 0 0 30px rgba(112, 255, 177, 0.08);
  transform: rotate(45deg);
}

.loading-glyph::first-letter {
  transform: rotate(-45deg);
}

.loading-status {
  margin: 1.6rem 0 0.65rem;
  color: #8eaaa9;
  font: 600 0.72rem var(--mono);
  letter-spacing: 0.12em;
}

.loading-track {
  width: min(330px, 72vw);
  height: 3px;
  overflow: hidden;
  background: rgba(119, 178, 177, 0.14);
}

.loading-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--cyan));
  box-shadow: 0 0 14px var(--mint);
  transition: width 220ms ease;
}

.loading-percent {
  margin-top: 0.6rem;
  color: var(--mint);
  font: 700 0.65rem var(--mono);
}

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

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

/* Home */
.home-screen {
  flex-direction: column;
  padding: clamp(1rem, 2.4vw, 2.1rem) clamp(1.1rem, 4.5vw, 5rem) 1rem;
}

.home-header {
  position: relative;
  z-index: 3;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
}

.home-actions,
.game-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.profile-chip {
  display: flex;
  min-height: 42px;
  padding: 0 0.9rem;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  color: #8ca9aa;
  font: 700 0.7rem var(--mono);
  background: rgba(7, 16, 22, 0.68);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}

.profile-chip strong,
.profile-chip b {
  color: var(--white);
}

.credit-icon {
  color: var(--orange);
  text-shadow: 0 0 12px rgba(255, 166, 41, 0.6);
}

.profile-divider {
  width: 1px;
  height: 18px;
  margin: 0 0.2rem;
  background: var(--line);
}

.home-main {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(1380px, 100%);
  min-height: 0;
  margin: auto;
  align-items: center;
  grid-template-columns: minmax(360px, 0.9fr) minmax(440px, 1.1fr);
  gap: clamp(1rem, 4vw, 5rem);
}

.hero-copy {
  padding: 1rem 0 1.5rem;
}

.signal-tag {
  display: inline-flex;
  margin-bottom: clamp(1.2rem, 3vh, 2.4rem);
  padding: 0.46rem 0.7rem;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(112, 255, 177, 0.16);
  color: #7bb59f;
  font: 700 0.58rem var(--mono);
  letter-spacing: 0.13em;
  background: rgba(12, 30, 29, 0.5);
}

.signal-tag span,
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
  animation: blink 1.8s ease-in-out infinite;
}

@keyframes blink {
  50% { opacity: 0.28; }
}

.hero-copy h1 {
  margin: 0.5rem 0 0;
  color: #dff9f3;
  font: 950 clamp(3.3rem, 7vw, 7.3rem) / 0.77 var(--sans);
  letter-spacing: -0.075em;
  text-transform: uppercase;
  text-shadow: 0 0 48px rgba(79, 197, 178, 0.08);
}

.hero-copy h1 span {
  color: transparent;
  -webkit-text-stroke: 1px rgba(212, 252, 243, 0.8);
  text-shadow: none;
}

.hero-copy h2 {
  margin: 1.4rem 0 0;
  color: #839f9e;
  font-size: clamp(1.2rem, 2.2vw, 1.9rem);
  font-weight: 600;
  letter-spacing: 0.16em;
}

.hero-copy h2 em {
  color: var(--mint);
  font-style: normal;
}

.hero-description {
  max-width: 610px;
  margin: 1.5rem 0 0;
  color: #8ca4a4;
  font-size: clamp(0.9rem, 1.25vw, 1.05rem);
  line-height: 1.85;
  letter-spacing: 0.03em;
}

.hero-buttons {
  display: flex;
  margin-top: clamp(1.5rem, 4vh, 2.8rem);
  flex-wrap: wrap;
  gap: 0.8rem;
}

.quick-specs {
  display: flex;
  margin-top: clamp(1.4rem, 4vh, 2.7rem);
  gap: 0;
}

.quick-specs div {
  display: flex;
  min-width: 128px;
  padding: 0 1.2rem;
  flex-direction: column;
  border-left: 1px solid var(--line);
}

.quick-specs div:first-child {
  padding-left: 0;
  border-left: 0;
}

.quick-specs strong {
  color: #bed8d4;
  font: 800 0.82rem var(--mono);
  letter-spacing: 0.08em;
}

.quick-specs span {
  margin-top: 0.3rem;
  color: #607d7f;
  font-size: 0.66rem;
}

.hero-visual {
  position: relative;
  width: min(680px, 100%);
  aspect-ratio: 1.06;
  justify-self: center;
  perspective: 1100px;
}

.hero-grid {
  position: absolute;
  inset: 17% 6% 5%;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(82, 220, 196, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(82, 220, 196, 0.14) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle, black 25%, transparent 72%);
  transform: rotateX(66deg) translateY(21%);
  transform-origin: center bottom;
}

.reactor-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(92, 226, 205, 0.25);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotateX(62deg);
}

.reactor-ring::before,
.reactor-ring::after {
  position: absolute;
  content: "";
  background: var(--mint);
  box-shadow: 0 0 12px var(--mint);
}

.reactor-ring::before {
  top: -2px;
  left: 28%;
  width: 17%;
  height: 3px;
}

.reactor-ring::after {
  right: 11%;
  bottom: 8%;
  width: 3px;
  height: 14%;
}

.reactor-ring--one {
  width: 78%;
  aspect-ratio: 1;
  animation: orbit 16s linear infinite;
}

.reactor-ring--two {
  width: 61%;
  aspect-ratio: 1;
  border-style: dashed;
  animation: orbit-reverse 11s linear infinite;
}

.reactor-ring--three {
  width: 44%;
  aspect-ratio: 1;
  border-color: rgba(255, 74, 64, 0.32);
  animation: orbit 8s linear infinite;
}

@keyframes orbit {
  to { transform: translate(-50%, -50%) rotateX(62deg) rotateZ(360deg); }
}

@keyframes orbit-reverse {
  to { transform: translate(-50%, -50%) rotateX(62deg) rotateZ(-360deg); }
}

.hero-token {
  position: absolute;
  top: 46%;
  left: 50%;
  display: grid;
  width: 40%;
  aspect-ratio: 1;
  place-items: center;
  border: clamp(10px, 1.3vw, 18px) solid #1e2a2f;
  border-radius: 50%;
  color: var(--red);
  background:
    radial-gradient(circle, rgba(255, 72, 61, 0.18) 0 8%, transparent 9%),
    repeating-conic-gradient(from 0deg, #1e2c31 0deg 4deg, #10181d 5deg 14deg),
    #111a1f;
  box-shadow:
    0 42px 55px rgba(0, 0, 0, 0.6),
    0 0 0 5px #091014,
    0 0 0 7px rgba(255, 74, 64, 0.34),
    0 0 70px rgba(255, 74, 64, 0.18),
    inset 0 0 55px #020609;
  transform: translate(-50%, -50%) rotateX(18deg) rotateZ(-4deg);
  animation: token-float 4.2s ease-in-out infinite;
}

.hero-token::before,
.hero-token::after {
  position: absolute;
  z-index: -1;
  inset: -12%;
  content: "";
  border: 2px solid rgba(99, 111, 115, 0.65);
  border-radius: 50%;
  clip-path: polygon(0 0, 42% 0, 38% 18%, 62% 18%, 58% 0, 100% 0, 100% 100%, 57% 100%, 62% 82%, 38% 82%, 43% 100%, 0 100%);
}

.hero-token::after {
  inset: 10%;
  border-color: rgba(255, 74, 64, 0.38);
}

@keyframes token-float {
  50% { transform: translate(-50%, calc(-50% - 13px)) rotateX(18deg) rotateZ(2deg); }
}

.token-symbol {
  position: relative;
  z-index: 2;
  font-size: clamp(3.4rem, 8vw, 7.8rem);
  font-weight: 900;
  text-shadow: 0 0 14px rgba(255, 74, 64, 0.8), 0 0 44px rgba(255, 74, 64, 0.42);
}

.token-code {
  position: absolute;
  bottom: 16%;
  color: rgba(255, 116, 104, 0.72);
  font: 700 clamp(0.42rem, 0.8vw, 0.68rem) var(--mono);
  letter-spacing: 0.12em;
}

.token-fin {
  position: absolute;
  top: 34%;
  width: 25%;
  height: 25%;
  border: 4px solid #243138;
  background: #10171b;
  z-index: -2;
}

.token-fin--left {
  left: -19%;
  transform: rotate(-36deg);
}

.token-fin--right {
  right: -19%;
  transform: rotate(36deg);
}

.visual-callout {
  position: absolute;
  z-index: 2;
  min-width: 125px;
  padding: 0.65rem 0.8rem;
  border-left: 2px solid var(--mint);
  background: linear-gradient(90deg, rgba(10, 31, 31, 0.85), transparent);
}

.visual-callout small,
.visual-callout strong {
  display: block;
  font-family: var(--mono);
}

.visual-callout small {
  color: #587879;
  font-size: 0.53rem;
  letter-spacing: 0.1em;
}

.visual-callout strong {
  margin-top: 0.3rem;
  color: var(--mint);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
}

.visual-callout--top {
  top: 19%;
  right: 7%;
}

.visual-callout--bottom {
  bottom: 14%;
  left: 2%;
  border-color: var(--red);
}

.visual-callout--bottom strong {
  color: var(--red);
}

.coordinate {
  position: absolute;
  color: rgba(109, 161, 158, 0.4);
  font: 600 0.5rem var(--mono);
  letter-spacing: 0.12em;
}

.coordinate--a {
  top: 31%;
  left: 3%;
  transform: rotate(-90deg);
}

.coordinate--b {
  right: 4%;
  bottom: 26%;
  transform: rotate(90deg);
}

.home-footer {
  position: relative;
  z-index: 3;
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(109, 190, 181, 0.1);
  color: #496768;
  font: 600 0.56rem var(--mono);
  letter-spacing: 0.09em;
}

.home-footer p {
  margin: 0;
}

.home-footer .status-dot {
  margin-right: 0.45rem;
}

.home-footer strong {
  color: var(--mint);
}

/* Game */
.game-screen {
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(circle at 50% 48%, rgba(16, 50, 54, 0.3), transparent 55%);
}

.game-header {
  position: relative;
  z-index: 5;
  display: grid;
  min-height: 66px;
  padding: 0 1.2rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(8, 17, 23, 0.96), rgba(9, 23, 28, 0.82), rgba(8, 17, 23, 0.96));
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  grid-template-columns: 1fr auto 1fr;
}

.match-meta {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.match-meta div {
  min-width: 78px;
  text-align: center;
}

.match-meta small,
.match-meta strong {
  display: block;
  font-family: var(--mono);
}

.match-meta small {
  color: #4f6c6e;
  font-size: 0.5rem;
  letter-spacing: 0.13em;
}

.match-meta strong {
  margin-top: 0.25rem;
  color: #b5d4d1;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.meta-separator {
  width: 1px;
  height: 24px;
  background: var(--line);
}

.game-actions {
  justify-self: end;
}

.arena-layout {
  display: grid;
  width: min(1540px, 100%);
  min-height: 0;
  margin: 0 auto;
  padding: clamp(0.6rem, 1.4vw, 1.15rem) clamp(0.65rem, 2vw, 1.6rem) 0.45rem;
  flex: 1;
  align-items: center;
  grid-template-columns: minmax(150px, 210px) minmax(440px, 840px) minmax(150px, 210px);
  gap: clamp(0.7rem, 1.8vw, 1.6rem);
  justify-content: center;
}

.combatant-panel {
  position: relative;
  align-self: center;
  min-height: 355px;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid rgba(123, 184, 181, 0.17);
  background:
    linear-gradient(145deg, rgba(21, 37, 43, 0.88), rgba(7, 15, 20, 0.92)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 0 40px rgba(50, 217, 255, 0.025);
  clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.combatant-panel::before,
.combatant-panel::after {
  position: absolute;
  content: "";
}

.combatant-panel::before {
  top: 0;
  left: 0;
  width: 45%;
  height: 2px;
  background: var(--muted);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.combatant-panel::after {
  right: -45px;
  bottom: -45px;
  width: 110px;
  height: 110px;
  border: 1px solid rgba(123, 184, 181, 0.12);
  border-radius: 50%;
}

.combatant-panel.is-turn {
  border-color: rgba(112, 255, 177, 0.46);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 26px rgba(112, 255, 177, 0.08);
}

.combatant-panel.is-turn::before {
  background: var(--mint);
  box-shadow: 0 0 12px var(--mint);
}

.combatant-panel.team-red::before {
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
}

.combatant-panel.team-blue::before {
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.panel-scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background: linear-gradient(transparent 0 49%, rgba(112, 255, 177, 0.04) 50%, transparent 51%);
  background-size: 100% 7px;
}

.combatant-heading {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: center;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
}

.actor-index {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  color: #769192;
  font: 700 0.62rem var(--mono);
}

.combatant-heading small,
.combatant-heading strong {
  display: block;
  font-family: var(--mono);
}

.combatant-heading small {
  color: #536f70;
  font-size: 0.48rem;
  letter-spacing: 0.1em;
}

.combatant-heading strong {
  margin-top: 0.1rem;
  color: #d1e9e5;
  font-size: 0.82rem;
}

.connection-state {
  color: var(--mint);
  font: 700 0.45rem var(--mono);
  letter-spacing: 0.08em;
}

.team-emblem {
  position: relative;
  display: grid;
  width: 118px;
  height: 118px;
  margin: 2.5rem auto 1.1rem;
  place-items: center;
  border: 1px solid rgba(133, 180, 179, 0.22);
  border-radius: 50%;
  color: #789294;
  background: radial-gradient(circle, rgba(133, 180, 179, 0.14), transparent 62%);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.65);
}

.team-emblem::before,
.team-emblem::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.team-emblem::before {
  inset: 8px;
  border: 1px dashed currentColor;
  opacity: 0.5;
  animation: spin 16s linear infinite;
}

.team-emblem::after {
  inset: 22px;
  border: 1px solid currentColor;
  opacity: 0.2;
}

.team-emblem span {
  font-size: 2.65rem;
  font-weight: 900;
  text-shadow: 0 0 18px currentColor;
}

.team-red .team-emblem,
.team-red .team-name {
  color: var(--red);
}

.team-blue .team-emblem,
.team-blue .team-name {
  color: var(--cyan);
}

.team-name {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #809a9b;
  font: 800 0.78rem var(--mono);
  letter-spacing: 0.08em;
  text-align: center;
}

.panel-stats {
  position: relative;
  z-index: 1;
  display: grid;
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  grid-template-columns: 1fr 1fr;
}

.panel-stats div {
  padding: 1rem 0.35rem 0;
  text-align: center;
}

.panel-stats div + div {
  border-left: 1px solid var(--line);
}

.panel-stats small,
.panel-stats strong {
  display: block;
  font-family: var(--mono);
}

.panel-stats small {
  color: #506d6e;
  font-size: 0.48rem;
  letter-spacing: 0.12em;
}

.panel-stats strong {
  margin-top: 0.35rem;
  color: #d6ebe7;
  font-size: 1.1rem;
}

.board-column {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  align-items: center;
}

.turn-console {
  position: relative;
  z-index: 3;
  display: grid;
  width: min(590px, 92%);
  min-height: 62px;
  margin-bottom: -10px;
  padding: 0.62rem 1rem;
  align-items: center;
  border: 1px solid rgba(112, 255, 177, 0.32);
  background: rgba(7, 18, 22, 0.94);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.36), inset 0 0 28px rgba(112, 255, 177, 0.035);
  grid-template-columns: 1fr auto 1fr;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%, 0 12px);
}

.turn-console > div:first-child small,
.turn-console > div:first-child strong {
  display: block;
  font-family: var(--mono);
}

.turn-console > div:first-child small {
  color: #4d6a6b;
  font-size: 0.47rem;
  letter-spacing: 0.14em;
}

.turn-console > div:first-child strong {
  margin-top: 0.2rem;
  color: var(--mint);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.turn-console > p {
  margin: 0;
  color: #789294;
  font-size: 0.66rem;
  line-height: 1.45;
  text-align: right;
}

.timer-ring {
  position: relative;
  display: flex;
  width: 72px;
  height: 72px;
  margin: -14px 1.15rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #0b151a 54%, transparent 55%),
    conic-gradient(var(--mint) var(--timer-progress), rgba(112, 255, 177, 0.1) 0);
  box-shadow: 0 0 24px rgba(112, 255, 177, 0.12);
}

.timer-ring::after {
  position: absolute;
  inset: 5px;
  content: "";
  border: 1px solid rgba(112, 255, 177, 0.18);
  border-radius: 50%;
}

.timer-ring span {
  position: relative;
  z-index: 1;
  color: #e4fff6;
  font: 800 1.15rem/1 var(--mono);
}

.timer-ring small {
  position: relative;
  z-index: 1;
  margin-top: 0.2rem;
  color: #598375;
  font: 700 0.42rem var(--mono);
  letter-spacing: 0.12em;
}

.timer-ring.is-warning {
  animation: timer-warning 0.72s ease-in-out infinite alternate;
  background:
    radial-gradient(circle, #170b0a 54%, transparent 55%),
    conic-gradient(var(--red) var(--timer-progress), rgba(255, 74, 64, 0.1) 0);
}

@keyframes timer-warning {
  to { box-shadow: 0 0 30px rgba(255, 74, 64, 0.4); }
}

.board-stage {
  position: relative;
  width: min(100%, 820px);
  height: clamp(540px, calc(100dvh - 174px), 820px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(91, 190, 183, 0.15);
  background:
    radial-gradient(circle at 50% 45%, rgba(36, 94, 89, 0.12), transparent 52%),
    rgba(2, 8, 12, 0.42);
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
}

#game-canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.board-vignette {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 65px rgba(1, 5, 8, 0.78);
}

.board-corner {
  position: absolute;
  z-index: 3;
  width: 26px;
  height: 26px;
  pointer-events: none;
}

.board-corner--tl {
  top: 9px;
  left: 9px;
  border-top: 2px solid var(--mint);
  border-left: 2px solid var(--mint);
}

.board-corner--tr {
  top: 9px;
  right: 9px;
  border-top: 2px solid var(--mint);
  border-right: 2px solid var(--mint);
}

.board-corner--bl {
  bottom: 9px;
  left: 9px;
  border-bottom: 2px solid var(--mint);
  border-left: 2px solid var(--mint);
}

.board-corner--br {
  right: 9px;
  bottom: 9px;
  border-right: 2px solid var(--mint);
  border-bottom: 2px solid var(--mint);
}

.board-label {
  position: absolute;
  z-index: 3;
  color: rgba(99, 164, 158, 0.48);
  font: 700 0.48rem var(--mono);
  letter-spacing: 0.13em;
  pointer-events: none;
}

.board-label--top {
  top: 14px;
  left: 48px;
}

.board-label--bottom {
  right: 48px;
  bottom: 14px;
}

.interaction-hint {
  display: flex;
  min-height: 30px;
  margin-top: 0.35rem;
  align-items: center;
  gap: 0.45rem;
  color: #4f6f70;
  font-size: 0.62rem;
}

.mouse-glyph {
  color: var(--mint);
  font-size: 1rem;
}

.battle-log {
  position: relative;
  z-index: 4;
  display: flex;
  min-height: 58px;
  padding: 0 1.4rem;
  align-items: center;
  border-top: 1px solid var(--line);
  background: rgba(6, 14, 19, 0.91);
  gap: 1rem;
}

.battle-log-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.battle-log-title span {
  width: 7px;
  height: 7px;
  border: 1px solid var(--orange);
  transform: rotate(45deg);
}

.battle-log-title strong {
  color: #5d7879;
  font: 700 0.55rem var(--mono);
  letter-spacing: 0.12em;
}

.capture-feed {
  display: flex;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  gap: 0.6rem;
}

.capture-entry {
  display: inline-flex;
  min-height: 32px;
  padding: 0.25rem 0.65rem 0.25rem 0.3rem;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  color: #7f9a9b;
  font-size: 0.58rem;
  background: rgba(12, 25, 31, 0.75);
  animation: feed-in 250ms ease both;
  white-space: nowrap;
}

@keyframes feed-in {
  from { opacity: 0; transform: translateY(8px); }
}

.capture-symbol {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
}

.capture-entry.team-red .capture-symbol { color: var(--red); }
.capture-entry.team-blue .capture-symbol { color: var(--cyan); }

/* Modals */
.modal-layer {
  position: absolute;
  z-index: 50;
  inset: 0;
  display: none;
  padding: 1rem;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: rgba(1, 5, 8, 0.79);
  backdrop-filter: blur(12px);
}

.modal-layer.is-active {
  display: flex;
}

.modal {
  position: relative;
  display: none;
  width: min(880px, 94vw);
  max-height: calc(100dvh - 2rem);
  padding: clamp(1.5rem, 3vw, 2.6rem);
  overflow: auto;
  border: 1px solid rgba(112, 255, 177, 0.3);
  background:
    linear-gradient(135deg, rgba(19, 37, 44, 0.98), rgba(5, 13, 18, 0.99)),
    var(--panel-strong);
  box-shadow: var(--shadow), inset 0 0 55px rgba(112, 255, 177, 0.025);
  clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
  animation: modal-in 220ms ease both;
}

.modal.is-active {
  display: block;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
}

.modal::before {
  position: absolute;
  top: 0;
  left: 20px;
  width: 110px;
  height: 2px;
  content: "";
  background: var(--mint);
  box-shadow: 0 0 16px var(--mint);
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  color: #759293;
  font-size: 1.3rem;
  background: rgba(8, 18, 24, 0.6);
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.modal h2 {
  margin: 0.4rem 0 0;
  color: #e2f7f2;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: 0.06em;
}

.modal-intro {
  margin: 0.75rem 0 0;
  color: #769092;
  font-size: 0.84rem;
  line-height: 1.7;
}

.difficulty-grid {
  display: grid;
  margin-top: 1.8rem;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.difficulty-card {
  position: relative;
  min-height: 245px;
  padding: 1.2rem;
  border: 1px solid rgba(115, 174, 174, 0.18);
  color: #9ab4b3;
  text-align: left;
  background: linear-gradient(150deg, rgba(24, 43, 49, 0.75), rgba(7, 15, 20, 0.86));
  cursor: pointer;
  transition: 180ms ease;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.difficulty-card:hover,
.difficulty-card.is-selected {
  border-color: rgba(112, 255, 177, 0.62);
  background: linear-gradient(150deg, rgba(25, 64, 59, 0.72), rgba(7, 20, 23, 0.9));
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32), inset 0 0 32px rgba(112, 255, 177, 0.035);
}

.difficulty-level {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  color: #4c6e6b;
  font: 700 0.52rem var(--mono);
}

.difficulty-icon {
  display: grid;
  width: 68px;
  height: 68px;
  margin: 0 auto 1.1rem;
  place-items: center;
  border: 1px solid rgba(112, 255, 177, 0.24);
  border-radius: 50%;
  color: var(--mint);
  font-size: 1.6rem;
  background: radial-gradient(circle, rgba(112, 255, 177, 0.12), transparent 65%);
}

.difficulty-card strong,
.difficulty-card small {
  display: block;
  text-align: center;
}

.difficulty-card strong {
  color: #d7eae7;
  font-size: 1rem;
}

.difficulty-card small {
  margin-top: 0.25rem;
  color: var(--mint);
  font: 700 0.58rem var(--mono);
  letter-spacing: 0.14em;
}

.difficulty-card p {
  min-height: 42px;
  margin: 1rem 0 0;
  color: #6e898a;
  font-size: 0.7rem;
  line-height: 1.55;
  text-align: center;
}

.difficulty-meter {
  display: flex;
  margin-top: 1rem;
  justify-content: center;
  gap: 4px;
}

.difficulty-meter i {
  width: 28px;
  height: 3px;
  background: rgba(112, 255, 177, 0.12);
}

.difficulty-card[data-difficulty="easy"] .difficulty-meter i:nth-child(1),
.difficulty-card[data-difficulty="medium"] .difficulty-meter i:nth-child(-n+2),
.difficulty-card[data-difficulty="hard"] .difficulty-meter i {
  background: var(--mint);
  box-shadow: 0 0 8px rgba(112, 255, 177, 0.45);
}

.help-grid {
  display: grid;
  margin-top: 1.8rem;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.help-grid article {
  position: relative;
  min-height: 108px;
  padding: 1rem 1rem 0.9rem 3.7rem;
  border: 1px solid rgba(117, 174, 174, 0.13);
  background: rgba(8, 19, 24, 0.55);
}

.manual-index {
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: var(--mint);
  font: 800 0.65rem var(--mono);
}

.help-grid h3 {
  margin: 0;
  color: #d2e6e3;
  font-size: 0.85rem;
}

.help-grid p {
  margin: 0.45rem 0 0;
  color: #708a8b;
  font-size: 0.7rem;
  line-height: 1.65;
}

.rank-strip {
  display: flex;
  margin-top: 1rem;
  padding: 0.8rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: #849d9d;
  font-size: 0.7rem;
  background: rgba(8, 18, 23, 0.55);
  gap: 0.6rem;
}

.rank-strip b {
  color: #3f5d5e;
}

.rank-major { color: var(--orange); }
.rank-minor { color: var(--mint); }

.compact-modal {
  width: min(470px, 92vw);
  text-align: center;
}

.pause-glyph {
  display: grid;
  width: 90px;
  height: 90px;
  margin: 0 auto 1.5rem;
  place-items: center;
  border: 1px solid rgba(112, 255, 177, 0.32);
  border-radius: 50%;
  color: var(--mint);
  background: radial-gradient(circle, rgba(112, 255, 177, 0.1), transparent 65%);
}

.pause-glyph span {
  font: 800 1.45rem var(--mono);
  letter-spacing: 0.18em;
}

.modal-button-stack {
  display: grid;
  margin-top: 1.8rem;
  gap: 0.7rem;
}

.modal-button-stack .primary-button {
  width: 100%;
}

.result-modal {
  width: min(570px, 94vw);
  text-align: center;
}

.result-badge {
  display: grid;
  width: 92px;
  height: 92px;
  margin: 0 auto 1.4rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 2rem;
  background: radial-gradient(circle, color-mix(in srgb, currentColor 18%, transparent), transparent 64%);
  box-shadow: 0 0 42px color-mix(in srgb, currentColor 20%, transparent);
}

.result-badge.is-win { color: var(--mint); }
.result-badge.is-loss { color: var(--red); }
.result-badge.is-draw { color: var(--orange); }

.result-subtitle {
  margin: 0.65rem 0 0;
  color: #789293;
  font-size: 0.8rem;
}

.result-scoreline {
  display: grid;
  margin-top: 1.5rem;
  padding: 1.1rem 0;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  grid-template-columns: 1fr auto 1fr;
}

.result-scoreline small,
.result-scoreline strong {
  display: block;
  font-family: var(--mono);
}

.result-scoreline small {
  color: #587474;
  font-size: 0.52rem;
  letter-spacing: 0.12em;
}

.result-scoreline strong {
  margin-top: 0.4rem;
  font-size: 1.7rem;
}

.result-scoreline > span {
  color: #466061;
}

.result-details {
  display: grid;
  margin-top: 0.85rem;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.result-details div {
  padding: 0.75rem 0.4rem;
  border: 1px solid rgba(115, 176, 174, 0.12);
  background: rgba(8, 18, 23, 0.5);
}

.result-details small,
.result-details strong {
  display: block;
  font-family: var(--mono);
}

.result-details small {
  color: #526e6f;
  font-size: 0.47rem;
  letter-spacing: 0.12em;
}

.result-details strong {
  margin-top: 0.35rem;
  color: #b8d2cf;
  font-size: 0.8rem;
}

.result-details .reward-cell strong {
  color: var(--orange);
}

.result-actions {
  display: flex;
  margin-top: 1.4rem;
  justify-content: center;
  gap: 0.7rem;
}

.toast {
  position: absolute;
  z-index: 80;
  bottom: 78px;
  left: 50%;
  max-width: min(90vw, 520px);
  padding: 0.7rem 1rem;
  border: 1px solid rgba(112, 255, 177, 0.35);
  color: #c5e6df;
  font-size: 0.74rem;
  background: rgba(7, 20, 23, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 180ms ease;
}

.toast.is-active {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  border-color: rgba(255, 74, 64, 0.55);
  color: #ffc0bb;
}

.error-screen {
  position: absolute;
  z-index: 300;
  inset: 0;
  display: none;
  padding: 1.5rem;
  place-items: center;
  text-align: center;
  background: #04080c;
}

.error-screen.is-active {
  display: grid;
}

.error-screen > div {
  max-width: 520px;
}

.error-code {
  color: var(--red);
  font: 800 0.7rem var(--mono);
  letter-spacing: 0.18em;
}

.error-screen h2 {
  margin: 0.7rem 0 0;
  font-size: 2rem;
}

.error-screen p {
  color: #7d9999;
  line-height: 1.7;
}

.error-screen button {
  min-height: 46px;
  padding: 0 1.2rem;
  border: 1px solid var(--red);
  color: #ffc0bb;
  background: rgba(255, 74, 64, 0.08);
  cursor: pointer;
}

/* Responsive */
@media (max-width: 1060px) {
  .home-main {
    grid-template-columns: 1fr 0.9fr;
  }

  .hero-visual {
    transform: scale(0.92);
  }

  .arena-layout {
    grid-template-columns: 145px minmax(360px, 1fr) 145px;
    gap: 0.65rem;
  }

  .combatant-panel {
    min-height: 310px;
    padding: 0.75rem;
  }

  .combatant-heading {
    grid-template-columns: auto 1fr;
  }

  .connection-state {
    display: none;
  }

  .team-emblem {
    width: 96px;
    height: 96px;
    margin-top: 2rem;
  }

  .team-emblem span {
    font-size: 2.15rem;
  }
}

@media (max-width: 820px) {
  html,
  body {
    overflow: hidden;
  }

  .app-shell {
    min-height: 0;
  }

  .home-screen {
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.85rem 1rem;
  }

  .home-header {
    flex-shrink: 0;
  }

  .brand-lockup small,
  .profile-chip span:not(.credit-icon):not(.profile-divider) {
    display: none;
  }

  .profile-chip {
    padding: 0 0.65rem;
  }

  .profile-divider {
    display: none;
  }

  .home-main {
    display: block;
    padding: 3.5rem 0 2rem;
  }

  .hero-copy {
    position: relative;
    z-index: 2;
    padding: 0;
  }

  .hero-copy h1 {
    font-size: clamp(3.8rem, 16vw, 6rem);
  }

  .hero-copy h2 {
    letter-spacing: 0.08em;
  }

  .hero-description {
    max-width: 560px;
  }

  .hero-visual {
    position: absolute;
    z-index: 0;
    top: 6%;
    right: -24%;
    width: 78vw;
    opacity: 0.36;
    pointer-events: none;
  }

  .visual-callout,
  .coordinate {
    display: none;
  }

  .home-footer {
    display: none;
  }

  .game-screen {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .game-header {
    position: sticky;
    top: 0;
    min-height: 56px;
    padding: 0 0.65rem;
    grid-template-columns: 1fr auto;
  }

  .game-brand small,
  .match-meta {
    display: none;
  }

  .arena-layout {
    display: grid;
    width: 100%;
    min-height: auto;
    padding: 0.65rem 0.55rem 0;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "player ai"
      "board board";
    gap: 0.55rem;
  }

  .player-panel { grid-area: player; }
  .ai-panel { grid-area: ai; }
  .board-column { grid-area: board; }

  .combatant-panel {
    display: grid;
    min-height: 88px;
    padding: 0.55rem 0.65rem;
    align-items: center;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .combatant-heading {
    grid-column: 1;
    grid-row: 1;
  }

  .actor-index {
    display: none;
  }

  .team-emblem {
    width: 58px;
    height: 58px;
    margin: 0;
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .team-emblem span {
    font-size: 1.45rem;
  }

  .team-name {
    align-self: end;
    margin: 0.2rem 0 0;
    font-size: 0.62rem;
    text-align: left;
    grid-column: 1;
    grid-row: 2;
  }

  .panel-stats {
    position: absolute;
    top: 0.45rem;
    right: 4.5rem;
    margin: 0;
    border: 0;
  }

  .panel-stats div {
    padding: 0 0.35rem;
  }

  .panel-stats small {
    font-size: 0.38rem;
  }

  .panel-stats strong {
    margin-top: 0.1rem;
    font-size: 0.72rem;
  }

  .turn-console {
    width: calc(100% - 1rem);
    min-height: 58px;
    padding: 0.5rem 0.65rem;
    grid-template-columns: 1fr auto;
  }

  .turn-console > p {
    display: none;
  }

  .timer-ring {
    width: 62px;
    height: 62px;
    margin: -12px 0 -12px 0.6rem;
  }

  .board-stage {
    width: 100%;
    height: clamp(620px, 78dvh, 760px);
  }

  .battle-log {
    display: none;
  }

  .interaction-hint {
    min-height: 35px;
    padding-bottom: env(safe-area-inset-bottom);
  }

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

  .difficulty-card {
    display: grid;
    min-height: 124px;
    padding: 0.9rem;
    align-items: center;
    grid-template-columns: 70px 1fr;
    grid-template-rows: auto auto auto;
  }

  .difficulty-icon {
    width: 56px;
    height: 56px;
    margin: 0;
    grid-column: 1;
    grid-row: 1 / 4;
  }

  .difficulty-card strong,
  .difficulty-card small,
  .difficulty-card p {
    text-align: left;
  }

  .difficulty-card p {
    min-height: 0;
    margin: 0.4rem 0 0;
  }

  .difficulty-meter {
    position: absolute;
    right: 0.8rem;
    bottom: 0.6rem;
  }

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

  .rank-strip {
    overflow-x: auto;
    justify-content: flex-start;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .home-screen {
    padding: 0.75rem;
  }

  .brand-lockup strong {
    font-size: 0.67rem;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .home-actions .icon-button {
    width: 38px;
    height: 38px;
  }

  .profile-chip {
    min-height: 38px;
  }

  .home-main {
    padding-top: 3rem;
  }

  .signal-tag {
    margin-bottom: 1.3rem;
  }

  .hero-copy h1 {
    font-size: clamp(3.15rem, 16.5vw, 5.2rem);
  }

  .hero-copy h2 {
    margin-top: 1rem;
    font-size: 1.15rem;
  }

  .hero-description {
    margin-top: 1rem;
    font-size: 0.84rem;
    line-height: 1.72;
  }

  .hero-buttons {
    display: grid;
    margin-top: 1.5rem;
  }

  .hero-buttons button {
    width: 100%;
  }

  .quick-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .quick-specs div {
    min-width: 0;
    padding: 0 0.65rem;
  }

  .quick-specs strong {
    font-size: 0.66rem;
  }

  .quick-specs span {
    font-size: 0.55rem;
  }

  .game-header .icon-button {
    width: 38px;
    height: 38px;
  }

  .game-brand strong {
    font-size: 0.72rem;
  }

  .combatant-panel {
    min-width: 0;
    padding: 0.45rem 0.5rem;
  }

  .combatant-heading small {
    display: none;
  }

  .combatant-heading strong {
    font-size: 0.72rem;
  }

  .connection-state,
  .panel-stats small {
    display: none;
  }

  .panel-stats {
    top: 0.55rem;
    right: 3.9rem;
  }

  .team-emblem {
    width: 50px;
    height: 50px;
  }

  .team-name {
    max-width: calc(100% - 55px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .board-stage {
    height: clamp(620px, 78dvh, 760px);
  }

  .interaction-hint {
    font-size: 0.57rem;
  }

  .modal {
    width: 96vw;
    padding: 1.25rem;
  }

  .modal h2 {
    padding-right: 2rem;
    font-size: 1.45rem;
  }

  .result-scoreline strong {
    font-size: 1.35rem;
  }

  .result-actions {
    display: grid;
  }

  .result-actions button {
    width: 100%;
  }
}

@media (max-height: 690px) and (min-width: 821px) {
  .game-header {
    min-height: 56px;
  }

  .arena-layout {
    padding-top: 0.4rem;
  }

  .combatant-panel {
    min-height: 280px;
  }

  .team-emblem {
    width: 82px;
    height: 82px;
    margin-top: 1.5rem;
  }

  .panel-stats {
    margin-top: 1.2rem;
  }

  .board-stage {
    height: calc(100dvh - 142px);
  }

  .battle-log {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
