:root {
  color-scheme: light;

  --background: #f1f5f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;

  --text: #0f172a;
  --muted: #475569;

  --line: #cbd5e1;
  --line-strong: #94a3b8;

  --theme-accent: #2563eb;
  --theme-accent-dark: #1e40af;
  --theme-accent-soft: #dbeafe;

  --success: #15803d;
  --success-soft: #dcfce7;

  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --danger-soft: #fee2e2;

  --warning: #d97706;
  --warning-soft: #fef3c7;

  --radius: 16px;
  --radius-small: 12px;

  --shadow: 0 8px 0 var(--line);
  --shadow-small: 0 4px 0 var(--line);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;

  --background: #0b1120;
  --surface: #111827;
  --surface-alt: #1e293b;

  --text: #f8fafc;
  --muted: #cbd5e1;

  --line: #334155;
  --line-strong: #64748b;

  --theme-accent: #3b82f6;
  --theme-accent-dark: #1d4ed8;
  --theme-accent-soft: #1e3a8a;

  --success: #22c55e;
  --success-soft: #14532d;

  --danger: #ef4444;
  --danger-dark: #b91c1c;
  --danger-soft: #7f1d1d;

  --warning: #f59e0b;
  --warning-soft: #78350f;

  --shadow: 0 8px 0 rgba(0, 0, 0, 0.35);
  --shadow-small: 0 4px 0 rgba(0, 0, 0, 0.35);
}



* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--background);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  font-weight: 900;
  color: var(--text);
}

p {
  margin: 0;
}

a {
  color: var(--theme-accent);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--theme-accent);
  outline-offset: 3px;
}



.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--theme-accent);
  color: #ffffff;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}



.container {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: clamp(18px, 3vw, 32px);
}

header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

header h1 svg {
  width: clamp(26px, 3vw, 36px);
  height: clamp(26px, 3vw, 36px);
  color: var(--theme-accent);
}

.top-actions {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow-small);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.nav-links a svg {
  width: 18px;
  height: 18px;
  color: var(--theme-accent);
}

.nav-links a:hover {
  border-color: var(--theme-accent);
  color: var(--theme-accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--theme-accent);
}

.play-link {
  background: var(--theme-accent);
  border-color: var(--theme-accent-dark);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--theme-accent-dark);
}

.play-link svg {
  color: #ffffff;
}

.play-link:hover {
  color: #ffffff;
  border-color: var(--theme-accent-dark);
  box-shadow: 0 6px 0 var(--theme-accent-dark);
}

main {
  display: grid;
  gap: clamp(16px, 2.5vw, 28px);
}



.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 2.5vw, 30px);
}

.home-card {
  max-width: 760px;
  margin: 0 auto;
}

.card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
}

.card h2 svg {
  width: clamp(22px, 2.4vw, 30px);
  height: clamp(22px, 2.4vw, 30px);
  color: var(--theme-accent);
  flex: 0 0 auto;
}

.card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.card h3 svg {
  width: 20px;
  height: 20px;
  color: var(--theme-accent);
}

.hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}


form {
  display: grid;
  gap: 18px;
}

fieldset {
  margin: 0;
  padding: clamp(14px, 2vw, 20px);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

legend {
  padding: 0 10px;
  font-weight: 900;
  color: var(--text);
}

.field {
  display: grid;
  gap: 7px;
}

label {
  font-weight: 800;
  color: var(--text);
}

input,
textarea,
select {
  width: 100%;
  padding: 13px 15px;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--line);
  border-radius: var(--radius-small);
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 4px var(--theme-accent-soft);
  outline: none;
}

input.invalid,
textarea.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.character-count {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  text-align: right;
}

.character-count.limit {
  color: var(--danger);
}



button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  background: var(--theme-accent);
  color: #ffffff;
  border: 2px solid var(--theme-accent-dark);
  border-radius: var(--radius-small);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--theme-accent-dark);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button svg,
.button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

button:hover:not(:disabled),
.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--theme-accent-dark);
}

button:active:not(:disabled),
.button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--theme-accent-dark);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-small);
}

.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  box-shadow: var(--shadow-small);
}

.secondary:hover:not(:disabled) {
  border-color: var(--theme-accent);
  color: var(--theme-accent);
  box-shadow: 0 6px 0 var(--theme-accent);
}

.danger {
  background: var(--danger);
  border-color: var(--danger-dark);
  box-shadow: 0 4px 0 var(--danger-dark);
}

.danger:hover:not(:disabled) {
  box-shadow: 0 6px 0 var(--danger-dark);
}

.back-button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  box-shadow: var(--shadow-small);
  margin-bottom: 16px;
}

.back-button:hover:not(:disabled) {
  border-color: var(--theme-accent);
  color: var(--theme-accent);
  box-shadow: 0 6px 0 var(--theme-accent);
}

.create-button {
  width: 100%;
}

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

.home-actions {
  display: grid;
  gap: 12px;
}

.main-action {
  width: 100%;
}



.status {
  min-height: 22px;
  font-weight: 800;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--success);
}



.code-box {
  display: grid;
  place-items: center;
  margin: 14px 0;
  padding: clamp(16px, 3vw, 26px);
  background: var(--theme-accent);
  color: #ffffff;
  border: 3px solid var(--theme-accent-dark);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--theme-accent-dark);
  font-size: clamp(2rem, 8vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  overflow-wrap: anywhere;
}



.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
  padding: clamp(12px, 1.8vw, 18px);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.item > div {
  display: grid;
  gap: 6px;
}

.remove-item {
  padding: 12px;
}

@media (max-width: 760px) {
  .item {
    grid-template-columns: 1fr;
  }

  .remove-item {
    width: 100%;
  }
}



.saved-games {
  display: grid;
  gap: 12px;
}

.saved-game {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px;
  background: var(--surface-alt);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.saved-game.removing {
  opacity: 0;
  transform: scale(0.97);
}

.saved-game strong {
  font-size: 1.1rem;
}

.saved-game-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}



.game-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(14px, 2vw, 24px);
}

.connection-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}

.connection-line {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  opacity: 0.9;
}

.game-column {
  min-width: 0;
  background: var(--surface-alt);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(14px, 2vw, 20px);
}

.option {
  position: relative;
  z-index: 6;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-small);
  margin-bottom: 10px;
  padding: 13px 44px 13px 15px;
  min-height: 54px;
  white-space: normal;
}

.option:hover:not(:disabled) {
  border-color: var(--theme-accent);
  box-shadow: 0 5px 0 var(--theme-accent);
}

.option.selected {
  background: var(--theme-accent);
  border-color: var(--theme-accent-dark);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--theme-accent-dark);
}

.option.selected::after {
  content: "✓";
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--theme-accent-dark);
  font-weight: 900;
  font-size: 14px;
}

.option.linked {
  border-color: currentColor;
}

.selection-hint {
  min-height: 22px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--muted);
}

.progress {
  margin-bottom: 14px;
  font-weight: 900;
  color: var(--text);
}


.result-score {
  margin: 12px 0;
  font-size: clamp(2rem, 8vw, 3.2rem);
  font-weight: 900;
  color: var(--theme-accent);
}

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

.result-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  background: var(--surface-alt);
  border: 2px solid var(--line);
  border-radius: var(--radius-small);
  text-align: left;
}

.result-item.correct {
  border-color: var(--success);
}

.result-item.incorrect {
  border-color: var(--danger);
}

.result-icon {
  width: 22px;
  height: 22px;
  margin-top: 2px;
}

.result-item.correct .result-icon {
  color: var(--success);
}

.result-item.incorrect .result-icon {
  color: var(--danger);
}



.screen {
  height: 100dvh;
  width: 100vw;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(6px, 0.8vw, 12px);
  padding: clamp(8px, 1vw, 16px);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1vw, 16px);
  flex-wrap: wrap;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.8vw, 12px);
  font-size: clamp(1rem, 2vw, 1.6rem);
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
}

.site-brand svg {
  width: clamp(22px, 2.4vw, 34px);
  height: clamp(22px, 2.4vw, 34px);
  color: var(--theme-accent);
}

.site-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: clamp(6px, 0.8vw, 10px) clamp(10px, 1.2vw, 16px);
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
  font-size: clamp(0.75rem, 1.3vw, 1rem);
  text-decoration: none;
  box-shadow: var(--shadow-small);
}

.site-link svg {
  width: clamp(14px, 1.4vw, 20px);
  height: clamp(14px, 1.4vw, 20px);
  color: var(--theme-accent);
}

.site-link:hover {
  border-color: var(--theme-accent);
  color: var(--theme-accent);
}

.screen-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(8px, 1vw, 16px);
}

.panel {
  min-height: 0;
  min-width: 0;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: clamp(16px, 1.8vw, 26px);
  box-shadow: var(--shadow);
  padding: clamp(12px, 1.7vw, 24px);
  display: grid;
  overflow: hidden;
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 7px;
  background: linear-gradient(
    90deg,
    var(--theme-accent),
    var(--theme-accent-dark)
  );
}

.left-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: clamp(8px, 1.1vw, 16px);
  text-align: center;
}

.game-title {
  margin: 0;
  font-size: clamp(1.15rem, 3vw, 2.3rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--text);
  overflow-wrap: anywhere;
}

.room-code {
  display: inline-grid;
  justify-self: center;
  align-items: center;
  padding: clamp(6px, 0.9vw, 12px) clamp(14px, 2vw, 32px);
  background: var(--theme-accent);
  color: #ffffff;
  border-radius: 18px;
  border: 3px solid var(--theme-accent-dark);
  box-shadow: 0 6px 0 var(--theme-accent-dark);
  font-size: clamp(1.8rem, 6vw, 4.4rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  line-height: 1;
  overflow-wrap: anywhere;
}

.qr-area {
  min-height: 0;
  display: grid;
  place-items: center;
}

.qr-box {
  display: grid;
  place-items: center;
  gap: clamp(6px, 0.8vw, 12px);
  background: var(--surface-alt);
  border: 2px solid var(--line);
  border-radius: 22px;
  padding: clamp(10px, 1.4vw, 18px);
  max-height: 100%;
  max-width: 100%;
}

#qrcode {
  display: grid;
  place-items: center;
  background: #ffffff;
  padding: clamp(8px, 1vw, 14px);
  border-radius: 16px;
  border: 2px solid var(--line);
  max-width: 100%;
  max-height: 100%;
}

#qrcode img,
#qrcode canvas {
  display: block;
  max-width: min(32vh, 100%);
  max-height: min(32vh, 100%);
  width: auto;
  height: auto;
}

.qr-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  font-weight: 900;
  color: var(--text);
  font-size: clamp(0.75rem, 1.4vw, 1.05rem);
}

.qr-label svg {
  width: clamp(15px, 1.6vw, 22px);
  height: clamp(15px, 1.6vw, 22px);
  color: var(--theme-accent);
  flex: 0 0 auto;
}

.screen-status {
  margin: 0;
  font-weight: 800;
  font-size: clamp(0.7rem, 1.2vw, 0.95rem);
  color: var(--muted);
}

.screen-status.error {
  color: var(--danger);
}

.right-panel {
  grid-template-rows: auto minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(6px, 0.9vw, 12px);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.8vw, 10px);
  margin: 0;
  font-size: clamp(0.95rem, 1.8vw, 1.45rem);
  font-weight: 900;
  color: var(--text);
}

.heading-icon {
  display: grid;
  place-items: center;
  width: clamp(28px, 2.8vw, 42px);
  height: clamp(28px, 2.8vw, 42px);
  border-radius: 12px;
  background: var(--surface-alt);
  border: 2px solid var(--line);
  color: var(--theme-accent);
  flex: 0 0 auto;
}

.heading-icon svg {
  width: clamp(15px, 1.6vw, 22px);
  height: clamp(15px, 1.6vw, 22px);
}

.leaders {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: clamp(4px, 0.5vw, 7px);
  align-content: start;
  padding-right: clamp(2px, 0.4vw, 6px);
}

.leader {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(6px, 0.8vw, 12px);
  background: var(--surface-alt);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: clamp(4px, 0.65vw, 9px) clamp(8px, 1vw, 14px);
}

.leader.first {
  border-color: #f59e0b;
  box-shadow: 0 4px 0 #f59e0b;
  background: color-mix(in srgb, #f59e0b 12%, var(--surface-alt));
}

.leader-position {
  display: grid;
  place-items: center;
  width: clamp(22px, 2.7vw, 34px);
  height: clamp(22px, 2.7vw, 34px);
  border-radius: 50%;
  background: var(--theme-accent);
  color: #ffffff;
  font-weight: 900;
  font-size: clamp(0.7rem, 1.2vw, 1rem);
  border: 2px solid var(--theme-accent-dark);
}

.leader.first .leader-position {
  background: #f59e0b;
  border-color: #b45309;
}

.leader-name {
  font-weight: 900;
  font-size: clamp(0.78rem, 1.35vw, 1.05rem);
  color: var(--text);
  overflow-wrap: anywhere;
}

.leader-score {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 900;
  font-size: clamp(0.78rem, 1.35vw, 1.05rem);
  color: var(--theme-accent-dark);
  white-space: nowrap;
}

.leader.first .leader-score {
  color: #b45309;
}

.leader-score svg {
  width: clamp(12px, 1.2vw, 17px);
  height: clamp(12px, 1.2vw, 17px);
}

.leader-more {
  opacity: 0.9;
}

.chart-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(6px, 0.8vw, 10px);
}

.chart-box {
  min-height: 0;
  position: relative;
  background: var(--surface-alt);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: clamp(8px, 1vw, 14px);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 100%;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.empty-state svg {
  width: clamp(32px, 3.8vw, 52px);
  height: clamp(32px, 3.8vw, 52px);
  color: var(--theme-accent);
}


.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.color-button {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  min-height: 58px;
  padding: 0;
  border-radius: 16px;
  border: 3px solid var(--line);
  box-shadow: 0 5px 0 var(--line);
  background: var(--swatch);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 0 var(--line);
}

.color-button[aria-pressed="true"] {
  border-color: var(--text);
  box-shadow: 0 5px 0 var(--text);
}

.color-button[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 1.6rem;
  font-weight: 900;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.color-button:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

.theme-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.theme-button {
  justify-content: center;
  min-height: 64px;
}

.theme-button[aria-pressed="true"] {
  background: var(--theme-accent);
  border-color: var(--theme-accent-dark);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--theme-accent-dark);
}



.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: clamp(16px, 3vw, 32px);
  padding-top: clamp(12px, 2vw, 20px);
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}

.footer-brand svg {
  width: 20px;
  height: 20px;
  color: var(--theme-accent);
}

.footer-credits {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-credits svg {
  width: 17px;
  height: 17px;
  color: var(--theme-accent);
}

.footer-credits a {
  color: var(--theme-accent);
  font-weight: 900;
  text-decoration: none;
}

.footer-credits a:hover {
  text-decoration: underline;
}



@media (max-width: 860px) {
  .screen {
    height: auto;
    min-height: 100dvh;
    grid-template-rows: auto auto auto;
  }

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

  .panel,
  .left-panel,
  .right-panel,
  .qr-area,
  .chart-box {
    min-height: auto;
  }

  .leaders {
    max-height: 50vh;
  }

  .chart-box {
    height: 260px;
  }
}

@media (max-width: 720px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .connection-layer {
    display: none;
  }

  .container {
    padding: 16px;
  }

  .card {
    padding: 18px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions button,
  .actions .button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .site-footer {
    justify-content: center;
    text-align: center;
  }

  .nav-links {
    width: 100%;
  }

  .nav-links a {
    flex: 1;
    justify-content: center;
  }
}