@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Source+Sans+Pro:wght@400;600&display=swap');

:root {
  --color-bg-1: #0c1a1f;
  --color-bg-2: #162c31;
  --color-bg-3: #0b1217;
  --color-panel: rgba(12, 28, 34, 0.88);
  --color-panel-strong: rgba(14, 32, 38, 0.92);
  --color-panel-mid: rgba(20, 42, 48, 0.88);
  --color-panel-border: #2a4c52;
  --color-panel-glow: rgba(116, 182, 169, 0.15);
  --color-link-glow: rgba(138, 198, 195, 0.18);
  --color-hero-start: rgba(31, 69, 76, 0.8);
  --color-hero-end: rgba(12, 28, 34, 0.9);
  --color-hero-accent: rgba(213, 163, 74, 0.15);
  --color-hero-accent-cool: rgba(138, 198, 195, 0.12);
  --color-panel-veil: rgba(12, 28, 34, 0.75);
  --color-focus-ring: rgba(213, 163, 74, 0.2);
  --color-shadow-dark: rgba(0, 0, 0, 0.35);
  --color-shadow-deep: rgba(0, 0, 0, 0.5);
  --color-text-shadow: rgba(255, 255, 255, 0.35);
  --color-text-dark: #122118;
  --color-accent-border: #e3b563;
  --color-accent: #d5a34a;
  --color-accent-strong: #f3c05b;
  --color-accent-deep: #b38137;
  --color-accent-glow: rgba(213, 163, 74, 0.25);
  --color-accent-glow-strong: rgba(213, 163, 74, 0.55);
  --color-player-accent: #7dcfff;
  --color-name-capsule-fill: #ffffff;
  --color-damage: #d34b42;
  --color-damage-text: #ffffff;
  --color-action-attack: #d34b42;
  --color-action-move: #33d06b;
  --color-action-jump: #3da4ff;
  --color-action-block: #f0c35a;
  --color-queue-lavender: #b9a7f2;
  --color-queue-lavender-strong: #cbb7ff;
  --color-queue-lavender-border: #a18be0;
  --color-queue-lavender-glow: rgba(185, 167, 242, 0.45);
  --color-card-movement: #1c5a2c;
  --color-card-ability: #4d3c7a;
  --color-card-outline: #0b0b0b;
  --color-card-header: rgba(10, 18, 14, 0.55);
  --color-card-surface: rgba(255, 255, 255, 0.08);
  --color-card-textbox-start: #f2e5cf;
  --color-card-textbox-end: #e6d3b1;
  --color-card-textbox-border: #d2a64c;
  --color-card-textbox-text: #101010;
  --color-link: #8ac6c3;
  --color-text: #e3ecf2;
  --color-subtle: #a5b7c0;
  --color-divider: rgba(255, 255, 255, 0.08);
  --color-grid-line: rgba(255, 255, 255, 0.03);
  --color-outline-soft: rgba(255, 255, 255, 0.08);
  --color-highlight-soft: rgba(255, 255, 255, 0.04);
  --color-highlight-medium: rgba(255, 255, 255, 0.1);
  --color-surface-1: #0f2026;
  --color-surface-2: #112a32;
  --color-surface-3: #1c2f35;
  --color-game-surface: var(--color-surface-1);
  --color-hex-fill: var(--color-surface-2);
  --color-hex-stroke: var(--color-link);
  --color-hex-land-fill: #0a681e;
  --color-hex-land-stroke: #0a0a0a;
  --color-surface-1-muted: rgba(15, 32, 38, 0.4);
  --color-surface-1-soft: rgba(15, 32, 38, 0.6);
  --color-surface-1-mid: rgba(15, 32, 38, 0.7);
  --color-ink-strong: rgba(10, 22, 26, 0.92);
  --radius-panel: 14px;
  --radius-pill: 999px;
  --shadow-elevated: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-soft: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-strong: 0 8px 20px rgba(0, 0, 0, 0.35);
  --shadow-cta: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(213, 163, 74, 0.4);
  --action-card-base-width: 240px;
  --action-card-base-height: 336px;
  --action-card-actions-left-base: 6;
  --action-card-action-width-base: 34;
  --action-card-scale: 1;
  --action-card-text-scale: 2.5;
  --action-card-width: calc(var(--action-card-base-width) * var(--action-card-scale));
  --action-card-height: calc(var(--action-card-base-height) * var(--action-card-scale));
  --action-card-border-width: calc(7px * var(--action-card-scale));
  --action-card-radius: calc(8px * var(--action-card-scale));
  --action-card-inner-offset: calc(6px * var(--action-card-scale));
  --action-card-inner-width: calc(228px * var(--action-card-scale));
  --action-card-inner-height: calc(324px * var(--action-card-scale));
  --action-card-header-height: calc(35px * var(--action-card-scale));
  --action-card-actions-left: calc(6px * var(--action-card-scale));
  --action-card-actions-top: calc(7px * var(--action-card-scale));
  --action-card-action-width: calc(34px * var(--action-card-scale));
  --action-card-action-height: calc(30px * var(--action-card-scale));
  --action-card-surface-left: calc(40px * var(--action-card-scale));
  --action-card-surface-top: calc(35px * var(--action-card-scale));
  --action-card-surface-width: calc(194px * var(--action-card-scale));
  --action-card-surface-height: calc(295px * var(--action-card-scale));
  --action-card-surface-top-height: calc(157px * var(--action-card-scale));
  --action-card-surface-mid-height: calc(72px * var(--action-card-scale));
  --action-card-surface-bottom-height: calc(66px * var(--action-card-scale));
  --action-card-title-padding-top: calc(6px * var(--action-card-scale));
  --action-card-title-padding-bottom: calc(2px * var(--action-card-scale));
  --action-card-title-top: 0;
  --action-card-title-left: calc(40px * var(--action-card-scale));
  --action-card-title-width: calc(139px * var(--action-card-scale));
  --action-card-title-height: var(--action-card-header-height);
  --action-card-title-font-size: calc(
    var(--action-card-title-height) - var(--action-card-title-padding-top) - var(--action-card-title-padding-bottom)
  );
  --action-card-rotation-top: calc(6px * var(--action-card-scale));
  --action-card-rotation-left: calc(179px * var(--action-card-scale));
  --action-card-rotation-width: calc(30px * var(--action-card-scale));
  --action-card-rotation-height: calc(30px * var(--action-card-scale));
  --action-card-priority-top: calc(8px * var(--action-card-scale));
  --action-card-priority-left: calc(209px * var(--action-card-scale));
  --action-card-priority-width: calc(25px * var(--action-card-scale));
  --action-card-priority-height: calc(26px * var(--action-card-scale));
  --action-card-damage-top: calc(300px * var(--action-card-scale));
  --action-card-damage-left: calc(6px * var(--action-card-scale));
  --action-card-damage-width: calc(26px * var(--action-card-scale));
  --action-card-damage-height: calc(30px * var(--action-card-scale));
  --action-card-kbf-top: calc(299px * var(--action-card-scale));
  --action-card-kbf-left: calc(18px * var(--action-card-scale));
  --action-card-kbf-width: calc(30px * var(--action-card-scale));
  --action-card-kbf-height: calc(30px * var(--action-card-scale));
  --action-card-hover-shift: calc(var(--action-card-width) * 0.1);
  --deck-card-scale: 0.5;
  --deck-card-width: calc(var(--action-card-base-width) * var(--deck-card-scale));
  --deck-card-height: calc(var(--action-card-base-height) * var(--deck-card-scale));
  --font-heading: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
  --font-body: 'Source Sans Pro', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--color-text);
  background: radial-gradient(circle at 18% 15%, var(--color-panel-glow), transparent 32%),
    radial-gradient(circle at 85% 10%, var(--color-accent-glow), transparent 45%),
    linear-gradient(135deg, var(--color-bg-1) 0%, var(--color-bg-2) 60%, var(--color-bg-3) 100%);
  padding: 28px;
  -webkit-user-select: none;
  user-select: none;
}

input,
textarea,
select,
option,
[contenteditable='true'],
.allow-text-select {
  -webkit-user-select: text;
  user-select: text;
}

.ui-shell,
.lobby-shell {
  max-width: 1200px;
  margin: 0 auto 48px;
  display: grid;
  gap: 20px;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(120deg, transparent 0, transparent 28px, var(--color-grid-line) 28px, var(--color-grid-line) 29px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.lobby-shell {
  position: relative;
  z-index: 1;
}

.hero-header {
  position: relative;
  overflow: hidden;
  padding: 20px 24px;
  border-radius: var(--radius-panel);
  background: linear-gradient(115deg, var(--color-hero-start), var(--color-hero-end));
  border: 1px solid var(--color-panel-border);
  box-shadow: var(--shadow-elevated);
}

.hero-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 10%, var(--color-hero-accent), transparent 50%),
    radial-gradient(circle at 15% 0%, var(--color-hero-accent-cool), transparent 40%);
  pointer-events: none;
}

.hero-header-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-subtle);
  font-size: 12px;
  margin: 0;
}

h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 30px;
  letter-spacing: 0.03em;
  color: var(--color-accent-strong);
}

.subtitle {
  margin: 0;
  color: var(--color-text);
  opacity: 0.85;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  padding: 10px 14px;
  background: var(--color-panel-veil);
  border: 1px solid var(--color-panel-border);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
  min-width: 140px;
  text-align: center;
  color: var(--color-subtle);
}

.grid-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.panel {
  position: relative;
  background: var(--color-panel);
  border: 1px solid var(--color-panel-border);
  border-radius: var(--radius-panel);
  padding: 16px 18px 18px;
  box-shadow: var(--shadow-elevated);
  backdrop-filter: blur(4px);
  animation: panel-rise 700ms ease both;
}

.panel::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius-panel) - 1px);
  border: 1px solid var(--color-highlight-soft);
  pointer-events: none;
}

.panel h2 {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
  color: var(--color-accent-strong);
}

.panel p {
  margin: 0 0 12px;
  color: var(--color-subtle);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--color-text);
  font-weight: 600;
}

input {
  background: var(--color-surface-1);
  border: 1px solid var(--color-panel-border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--color-text);
  font-family: var(--font-body);
  box-shadow: inset 0 1px 0 var(--color-highlight-soft), var(--shadow-soft);
}

input:focus {
  outline: 1px solid var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.btn {
  appearance: none;
  cursor: pointer;
  border: 1px solid var(--color-panel-border);
  border-radius: var(--radius-pill);
  background: linear-gradient(145deg, var(--color-surface-1), var(--color-surface-2));
  color: var(--color-text);
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 10px 16px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--color-highlight-medium);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 200ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--color-accent);
  box-shadow: 0 10px 30px var(--color-shadow-dark), inset 0 1px 0 var(--color-highlight-medium);
}

.btn:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 8px var(--color-shadow-deep);
}

.btn:disabled,
.btn.is-disabled {
  cursor: not-allowed;
  opacity: 0.6;
  background: var(--color-surface-1-muted);
  border-color: var(--color-panel-border);
  color: var(--color-subtle);
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
}

.btn:disabled:hover,
.btn.is-disabled:hover {
  transform: none;
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
}

.btn-primary {
  background: linear-gradient(145deg, var(--color-accent), var(--color-accent-strong));
  color: var(--color-text-dark);
  border-color: var(--color-accent-border);
  text-shadow: 0 1px 0 var(--color-text-shadow);
}

.btn-queueing {
  background: linear-gradient(145deg, var(--color-queue-lavender), var(--color-queue-lavender-strong));
  color: var(--color-text-dark);
  border-color: var(--color-queue-lavender-border);
  text-shadow: 0 1px 0 var(--color-text-shadow);
  box-shadow: var(--shadow-soft), 0 0 18px var(--color-queue-lavender-glow);
}

.btn-ghost {
  background: transparent;
  border-style: dashed;
  color: var(--color-link);
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.divider {
  height: 1px;
  background: var(--color-divider);
  margin: 12px 0 10px;
}

pre {
  background: var(--color-surface-1);
  border: 1px solid var(--color-panel-border);
  border-radius: 10px;
  padding: 12px;
  color: var(--color-link);
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
  min-height: 140px;
  overflow: auto;
}

small {
  color: var(--color-subtle);
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 320px;
}

.data-table thead th {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--color-subtle);
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-divider);
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--color-divider);
}

.data-table tbody tr {
  background: var(--color-surface-1-soft);
}

.data-table tbody tr:nth-child(even) {
  background: var(--color-surface-1-muted);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .queue-flag {
  text-align: center;
  font-family: var(--font-heading);
  color: var(--color-queue-lavender-strong);
  letter-spacing: 0.08em;
}

.data-table .empty-state {
  text-align: center;
  color: var(--color-subtle);
  font-style: italic;
  padding: 16px 12px;
}

@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger-1 {
  animation-delay: 0.05s;
}

.stagger-2 {
  animation-delay: 0.1s;
}

.stagger-3 {
  animation-delay: 0.15s;
}

.stagger-4 {
  animation-delay: 0.2s;
}

.stagger-5 {
  animation-delay: 0.25s;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(120deg, var(--color-panel-mid), var(--color-panel-strong));
  border: 1px solid var(--color-panel-border);
}

.top-bar::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--radius-panel) - 6px);
  border: 1px solid var(--color-outline-soft);
  pointer-events: none;
}

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

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-cta {
  padding: 12px 26px;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: var(--shadow-cta);
}

.lobby-main {
  display: grid;
  grid-template-columns: 210px minmax(320px, 1fr) 300px;
  gap: 18px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}

.nav-title {
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  color: var(--color-accent-strong);
  font-size: 14px;
}

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

.nav-item {
  position: relative;
  padding: 10px 12px 10px 30px;
  border-radius: 10px;
  border: 1px solid var(--color-panel-border);
  background: linear-gradient(135deg, var(--color-surface-1), var(--color-surface-1-muted));
  font-weight: 600;
  color: var(--color-subtle);
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--color-panel-border);
  box-shadow: 0 0 6px var(--color-accent-glow);
}

.nav-item.active {
  color: var(--color-text);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-strong);
}

.nav-item.active::before {
  background: var(--color-accent-strong);
  box-shadow: 0 0 10px var(--color-accent-glow-strong);
}

.nav-footer {
  margin: 0;
  font-size: 12px;
  color: var(--color-subtle);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
  background: linear-gradient(140deg, var(--color-panel-strong), var(--color-ink-strong));
}

.hero-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, var(--color-link-glow), transparent 40%),
    radial-gradient(circle at 90% 15%, var(--color-accent-glow), transparent 45%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  max-width: 480px;
}

.hero-lead {
  margin: 0 0 18px;
  color: var(--color-text);
  line-height: 1.6;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-panel-border);
  background: var(--color-surface-1-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-subtle);
}

.hero-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--color-panel-border);
  background: var(--color-surface-1-mid);
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
}

.stat-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-subtle);
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--color-accent-strong);
}

.info-stack {
  display: grid;
  gap: 18px;
}

@media (max-width: 640px) {
  .hero-header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 1100px) {
  .lobby-main {
    grid-template-columns: 200px 1fr;
  }

  .info-stack {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .lobby-main {
    grid-template-columns: 1fr;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-bar-actions {
    width: 100%;
    justify-content: space-between;
  }
}

.menu-body {
  padding: 0;
}

.menu-body::before {
  display: none;
}

.menu-shell {
  min-height: 100vh;
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  padding: 28px;
  align-items: start;
  flex-wrap: wrap;
  position: relative;
}

.menu-sidebar,
.menu-match {
  background: linear-gradient(160deg, var(--color-panel-strong), var(--color-panel));
}

.menu-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 56px);
  position: absolute;
  left: 28px;
  top: 28px;
  bottom: 28px;
  width: 240px;
  transition: transform 180ms ease, opacity 160ms ease;
  z-index: 1;
}

.menu-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 58px;
}

.icon-btn {
  width: 46px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--color-panel-border);
  background: var(--color-surface-1);
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
}

.icon-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-accent-strong);
  border-radius: 999px;
}

.menu-toggle {
  position: absolute;
  top: 28px;
  left: 28px;
  z-index: 3;
}

.brand-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  margin: 0;
  font-family: var(--font-heading);
  color: var(--color-accent-strong);
  letter-spacing: 0.04em;
}

.brand-sub {
  margin: 0;
  color: var(--color-subtle);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.menu-nav {
  display: grid;
  gap: 10px;
}

.menu-link {
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-panel-border);
  background: linear-gradient(140deg, var(--color-surface-1), var(--color-surface-1-muted));
  color: var(--color-text);
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.menu-link:hover {
  transform: translateY(-1px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-soft);
}

.menu-link.active {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-strong);
  color: var(--color-accent-strong);
}

.menu-footer-link {
  margin-top: auto;
  font-size: 12px;
  color: var(--color-subtle);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.menu-footer-link:hover {
  color: var(--color-accent-strong);
}

.menu-match {
  display: grid;
  gap: 14px;
  align-content: start;
  justify-items: stretch;
  justify-self: end;
  max-width: 320px;
  width: 100%;
}

.match-cta {
  display: grid;
  gap: 12px;
  justify-items: stretch;
}

.queue-field {
  display: grid;
  gap: 8px;
}

.queue-label {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--color-subtle);
}

.menu-select {
  appearance: none;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-panel-border);
  background: var(--color-surface-1);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 600;
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
}

.menu-select:focus {
  outline: 1px solid var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.btn-small {
  padding: 8px 14px;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.menu-decks {
  flex: 1 1 520px;
  max-width: 760px;
  width: min(760px, 100%);
  display: grid;
  gap: 16px;
  align-content: start;
}

.menu-decks-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.menu-decks-header p {
  margin: 4px 0 0;
  color: var(--color-subtle);
}

.deck-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(var(--deck-card-width), 1fr));
  justify-items: center;
}

.deck-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-subtle);
  font-style: italic;
}

.deck-card {
  position: relative;
  width: var(--deck-card-width);
  display: grid;
  gap: 8px;
  justify-items: center;
}

.deck-card-button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  display: grid;
  gap: 8px;
  text-align: center;
  padding: 0;
}

.deck-card-portrait {
  width: var(--deck-card-width);
  height: var(--deck-card-height);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-panel-border);
  background: var(--color-panel-mid);
  box-shadow: var(--shadow-soft);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

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

.deck-card-button:hover .deck-card-portrait,
.deck-card-button:focus-visible .deck-card-portrait {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-strong);
}

.deck-card-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text);
}

.deck-card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 6px;
}

.deck-action {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--color-panel-border);
  background: var(--color-surface-1);
  color: var(--color-text);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.deck-action:hover {
  transform: translateY(-1px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-soft);
}

.deck-action svg {
  width: 14px;
  height: 14px;
}

.deck-card.is-selected .deck-card-portrait {
  border-color: var(--color-accent);
  box-shadow: 0 0 18px var(--color-accent-glow);
}

.selected-deck {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--color-panel-border);
  background: var(--color-panel-veil);
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
}

.selected-deck-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--color-subtle);
}

.selected-deck-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
}

.selected-deck-card.is-empty {
  color: var(--color-subtle);
  font-style: italic;
}

.selected-deck-portrait {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-panel-border);
  background: var(--color-panel-mid);
}

.selected-deck-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.selected-deck-name {
  font-weight: 600;
}

.selected-deck-empty {
  color: var(--color-subtle);
  font-style: italic;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--color-panel-veil);
  backdrop-filter: blur(4px);
  z-index: 5;
  padding: 24px;
}

.modal-overlay[hidden] {
  display: none;
}

.interaction-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: transparent;
  z-index: 8;
  pointer-events: none;
}

.interaction-overlay[hidden] {
  display: none;
}

.throw-modal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  --throw-width: 68px;
  --throw-height: 102px;
  pointer-events: none;
}

.throw-center {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--throw-center-size, 18px);
  height: var(--throw-center-size, 18px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid var(--color-damage);
  background: var(--color-panel-strong);
  box-shadow: 0 0 12px rgba(208, 72, 64, 0.45);
}

.throw-arrow {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--throw-width);
  height: var(--throw-height);
  background: var(--color-damage);
  clip-path: polygon(50% 0%, 100% 60%, 70% 60%, 70% 100%, 30% 100%, 30% 60%, 0 60%);
  transform: translate(-50%, -50%) translate(var(--offset-x, 0px), var(--offset-y, 0px))
    rotate(var(--angle, 0deg)) scale(var(--scale, 1));
  border: none;
  border-radius: 6px;
  cursor: pointer;
  filter: drop-shadow(0 0 6px rgba(208, 72, 64, 0.4));
  transition: transform 0.18s ease, filter 0.18s ease;
  pointer-events: auto;
}

.throw-arrow:hover,
.throw-arrow:focus-visible {
  --scale: 1.18;
  filter: drop-shadow(0 0 12px rgba(208, 72, 64, 0.7));
  animation: throwPulse 0.9s ease-in-out infinite;
}

@keyframes throwPulse {
  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(208, 72, 64, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(208, 72, 64, 0.85));
  }
}

.combo-modal {
  width: min(360px, 90vw);
  display: grid;
  gap: 10px;
  text-align: center;
  pointer-events: auto;
  padding: 22px 24px;
}

.combo-modal-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--color-subtle);
}

.combo-modal-copy {
  margin: 0;
  color: var(--color-subtle);
  font-size: 0.95rem;
}

.combo-modal-actions {
  justify-content: center;
}

.hand-trigger-modal {
  width: min(380px, 92vw);
  display: grid;
  gap: 10px;
  text-align: center;
  pointer-events: auto;
  padding: 22px 24px;
  border-color: rgba(67, 190, 134, 0.55);
  background: linear-gradient(160deg, rgba(12, 30, 20, 0.95), rgba(16, 24, 28, 0.9));
}

.hand-trigger-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--color-subtle);
}

.hand-trigger-copy {
  margin: 0;
  color: var(--color-subtle);
  font-size: 0.95rem;
}

.hand-trigger-actions {
  justify-content: center;
}

.discard-modal {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, 92vw);
  display: grid;
  gap: 6px;
  pointer-events: auto;
  padding: 12px 16px;
  border-color: rgba(211, 75, 66, 0.45);
  background: linear-gradient(160deg, rgba(24, 10, 12, 0.92), rgba(12, 26, 32, 0.88));
}

.draw-modal {
  border-color: rgba(71, 210, 144, 0.55);
}

.discard-modal-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--color-subtle);
}

.discard-modal-copy {
  margin: 0;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.action-card.is-discard-pending {
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 var(--color-highlight-soft),
    0 0 0 2px rgba(211, 75, 66, 0.55),
    0 0 18px rgba(211, 75, 66, 0.65);
  animation: discardPulse 1.1s ease-in-out infinite;
}

.action-card.is-reveal-pending {
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 var(--color-highlight-soft),
    0 0 0 2px rgba(71, 210, 144, 0.7),
    0 0 18px rgba(71, 210, 144, 0.7);
  animation: revealPulse 1.2s ease-in-out infinite;
}

.action-card.is-draw-pending {
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 var(--color-highlight-soft),
    0 0 0 2px rgba(71, 210, 144, 0.7),
    0 0 18px rgba(71, 210, 144, 0.7);
  animation: revealPulse 1.2s ease-in-out infinite;
}

.action-card.is-draw-selected {
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 var(--color-highlight-soft),
    0 0 0 2px rgba(71, 210, 144, 0.9),
    0 0 22px rgba(71, 210, 144, 0.85);
  animation: none;
}

.action-card.is-draw-pending,
.action-card.is-draw-selected {
  cursor: pointer;
}

.action-card.is-discard-selected {
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 var(--color-highlight-soft);
  filter: grayscale(1) brightness(0.55);
  opacity: 0.7;
  animation: none;
}

@keyframes revealPulse {
  0%,
  100% {
    box-shadow:
      var(--shadow-soft),
      inset 0 1px 0 var(--color-highlight-soft),
      0 0 0 2px rgba(71, 210, 144, 0.5),
      0 0 12px rgba(71, 210, 144, 0.45);
  }
  50% {
    box-shadow:
      var(--shadow-soft),
      inset 0 1px 0 var(--color-highlight-soft),
      0 0 0 2px rgba(71, 210, 144, 0.85),
      0 0 24px rgba(71, 210, 144, 0.8);
  }
}

.action-hud.is-locked .action-card.is-discard-selected {
  filter: grayscale(1) brightness(0.55);
  opacity: 0.7;
}

@keyframes discardPulse {
  0%,
  100% {
    box-shadow:
      var(--shadow-soft),
      inset 0 1px 0 var(--color-highlight-soft),
      0 0 0 2px rgba(211, 75, 66, 0.35),
      0 0 12px rgba(211, 75, 66, 0.5);
  }
  50% {
    box-shadow:
      var(--shadow-soft),
      inset 0 1px 0 var(--color-highlight-soft),
      0 0 0 3px rgba(211, 75, 66, 0.8),
      0 0 22px rgba(211, 75, 66, 0.9);
  }
}

.game-over-overlay {
  inset: auto;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: auto;
  background: transparent;
  backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 6;
}

.game-over {
  width: min(420px, 92vw);
  text-align: center;
  padding: 28px 24px;
}

.game-over-message {
  margin: 12px 0 20px;
  font-size: 1.1rem;
}

.deck-preview {
  width: min(1200px, 96vw);
  max-height: 90vh;
  overflow: auto;
  display: grid;
  gap: 16px;
  --action-card-scale: 0.85;
}

.deck-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.deck-preview-subtitle {
  margin: 4px 0 0;
  color: var(--color-subtle);
}

.deck-preview-section h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--color-accent-strong);
}

.deck-spread {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 8px 0 12px;
}

.deck-spread .action-card {
  cursor: default;
}

.deck-spread .action-card + .action-card {
  margin-left: calc(-1 * var(--action-card-width) * 0.7);
}

.deck-spread .action-card:hover {
  transform: translateY(calc(-1 * var(--action-card-height) * 0.08));
  z-index: 3;
  box-shadow: var(--shadow-strong);
}

.deck-builder {
  width: min(1600px, 97vw);
  max-height: 92vh;
  overflow: hidden;
  padding: 10px 12px 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  --deck-builder-card-scale: 0.5;
  --deck-library-card-scale: var(--deck-builder-card-scale);
  --action-card-scale: var(--deck-builder-card-scale);
  --deck-stack-peek: calc(var(--action-card-height) * 0.1);
  --deck-stack-hit-height: var(--deck-stack-peek);
}

.deck-builder-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding-right: 28px;
}

.deck-builder-toolbar {
  flex-wrap: nowrap;
}

.deck-builder-title-block {
  min-width: 220px;
  max-width: 520px;
}

.deck-builder-title-block h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.1;
}

.deck-builder-title-block p {
  margin: 2px 0 0;
  color: var(--color-subtle);
}

.deck-builder-subtitle {
  transition: color 120ms ease, text-shadow 120ms ease;
}

.deck-builder-subtitle.is-capacity-pulse {
  animation: deckBuilderCapacityPulse 380ms ease 1;
}

@keyframes deckBuilderCapacityPulse {
  0% {
    color: var(--color-subtle);
    text-shadow: none;
  }
  35% {
    color: var(--color-damage);
    text-shadow: 0 0 14px rgba(211, 75, 66, 0.6);
  }
  100% {
    color: var(--color-subtle);
    text-shadow: none;
  }
}

.deck-name-field {
  min-width: 280px;
  width: min(430px, 46vw);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.deck-name-field input {
  height: 38px;
  width: 100%;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.deck-save-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 10px;
  border: 1px solid var(--color-panel-border);
  background: var(--color-surface-1);
  color: var(--color-text);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.deck-save-icon:hover {
  transform: translateY(-1px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-soft);
}

.deck-save-icon svg {
  width: 18px;
  height: 18px;
}

.deck-builder-layout {
  min-height: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(calc(var(--action-card-width) + 36px), calc(var(--action-card-width) + 56px));
  min-width: 0;
  overflow: hidden;
}

.deck-builder-library-pane {
  min-height: 0;
  min-width: 0;
  display: grid;
  gap: 8px;
  grid-template-rows: auto minmax(0, 1fr);
}

.deck-library-scroll {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--color-divider);
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(10, 24, 18, 0.86), rgba(13, 26, 32, 0.84));
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
  padding: 10px;
}

.deck-section-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--color-subtle);
}

.deck-character-picker {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.deck-builder-selection-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 3px;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
}

.deck-builder-selection-header {
  border: 1px solid var(--color-divider);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(10, 23, 19, 0.82), rgba(11, 20, 28, 0.78));
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
  padding: 6px;
}

.deck-builder-character {
  display: grid;
  gap: 6px;
}

.deck-character-summary {
  appearance: none;
  border: 1px solid var(--color-panel-border);
  border-radius: 12px;
  background: var(--color-surface-1);
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.deck-character-summary:hover {
  transform: translateY(-1px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-soft);
}

.deck-character-summary-portrait {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-panel-border);
  background: var(--color-panel-mid);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.deck-character-summary-portrait.is-empty {
  border-style: dashed;
  opacity: 0.85;
}

.deck-character-summary-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.deck-character-summary-name {
  font-weight: 600;
  letter-spacing: 0.03em;
}

.deck-character-card {
  appearance: none;
  border: 1px solid var(--color-panel-border);
  background: var(--color-surface-1);
  border-radius: 12px;
  padding: 8px;
  color: var(--color-text);
  font-weight: 600;
  display: grid;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.deck-character-name {
  font-size: 14px;
  letter-spacing: 0.02em;
}

.deck-character-power {
  display: block;
  min-height: 32px;
  font-size: 11px;
  line-height: 1.25;
  color: var(--color-subtle);
  font-weight: 500;
}

.deck-character-card:hover {
  transform: translateY(-1px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-soft);
}

.deck-character-card.is-selected {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-strong);
}

.deck-character-portrait {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-panel-border);
  background: var(--color-panel-mid);
}

.deck-character-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.deck-filter-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--color-subtle);
}

.deck-library {
  --action-card-scale: var(--deck-library-card-scale);
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(var(--action-card-width), 1fr));
  align-content: start;
  justify-items: center;
  padding: 4px;
  min-width: max-content;
}

.deck-library .action-card {
  cursor: pointer;
  pointer-events: auto;
}

.deck-library .action-card.is-selected {
  opacity: 0.4;
  filter: grayscale(1);
  pointer-events: none;
}

.deck-stack-section {
  min-height: 0;
  display: grid;
}

.deck-stack {
  position: relative;
  width: var(--action-card-width);
  min-width: var(--action-card-width);
  margin: 0 auto;
  height: calc((var(--deck-stack-count, 1) - 1) * var(--deck-stack-peek) + var(--action-card-height));
  overflow: visible;
}

.deck-stack-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px 6px 0;
}

.deck-stack-item {
  position: absolute;
  left: 0;
  top: calc(var(--deck-stack-index, 0) * var(--deck-stack-peek));
  width: var(--action-card-width);
  height: var(--action-card-height);
  z-index: var(--deck-stack-z, 1);
  pointer-events: none;
  transition: transform 140ms ease;
}

.deck-stack-item:hover,
.deck-stack-item:focus-within {
  z-index: 260;
  transform: translateX(-6px);
}

.deck-stack-item.is-dragging {
  opacity: 0.72;
}

.deck-stack-card {
  pointer-events: none;
  cursor: default;
}

.deck-stack-hitbox {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: var(--deck-stack-hit-height);
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  pointer-events: auto;
  cursor: pointer;
}

.deck-stack-item.is-draggable .deck-stack-hitbox {
  cursor: grab;
}

.deck-stack-item.is-drop-target .deck-stack-card::after {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px rgba(213, 163, 74, 0.45), 0 0 12px rgba(213, 163, 74, 0.55);
}

.deck-stack-empty {
  border: 1px dashed var(--color-panel-border);
  border-radius: 10px;
  min-height: calc(var(--action-card-height) * 0.45);
  display: grid;
  place-items: center;
  padding: 10px;
  color: var(--color-subtle);
  text-align: center;
  font-size: 0.88rem;
}

.deck-character-modal {
  width: min(760px, 94vw);
  max-height: 88vh;
  overflow: auto;
  display: grid;
  gap: 12px;
}

.deck-character-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.deck-character-modal-body {
  display: grid;
  gap: 12px;
}

.deck-character-clear {
  appearance: none;
  border: 1px solid var(--color-panel-border);
  border-radius: 10px;
  background: var(--color-surface-1);
  color: var(--color-subtle);
  font-family: var(--font-body);
  font-weight: 600;
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--color-highlight-soft);
  transition: border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.deck-character-clear:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

#deckBuilderClose {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0;
  font-family: var(--font-body);
  box-shadow: var(--shadow-soft);
}

.menu-shell.menu-collapsed .menu-sidebar,
.menu-sidebar.is-collapsed {
  animation: none;
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(-100% - 28px));
}

.menu-sidebar[hidden] {
  display: none;
}

@media (max-width: 1100px) {
  .menu-sidebar {
    width: 200px;
  }
}

@media (max-width: 820px) {
  .menu-shell {
    padding: 18px;
  }

  .menu-sidebar {
    left: 18px;
    top: 18px;
    bottom: 18px;
    min-height: auto;
  }

  .menu-toggle {
    top: 18px;
    left: 18px;
  }

  .menu-match {
    max-width: none;
  }
}

@media (max-width: 1100px) {
  .menu-decks {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 1200px) {
  .deck-builder {
    --deck-library-card-scale: 0.46;
  }
}

@media (max-width: 980px) {
  .deck-builder {
    --deck-library-card-scale: 0.42;
  }

  .deck-builder-toolbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    padding-right: 28px;
  }

  .deck-builder-title-block {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .deck-name-field {
    width: 100%;
    margin-right: 0;
  }
}

@media (max-width: 640px) {
  .deck-preview {
    --action-card-scale: 0.75;
  }

  .deck-library-scroll {
    max-height: 320px;
  }
}

.game-area {
  position: fixed;
  inset: 18px;
  border-radius: var(--radius-panel);
  border: 1px solid var(--color-panel-border);
  background: var(--color-panel);
  box-shadow: var(--shadow-elevated);
  padding: 12px;
  z-index: 4;
  display: grid;
  overflow: hidden;
}
.game-area.is-game-over {
  filter: sepia(0.85) saturate(0.85);
}

.game-area[hidden] {
  display: none;
}

.action-hud {
  position: absolute;
  inset: 12px;
  z-index: 6;
  pointer-events: none;
  --action-card-scale-base: 0.67;
  --action-card-scale: var(--action-card-scale-base);
  --action-hand-width-base: min(70vw, 920px);
  --action-hand-width: var(--action-hand-width-base);
  --action-hand-height: calc(var(--action-card-height) * 1.05);
  --action-hand-fan-gap-factor: 0.32;
  --action-hand-fan-lift-factor: 0.18;
  --action-hand-fan-gap: calc(var(--action-card-width) * var(--action-hand-fan-gap-factor));
  --action-hand-fan-lift: calc(var(--action-card-height) * var(--action-hand-fan-lift-factor));
  --action-hand-fan-rotate: 10deg;
  --action-hand-card-scale: 0.7;
  --action-hand-hover-raise: calc(var(--action-card-height) * -0.25);
  --action-hand-hover-padding: calc(var(--action-card-height) * 0.5);
  --action-hand-offscreen: 0.3;
  --action-panel-width: min(230px, 28vw);
  --action-center-right: 18px;
  --action-hand-modal-gap: 18px;
  --action-hand-right: calc(var(--action-panel-width) + var(--action-center-right) + var(--action-hand-modal-gap));
}

.action-hud[hidden] {
  display: none;
}

.action-hud.is-locked {
  opacity: 1;
}

.action-hud .action-slot-row,
.action-hud .rotation-selector {
  display: none;
}

.action-hud:not(.is-turn) .action-submit {
  display: none;
}

.action-hud.is-turn .action-slot-row,
.action-hud.is-turn .rotation-selector {
  display: grid;
}

.action-hud:not(.is-turn) .action-center {
  pointer-events: none;
}

.action-hand {
  position: absolute;
  bottom: calc(-1 * var(--action-card-height) * var(--action-hand-offscreen));
  width: var(--action-hand-width);
  height: var(--action-hand-height);
  display: block;
  overflow: visible;
  pointer-events: auto;
  left: auto;
  right: var(--action-hand-right);
}

.action-hand-movement {
  left: auto;
  right: var(--action-hand-right);
}

.action-hand-ability {
  left: auto;
  right: var(--action-hand-right);
}

.action-card {
  appearance: none;
  width: var(--action-card-width);
  height: var(--action-card-height);
  border: none;
  border-radius: var(--action-card-radius);
  padding: 0;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 500;
  text-align: left;
  user-select: none;
  cursor: grab;
  box-shadow: var(--shadow-soft), inset 0 1px 0 var(--color-highlight-soft);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  position: relative;
  overflow: visible;
  display: block;
  isolation: isolate;
  transform: none;
}

.action-card::before {
  content: '';
  position: absolute;
  left: var(--action-card-inner-offset);
  top: var(--action-card-inner-offset);
  width: var(--action-card-inner-width);
  height: var(--action-card-inner-height);
  background: var(--action-card-inner-bg, var(--color-card-movement));
  border-radius: 0;
  z-index: 0;
}

.action-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border: var(--action-card-border-width) solid var(--color-card-outline);
  border-radius: var(--action-card-radius);
  pointer-events: none;
  z-index: 1;
}

.action-hud.is-combo .action-card.is-combo-eligible::after {
  border-color: var(--color-damage);
  box-shadow: 0 0 0 1px rgba(211, 75, 66, 0.4), 0 0 14px rgba(211, 75, 66, 0.7);
  animation: comboPulse 1.1s ease-in-out infinite;
}

.action-card[data-card-type='movement'] {
  --action-card-inner-bg: linear-gradient(165deg, rgba(255, 255, 255, 0.08), transparent 65%), var(--color-card-movement);
}

.action-card[data-card-type='ability'] {
  --action-card-inner-bg: linear-gradient(165deg, rgba(255, 255, 255, 0.18), transparent 65%), var(--color-card-ability);
}

.action-hand .action-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: var(--fan-z, 1);
  transform: translate3d(
      calc(var(--fan-shift, 0) * var(--action-hand-fan-gap)),
      calc(-1 * var(--fan-curve, 0) * var(--action-hand-fan-lift)),
      0
    )
    rotate(calc(var(--fan-offset, 0) * var(--action-hand-fan-rotate)))
    scale(calc(var(--fan-scale, 1) * var(--action-hand-card-scale)));
  transform-origin: 50% 100%;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.action-hand .action-card.is-hovered {
  transform: translate3d(
      calc(var(--fan-shift, 0) * var(--action-hand-fan-gap)),
      calc(-1 * var(--fan-curve, 0) * var(--action-hand-fan-lift) + var(--action-hand-hover-raise)),
      0
    )
    rotate(0deg)
    scale(var(--fan-scale, 1));
  z-index: 60;
  box-shadow: var(--shadow-strong);
}

.action-card.is-dragging {
  opacity: 0.7;
}

.action-card.is-shaking {
  animation: cardShake 320ms ease-in-out;
}

.action-card.is-disabled {
  cursor: default;
  opacity: 1;
}

.action-card.is-exhausted {
  cursor: not-allowed;
}

.action-card.is-exhausted.is-draw-pending,
.action-card.is-exhausted.is-draw-selected {
  cursor: pointer;
}

.action-card.is-exhausted::before {
  filter: grayscale(1) brightness(0.65);
}

.action-card.is-exhausted .action-card-header,
.action-card.is-exhausted .action-card-body {
  filter: grayscale(1) brightness(0.65);
}

.action-card.is-draw-selected .action-card-header,
.action-card.is-draw-selected .action-card-body {
  filter: none;
  opacity: 1;
}

.action-card.is-draw-selected::before {
  filter: none;
  opacity: 1;
}

.action-card.is-draw-selected::after {
  opacity: 1;
}

.action-card.is-animating,
.action-card.is-drawn {
  opacity: 0;
  pointer-events: none;
}

.action-hud.is-locked .action-card {
  cursor: default;
  opacity: 1;
  filter: none;
}

@keyframes comboPulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(211, 75, 66, 0.35), 0 0 10px rgba(211, 75, 66, 0.45);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(211, 75, 66, 0.6), 0 0 18px rgba(211, 75, 66, 0.85);
  }
}

@keyframes cardShake {
  0%,
  100% {
    translate: 0 0;
  }
  20% {
    translate: calc(-6px * var(--action-card-scale)) 0;
  }
  40% {
    translate: calc(6px * var(--action-card-scale)) 0;
  }
  60% {
    translate: calc(-4px * var(--action-card-scale)) 0;
  }
  80% {
    translate: calc(4px * var(--action-card-scale)) 0;
  }
}

@keyframes rotationSubmitPulse {
  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(213, 163, 74, 0.45));
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(213, 163, 74, 0.85));
  }
}

@keyframes cardBackFlip {
  0% {
    opacity: 1;
    transform: perspective(900px) rotateY(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: perspective(900px) rotateY(180deg) scale(1.05);
  }
}

.action-card-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--action-card-header-height);
  background: transparent;
  z-index: 3;
}

.action-card-title {
  position: absolute;
  top: var(--action-card-title-top);
  left: var(--action-card-title-left);
  width: var(--action-card-title-width);
  height: var(--action-card-title-height);
  font-family: var(--font-heading);
  font-size: var(--action-card-title-font-size);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--action-card-title-padding-top) 0 var(--action-card-title-padding-bottom);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.action-card-badges {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.action-card-badge {
  position: absolute;
  border-radius: 50%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.action-card-rotation {
  width: var(--action-card-rotation-width);
  height: var(--action-card-rotation-height);
  top: var(--action-card-rotation-top);
  left: var(--action-card-rotation-left);
}

.action-card-priority {
  width: var(--action-card-priority-width);
  height: var(--action-card-priority-height);
  top: var(--action-card-priority-top);
  left: var(--action-card-priority-left);
  background-color: transparent;
  border-radius: 0;
}

.action-card-priority-value {
  font-size: calc(9px * var(--action-card-scale) * var(--action-card-text-scale, 1));
  font-weight: 700;
  color: #1b1b1b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  line-height: 1;
}

.action-card-body {
  position: absolute;
  inset: 0;
  padding: 0;
  z-index: 2;
}

.action-card-actions {
  position: absolute;
  top: var(--action-card-actions-top);
  left: var(--action-card-actions-left);
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
  margin: 0;
  padding: 0;
  z-index: 2;
}

.action-card-action {
  width: var(--action-card-action-width);
  height: var(--action-card-action-height);
  display: block;
  border-radius: 0;
  border: none;
  background-color: transparent;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.action-card-surface {
  position: absolute;
  top: var(--action-card-surface-top);
  left: var(--action-card-surface-left);
  width: var(--action-card-surface-width);
  height: var(--action-card-surface-height);
  border-radius: 0;
  border: calc(1px * var(--action-card-scale)) solid var(--color-card-textbox-border);
  color: var(--color-card-textbox-text);
  background: transparent;
  box-shadow: none;
  display: grid;
  grid-template-rows: var(--action-card-surface-top-height) var(--action-card-surface-mid-height) var(--action-card-surface-bottom-height);
  gap: 0;
}

.action-card-surface-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  color: var(--color-card-textbox-text);
  font-size: calc(9px * var(--action-card-scale) * var(--action-card-text-scale, 1));
  line-height: 1;
  font-weight: 400;
  overflow: hidden;
}

.action-card-surface-row.is-active,
.action-card-surface-row.is-passive {
  background: linear-gradient(160deg, var(--color-card-textbox-start), var(--color-card-textbox-end));
}

.action-card-surface-row.is-passive {
  font-size: calc(8px * var(--action-card-scale) * var(--action-card-text-scale, 1));
}

.action-card-surface-row + .action-card-surface-row {
  border-top: calc(1px * var(--action-card-scale)) solid var(--color-card-textbox-border);
}

.action-card-surface-row.is-empty {
  background: rgba(0, 0, 0, 0.12);
}

.action-card-surface-text {
  width: 100%;
  min-width: 0;
  padding: 0;
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.action-card-stats {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 4;
}

.action-card-stat {
  position: absolute;
  border-radius: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: calc(9px * var(--action-card-scale) * var(--action-card-text-scale, 1));
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.action-card-stat::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--action-card-stat-icon);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}

.action-card-stat-damage {
  width: var(--action-card-damage-width);
  height: var(--action-card-damage-height);
  top: var(--action-card-damage-top);
  left: var(--action-card-damage-left);
}

.action-card-stat-kbf {
  width: var(--action-card-kbf-width);
  height: var(--action-card-kbf-height);
  top: var(--action-card-kbf-top);
  left: var(--action-card-kbf-left);
}

.action-card-stat-kbf.is-throw-indicator::before {
  filter: grayscale(1) brightness(0.7);
}

.action-card-stat-value {
  position: relative;
  z-index: 1;
  line-height: 1;
}

.card-inline-icon {
  display: inline-block;
  height: 1em;
  width: auto;
  vertical-align: -0.05em;
  margin: 0 2px;
}

.action-center {
  position: absolute;
  right: var(--action-center-right);
  bottom: calc(var(--action-hand-height) * 0.08);
  display: grid;
  justify-items: center;
  gap: 12px;
  width: var(--action-panel-width);
  pointer-events: auto;
  z-index: 2;
}

.action-submit {
  display: none;
}

.action-slot-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  justify-items: center;
}

.action-slot {
  position: relative;
  display: grid;
  gap: 0;
  justify-items: center;
}

.action-slot-drop {
  width: calc(var(--action-card-width) * 0.5);
  height: calc(var(--action-card-height) * 0.5);
  padding: 4px;
  border-radius: calc(var(--action-card-radius) * 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.35);
  background: linear-gradient(150deg, rgba(8, 18, 14, 0.7), rgba(8, 18, 14, 0.4));
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.action-slot-drop .action-slot-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--color-accent-strong);
  opacity: 0.95;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 6;
}

.action-slot-drop.is-occupied .action-slot-label {
  opacity: 0;
}

.action-slot-drop.is-occupied {
  border-style: solid;
  border-color: var(--color-accent);
  box-shadow: inset 0 0 0 1px var(--color-highlight-medium);
}

.action-slot-drop.is-hover {
  border-color: var(--color-accent-strong);
  box-shadow: 0 0 12px var(--color-accent-glow);
}

.action-hud.is-locked .action-slot-drop {
  border-color: var(--color-outline-soft);
  background: var(--color-panel-veil);
}

.action-slot-drop .action-card {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  transform: translate(-50%, -50%) scale(0.5);
  transform-origin: center;
  margin: 0;
  cursor: grab;
}

.rotation-selector {
  display: grid;
  justify-items: center;
}

.rotation-wheel {
  width: 165px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.rotation-wheel svg {
  width: 100%;
  height: 100%;
}

.rotation-wheel .rotation-wedge {
  cursor: pointer;
  outline: none;
}

.rotation-wheel .rotation-wedge path {
  fill: var(--color-surface-1);
  stroke: var(--color-panel-border);
  stroke-width: 1.5;
  transition: fill 160ms ease, stroke 160ms ease;
}

.rotation-wheel .rotation-wedge.is-selected path {
  fill: var(--color-accent-strong);
}

.rotation-wheel .rotation-wedge.is-selected text {
  fill: var(--color-text-dark);
}

.rotation-wheel .rotation-wedge.is-disabled {
  cursor: not-allowed;
}

.rotation-wheel .rotation-wedge.is-disabled path {
  fill: #3f4347;
  stroke: #5c6268;
}

.rotation-wheel .rotation-wedge.is-disabled text {
  fill: #9aa1a7;
}

.rotation-wheel .rotation-wedge:focus-visible path {
  stroke: var(--color-accent-strong);
}

.rotation-wheel text {
  font-family: var(--font-heading);
  font-size: 12px;
  fill: var(--color-text);
  pointer-events: none;
}

.rotation-wheel .rotation-center circle {
  fill: var(--color-panel);
  stroke: var(--color-panel-border);
  stroke-width: 1.5;
}

.rotation-wheel .rotation-center {
  pointer-events: none;
}

.rotation-wheel .rotation-center text {
  font-family: var(--font-body);
  font-size: 6.5px;
  letter-spacing: 0.02em;
  fill: var(--color-subtle);
}

.rotation-wheel.is-submit-ready .rotation-center {
  pointer-events: auto;
  cursor: pointer;
}

.rotation-wheel.is-submit-ready .rotation-center circle {
  stroke: var(--color-accent);
  filter: drop-shadow(0 0 10px rgba(213, 163, 74, 0.6));
  animation: rotationSubmitPulse 1.2s ease-in-out infinite;
}

.rotation-wheel.is-submit-ready .rotation-center text {
  fill: var(--color-accent-strong);
}

.action-hud.is-locked .rotation-wheel {
  pointer-events: none;
  opacity: 0.6;
}

.action-card-ghost,
.action-card-draw {
  position: fixed;
  left: 0;
  top: 0;
  margin: 0;
  pointer-events: none;
  z-index: 30;
}

.action-card-ghost {
  box-shadow: var(--shadow-strong);
}

.action-card-draw {
  background-image: url('/public/images/CardBack.png');
  background-size: cover;
  background-position: center;
  border-radius: var(--action-card-radius);
  border: var(--action-card-border-width) solid var(--color-card-outline);
  box-shadow: var(--shadow-strong);
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.action-card-draw.is-flipping {
  animation: cardBackFlip 440ms ease forwards;
}

.game-frame {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius-panel) - 6px);
  overflow: hidden;
  background: var(--color-game-surface);
}

.game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  max-width: 100%;
  max-height: 100%;
}

.game-canvas.is-dragging {
  cursor: grabbing;
}

.timeline-tooltip {
  position: absolute;
  z-index: 7;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--color-panel-border);
  background: linear-gradient(150deg, var(--color-panel-strong), var(--color-panel));
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.4;
  box-shadow: var(--shadow-soft);
  pointer-events: none;
}

.timeline-tooltip[hidden] {
  display: none;
}

.timeline-tooltip-text {
  display: block;
}

.timeline-tooltip-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.timeline-tooltip-instruction {
  margin-bottom: 6px;
}

.timeline-tooltip-divider {
  height: 1px;
  margin: 6px 0;
  background: var(--color-divider);
  opacity: 0.7;
}

.timeline-tooltip-passive {
  font-style: italic;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-tooltip-passive-text {
  display: block;
}

@media (max-width: 640px) {
  .action-hud {
    --action-hand-width-base: min(88vw, 360px);
    --action-hand-fan-gap-factor: 0.24;
    --action-hand-card-scale: 0.7;
    --action-panel-width: min(180px, 40vw);
    --action-center-right: 10px;
    --action-hand-modal-gap: 12px;
  }

  .action-hand-movement {
    left: auto;
    right: var(--action-hand-right);
  }

  .action-hand-ability {
    left: auto;
    right: var(--action-hand-right);
  }

  .action-center {
    bottom: calc(var(--action-hand-height) * 0.12);
  }

  .rotation-wheel {
    width: 132px;
  }
}
