/*
 * BeraGuess – site stylesheet
 * Sits on top of Bootstrap 5.3 (dark theme). Everything custom lives here.
 */

:root {
  --bg: #0a0e13;
  --surface: rgba(17, 23, 30, .88);
  --surface-solid: #141b23;
  --surface-2: #1b242e;
  --surface-3: #232e3a;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #eef2f6;
  --muted: #98a6b5;
  --honey: #f5a623;
  --honey-2: #ffcb47;
  --honey-ink: #2a1a00;
  --green: #3ddc84;
  --red: #ff6161;
  --blue: #63b3ff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font-display: "Fredoka", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --header-h: 64px;

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-body-font-family: var(--font-body);
  --bs-border-color: var(--border);
  --bs-link-color: var(--honey-2);
  --bs-link-hover-color: #ffe08a;
  --bs-link-color-rgb: 255, 203, 71;
  --bs-link-hover-color-rgb: 255, 224, 138;
}

[data-bs-theme="dark"] {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-2);
  --bs-border-color: var(--border);
}

/* ---------- Base ---------- */

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(245, 166, 35, .12), transparent 60%),
    linear-gradient(180deg, rgba(10, 14, 19, .55) 0%, rgba(10, 14, 19, .88) 45%, rgba(10, 14, 19, .97) 100%);
  pointer-events: none;
}

h1, h2, h3, h4, h5, .display-font {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--text);
}

a { text-decoration: none; }
a:hover { text-decoration: underline; }

small, .small, .text-muted { color: var(--muted) !important; }

img { max-width: 100%; }

.container-xl { max-width: 1240px; }

:focus-visible { outline: 2px solid var(--honey-2); outline-offset: 2px; }

/* Hide everything that needs a signed-in user (toggled by javascript.js) */
.blockClass { display: none !important; }

/* ---------- Buttons ---------- */

.btn { font-weight: 600; border-radius: 999px; padding: .55rem 1.15rem; transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease; }
.btn:active { transform: translateY(1px); }

.btn-honey {
  --bs-btn-color: var(--honey-ink);
  --bs-btn-bg: var(--honey);
  --bs-btn-border-color: var(--honey);
  --bs-btn-hover-color: var(--honey-ink);
  --bs-btn-hover-bg: var(--honey-2);
  --bs-btn-hover-border-color: var(--honey-2);
  --bs-btn-active-bg: var(--honey-2);
  --bs-btn-active-color: var(--honey-ink);
  box-shadow: 0 6px 20px rgba(245, 166, 35, .25);
}

.btn-ghost {
  --bs-btn-color: var(--text);
  --bs-btn-bg: rgba(255, 255, 255, .06);
  --bs-btn-border-color: var(--border-strong);
  --bs-btn-hover-color: var(--text);
  --bs-btn-hover-bg: rgba(255, 255, 255, .12);
  --bs-btn-hover-border-color: var(--border-strong);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--header-h);
  background: rgba(10, 14, 19, .78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.site-header .container-xl { height: 100%; display: flex; align-items: center; gap: 1rem; }

.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none !important; }
.brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; background: #f7d9c4; border: 2px solid var(--honey); }
.brand span { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.brand span b { color: var(--honey); font-weight: 700; }

.main-nav { display: flex; gap: .25rem; margin-left: 1rem; }
.main-nav a { color: var(--muted); font-weight: 500; font-size: .95rem; padding: .4rem .75rem; border-radius: 999px; text-decoration: none; }
.main-nav a:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.main-nav a.active { color: var(--honey-2); background: rgba(245, 166, 35, .12); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.user-chip {
  display: flex; align-items: center; gap: .6rem;
  padding: .25rem .9rem .25rem .25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none !important;
}
.user-chip:hover { background: rgba(255, 255, 255, .1); }
.user-chip img { width: 34px; height: 34px; border-radius: 50%; }
.user-chip .caption-title { font-size: .9rem; font-weight: 600; line-height: 1.1; margin: 0; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .caption-sub-title { font-size: .78rem; color: var(--honey-2); margin: 0; line-height: 1.2; }

.dropdown-menu {
  --bs-dropdown-bg: var(--surface-solid);
  --bs-dropdown-border-color: var(--border-strong);
  --bs-dropdown-link-color: var(--text);
  --bs-dropdown-link-hover-bg: rgba(255, 255, 255, .07);
  --bs-dropdown-link-hover-color: var(--text);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: .4rem;
}
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; }
.dropdown-item i { width: 1.25rem; display: inline-block; color: var(--muted); }

.nav-toggle { display: none; background: transparent; border: 1px solid var(--border-strong); color: var(--text); border-radius: 10px; width: 40px; height: 40px; }

@media (max-width: 991.98px) {
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    margin: 0;
    padding: .75rem 1rem 1rem;
    background: rgba(10, 14, 19, .97);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform .25s ease;
    z-index: -1;
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav a { padding: .7rem .75rem; font-size: 1rem; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .user-chip .caption { display: none; }
  .user-chip { padding: .25rem; }
}

/* ---------- Sections ---------- */

.section { padding: 2.5rem 0; }
.section + .section { padding-top: 1rem; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); margin: 0; }
.section-head p { margin: .25rem 0 0; color: var(--muted); }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--honey); margin-bottom: .35rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.panel h3 { font-size: 1.35rem; margin-bottom: .75rem; }
.panel p:last-child { margin-bottom: 0; }

/* ---------- Hero ---------- */

.hero { padding: 3.5rem 0 2rem; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2rem; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; margin-bottom: 1rem; }
.hero h1 em { font-style: normal; color: var(--honey); }
.hero .lead { color: #c8d2dc; font-size: 1.15rem; max-width: 36rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0; }

.hero-stats { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-stat { background: rgba(255, 255, 255, .05); border: 1px solid var(--border); border-radius: 12px; padding: .6rem 1rem; min-width: 130px; }
.hero-stat span { display: block; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.hero-stat strong { font-family: var(--font-display); font-size: 1.35rem; color: var(--text); }
.hero-stat.is-hot strong { color: var(--honey-2); }

.hero-card { position: relative; }
.hero-card img.hero-art { width: 100%; border-radius: 12px; margin-bottom: 1rem; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: .75rem; align-items: start; }
.steps .num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(245, 166, 35, .14); color: var(--honey-2); font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.steps strong { display: block; }
.steps p { margin: 0; color: var(--muted); font-size: .93rem; }

.spotlight { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; align-items: start; }
.spotlight img { border-radius: 12px; width: 100%; }
.spotlight h3 { font-size: 1.2rem; }
.spotlight p, .spotlight li { font-size: .93rem; color: #c8d2dc; }
.spotlight ul { padding-left: 1.1rem; margin-bottom: .75rem; }

@media (max-width: 991.98px) {
  .hero { padding-top: 2rem; }
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .spotlight { grid-template-columns: 1fr; }
  .spotlight img { max-width: 160px; }
}

.ref-row { display: flex; align-items: center; gap: .5rem; background: rgba(255, 255, 255, .05); border: 1px solid var(--border); border-radius: 10px; padding: .45rem .5rem .45rem .75rem; margin: .5rem 0 .75rem; min-width: 0; }
.ref-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.copy-btn { border: 0; background: rgba(255, 255, 255, .08); color: var(--text); border-radius: 8px; width: 34px; height: 34px; flex: none; cursor: pointer; }
.copy-btn:hover { background: rgba(255, 255, 255, .16); }
.copied { font-size: .8rem; color: var(--green); flex: none; }

/* ---------- New games pill ---------- */

#newGameAlertDiv {
  position: fixed;
  top: calc(var(--header-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1020;
  background: var(--honey);
  color: var(--honey-ink);
  font-weight: 700;
  padding: .55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(245, 166, 35, .35);
  white-space: nowrap;
}

/* ---------- Game grid & cards ---------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}
.game-grid > .col { width: auto; max-width: none; padding: 0; flex: initial; }

.empty-state { grid-column: 1 / -1; text-align: center; padding: 2.5rem 1rem; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.game-grid:has(> .col) > .empty-state { display: none; }

.game-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.game-card:hover { transform: translateY(-3px); border-color: rgba(245, 166, 35, .35); }

.game-card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.game-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 575.98px) { .game-card__media { aspect-ratio: 16 / 9; } }
.game-card__badges { position: absolute; inset: .6rem .6rem auto .6rem; display: flex; justify-content: space-between; gap: .5rem; }
.badge-soft { display: inline-flex; align-items: center; gap: .3rem; background: rgba(10, 14, 19, .78); backdrop-filter: blur(6px); color: var(--text); font-size: .75rem; font-weight: 600; padding: .3rem .6rem; border-radius: 999px; }

.game-card .card-body { display: flex; flex-direction: column; gap: .85rem; padding: 1rem 1.1rem 1.1rem; }

.game-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.game-card .card-title { font-family: var(--font-display); font-size: 1.2rem; margin: 0; }
.game-card__price { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.game-card .card-text { display: flex; flex-direction: column; gap: .75rem; font-size: .9rem; }

.game-type { font-size: .82rem; color: var(--muted); }
.game-type strong { color: var(--text); font-weight: 600; }

.game-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.gs { background: var(--surface-2); border-radius: var(--radius-sm); padding: .5rem .65rem; min-width: 0; }
.gs__label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.gs__value { display: block; font-weight: 700; font-size: .95rem; overflow-wrap: anywhere; }
.gs__value s { color: var(--muted); font-weight: 500; font-size: .8rem; margin-right: .25rem; }
.gs--prize .gs__value { color: var(--honey-2); }
.gs--jackpot.is-hot { background: linear-gradient(135deg, rgba(245, 166, 35, .22), rgba(255, 97, 97, .14)); }
.gs--jackpot.is-hot .gs__value { color: var(--honey-2); }

.game-times { display: grid; gap: .35rem; }
.game-times > div { display: flex; justify-content: space-between; gap: .5rem; }
.game-times span.lbl { color: var(--muted); white-space: nowrap; }
.game-times .blockCounter, .game-times .endCounter { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }

.game-band { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; }
.game-band .tooltip2 { color: var(--text); font-weight: 600; }

.predict label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
.predict .form-control {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 600;
  padding: .6rem .8rem;
  font-variant-numeric: tabular-nums;
}
.predict .form-control:focus { border-color: var(--honey); box-shadow: 0 0 0 3px rgba(245, 166, 35, .2); }
.predict .form-control.is-valid { border-color: var(--green); }
.predict .form-control.is-invalid { border-color: var(--red); }
.predict .invalid-feedback { font-size: .78rem; }

.predict-done { display: flex; justify-content: space-between; align-items: center; background: rgba(99, 179, 255, .08); border: 1px solid rgba(99, 179, 255, .2); border-radius: var(--radius-sm); padding: .5rem .7rem; }
.predict-done span { color: var(--muted); font-size: .82rem; }
.predict-done strong { font-variant-numeric: tabular-nums; }

.signin-hint { font-size: .85rem; color: var(--muted); text-align: center; }

/* The status button – javascript.js toggles btn-info / btn-warning / btn-secondary / btn-success */
.game-card .sendMy {
  margin-top: auto;
  width: 100%;
  border-radius: 12px;
  padding: .7rem 1rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: .04em;
  border: 1px solid transparent;
}
.game-card .sendMy.btn-info { background: var(--honey); color: var(--honey-ink); box-shadow: 0 6px 18px rgba(245, 166, 35, .25); }
.game-card .sendMy.btn-info:hover { background: var(--honey-2); }
.game-card .sendMy.btn-warning { background: rgba(245, 166, 35, .12); color: var(--honey-2); border-color: rgba(245, 166, 35, .35); }
.game-card .sendMy.btn-secondary { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.game-card .sendMy.btn-success { background: var(--green); color: #052611; }
.game-card .sendMy.finishedGame { font-size: .95rem; }

.game-card .spinner-border { align-self: center; color: var(--honey); }

/* Finished games: compact cards, collapsed list */
#finishedHolder .game-card__media { aspect-ratio: 16 / 7; }
#finishedHolder .game-stats .gs:nth-child(2),
#finishedHolder .game-stats .gs:nth-child(3),
#finishedHolder .game-times > div:first-child,
#finishedHolder .game-band { display: none; }
#finishedHolder .game-card { opacity: .92; }
@media (max-width: 575.98px) {
  #finishedHolder .game-card__media { display: none; }
  #finishedHolder .game-card .card-body { padding-top: .9rem; }
}
#finishedHolder.is-collapsed > .col:nth-child(n+9) { display: none; }

.show-more { display: flex; justify-content: center; margin-top: 1.25rem; }

/* ---------- Tooltip ---------- */

.tooltip2 { position: relative; cursor: help; border-bottom: 1px dotted var(--muted); }
.tooltip2::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 135%;
  right: 0;
  background: var(--surface-3);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease;
  box-shadow: var(--shadow);
  z-index: 5;
}
.tooltip2:hover::after { opacity: 1; visibility: visible; }

/* ---------- Weekly Chase ---------- */

.chase-hero { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; align-items: center; }
.chase-hero img { width: 100%; }
.chase-hero p { color: #c8d2dc; }

.rules { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.rules summary { cursor: pointer; font-weight: 600; color: var(--honey-2); list-style: none; }
.rules summary::-webkit-details-marker { display: none; }
.rules summary::before { content: "▸ "; }
.rules[open] summary::before { content: "▾ "; }
.rules .rules-body { margin-top: .75rem; color: #c8d2dc; font-size: .95rem; }
.rules .rules-body h4 { font-size: 1rem; margin: 1rem 0 .4rem; }

.stat-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem; margin-top: 1rem; }
.stat-tile { background: var(--surface-2); border-radius: var(--radius-sm); padding: .7rem; text-align: center; }
.stat-tile span { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-tile strong { font-family: var(--font-display); font-size: 1.4rem; }

.duel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; margin-top: 1.1rem; }
.duel-card h3 { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.duel-card .duel-name { color: var(--honey-2); font-weight: 600; margin-bottom: .75rem; }
.duel-card p { color: #c8d2dc; font-size: .93rem; }
.duel-body { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; align-items: center; margin: 1rem 0; }
.duel-body img { width: 100%; }
.duel-stats { width: 100%; font-size: .9rem; }
.duel-stats td { padding: .3rem 0; border-bottom: 1px solid var(--border); }
.duel-stats td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.duel-stats tr:last-child td { border-bottom: 0; }
.duel-note { font-size: .75rem; color: var(--muted); }
.duel-situation { background: var(--surface-2); border-radius: var(--radius-sm); padding: .75rem .9rem; margin: 0; }

@media (max-width: 767.98px) {
  .chase-hero, .duel-grid { grid-template-columns: 1fr; }
  .chase-hero img { max-width: 220px; }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* Giant Honeypot pick */
.game-board { display: flex; justify-content: center; align-items: flex-end; gap: clamp(16px, 6vw, 80px); flex-wrap: wrap; width: 100%; padding: 20px 0; }
.card-container { width: 160px; position: relative; cursor: pointer; transition: transform .3s cubic-bezier(.175, .885, .32, 1.275); z-index: 1; }
.card-container:hover { transform: scale(1.12) translateY(-8px); z-index: 10; }
.pot-svg { width: 100%; text-align: center; filter: drop-shadow(0 10px 15px rgba(0, 0, 0, .6)); transition: all .5s ease; position: relative; z-index: 5; }
@keyframes shake {
  0% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-5px, 0) rotate(-5deg); }
  50% { transform: translate(5px, 0) rotate(5deg); }
  75% { transform: translate(-5px, 0) rotate(-5deg); }
  100% { transform: translate(0, 0) rotate(0); }
}
.shaking .pot-svg { animation: shake .4s infinite; }
.reveal .pot-svg { transform: translateY(-120px) scale(.9); opacity: .9; }
#result-message { text-align: center; margin-top: 1rem; }
#fireworks { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2000; }
@media (max-width: 600px) { .card-container { width: 96px; } }

/* ---------- Leaderboard & Elders ---------- */

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: start; }
@media (max-width: 991.98px) { .two-col { grid-template-columns: 1fr; } }

.my-rank { background: rgba(245, 166, 35, .1); border: 1px solid rgba(245, 166, 35, .3); border-radius: var(--radius-sm); padding: .6rem .8rem; margin-bottom: 1rem; }
.my-rank:empty { display: none; }

.table-wrap { max-height: 520px; overflow: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-striped-bg: rgba(255, 255, 255, .03);
  --bs-table-striped-color: var(--text);
  --bs-table-border-color: var(--border);
  margin: 0;
  font-size: .92rem;
}
.table thead th { position: sticky; top: 0; background: var(--surface-3); color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; border-bottom: 0; z-index: 1; }
.table th, .table td { padding: .6rem .8rem; vertical-align: middle; }
#seasonTable tr:nth-child(1) th { color: #ffd34d; }
#seasonTable tr:nth-child(2) th { color: #d6dde5; }
#seasonTable tr:nth-child(3) th { color: #e3a26b; }
#seasonTable td:last-child, #seasonTable th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.elders-art { width: 100%; border-radius: 12px; margin-bottom: 1rem; aspect-ratio: 3 / 1.5; object-fit: cover; }
.perk-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.perk-list li { display: flex; gap: .6rem; color: #c8d2dc; font-size: .93rem; }

/* ---------- About ---------- */

.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.about-grid .panel i { font-size: 1.6rem; color: var(--honey); }
.about-grid .panel h3 { font-size: 1.15rem; margin: .5rem 0; }
.about-grid .panel p { color: #c8d2dc; font-size: .93rem; }
.lore { font-size: 1.02rem; color: #c8d2dc; max-width: 56rem; }
@media (max-width: 767.98px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; margin-top: 2rem; color: var(--muted); font-size: .9rem; background: rgba(10, 14, 19, .8); }
.site-footer .container-xl { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--muted); }
#debugText { font-size: .75rem; word-break: break-all; }

/* ---------- Bootstrap modals ---------- */

.modal-content {
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.modal-header, .modal-footer { border-color: var(--border); }
.modal-title { font-family: var(--font-display); }
.modal-body { color: #d3dbe3; }
.modal-body h4 { font-size: 1.1rem; margin-top: 1rem; }
.modal-body .table { font-size: .85rem; }
.modal-body .primary { color: var(--green); font-weight: 700; }
.modal-body .secondary { color: var(--honey-2); font-weight: 700; }
.modal-backdrop.show { opacity: .7; }
.modal .form-control { background: var(--bg); border-color: var(--border-strong); color: var(--text); }
.modal .form-range::-webkit-slider-thumb { background: var(--honey); }
.modal .form-range::-moz-range-thumb { background: var(--honey); }
#withdrawButton, #saveProfileButton { background: var(--honey); border-color: var(--honey); color: var(--honey-ink); }

/* Lightweight info modal (#demoModal, opened via window.showModal) */
#demoModal { position: fixed; inset: 0; display: none; z-index: 1060; }
#demoModal[aria-hidden="false"] { display: block; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .65); }
.modal__dialog { position: relative; margin: 12dvh auto 0; width: min(520px, calc(100% - 32px)); background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); padding: 1.25rem; }
.modal__header, .modal__footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.modal__body { text-align: center; padding: .75rem 0; }
.modal__body img { border-radius: 12px; margin-bottom: .75rem; }
.modal__close { background: transparent; color: var(--text); border: 0; font-size: 28px; line-height: 1; cursor: pointer; }
.modal__btn { margin: auto; background: var(--honey) !important; color: var(--honey-ink) !important; }

/* ---------- Wallet picker ---------- */

#overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .65); z-index: 1070; backdrop-filter: blur(3px); }
#walletPopupHolder {
  display: none;
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: min(380px, calc(100% - 32px));
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  z-index: 1080;
}
#walletPopupHolder p { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: .75rem; }
#walletPopup:empty::after { content: "No browser wallet detected. Install MetaMask, Rabby or another EVM wallet to continue."; color: var(--muted); font-size: .9rem; }
#walletPopup button {
  display: block;
  width: 100%;
  margin: .5rem 0 0;
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
}
#walletPopup button:hover { border-color: var(--honey); background: var(--surface-3); }

/* ---------- Loader ---------- */

#loader { display: none; position: fixed; inset: 0; z-index: 2100; background: rgba(10, 14, 19, .7); align-items: center; justify-content: center; flex-direction: column; gap: .75rem; color: var(--muted); }
#loader .spinner-border { width: 3rem; height: 3rem; color: var(--honey); }

/* ---------- Game history (history.php) ---------- */

.history-intro { padding-bottom: 0; }
.history-stats { margin-top: .25rem; }
.history-panel { padding: 0; overflow: visible; }
.history-table thead th { top: var(--header-h); }
.history-table thead th:first-child { border-top-left-radius: var(--radius); }
.history-table thead th:last-child { border-top-right-radius: var(--radius); }
.history-table tbody tr:hover { background: rgba(255, 255, 255, .035); }
.history-table td, .history-table th { white-space: nowrap; }
.history-game { font-weight: 600; margin-right: .5rem; }
.history-table .badge-soft { background: var(--surface-3); }
.history-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.history-price { font-family: var(--font-display); font-size: 1.02rem; }
.history-table .is-win { color: var(--green); font-weight: 600; }
.history-table .is-jackpot { color: var(--honey-2); font-weight: 600; }
.history-table .is-none { color: var(--muted); }
.history-panel .empty-state { margin: 1.25rem; }
.history-panel .show-more { padding: 0 1rem 1.25rem; }

@media (max-width: 1199.98px) {
  .history-table { font-size: .85rem; }
  .history-table th, .history-table td { padding: .55rem .45rem; }
  .history-game { display: block; margin: 0 0 .2rem; }
  .history-time { white-space: normal !important; min-width: 5.5rem; }
}

@media (max-width: 991.98px) {
  .history-panel { background: transparent; border: 0; box-shadow: none; backdrop-filter: none; }
  .history-table thead { display: none; }
  .history-table, .history-table tbody { display: block; }
  .history-table tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: .35rem 1rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: .9rem 1rem; margin-bottom: .75rem;
  }
  .history-table th, .history-table td { display: flex; justify-content: space-between; gap: .5rem; padding: 0; border: 0; text-align: left !important; white-space: normal; }
  .history-table td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-family: var(--font-body); font-weight: 400; }
  .history-game { display: inline; margin: 0 .5rem 0 0; }
  .history-table th[scope="row"] { grid-column: 1 / -1; justify-content: flex-start; align-items: center; padding-bottom: .4rem; margin-bottom: .2rem; border-bottom: 1px solid var(--border); }
  .history-table .history-time { grid-column: 1 / -1; }
  .history-table .history-action { grid-column: 1 / -1; margin-top: .4rem; }
  .history-table .history-action .btn { width: 100%; }
  .history-panel .empty-state, .history-panel .show-more { margin: 0; padding: 1rem 0; }
}

/* ---------- Toasts ---------- */

#toastContainer { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; }
.jq-toast-wrap .jq-toast-single { border-radius: 12px; font-family: var(--font-body); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
