* {
  box-sizing: border-box;
}
:root {
  --bg: #080808;
  --panel: #111;
  --panel2: #171717;
  --red: #d20b12;
  --bright-red: #ff2028;
  --dark-red: #5e080b;
  --line: #4a181a;
  --text: #f1eeee;
  --muted: #9b9292;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  background:
    radial-gradient(circle at 50% -10%, #3b090c 0, transparent 35%),
    linear-gradient(135deg, #050505 0%, #120607 48%, #050505 100%);
  color: var(--text);
  min-height: 100vh;
}
body::before {
  content: "♠     ♦     ♣     ♥";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  font-size: 18vw;
  letter-spacing: 5vw;
  transform: rotate(-12deg) translate(-5%, 20%);
  white-space: nowrap;
}
main {
  width: min(1200px, 94vw);
  margin: 26px auto 48px;
  position: relative;
}
h1 {
  text-align: center;
  letter-spacing: 0.18em;
  font-size: clamp(36px, 6vw, 64px);
  margin: 0 0 4px;
  color: #fff;
  text-shadow: 0 0 16px #d20b12;
}
.controls {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 26px auto;
  max-width: 900px;
}
button,
input {
  font: inherit;
  height: 48px;
  border: 1px solid #5a2022;
  border-radius: 7px;
}
button {
  padding: 0 22px;
  cursor: pointer;
  color: white;
  background: linear-gradient(#c9141a, #72080c);
  box-shadow:
    inset 0 1px #ff6267,
    0 4px 14px #000;
  font-weight: 700;
}
button:hover:not(:disabled) {
  background: linear-gradient(#ed1a22, #930b10);
  box-shadow:
    inset 0 1px #ff8588,
    0 0 16px #a50d12;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}
input {
  width: 100%;
  padding: 0 14px;
  color: white;
  background: #090909;
  outline: none;
}
input:focus {
  border-color: var(--bright-red);
  box-shadow: 0 0 10px #8c0c11;
}
.current {
  text-align: center;
  margin: 14px auto 28px;
  min-height: 126px;
  width: 190px;
  padding: 12px 10px;
  border: 1px solid #67181b;
  border-radius: 50%;
  background: radial-gradient(circle, #3c080b 0%, #100505 65%);
  box-shadow:
    0 0 30px #43090c,
    inset 0 0 25px #000;
}
.current-label {
  font:
    12px system-ui,
    sans-serif;
  color: #a88c8c;
  letter-spacing: 0.12em;
}
.number {
  font-size: 66px;
  line-height: 1.1;
  font-weight: 700;
  color: white;
  text-shadow: 0 0 14px #ff3036;
}
#message {
  min-height: 1.5em;
  text-align: center;
  color: #ff5b60;
  margin-bottom: 12px;
  font:
    14px system-ui,
    sans-serif;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.card-wrap {
  background: linear-gradient(145deg, #1a090a, #090909);
  border: 1px solid #7c171b;
  border-radius: 9px;
  padding: 10px;
  box-shadow:
    0 10px 25px #000,
    inset 0 0 20px #260708;
}
.card-wrap h2 {
  text-align: center;
  font-size: 19px;
  letter-spacing: 0.16em;
  margin: 2px 0 10px;
  color: #eee;
}
.card-wrap h2::before,
.card-wrap h2::after {
  content: " ♦ ";
  color: #bd1218;
}
.card {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  aspect-ratio: 1;
  border: 1px solid #7b383b;
  background: #080808;
}
.cell {
  min-width: 0;
  display: grid;
  place-items: center;
  border-right: 1px solid #402224;
  border-bottom: 1px solid #402224;
  font-size: clamp(18px, 3vw, 29px);
  font-weight: 600;
  background: linear-gradient(145deg, #151515, #090909);
  color: #e9e2e2;
  transition: 0.15s;
}
.cell:nth-child(5n) {
  border-right: 0;
}
.cell:nth-last-child(-n + 5) {
  border-bottom: 0;
}
.cell.opened {
  background: radial-gradient(circle, #f02228 0%, #9b0b10 62%, #4a0608 100%);
  color: white;
  text-shadow: 0 0 9px white;
  box-shadow:
    inset 0 0 12px #ff5d62,
    0 0 8px #71080c;
}
.cell.reach {
  background: linear-gradient(145deg, #8f6500, #4d3500);
  color: #fff;
  box-shadow:
    inset 0 0 10px #ffd84a,
    0 0 10px #a87500;
}
.cell.bingo {
  background: linear-gradient(145deg, #ff3038, #9b080e);
  color: #fff;
  text-shadow: 0 0 9px #fff;
  box-shadow:
    inset 0 0 14px #ff777b,
    0 0 16px #e3131a;
}

.history {
  margin: 22px auto 0;
  padding: 13px 16px;
  background: #0b0b0b;
  border: 1px solid #381719;
  border-radius: 8px;
}
.history-title {
  font:
    12px system-ui,
    sans-serif;
  letter-spacing: 0.15em;
  color: #a98c8c;
  margin-bottom: 9px;
}
#history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.history-number {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 7px;
  border: 1px solid #492022;
  border-radius: 50%;
  background: #151010;
  color: #ddd;
}
.history-number:first-child {
  background: #c20d13;
  border-color: #ff3a40;
  box-shadow: 0 0 10px #74090d;
  color: white;
}
@media (max-width: 750px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }
  .controls input {
    grid-column: 1;
  }
  .controls #selectButton {
    grid-column: 2;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  main {
    width: min(500px, 94vw);
  }
}
