.ttt-page .intro,
.mp-page .intro { max-width: 42rem; }

.ttt-shell,
.mp-shell {
  max-width: 520px;
  margin: 0 auto;
}

.ttt-panel,
.mp-panel {
  background: rgba(12, 18, 28, 0.72);
  border: 1px solid rgba(120, 255, 210, 0.14);
  border-radius: 1.25rem;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
}

.ttt-panel h2,
.mp-panel h2 {
  font-family: Syne, sans-serif;
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}

.ttt-stake-row label,
.mp-stake-row label {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.5rem;
}

.stake-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stake-chip {
  border: 1px solid rgba(120, 255, 210, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: #e8fff8;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.stake-chip.is-active {
  border-color: #5dffb8;
  background: rgba(93, 255, 184, 0.12);
}

.ttt-actions,
.mp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.ttt-msg,
.mp-msg {
  min-height: 1.25rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0.75rem 0 0;
}

.ttt-msg.is-error,
.mp-msg.is-error { color: #ff8a8a; }
.ttt-msg.is-win,
.mp-msg.is-win { color: #5dffb8; }

.ttt-rooms,
.mp-rooms { margin-top: 1.25rem; }
.ttt-rooms h2,
.mp-rooms h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.room-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.room-item strong { color: #5dffb8; }

.ttt-room-code strong,
.mp-room-code strong {
  font-family: Syne, monospace;
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  color: #5dffb8;
}

.ttt-share,
.mp-share {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.72);
}

.ttt-share-row,
.mp-share-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin: 0.35rem 0 1rem;
}

.ttt-link,
.mp-link {
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.ttt-share-row .btn,
.mp-share-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.ttt-hud,
.mp-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ttt-player,
.mp-player {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.ttt-player.opp,
.mp-player.opp { justify-content: flex-end; }

.ttt-player .sym,
.mp-player .sym {
  display: inline-flex;
  width: 1.6rem;
  height: 1.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.4rem;
  font-weight: 700;
  font-family: Syne, sans-serif;
}

.ttt-player.you .sym,
.mp-player.you .sym {
  background: rgba(93, 255, 184, 0.15);
  color: #5dffb8;
}

.ttt-player.opp .sym,
.mp-player.opp .sym {
  background: rgba(255, 140, 120, 0.15);
  color: #ff9a88;
}

.ttt-pot-badge,
.mp-pot-badge {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

.ttt-pot-badge strong,
.mp-pot-badge strong {
  display: block;
  font-size: 1.1rem;
  color: #5dffb8;
}

.ttt-turn,
.mp-turn {
  text-align: center;
  font-size: 0.95rem;
  margin: 0 0 1rem;
  color: rgba(255, 255, 255, 0.75);
}

.ttt-login-note,
.mp-login-note {
  text-align: center;
  padding: 1rem;
}

.ttt-login-note a,
.mp-login-note a { color: #5dffb8; }

.ttt-empty,
.mp-empty {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Connect Four */
.c4-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  max-width: 380px;
  margin: 0 auto;
}

.c4-col {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.35rem;
}

.c4-cell {
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  cursor: default;
}

.c4-cell.p1 { background: #5dffb8; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2); }
.c4-cell.p2 { background: #ff9a88; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2); }

.c4-col-btn {
  border: none;
  background: rgba(93, 255, 184, 0.12);
  color: #5dffb8;
  border-radius: 0.5rem;
  padding: 0.35rem;
  font: inherit;
  cursor: pointer;
  margin-bottom: 0.25rem;
}

.c4-col-btn:hover:not(:disabled) { background: rgba(93, 255, 184, 0.22); }
.c4-col-btn:disabled { opacity: 0.35; cursor: default; }

/* RPS */
.rps-picks {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rps-btn {
  border: 1px solid rgba(120, 255, 210, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: #e8fff8;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  font: inherit;
  font-size: 2rem;
  cursor: pointer;
  min-width: 5rem;
}

.rps-btn:hover:not(:disabled) { border-color: #5dffb8; }
.rps-btn:disabled { opacity: 0.45; cursor: default; }

.rps-score {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1rem 0;
  font-family: Syne, sans-serif;
}

/* Reversi / Gomoku boards */
.rev-board, .go-board {
  display: grid;
  gap: 2px;
  margin: 0 auto;
  max-width: 100%;
}

.rev-board { grid-template-columns: repeat(8, 1fr); max-width: 360px; }
.go-board { grid-template-columns: repeat(15, 1fr); max-width: 420px; }

.rev-cell, .go-cell {
  aspect-ratio: 1;
  border: none;
  background: rgba(20, 80, 55, 0.55);
  border-radius: 0.2rem;
  cursor: pointer;
  position: relative;
}

.rev-cell:disabled, .go-cell:disabled { cursor: default; }

.rev-cell.p1::after, .go-cell.p1::after,
.rev-cell.p2::after, .go-cell.p2::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
}

.rev-cell.p1::after, .go-cell.p1::after { background: #111; }
.rev-cell.p2::after, .go-cell.p2::after { background: #f4f4f4; }

.go-cell { background: rgba(180, 140, 80, 0.35); }

/* War */
.war-table {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1.5rem 0;
}

.war-card {
  width: 4.5rem;
  height: 6.5rem;
  border-radius: 0.6rem;
  background: linear-gradient(145deg, #1a2438, #0d121c);
  border: 1px solid rgba(120, 255, 210, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: Syne, sans-serif;
}

.war-card .rank { font-size: 1.5rem; font-weight: 700; }
.war-card .suit { font-size: 1.25rem; }
.war-card.hearts, .war-card.diamonds { color: #ff7a7a; }
.war-card.spades, .war-card.clubs { color: #e8fff8; }

.war-counts {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.5rem;
}

.war-log {
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  min-height: 2.5rem;
}

.mp-shell-wide { max-width: 640px; }
.mp-scoreline {
  text-align: center;
  font-family: Syne, sans-serif;
  color: rgba(255,255,255,0.75);
  margin: 0 0 0.5rem;
}

/* Dots and Boxes */
.dots-board { display: flex; flex-direction: column; gap: 0; margin: 0 auto; max-width: 360px; }
.dots-row { display: flex; }
.dots-cell { display: grid; grid-template-columns: 1.25rem 1fr; grid-template-rows: 1.25rem 1fr; width: 4.5rem; height: 4.5rem; }
.dots-cell.tail { width: 1.25rem; }
.dots-edge {
  border: none;
  background: rgba(255,255,255,0.12);
  border-radius: 0.25rem;
  cursor: pointer;
  padding: 0;
}
.dots-edge.h { grid-column: 2; height: 0.35rem; align-self: center; }
.dots-edge.v { grid-row: 2; width: 0.35rem; justify-self: center; }
.dots-edge.on { background: #5dffb8; cursor: default; }
.dots-edge:disabled:not(.on) { opacity: 0.25; cursor: default; }
.dots-box {
  grid-row: 2; grid-column: 2;
  border-radius: 0.35rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  color: rgba(0,0,0,0.5);
}
.dots-box.p1 { background: rgba(93,255,184,0.25); }
.dots-box.p2 { background: rgba(255,154,136,0.25); }
.dots-row.bottom .dots-cell { height: 1.25rem; grid-template-rows: 1fr; }

/* Nim */
.nim-board { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.nim-pile { text-align: center; min-width: 5.5rem; }
.nim-stones { display: flex; flex-wrap: wrap; gap: 0.25rem; justify-content: center; min-height: 3rem; margin: 0.5rem 0; }
.nim-stone {
  width: 0.85rem; height: 0.85rem; border-radius: 50%;
  background: #5dffb8;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2);
}
.nim-actions { display: flex; flex-direction: column; gap: 0.35rem; }

/* Mancala */
.mancala-board { max-width: 420px; margin: 0 auto; }
.mancala-top, .mancala-bottom { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.4rem; }
.mancala-mid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 0.6rem 0; }
.mancala-store {
  text-align: center;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(255,255,255,0.06);
  font-family: Syne, sans-serif;
  font-size: 1.4rem;
}
.mancala-store span { display: block; font-size: 0.7rem; color: rgba(255,255,255,0.5); margin-top: 0.25rem; }
.mancala-store.mine { border: 1px solid rgba(93,255,184,0.25); color: #5dffb8; }
.mancala-pit {
  aspect-ratio: 1;
  border: 1px solid rgba(120,255,210,0.2);
  border-radius: 50%;
  background: rgba(20,80,55,0.45);
  color: #e8fff8;
  font: inherit;
  cursor: pointer;
}
.mancala-pit.off { opacity: 0.55; cursor: default; }
.mancala-pit:not(.off):hover { border-color: #5dffb8; }

/* Pig Dice */
.pig-board { text-align: center; }
.pig-score, .pig-turn-total, .pig-die { margin: 0.75rem 0; font-family: Syne, sans-serif; }
.pig-score { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.pig-die { font-size: 1.25rem; }
.pig-actions { display: flex; justify-content: center; gap: 0.75rem; margin-top: 1rem; }

/* Fleet Battle */
.fleet-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.fleet-panel h3 { font-size: 0.85rem; text-align: center; margin: 0 0 0.5rem; color: rgba(255,255,255,0.65); }
.fleet-grid { display: grid; gap: 3px; }
.fleet-cell {
  aspect-ratio: 1;
  border: 1px solid rgba(120,255,210,0.15);
  border-radius: 0.25rem;
  background: rgba(0,40,60,0.45);
  color: #e8fff8;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}
.fleet-cell.ship { background: rgba(93,255,184,0.12); }
.fleet-cell.hit { background: rgba(255,100,80,0.45); }
.fleet-cell.miss { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.35); }
.fleet-cell:disabled { cursor: default; }

@media (max-width: 520px) {
  .fleet-wrap { grid-template-columns: 1fr; }
}
