/* ============================================================
   RipTabs.com — Main Stylesheet
   Aesthetic: Casino-dark luxury with gold accents
   Font: Bebas Neue (headings) + DM Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --navy:       #0f0f1e;
  --navy-light: #1a1a2e;
  --navy-mid:   #22223a;
  --gold:       #f0c000;
  --gold-light: #ffd740;
  --gold-dim:   #b89400;
  --red:        #E24B4A;
  --yellow:     #EF9F27;
  --green:      #639922;
  --white:      #f5f5f5;
  --grey-1:     #e8e8e8;
  --grey-2:     #c8c8c8;
  --grey-3:     #888;
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,.18);
  --shadow-md:  0 4px 18px rgba(0,0,0,.28);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.38);
  --font-head:  'Bebas Neue', sans-serif;
  --font-body:  'DM Sans', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, canvas { display: block; max-width: 100%; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }
button { font-family: var(--font-body); cursor: pointer; }
input, select, textarea { font-family: var(--font-body); }

/* ── Layout ────────────────────────────────────────────────── */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.page-wrap  { padding: 24px 0 60px; }

/* ── Site Header ───────────────────────────────────────────── */
.site-header {
  background: var(--navy-light);
  border-bottom: 1px solid rgba(240,192,0,.15);
  padding: 0 20px;
}
.site-header__inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.site-logo {
  font-family: var(--font-head);
  font-size: 28px;
  letter-spacing: .08em;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(240,192,0,.4);
}
.site-logo span { color: var(--white); }
.site-nav { display: flex; gap: 20px; font-size: 14px; font-weight: 500; }
.site-nav a { color: var(--grey-2); }
.site-nav a:hover { color: var(--gold); }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--navy-light);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.card--gold { border-color: rgba(240,192,0,.25); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600; border: none;
  transition: opacity .15s, transform .1s;
  cursor: pointer; letter-spacing: .02em;
}
.btn:hover  { opacity: .88; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--gold); color: var(--navy); }
.btn-danger  { background: #FCEBEB; color: #A32D2D; }
.btn-warn    { background: #FAEEDA; color: #633806; }
.btn-success { background: #EAF3DE; color: #27500A; }
.btn-ghost   { background: rgba(255,255,255,.07); color: var(--white); border: 1px solid rgba(255,255,255,.12); }
.btn-lg      { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-md); }
.btn-sm      { padding: 6px 14px; font-size: 12px; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--grey-3); letter-spacing: .06em; text-transform: uppercase; }
.form-input {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--white); font-size: 14px; outline: none;
  transition: border-color .15s;
}
.form-input:focus { border-color: var(--gold); }
.form-input::placeholder { color: rgba(255,255,255,.3); }
.form-input[type=number] { -moz-appearance: textfield; }
.form-input[type=number]::-webkit-inner-spin-button { display: none; }
.form-hint  { font-size: 11px; color: var(--grey-3); }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }

/* ── Jar Bar ───────────────────────────────────────────────── */
.jar-bar {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.jar-bar__title {
  font-size: 11px; font-weight: 600; color: var(--grey-3);
  text-transform: uppercase; letter-spacing: .07em;
}
.jar-tier {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  grid-template-rows: auto 6px;
  gap: 0 10px;
  align-items: center;
}
.jar-tier--empty { opacity: .45; }
.jar-dot  { width: 10px; height: 10px; border-radius: 50%; grid-row: 1; }
.jar-label{ font-size: 13px; font-weight: 500; grid-row: 1; }
.jar-pts  { font-size: 11px; color: var(--grey-3); grid-row: 1; }
.jar-rem  { font-size: 13px; font-weight: 600; grid-row: 1; }
.jar-track{ grid-column: 2 / 5; grid-row: 2; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.jar-fill { height: 6px; border-radius: 3px; transition: width .5s ease; }

/* ── Tab Shell ─────────────────────────────────────────────── */
.tab-shell {
  width: 240px;
  background: #e8e8e8;
  border-radius: 14px;
  border: 2px solid #bbb;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.5);
  margin: 0 auto;
}
.tab-shell__header {
  background: linear-gradient(180deg, #ddd, #ccc);
  border-radius: 12px 12px 0 0;
  border-bottom: 1.5px solid #bbb;
  padding: 7px 12px;
  text-align: center;
}
.tab-shell__game {
  font-family: var(--font-head);
  font-size: 18px; letter-spacing: .1em; color: #1a1a2e;
}
.tab-shell__sn { font-size: 9px; color: #888; margin-top: 1px; }
.tab-shell__rows { padding: 5px 7px; display: flex; flex-direction: column; gap: 4px; }
.tab-shell__footer {
  background: var(--navy);
  border-radius: 0 0 12px 12px;
  padding: 6px 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.tab-open-here {
  background: var(--gold); color: var(--navy);
  font-size: 9px; font-weight: 900; padding: 3px 8px;
  border-radius: 4px; letter-spacing: .06em;
}
.tab-brand { font-size: 8px; color: #666; letter-spacing: .1em; }

/* ── Play Page Layout ──────────────────────────────────────── */
.play-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 680px) {
  .play-layout { grid-template-columns: 1fr; }
}
.play-main   { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.play-side   { display: flex; flex-direction: column; gap: 14px; }

/* ── Points HUD ────────────────────────────────────────────── */
.pts-hud {
  display: flex; gap: 20px; justify-content: center;
  background: rgba(255,255,255,.04);
  border-radius: var(--radius-md); padding: 12px 20px;
}
.pts-hud__stat { text-align: center; }
.pts-hud__n    { font-size: 24px; font-weight: 600; color: var(--gold); font-family: var(--font-head); letter-spacing: .04em; }
.pts-hud__l    { font-size: 11px; color: var(--grey-3); font-weight: 500; }

/* ── Result chip ───────────────────────────────────────────── */
.result-chip {
  display: block;           /* always in flow — no layout shift */
  min-height: 38px;         /* reserved space even when empty */
  text-align: center;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  visibility: hidden;       /* hidden but still takes space */
  opacity: 0;
  transition: opacity .25s ease, visibility .25s ease;
}
.result-chip.visible {
  visibility: visible;
  opacity: 1;
  animation: chipPop .25s ease;
}
@keyframes chipPop { 0%{transform:scale(.85);opacity:0} 100%{transform:scale(1);opacity:1} }

/* ── Action buttons ────────────────────────────────────────── */
.action-row  { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ── Saved tray ────────────────────────────────────────────── */
.saved-tray__label { font-size: 11px; font-weight: 600; color: var(--grey-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; }
.saved-tray__row   {
  display: flex; gap: 8px; flex-wrap: wrap; min-height: 52px;
  padding: 8px; background: rgba(255,255,255,.04);
  border-radius: var(--radius-md); border: 1px dashed rgba(255,255,255,.1);
  align-items: center;
}
.saved-chip {
  width: 38px; height: 50px;
  background: #e8e8e8; border: 2px solid var(--yellow);
  border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; position: relative; flex-shrink: 0;
  transition: transform .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.saved-chip:hover { transform: scale(1.1) translateY(-2px); box-shadow: var(--shadow-md); }
.saved-chip__badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--yellow); color: #412402;
  font-size: 8px; font-weight: 700; padding: 1px 4px;
  border-radius: 6px; line-height: 1.4;
}

/* ── Live feed ─────────────────────────────────────────────── */
.live-feed { display: flex; flex-direction: column; gap: 5px; }
.live-feed__title { font-size: 11px; font-weight: 600; color: var(--grey-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.feed-item {
  font-size: 12px; padding: 7px 10px;
  background: rgba(255,255,255,.05); border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 8px; color: var(--grey-1);
}
.feed-item--new { animation: feedSlide .4s ease; }
@keyframes feedSlide { 0%{transform:translateX(-10px);opacity:0} 100%{transform:none;opacity:1} }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ── Admin Dashboard ───────────────────────────────────────── */
.admin-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 20px; }
.admin-kpi  { background: rgba(255,255,255,.05); border-radius: var(--radius-md); padding: 16px; text-align: center; }
.admin-kpi__n { font-size: 28px; font-weight: 600; color: var(--gold); font-family: var(--font-head); }
.admin-kpi__l { font-size: 11px; color: var(--grey-3); margin-top: 2px; }

.claims-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.claims-table th { text-align: left; padding: 8px 10px; font-size: 11px; color: var(--grey-3); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid rgba(255,255,255,.08); }
.claims-table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,.05); }
.claims-table tr:hover td { background: rgba(255,255,255,.03); }

.redeem-btn { font-size: 11px; padding: 4px 10px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,.15); background: transparent; color: var(--white); cursor: pointer; }
.redeem-btn:hover { background: rgba(255,255,255,.08); }
.redeem-btn--done { color: var(--green); border-color: var(--green); opacity: .6; cursor: default; }

/* ── Join code display ─────────────────────────────────────── */
.join-code-box {
  background: rgba(240,192,0,.08); border: 2px dashed var(--gold-dim);
  border-radius: var(--radius-md); padding: 16px 24px; text-align: center;
}
.join-code-box__label { font-size: 11px; color: var(--grey-3); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
.join-code-box__code  { font-family: var(--font-head); font-size: 42px; letter-spacing: .18em; color: var(--gold); line-height: 1; }

/* ── Landing page ──────────────────────────────────────────── */
.hero { text-align: center; padding: 60px 20px 40px; }
.hero__logo { font-family: var(--font-head); font-size: 72px; letter-spacing: .08em; color: var(--gold); text-shadow: 0 0 40px rgba(240,192,0,.3), 0 0 80px rgba(240,192,0,.1); line-height: 1; }
.hero__sub  { font-size: 18px; color: var(--grey-2); margin: 10px 0 32px; font-weight: 300; }
.hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Misc ──────────────────────────────────────────────────── */
.section-title { font-family: var(--font-head); font-size: 20px; letter-spacing: .06em; color: var(--white); margin-bottom: 12px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 8px; font-weight: 600; }
.badge-open   { background: #EAF3DE; color: #27500A; }
.badge-closed { background: #FCEBEB; color: #A32D2D; }
.text-gold    { color: var(--gold); }
.text-muted   { color: var(--grey-3); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex  { display: flex; }
.gap-8 { gap: 8px; }
.gap-12{ gap: 12px; }
.w-full{ width: 100%; }
.text-center { text-align: center; }

/* ── Confetti (via JS) ─────────────────────────────────────── */
.confetti-piece {
  position: fixed; width: 10px; height: 10px; top: -10px;
  pointer-events: none; z-index: 9999; border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ── Toast notifications ───────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  background: var(--navy-light); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md); padding: 12px 18px;
  font-size: 13px; color: var(--white);
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease, toastOut .3s ease 3.5s forwards;
}
@keyframes toastIn  { from{transform:translateY(20px);opacity:0} }
@keyframes toastOut { to  {transform:translateY(20px);opacity:0} }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .hero__logo { font-size: 52px; }
  .admin-grid { grid-template-columns: 1fr 1fr; }
  .pts-hud    { gap: 14px; padding: 10px 14px; }
  .pts-hud__n { font-size: 20px; }
}

/* ============================================================
   MOBILE — Play page responsive overhaul
   ============================================================ */

/* Stack layout on mobile */
@media (max-width: 760px) {
  .play-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Side panel goes below the tab on mobile */
  .play-side {
    order: 2;
  }

  .play-main {
    order: 1;
  }

  /* Tab shell — scale down slightly on narrow screens */
  .tab-shell {
    width: 100%;
    max-width: 300px;
  }

  /* Action buttons — full width stack on very small screens */
  .action-row {
    width: 100%;
    max-width: 300px;
  }

  .action-row .btn {
    flex: 1;
    justify-content: center;
    padding: 10px 8px;
    font-size: 13px;
  }

  /* Buy button full width */
  #btn-buy, #btn-buy5 {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  /* Points HUD — tighter on mobile */
  .pts-hud {
    gap: 12px;
    padding: 10px 14px;
    width: 100%;
    max-width: 300px;
  }

  .pts-hud__n { font-size: 20px; }

  /* Result chip full width */
  .result-chip {
    width: 100%;
    max-width: 300px;
    font-size: 13px;
    padding: 8px 14px;
  }

  /* Jar bar tiers — compact on mobile */
  .jar-tier {
    grid-template-columns: 10px 1fr auto;
    grid-template-rows: auto auto 6px;
  }
  .jar-pts { display: none; } /* hide pts column on mobile, save space */
  .jar-rem { grid-column: 3; }
  .jar-track { grid-column: 1 / 4; grid-row: 3; }

  /* Saved tray */
  .saved-tray__row { min-height: 36px; }

  /* Live feed — fewer items on mobile */
  .live-feed .feed-item:nth-child(n+5) { display: none; }

  /* Admin grid */
  .admin-grid { grid-template-columns: repeat(2, 1fr); }

  /* Hero */
  .hero { padding: 32px 16px 24px; }
  .hero__logo { font-size: 52px; }
  .hero__sub   { font-size: 15px; }

  /* Landing page grid — stack on mobile */
  .container .page-wrap > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 400px) {
  .tab-shell { max-width: 260px; }
  .action-row .btn { font-size: 12px; padding: 9px 6px; }
  .pts-hud__n { font-size: 18px; }
  .pts-hud { gap: 8px; padding: 8px 10px; }
}

/* Touch target improvements for mobile */
@media (hover: none) {
  .btn { min-height: 44px; }
  .saved-chip { width: 44px; height: 56px; }
  canvas.rc { cursor: grab; }
}

/* Landing page grid */
.landing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 680px;
  margin: 0 auto;
}
@media (max-width: 600px) {
  .landing-grid { grid-template-columns: 1fr; }
}

/* ── Saved chip redesign ─────────────────────────────────────── */
.saved-chip {
  width: 40px; height: 52px;
  background: linear-gradient(135deg, #1a1a2e, #22223a);
  border: 2px solid #EF9F27;
  border-radius: 7px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.06);
  overflow: hidden;
}
.saved-chip:hover { transform: scale(1.12) translateY(-3px); box-shadow: 0 6px 18px rgba(240,192,0,.3); }
.saved-chip .sc-star {
  font-size: 22px; color: #f0c000; z-index: 1;
  text-shadow: 0 0 8px rgba(240,192,0,.8), 0 0 20px rgba(240,192,0,.4);
}
.saved-chip .sc-qmark {
  font-size: 20px; color: var(--grey-3); z-index: 1;
}
.saved-chip .sc-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(240,192,0,.15), transparent 70%);
  animation: chipPulse 1.8s ease-in-out infinite;
}
@keyframes chipPulse {
  0%,100% { opacity: .5; } 50% { opacity: 1; }
}
.saved-chip__badge {
  position: absolute; top: -5px; right: -5px;
  background: #EF9F27; color: #412402;
  font-size: 8px; font-weight: 700;
  padding: 1px 4px; border-radius: 5px; line-height: 1.4;
}

/* ── Font Awesome icon adjustments ──────────────────────────── */
.btn i, .abtn i { margin-right: 5px; }
.btn i:only-child, .abtn i:only-child { margin-right: 0; }
.site-logo i { font-size: 22px; vertical-align: middle; margin-right: 4px; }
.site-nav a i { margin-right: 4px; }
#sound-toggle i { font-size: 15px; }
.feed-item i { width: 14px; text-align: center; }
.jar-tier i  { font-size: 10px; }
.admin-kpi i { font-size: 24px; color: var(--gold); margin-bottom: 4px; display: block; }

/* ── Button innerHTML support (FA icons) ─────────────────────── */
.btn, .abtn { display: inline-flex; align-items: center; gap: 6px; }

/* ── Modern sharp button overrides ──────────────────────────── */
.btn {
  border-radius: 4px;  /* sharp corners, not pill */
  font-weight: 600;
  letter-spacing: .02em;
}
.btn-primary {
  background: #f0c000;
  color: #1a1a2e;
  box-shadow: 0 2px 8px rgba(240,192,0,.25);
}
.btn-primary:hover { background: #ffd740; box-shadow: 0 4px 12px rgba(240,192,0,.35); }

.btn-ghost {
  background: rgba(255,255,255,.08);
  color: var(--white);
  border: 1px solid rgba(255,255,255,.18);
}
.btn-ghost:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); }

.btn-danger  { background: #c0392b; color: #fff; border-radius: 4px; }
.btn-danger:hover { background: #e74c3c; }
.btn-warn    { background: #e67e22; color: #fff; border-radius: 4px; }
.btn-warn:hover { background: #f39c12; }
.btn-success { background: #27ae60; color: #fff; border-radius: 4px; }
.btn-success:hover { background: #2ecc71; }

/* Active state for all buttons */
.btn:active { transform: scale(.97); }

/* ── Global text visibility fixes ───────────────────────────── */
/* Body text — much more readable */
body { color: #e8e8e8; }

/* Muted text — lighter than before but still readable */
.text-muted { color: #aaa !important; }

/* Card text */
.card { color: #e0e0e0; }

/* Form labels */
.form-label { color: #bbb; }

/* Form input text */
.form-input { color: #fff; }
.form-input::placeholder { color: rgba(255,255,255,.35); }

/* Section titles */
.section-title { color: #fff; }

/* Grey-3 overrides — was too dark */
:root { --grey-3: #aaa; }

/* Nav links */
.site-nav a { color: #ccc; }
.site-nav a:hover { color: var(--gold); }

/* Feed items */
.feed-item { color: #ccc; }

/* Table text */
.claims-table td { color: #ddd; }
.claims-table th { color: #aaa; }

/* KPI labels */
.admin-kpi__l { color: #aaa; font-size:12px; margin-top:2px; }
.admin-kpi__n { color: #fff; }

/* Jar labels */
.jar-label { color: #ddd; }
.jar-pts   { color: #aaa; }

/* Box card meta */
.box-card__meta { color: #aaa; }

/* Hint bar */
.hint-bar { color: #aaa; }

/* pts-hud labels */
.pts-hud__l { color: #aaa; }