:root {
  --bg: #101218;
  --bg-soft: #171b24;
  --panel: #202633;
  --panel-strong: #293141;
  --felt: #136447;
  --felt-dark: #0d4633;
  --felt-line: rgba(231, 244, 229, 0.28);
  --gold: #f1b84b;
  --gold-dark: #be7d21;
  --red: #d85b55;
  --blue: #5ba4e8;
  --ink: #f7f1e3;
  --muted: #aeb8c9;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  background:
    linear-gradient(180deg, rgba(22, 27, 38, 0.98), rgba(13, 15, 21, 1)),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  background: #2a3242;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, opacity 150ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(241, 184, 75, 0.7);
  background: #344054;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--ink);
  background: #111722;
  outline: none;
}

input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(241, 184, 75, 0.15);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 14px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--border);
  background: rgba(15, 18, 26, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.topnav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  color: var(--muted);
}

.topnav a[aria-current="page"] {
  color: var(--ink);
  background: rgba(241, 184, 75, 0.18);
}

.wallet-pill {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 142px;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid rgba(241, 184, 75, 0.35);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(241, 184, 75, 0.09);
}

.wallet-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.25rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
}

.intro {
  max-width: 54ch;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.primary-btn {
  border-color: rgba(241, 184, 75, 0.58);
  color: #17130a;
  font-weight: 800;
  background: linear-gradient(180deg, #ffd978, var(--gold));
}

.primary-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffe198, #f1bd59);
}

.danger-btn {
  border-color: rgba(216, 91, 85, 0.58);
  background: rgba(216, 91, 85, 0.2);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.05);
}

.warning-text {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(216, 91, 85, 0.48);
  border-radius: 999px;
  color: #ffaaa5;
  font-size: 0.78rem;
  background: rgba(216, 91, 85, 0.14);
}

.ai-badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid rgba(91, 164, 232, 0.58);
  border-radius: 999px;
  color: #b9dcff;
  font-size: 0.66rem;
  font-weight: 900;
  background: rgba(91, 164, 232, 0.16);
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.reward-grid button {
  min-width: 0;
  padding-inline: 8px;
  font-size: 0.84rem;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 92px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.78rem;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 8px, transparent 8px 16px),
    rgba(255, 255, 255, 0.03);
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 36px));
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(28, 34, 46, 0.96);
  box-shadow: var(--shadow);
}

.card {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(42px, 7.2vw, 74px);
  aspect-ratio: 5 / 7;
  border: 1px solid rgba(17, 18, 22, 0.22);
  border-radius: 7px;
  color: #1b1c22;
  background: #fffdf4;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
  font-weight: 900;
}

.card::before,
.card::after {
  position: absolute;
  font-size: 0.68em;
  line-height: 1;
  content: attr(data-label);
}

.card::before {
  top: 7px;
  left: 7px;
}

.card::after {
  right: 7px;
  bottom: 7px;
  transform: rotate(180deg);
}

.card .suit {
  font-size: 1.45em;
}

.card.red {
  color: #c73336;
}

.card.back {
  border: 2px solid rgba(255, 255, 255, 0.78);
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.16) 0 12%, transparent 13%),
    linear-gradient(135deg, #234f93, #7b1f3f);
}

.card.back::before,
.card.back::after {
  content: "";
}

.chip {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 4px dashed rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  color: #111722;
  font-size: 0.64rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.28);
}

.chip-25 { background: #d9f0ff; }
.chip-100 { background: #ea5455; color: #fff; }
.chip-500 { background: #4aa96c; color: #fff; }
.chip-1000 { background: #f5d76e; }
.chip-5000 { background: #7b61ff; color: #fff; }

.flying-chip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  animation: fly-chip 560ms ease-in forwards;
}

@keyframes fly-chip {
  to {
    transform: translate(var(--dx), var(--dy)) scale(0.65);
    opacity: 0.2;
  }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr auto;
    min-height: auto;
  }

  .topnav {
    grid-column: 1 / -1;
    width: 100%;
  }

  .topnav a {
    flex: 1;
  }

  .wallet-pill {
    min-width: 116px;
  }

  .reward-grid {
    grid-template-columns: 1fr;
  }
}
