:root {
  --bg: #f4efe6;
  --card: #fffaf3;
  --ink: #1f1c1a;
  --accent: #b14d2a;
  --accent-soft: #f3d4c8;
  --grid-gap: 10px;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff6e8 0%, #efe3d3 45%, #e9d9c6 100%);
  min-height: 100vh;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

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

.title-block h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3rem);
  letter-spacing: 1px;
}

.subtitle {
  margin: 6px 0 0;
  font-size: 1rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 10px 16px;
  font-size: 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.status {
  margin: 18px 0 10px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bingo-banner {
  background: var(--accent);
  color: #fff;
  padding: 8px 22px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 2px;
  box-shadow: var(--shadow);
}

.board {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.cell {
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 14px 10px;
  min-height: 88px;
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  background: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.cell:hover {
  transform: translateY(-1px);
}

.cell.marked {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.cell.free {
  background: #fce9d4;
  border-style: dashed;
}

.cell.bingo {
  background: #1f1c1a;
  color: #fff;
  border-color: #1f1c1a;
}

@media (max-width: 720px) {
  .controls {
    width: 100%;
    justify-content: flex-start;
  }

  .board {
    padding: 14px;
  }

  .cell {
    min-height: 72px;
    padding: 10px 6px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .controls,
  .subtitle,
  .status {
    display: none;
  }

  .page {
    padding: 0;
  }

  .board {
    box-shadow: none;
    padding: 0;
    border-radius: 0;
  }

  .cell {
    border-color: #000;
    color: #000;
    background: #fff;
  }

  .cell.marked,
  .cell.free,
  .cell.bingo {
    background: #fff;
    color: #000;
  }
}
