/* ===== Arcade Lounge — Design System ===== */

:root {
  --bg: #1A1025;
  --panel: #241733;
  --panel-2: #2E1D42;
  --ink: #F5F0FF;
  --ink-dim: #B8A9CC;
  --violet: #7C5CFF;
  --lime: #C6FF3D;
  --pink: #FF3D8A;

  --radius: 14px;
  --border: 1px solid rgba(245, 240, 255, 0.08);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 10% 0%, rgba(124, 92, 255, 0.28), transparent 45%),
    radial-gradient(circle at 90% 0%, rgba(255, 61, 138, 0.22), transparent 45%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
}

img, svg {
  max-width: 100%;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Topbar ===== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 12px var(--lime);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-dim);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--lime);
}

.back-link {
  text-decoration: none;
  color: var(--ink-dim);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--lime);
}

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--lime);
  color: #14200a;
  box-shadow: 0 0 0 rgba(198, 255, 61, 0);
}

.btn-primary:hover {
  box-shadow: 0 0 24px rgba(198, 255, 61, 0.55);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(245, 240, 255, 0.25);
}

.btn-ghost:hover {
  border-color: var(--violet);
  color: var(--ink);
  box-shadow: 0 0 16px rgba(124, 92, 255, 0.35);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-block {
  width: 100%;
}

/* ===== Panels ===== */

.panel {
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ===== Hero ===== */

.hero {
  text-align: center;
  padding: 80px 24px 60px;
  max-width: 900px;
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  margin: 0 0 20px;
  text-transform: uppercase;
}

.hero h1 .accent-lime {
  color: var(--lime);
}

.hero h1 .accent-pink {
  color: var(--pink);
}

.hero p {
  font-size: 1.1rem;
  color: var(--ink-dim);
  max-width: 560px;
  margin: 0 auto 32px;
}

/* ===== Games grid ===== */

.section {
  padding: 40px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 28px;
  text-align: center;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.game-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--violet);
  box-shadow: 0 12px 30px rgba(124, 92, 255, 0.25);
}

.game-card .eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--lime);
  background: rgba(198, 255, 61, 0.1);
  border: 1px solid rgba(198, 255, 61, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 14px;
}

.game-card h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.game-card p {
  color: var(--ink-dim);
  font-size: 0.92rem;
  margin: 0;
}

.game-card.coming-soon {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(0.6);
}

.game-card.coming-soon .eyebrow {
  color: var(--ink-dim);
  background: rgba(245, 240, 255, 0.06);
  border-color: rgba(245, 240, 255, 0.2);
}

/* ===== How it works ===== */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.step {
  text-align: center;
  padding: 20px;
}

.step-num {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  background: rgba(124, 92, 255, 0.15);
  border: 1px solid rgba(124, 92, 255, 0.5);
  color: var(--violet);
}

.step h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.step p {
  color: var(--ink-dim);
  font-size: 0.88rem;
  margin: 0;
}

/* ===== Ad slot ===== */

.ad-slot {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 24px;
  text-align: center;
}

/* ===== Footer ===== */

footer {
  border-top: var(--border);
  margin-top: 60px;
  padding: 28px 24px;
  text-align: center;
  color: var(--ink-dim);
  font-size: 0.85rem;
}

/* ===== Ticket / room code box ===== */

.ticket {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 28px;
  border: 2px dashed var(--lime);
  border-radius: 10px;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(198, 255, 61, 0.05),
      rgba(198, 255, 61, 0.05) 10px,
      rgba(198, 255, 61, 0.09) 10px,
      rgba(198, 255, 61, 0.09) 20px
    ),
    var(--panel);
}

.ticket-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.ticket-code {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--lime);
  text-shadow: 0 0 12px rgba(198, 255, 61, 0.6);
  letter-spacing: 0.04em;
  word-break: break-all;
  text-align: center;
}

/* ===== Game page layout ===== */

.game-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

.lobby {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.lobby h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  margin: 0 0 14px;
  text-transform: uppercase;
}

.field-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

input[type="text"] {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid rgba(245, 240, 255, 0.15);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--violet);
}

input[type="text"]::placeholder {
  color: var(--ink-dim);
}

.copy-btn {
  margin-top: 12px;
}

/* Status indicator */

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--ink-dim);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
  flex-shrink: 0;
}

.status-dot.waiting {
  background: var(--pink);
  animation: pulse 1.2s ease-in-out infinite;
}

.status-dot.connected {
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* Turn banner */

.turn-banner {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 14px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  background: var(--panel);
  border: var(--border);
  color: var(--ink-dim);
}

.turn-banner.your-turn {
  color: var(--lime);
  border-color: rgba(198, 255, 61, 0.4);
  box-shadow: 0 0 20px rgba(198, 255, 61, 0.15);
}

.turn-banner.win {
  color: var(--lime);
  border-color: rgba(198, 255, 61, 0.5);
}

.turn-banner.lose {
  color: var(--pink);
  border-color: rgba(255, 61, 138, 0.5);
}

.turn-banner.draw {
  color: var(--ink);
}

/* Board wrapper */

.board-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.game-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.hidden {
  display: none !important;
}

/* ===== Tic-Tac-Toe board ===== */

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 90px);
  grid-template-rows: repeat(3, 90px);
  gap: 8px;
}

.ttt-cell {
  background: var(--panel);
  border: var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.6rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  color: var(--ink);
}

.ttt-cell:hover:not(.filled) {
  border-color: var(--violet);
  background: var(--panel-2);
}

.ttt-cell.filled {
  cursor: default;
}

.ttt-cell.mark-x {
  color: var(--violet);
}

.ttt-cell.mark-o {
  color: var(--pink);
}

.ttt-cell.win-cell {
  color: var(--lime) !important;
  box-shadow: inset 0 0 0 2px var(--lime);
}

/* ===== Connect Four board ===== */

.c4-board {
  display: inline-grid;
  grid-template-columns: repeat(7, 52px);
  grid-auto-rows: 52px;
  gap: 6px;
  background: var(--panel-2);
  border: var(--border);
  border-radius: 10px;
  padding: 10px;
}

.c4-col {
  display: contents;
}

.c4-cell {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg);
  position: relative;
  cursor: pointer;
}

.c4-cell:hover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--violet);
}

.c4-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform: scale(0);
  animation: drop 0.35s ease forwards;
}

.c4-disc.red {
  background: radial-gradient(circle at 35% 30%, #ff6b9d, var(--pink));
}

.c4-disc.yellow {
  background: radial-gradient(circle at 35% 30%, #fff58a, var(--lime));
}

.c4-disc.win {
  box-shadow: 0 0 14px 3px var(--lime);
}

@keyframes drop {
  from { transform: scale(0.3); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}

/* ===== 8x8 board (Checkers, Othello) ===== */

.board8 {
  display: inline-grid;
  grid-template-columns: repeat(8, 52px);
  grid-template-rows: repeat(8, 52px);
  border: var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.board8-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.board8-cell.light {
  background: var(--panel-2);
}

.board8-cell.dark {
  background: #150c1f;
}

.board8-cell.selectable {
  cursor: pointer;
}

.board8-cell.selectable:hover::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 2px var(--violet);
}

.board8-cell.highlight::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 3px var(--lime);
}

/* Checkers pieces */

.checker-piece {
  width: 76%;
  height: 76%;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.checker-piece.red {
  background: radial-gradient(circle at 35% 30%, #ff6b9d, var(--pink));
  color: #3a0018;
}

.checker-piece.white {
  background: radial-gradient(circle at 35% 30%, #ffffff, #d8cdeb);
  color: #2c2140;
}

.checker-piece.selected {
  box-shadow: 0 0 0 3px var(--lime), 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Othello discs */

.othello-disc {
  width: 80%;
  height: 80%;
  border-radius: 50%;
}

.othello-disc.violet {
  background: radial-gradient(circle at 35% 30%, #b7a4ff, var(--violet));
}

.othello-disc.pink {
  background: radial-gradient(circle at 35% 30%, #ff9dc4, var(--pink));
}

.othello-disc.ghost {
  opacity: 0.22;
}

.othello-disc.win {
  box-shadow: 0 0 14px 3px var(--lime);
}

/* ===== Battleship ===== */

.bs-boards {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.bs-board-wrap {
  text-align: center;
}

.bs-label {
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.bs-grid {
  display: inline-grid;
  grid-template-columns: repeat(8, 34px);
  grid-template-rows: repeat(8, 34px);
  gap: 3px;
  background: var(--panel);
  border: var(--border);
  border-radius: 10px;
  padding: 8px;
}

.bs-cell {
  width: 34px;
  height: 34px;
  background: var(--panel-2);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bs-cell.not-clickable {
  cursor: default;
}

.bs-cell.ship {
  background: var(--violet);
}

.bs-cell.hit {
  background: var(--pink);
  box-shadow: 0 0 8px rgba(255, 61, 138, 0.6);
}

.bs-cell.miss::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-dim);
}

.bs-cell.sunk {
  background: #5c0026;
}

/* ===== Dots and Boxes ===== */

.dab-board {
  display: inline-grid;
  background: var(--panel);
  border: var(--border);
  border-radius: 10px;
  padding: 14px;
}

.dab-dot {
  background: var(--ink-dim);
  border-radius: 50%;
}

.dab-edge {
  background: rgba(245, 240, 255, 0.08);
  border-radius: 3px;
  cursor: pointer;
}

.dab-edge:hover {
  background: rgba(124, 92, 255, 0.5);
}

.dab-edge.filled-host {
  background: var(--violet);
  cursor: default;
}

.dab-edge.filled-joiner {
  background: var(--pink);
  cursor: default;
}

.dab-box {
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.dab-box.owned-host {
  background: rgba(124, 92, 255, 0.28);
  color: var(--violet);
}

.dab-box.owned-joiner {
  background: rgba(255, 61, 138, 0.28);
  color: var(--pink);
}

/* ===== Rock Paper Scissors ===== */

.rps-choices {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.rps-choice-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  font-size: 2.4rem;
  background: var(--panel);
  border: var(--border);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.rps-choice-btn:hover:not(:disabled) {
  transform: translateY(-4px);
  border-color: var(--violet);
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.3);
}

.rps-choice-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.rps-choice-btn.picked {
  border-color: var(--lime);
  box-shadow: 0 0 20px rgba(198, 255, 61, 0.4);
}

.rps-reveal {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
  font-size: 3rem;
}

.rps-reveal .vs {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink-dim);
}

.rps-score {
  text-align: center;
  font-family: var(--font-mono);
  color: var(--ink-dim);
  margin-bottom: 16px;
}

.rps-score .me {
  color: var(--lime);
  font-weight: 700;
}

.rps-score .opp {
  color: var(--pink);
  font-weight: 700;
}

/* ===== Sketch and Guess ===== */

.word-choices {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.word-choice-btn {
  min-width: 140px;
  text-transform: capitalize;
}

.draw-canvas-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.draw-canvas {
  background: #ffffff;
  border-radius: 10px;
  border: var(--border);
  touch-action: none;
  cursor: crosshair;
  max-width: 100%;
  height: auto;
}

.draw-canvas.readonly {
  cursor: default;
}

.guess-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.guess-row input[type="text"] {
  max-width: 240px;
}

.guess-log {
  max-width: 420px;
  margin: 0 auto 20px;
  max-height: 160px;
  overflow-y: auto;
}

.guess-item {
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.9rem;
  background: var(--panel);
  border: 1px solid transparent;
}

.guess-item.correct {
  color: var(--lime);
  border-color: rgba(198, 255, 61, 0.4);
}

.guess-item.wrong {
  color: var(--ink-dim);
}

/* ===== Responsive ===== */

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    gap: 12px;
  }

  .nav-links {
    gap: 18px;
  }

  .ttt-board {
    grid-template-columns: repeat(3, 28vw);
    grid-template-rows: repeat(3, 28vw);
  }

  .c4-board {
    grid-template-columns: repeat(7, 12vw);
    grid-auto-rows: 12vw;
  }

  .c4-cell {
    width: 12vw;
    height: 12vw;
  }

  .board8 {
    grid-template-columns: repeat(8, 11vw);
    grid-template-rows: repeat(8, 11vw);
  }

  .bs-grid {
    grid-template-columns: repeat(8, 9vw);
    grid-template-rows: repeat(8, 9vw);
  }

  .bs-cell {
    width: 9vw;
    height: 9vw;
  }

  .bs-boards {
    gap: 16px;
  }
}
