:root {
  --bg-dark: #0d0f1a;
  --bg-panel: #1a1d33;
  --text: #e0e8ff;
  --muted: #a0a8c8;
  --accent-blue: #6fa8ff;
  --accent-pink: #ff7ac2;
  --accent-green: #6fe3a2;
  --accent-yellow: #ffd86b;
  --accent-red: #ff6f6f;
  --accent-purple: #b794f6;
  --accent-orange: #ffa94d;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: auto;
}

body {
  background: radial-gradient(circle at top, #1e2245, var(--bg-dark) 70%);
  color: var(--text);
  font-family: "Lexend", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Header */
.app-header {
  padding: 16px 24px;
  border-bottom: 1px solid #303560;
}

.title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
}

.help-icon {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-pink));
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(111, 168, 255, 0.4);
  margin-left: 8px;
  margin-bottom: 2px;
}

.help-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(111, 168, 255, 0.6);
}

.help-icon:active {
  transform: scale(0.95);
}

.limit-badge,
.game-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent-blue);
  line-height: 1;
  text-shadow: 0 0 6px #1a1d33;
}

.tagline {
  font-family: "Space Mono", monospace;
  font-size: 18px;
  color: var(--accent-green);
  text-shadow: 0 0 10px var(--accent-green);
  white-space: nowrap;
}

.scores-display {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.player-score {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-panel);
  padding: 8px 14px;
  border-radius: 20px;
  border: 2px solid #4a4f80;
  transition: all 0.3s ease;
}

.player-score.active {
  border-color: var(--accent-green);
  box-shadow: 0 0 15px rgba(111, 227, 162, 0.4);
}

.player-score-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #4a4f80;
  overflow: hidden;
  background: #1a1d33;
}

.player-score-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-score-name {
  font-family: "Space Mono", monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.player-score-value {
  font-family: "Space Mono", monospace;
  font-size: 16px;
  font-weight: 900;
  color: var(--accent-yellow);
  padding: 2px 8px;
  background: #141938;
  border-radius: 10px;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 16px;
  padding: 16px;
  height: calc(100vh - 140px);
}

.game-area {
  background: linear-gradient(135deg, #0a1628 0%, #000 100%);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: auto;
  border: 1px solid #303560;
  position: relative;
}

.right-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

/* Players Container */
.players-container {
  position: absolute;
  inset: 0;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
}

.player-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg-panel);
  border: 2px solid #4a4f80;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.player-zone.active {
  border-color: var(--accent-green);
  box-shadow: 0 0 25px rgba(111, 227, 162, 0.5);
}

.player-zone.active.human {
  position: relative;
}

.player-zone.active.human::before {
  content: "YOUR TURN";
  position: absolute;
  top: -12px;
  right: 12px;
  background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange));
  color: #000;
  font-family: "Space Mono", monospace;
  font-weight: 900;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(255, 216, 107, 0.6);
  animation: turnPulse 1.5s ease-in-out infinite;
  z-index: 10;
  letter-spacing: 0.5px;
}

@keyframes turnPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(255, 216, 107, 0.6);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 216, 107, 0.8);
  }
}

.player-zone.human {
  grid-column: 1 / -1;
  border-color: var(--accent-blue);
}

.player-info-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #4a4f80;
  background: #1a1d33;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-zone.active .player-avatar-large {
  border-color: var(--accent-green);
  box-shadow: 0 0 20px rgba(111, 227, 162, 0.6);
}

.player-details {
  text-align: left;
}

.player-name-large {
  font-weight: 900;
  font-size: 20px;
  color: var(--text);
  margin-bottom: 4px;
}

.player-cards-count {
  font-family: "Space Mono", monospace;
  font-size: 14px;
  color: var(--muted);
}

.player-cards-count strong {
  color: var(--accent-yellow);
  font-size: 16px;
}

.player-fractions-made {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  justify-content: center;
  max-width: 100%;
}

.fraction-badge {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

/* Panels */
.status-box,
.controls-box,
.my-fractions-box,
.my-hand-box,
.history-box {
  background: var(--bg-panel);
  border: 1px solid #303560;
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.status-box {
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.status-item .label {
  font-size: 12px;
  color: var(--muted);
}

.status-item .value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  font-family: "Space Mono";
  margin-top: 4px;
  color: var(--text);
}

.controls-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.question {
  text-align: center;
  font-weight: 700;
  color: var(--accent-blue);
  font-size: 16px;
}

.player-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* My Fractions Box */
.my-fractions-box h3 {
  margin: 0 0 12px;
  text-align: center;
  color: var(--accent-blue);
  font-size: 16px;
}

.fractions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.fraction-card {
  background: linear-gradient(135deg, #1a1d3a 0%, #242850 100%);
  border: 2px solid var(--accent-purple);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.fraction-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(183, 148, 246, 0.4);
}

.fraction-card.completed {
  opacity: 0.5;
  background: linear-gradient(135deg, #0d3d20 0%, #1a5c35 100%);
  border-color: var(--accent-green);
  cursor: default;
}

.fraction-card.completed:hover {
  transform: none;
}

.fraction-display {
  font-family: "Space Mono", monospace;
  font-size: 18px;
  font-weight: 900;
  color: var(--accent-yellow);
  margin-bottom: 6px;
}

.fraction-card.completed .fraction-display {
  color: var(--accent-green);
}

.pie-chart {
  width: 45px;
  height: 45px;
  margin: 4px auto;
}

.completed-check {
  color: var(--accent-green);
  font-size: 14px;
  font-weight: 900;
}

/* My Hand Box */
.my-hand-box h3 {
  margin: 0 0 12px;
  text-align: center;
  color: var(--accent-blue);
  font-size: 16px;
}

.hand-display {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 80px;
}

.card {
  width: 50px;
  height: 70px;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff 0%, #eaf0ff 100%);
  color: #222;
  border: 2px solid #d0d4e6;
  box-shadow: var(--shadow);
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "Space Mono", monospace;
  font-weight: 900;
  font-size: 16px;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.card.selected {
  transform: translateY(-8px);
  border-color: var(--accent-pink);
  box-shadow: 0 0 20px rgba(255, 122, 194, 0.6);
}

.card.hearts,
.card.diamonds {
  color: #b8103c;
}

.card.spades,
.card.clubs {
  color: #0d0f1a;
}

.card-value {
  font-size: 18px;
  font-weight: 900;
}

.card-suit {
  font-size: 14px;
  margin-top: 4px;
}

/* History */
.history-box h3 {
  margin: 0 0 8px;
  text-align: center;
  color: var(--accent-blue);
  font-size: 16px;
}

.history-list {
  margin: 0;
  padding-left: 20px;
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
}

.history-list li {
  margin: 3px 0;
  padding: 4px 0;
  font-family: "Space Mono";
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.history-list li.highlight {
  color: var(--accent-green);
}

.history-list li.warning {
  color: var(--accent-yellow);
}

.history-list li.error {
  color: var(--accent-red);
}

/* Buttons */
.action-btn,
button.primary,
button.secondary {
  padding: 12px;
  border-radius: 10px;
  border: 2px solid #4a4f80;
  background: #2a2d4a;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.action-btn:hover,
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.action-btn:active,
button:active {
  transform: translateY(0);
}

button.primary {
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-pink));
  border: none;
  padding: 16px;
  font-size: 18px;
}

button.secondary {
  background: linear-gradient(135deg, #4a4f80, #2a2d4a);
  border-color: #4a4f80;
  padding: 14px;
  font-size: 16px;
}

.hidden {
  display: none !important;
}

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: #0d0f1acc;
  backdrop-filter: blur(8px);
  z-index: 100;
}

.overlay.visible {
  display: grid;
}

.overlay .card {
  background: var(--bg-dark);
  border: 2px solid #303560;
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
  color: var(--text);
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
}

.overlay .card h2 {
  margin: 0 0 20px;
  color: var(--accent-blue);
  font-size: 32px;
}

.overlay .card h3 {
  color: var(--accent-pink);
  font-size: 18px;
  margin: 16px 0 8px;
}

.overlay .card p,
.overlay .card ul {
  margin: 8px 0;
  line-height: 1.6;
}

.overlay .card ul {
  padding-left: 24px;
}

.overlay .card li {
  margin: 6px 0;
}

/* Instructions overlay */
.instructions {
  width: min(1000px, 90vw);
  min-height: 60vh;
}

.instructions-content {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 10px;
}

.countdown {
  margin-top: 16px;
  text-align: center;
  color: var(--accent-yellow);
  font-family: "Space Mono";
  font-size: 16px;
  font-weight: 700;
}

/* Setup overlay */
.setup {
  width: min(800px, 90vw);
  min-height: 60vh;
}

.setup form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setup label {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.setup input,
.setup select {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  border-radius: 8px;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid #4a4f80;
  font-size: 16px;
}

.avatar-preview {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid #4a4f80;
  overflow: hidden;
  background: #1a1d33;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px auto;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.avatar-preview:hover {
  border-color: var(--accent-purple);
  transform: scale(1.05);
}

.change-avatar-btn {
  padding: 12px 20px !important;
  width: auto !important;
  margin: 0 auto;
  display: block;
  font-size: 15px !important;
}

/* Avatar selection modal */
.avatar-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.avatar-modal.hidden {
  display: none;
}

.avatar-modal-content {
  background: var(--bg-panel);
  border: 2px solid var(--accent-purple);
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow);
}

.avatar-modal-content h3 {
  margin: 0 0 16px;
  color: var(--accent-purple);
  text-align: center;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.avatar-option {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid #4a4f80;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  background: #1a1d33;
  padding: 8px;
  position: relative;
}

.avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.avatar-option:hover {
  border-color: var(--accent-purple);
  transform: scale(1.05);
}

.avatar-option.selected {
  border-color: var(--accent-green);
  box-shadow: 0 0 15px rgba(111, 255, 177, 0.5);
}

.avatar-modal-close {
  width: 100%;
}

/* Fraction selection modal */
.fraction-select {
  width: min(900px, 92vw);
  max-height: 85vh;
  min-height: 60vh;
}

.fraction-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.fraction-option {
  background: linear-gradient(135deg, #1a1d3a 0%, #242850 100%);
  border: 2px solid var(--accent-purple);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.fraction-option:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(183, 148, 246, 0.5);
  border-color: var(--accent-green);
}

.fraction-option-display {
  font-family: "Space Mono", monospace;
  font-size: 34px;
  font-weight: 900;
  color: var(--accent-yellow);
  margin-bottom: 10px;
}

.fraction-option-equivalent {
  font-family: "Space Mono", monospace;
  font-size: 16px;
  color: var(--accent-pink);
  margin-top: 6px;
}

/* Card pair selection modal */
.card-pair-select {
  width: min(1100px, 95vw);
  max-height: 88vh;
  min-height: 65vh;
}

.modal-subtitle {
  text-align: center;
  font-size: 18px;
  color: var(--accent-pink);
  margin: -8px 0 20px 0;
}

.modal-subtitle strong {
  color: var(--accent-yellow);
  font-family: "Space Mono", monospace;
  font-size: 24px;
}

.card-pair-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
  max-height: 65vh;
  overflow-y: auto;
  padding: 8px;
}

.card-pair-option {
  background: linear-gradient(135deg, #1a1d3a 0%, #242850 100%);
  border: 2px solid var(--accent-blue);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.card-pair-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(111, 168, 255, 0.6);
  border-color: var(--accent-green);
  background: linear-gradient(135deg, #1f2340 0%, #2a3060 100%);
}

.card-pair-option .card {
  width: 65px;
  height: 91px;
  flex-shrink: 0;
  font-size: 14px;
}

.card-pair-option .card .card-value {
  font-size: 18px;
  font-weight: 900;
}

.card-pair-option .card .card-suit {
  font-size: 16px;
}

.card-pair-equals {
  font-family: "Space Mono", monospace;
  font-size: 24px;
  font-weight: 900;
  color: var(--accent-yellow);
}

.card-pair-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}

.card-pair-fraction {
  font-family: "Space Mono", monospace;
  font-size: 28px;
  font-weight: 900;
  color: var(--accent-green);
}

.card-pair-simplified {
  font-family: "Space Mono", monospace;
  font-size: 13px;
  color: var(--accent-pink);
  font-weight: 600;
}

/* Game over overlay */
.gameover {
  width: min(700px, 90vw);
  min-height: 40vh;
  text-align: center;
}

.gameover h2 {
  font-size: 42px;
  margin: 0 0 20px;
  text-shadow: 0 0 20px var(--accent-blue);
}

.winner-display {
  margin: 20px 0;
  padding: 20px;
  background: var(--bg-panel);
  border-radius: 12px;
  border: 2px solid var(--accent-green);
}

.winner-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--accent-green);
  margin: 0 auto 16px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(111, 227, 162, 0.6);
}

.winner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.winner-name {
  font-size: 24px;
  font-weight: 900;
  color: var(--accent-green);
  margin-bottom: 8px;
}

.winner-stats {
  font-family: "Space Mono", monospace;
  font-size: 18px;
  color: var(--accent-yellow);
}

.gameover-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.gameover-actions button {
  flex: 1;
}

/* Help modal */
.help-modal {
  width: min(1000px, 95vw);
  max-height: 90vh;
  min-height: 70vh;
  position: relative;
}

.close-help {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--accent-pink);
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  z-index: 10;
}

.close-help:hover {
  background: rgba(255, 107, 178, 0.2);
  transform: rotate(90deg);
}

.help-modal h2 {
  color: var(--accent-blue);
  margin-bottom: 24px;
  padding-right: 40px;
  font-size: 36px;
}

.help-modal .instructions-content {
  max-height: 68vh;
  overflow-y: auto;
  margin-bottom: 24px;
  padding-right: 12px;
  font-size: 16px;
}

.help-modal .instructions-content h3 {
  font-size: 22px;
  margin-top: 20px;
  margin-bottom: 12px;
}

.help-modal .instructions-content p,
.help-modal .instructions-content ul {
  font-size: 16px;
  line-height: 1.6;
}

.help-modal .instructions-content li {
  margin-bottom: 8px;
}

.help-modal .instructions-content::-webkit-scrollbar {
  width: 8px;
}

.help-modal .instructions-content::-webkit-scrollbar-track {
  background: var(--bg-panel);
  border-radius: 4px;
}

.help-modal .instructions-content::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
  border-radius: 4px;
}

.help-modal .instructions-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

/* Card play animation container */
.card-play-container {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  animation: cardPlayContainer 2s ease-out forwards;
  pointer-events: none;
}

/* Fraction made label animation */
.fraction-made-label {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: "Space Mono", monospace;
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  min-width: 60px;
  text-align: center;
}

/* Card pair container */
.played-cards-animation {
  display: flex;
  gap: 8px;
}

.played-cards-animation .card {
  width: 60px;
  height: 84px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

@keyframes cardPlayContainer {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1d33;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #4a4f80;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6fa8ff;
}

/* Responsive */
@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr 360px;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  body {
    overflow: auto;
  }

  .right-panel {
    max-height: none;
  }

  .game-area {
    min-height: 600px;
  }

  .players-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .fraction-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .fraction-options {
    grid-template-columns: 1fr;
  }
}
