:root {
  color-scheme: dark;
  --bg: #070a0d;
  --panel: rgba(11, 18, 24, 0.84);
  --panel-strong: rgba(16, 27, 35, 0.96);
  --felt: #07543e;
  --felt-dark: #053829;
  --text: #f4f7fb;
  --muted: #a9b8c7;
  --line: rgba(255, 255, 255, 0.13);
  --gold: #f6c65b;
  --green: #31d083;
  --red: #ff6b6b;
  --blue: #66d9ef;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(49, 208, 131, 0.2), transparent 28rem),
    radial-gradient(circle at 85% 15%, rgba(246, 198, 91, 0.16), transparent 30rem),
    linear-gradient(135deg, #05070a, #0b1218 55%, #07130f);
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid rgba(246, 198, 91, 0.42);
  outline-offset: 3px;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.topbar, .hero, .card-heading, .score-card {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar { justify-content: space-between; margin-bottom: 36px; }
.gallery-link, .pill, button, .score-card, .card {
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.gallery-link, .pill {
  border-radius: 999px;
  padding: 0.72rem 0.95rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.gallery-link:hover { color: var(--text); border-color: rgba(246, 198, 91, 0.45); }

.hero {
  justify-content: space-between;
  align-items: stretch;
  margin-bottom: 28px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow.small { font-size: 0.7rem; }
h1, h2 { margin: 0; letter-spacing: -0.04em; }
h1 {
  max-width: 900px;
  font-size: clamp(2.75rem, 8vw, 6.6rem);
  line-height: 0.9;
}
h2 { font-size: clamp(1.55rem, 3vw, 2.35rem); }
.lede, .subtle, .feedback, details { color: var(--muted); line-height: 1.65; }
.lede { max-width: 780px; font-size: 1.08rem; }

.score-card {
  flex-wrap: wrap;
  justify-content: center;
  min-width: min(100%, 330px);
  padding: 18px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
}
.score-card div { min-width: 74px; text-align: center; }
.score-card span { display: block; font-size: 1.85rem; font-weight: 900; color: var(--green); }
.score-card small { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

.layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr); gap: 22px; }
.card {
  border-radius: 30px;
  padding: clamp(20px, 4vw, 34px);
  background: linear-gradient(145deg, var(--panel), rgba(255, 255, 255, 0.045));
  box-shadow: var(--shadow);
}
.card-heading { justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }

button {
  border-radius: 999px;
  padding: 0.86rem 1rem;
  color: #06100c;
  background: linear-gradient(135deg, var(--gold), #ffe29a);
  font-weight: 900;
  box-shadow: 0 12px 35px rgba(246, 198, 91, 0.18);
}
button:hover { transform: translateY(-1px); }
button.secondary, button.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}
button.ghost { padding: 0.65rem 0.85rem; color: var(--muted); }
.actions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.actions button[disabled] { opacity: 0.58; cursor: not-allowed; transform: none; }

.table-felt {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  gap: 22px;
  min-height: 330px;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 32px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.11), transparent 42%),
    linear-gradient(135deg, var(--felt), var(--felt-dark));
}
.table-felt::before {
  content: "BLACKJACK";
  position: absolute;
  inset: auto 0 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.08);
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 1000;
  letter-spacing: 0.08em;
  pointer-events: none;
}
.dealer-zone, .player-zone { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.label { color: rgba(255,255,255,0.76); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; }
.hand { display: flex; flex-wrap: wrap; gap: 12px; }
.playing-card {
  display: grid;
  place-items: center;
  width: 86px;
  height: 122px;
  border-radius: 14px;
  color: #111827;
  background: linear-gradient(160deg, #fff, #dbe4ef);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  font-size: 2rem;
  font-weight: 1000;
}
.playing-card.red { color: #c62828; }

.feedback {
  min-height: 112px;
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}
.feedback.correct { color: #d7ffe9; border-color: rgba(49, 208, 131, 0.55); background: rgba(49, 208, 131, 0.12); }
.feedback.incorrect { color: #ffe1e1; border-color: rgba(255, 107, 107, 0.55); background: rgba(255, 107, 107, 0.12); }
.feedback strong { color: var(--text); }

.control { display: grid; gap: 8px; margin: 18px 0; color: var(--muted); font-weight: 800; }
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.065);
}
.true-count-box, .guidance {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.2);
}
.true-count-box { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.true-count-box strong { color: var(--blue); font-size: 2rem; }
.guidance { color: #dfe9f3; line-height: 1.6; }
summary { color: var(--gold); cursor: pointer; font-weight: 900; }
li { margin: 0.4rem 0; }

@media (max-width: 900px) {
  .hero, .layout, .table-felt { grid-template-columns: 1fr; }
  .hero { display: grid; }
  .actions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .topbar, .card-heading { align-items: stretch; flex-direction: column; }
  .actions { grid-template-columns: 1fr; }
  .playing-card { width: 72px; height: 104px; }
}
