/* lir.css: Let It Ride table. Burgundy felt, cream cards, gold accents. */
:root {
  --felt: #4a0d1a;
  --felt-2: #6a1426;
  --felt-3: #861c33;
  --line: rgba(255, 230, 200, .22);
  --cream: #fbf7ee;
  --ink: #1d1a17;
  --muted: #6d655c;
  --red: #c0272d;
  --gold: #f2c14e;
  --gold-deep: #c9971c;
  --good: #7be0a0;
  --bad: #ffb3b0;
  --head: 'Fredoka', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --shadow: 0 6px 18px rgba(0, 0, 0, .35);
  --card-w: clamp(64px, 9vw, 120px);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: var(--body);
  color: var(--cream);
  background:
    radial-gradient(1400px 700px at 40% -10%, var(--felt-3), transparent 70%),
    radial-gradient(900px 600px at 100% 100%, var(--felt-2), transparent 70%),
    var(--felt);
}
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- top bar ---------- */
.l-top {
  display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap;
  padding: 14px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
}
.l-top h1 { margin: 0; font-family: var(--head); font-size: clamp(1.4rem, 2.4vw, 2rem); color: var(--gold); margin-right: auto; }
.l-top h1 span { font-size: .55em; color: var(--cream); font-weight: 500; opacity: .85; }
.l-bank { display: flex; align-items: baseline; gap: 10px; }
.l-bank-label { font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; opacity: .8; }
.l-bank strong { font-family: var(--head); font-size: 1.8rem; color: var(--gold); }

/* ---------- layout: table on the left, pay tables on the right ---------- */
.l-main {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: clamp(16px, 2vw, 32px); padding: clamp(16px, 2vw, 32px) clamp(16px, 3vw, 40px);
}
.l-table {
  padding: clamp(16px, 2.5vw, 36px); border-radius: 36px;
  background: radial-gradient(ellipse at 50% 20%, var(--felt-3), var(--felt-2) 55%, var(--felt) 100%);
  border: 10px solid #3a2414; box-shadow: inset 0 0 60px rgba(0,0,0,.45), var(--shadow);
}

.l-row { display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 2vw, 26px); }
.l-zone { text-align: center; }
.l-zone-title { margin: 0 0 10px; font-family: var(--head); font-weight: 500; font-size: 1rem; letter-spacing: 1px; text-transform: uppercase; opacity: .8; }
.l-cards { display: flex; gap: clamp(6px, 1vw, 14px); justify-content: center; min-height: calc(var(--card-w) * 1.4); }

/* ---------- cards ---------- */
.l-card {
  position: relative; width: var(--card-w); aspect-ratio: 5 / 7; border-radius: 10px;
  background: var(--cream); color: var(--ink); box-shadow: var(--shadow);
  font-family: var(--head); transition: transform .2s ease, box-shadow .2s ease;
}
.l-card.is-red { color: var(--red); }
.l-card.is-slot { background: transparent; border: 2px dashed var(--line); box-shadow: none; }
.l-card.is-back {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 6px, transparent 6px 12px),
    linear-gradient(135deg, #1f3a6b, #12284f);
  border: 5px solid var(--cream);
}
.l-corner { position: absolute; top: 6px; left: 8px; font-size: calc(var(--card-w) * .2); font-weight: 700; line-height: .95; text-align: center; }
.l-corner-b { top: auto; left: auto; bottom: 6px; right: 8px; transform: rotate(180deg); }
.l-pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--card-w) * .5); }
.l-card.is-win { transform: translateY(-10px); box-shadow: 0 0 0 3px var(--gold), 0 10px 22px rgba(0,0,0,.45); }

.l-card.is-new { animation: l-deal .38s ease-out both; }
@keyframes l-deal { from { opacity: 0; transform: translateY(-60px) rotate(-8deg); } to { opacity: 1; transform: none; } }
.l-card.is-flip { animation: l-flip .45s ease-out both; }
@keyframes l-flip { from { transform: rotateY(90deg); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .l-card.is-new, .l-card.is-flip { animation: none; } }

/* ---------- result line ---------- */
.l-result { min-height: 1.6em; margin: 22px 0 14px; text-align: center; font-family: var(--head); font-size: clamp(1.1rem, 2vw, 1.5rem); }
.l-result.is-good { color: var(--good); }
.l-result.is-bad { color: var(--bad); }
.l-result.is-warn { color: var(--gold); }

/* ---------- betting spots ---------- */
.l-spots { display: grid; justify-items: center; gap: clamp(10px, 1.6vw, 20px); }
.l-spot-row { display: flex; justify-content: center; align-items: center; gap: clamp(10px, 2.5vw, 36px); flex-wrap: wrap; }
.l-spot {
  position: relative; width: clamp(92px, 11vw, 140px); aspect-ratio: 1; border-radius: 50%;
  display: grid; align-content: center; justify-items: center; gap: 4px;
  background: rgba(0,0,0,.18); border: 3px solid rgba(255,230,200,.6); color: var(--cream); cursor: pointer;
}
.l-spot:disabled { cursor: default; }
.l-spot:not(:disabled):hover { background: rgba(0,0,0,.3); }
.l-spot-name { font-family: var(--head); font-size: clamp(1.4rem, 2.6vw, 2.2rem); font-weight: 700; line-height: 1; }
.l-spot-bonus { border-color: var(--gold); }
.l-spot-bonus .l-spot-name { font-size: clamp(.8rem, 1.2vw, 1rem); color: var(--gold); text-transform: uppercase; letter-spacing: .5px; padding: 0 10px; text-align: center; }
.l-spot-amt { min-height: 1.6em; font-weight: 700; font-size: .95rem; }
.l-spot-amt.has-chip { padding: 2px 10px; border-radius: 999px; border: 2px dashed rgba(255,255,255,.7); }
.l-spot-note { min-height: 1.1em; font-size: .8rem; font-weight: 600; }
.l-spot.is-deciding { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(242,193,78,.35); animation: l-pulse 1.4s ease-in-out infinite; }
@keyframes l-pulse { 50% { box-shadow: 0 0 0 9px rgba(242,193,78,.12); } }
@media (prefers-reduced-motion: reduce) { .l-spot.is-deciding { animation: none; } }
.l-spot.is-pulled { opacity: .55; }
.l-spot.is-won { border-color: var(--good); }
.l-spot.is-won .l-spot-note { color: var(--good); }
.l-spot.is-lost .l-spot-note { color: var(--bad); }

/* ---------- controls ---------- */
.l-controls { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.l-btn {
  padding: 12px 26px; border-radius: 999px; border: 2px solid var(--cream); background: transparent; color: var(--cream);
  font-family: var(--head); font-weight: 600; font-size: 1.1rem; cursor: pointer;
}
.l-btn:hover:not(:disabled) { background: rgba(255,255,255,.1); }
.l-btn:disabled { opacity: .45; cursor: default; }
.l-btn-gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.l-btn-gold:hover:not(:disabled) { background: #f7cf6c; }
.l-btn-ghost { border-color: rgba(255,255,255,.4); }
.l-btn-sm { padding: 6px 16px; font-size: .95rem; }
.l-total { font-weight: 600; opacity: .9; }
.l-hint { min-height: 1.3em; margin: 12px 0 0; text-align: center; color: var(--gold); font-style: italic; }

/* ---------- chips ---------- */
.l-chips { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.l-chip {
  width: 58px; height: 58px; border-radius: 50%; cursor: pointer; font-family: var(--head); font-weight: 700; font-size: 1.05rem;
  border: 5px dashed rgba(255,255,255,.85); color: #fff; box-shadow: var(--shadow); transition: transform .12s ease;
}
.l-chip.is-on { transform: translateY(-6px); outline: 3px solid var(--gold); outline-offset: 3px; }
.chip-1   { background: #e9e4da; color: var(--ink); }
.chip-5   { background: #c0272d; }
.chip-25  { background: #1f8a4c; }
.chip-100 { background: #1d1a17; }
.chip-500 { background: #6b3fa0; }
.l-chip.chip-1 { border-color: #8a8174; }
.l-spot-amt.chip-1 { background: #e9e4da; color: var(--ink); }

/* ---------- side panel ---------- */
.l-side { display: grid; gap: 16px; align-content: start; }
.l-pay { padding: 16px 20px; border-radius: 20px; background: rgba(0,0,0,.25); }
.l-pay h2 { margin: 0 0 10px; font-family: var(--head); font-size: 1.15rem; color: var(--gold); }
.l-pay table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.l-pay th { text-align: left; font-weight: 500; padding: 5px 6px; }
.l-pay td { text-align: right; font-weight: 700; padding: 5px 6px; white-space: nowrap; }
.l-pay tr + tr th, .l-pay tr + tr td { border-top: 1px solid var(--line); }
.l-pay tr.is-hit th, .l-pay tr.is-hit td { background: var(--gold); color: var(--ink); }
.l-pay tr.is-hit th { border-radius: 8px 0 0 8px; }
.l-pay tr.is-hit td { border-radius: 0 8px 8px 0; }
.l-pay-note td { text-align: left; font-weight: 400; font-size: .85rem; opacity: .8; }
.l-stats dl { margin: 0 0 12px; display: grid; gap: 6px; }
.l-stats dl div { display: flex; justify-content: space-between; }
.l-stats dt { opacity: .85; }
.l-stats dd { margin: 0; font-weight: 700; }
.l-check { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; cursor: pointer; }
.l-link { background: none; border: 0; padding: 0; color: var(--bad); text-decoration: underline; cursor: pointer; font-weight: 600; }

/* ---------- how-to dialog ---------- */
.l-dialog { max-width: 560px; width: calc(100% - 32px); border: 0; border-radius: 22px; padding: 22px 26px; background: var(--cream); color: var(--ink); }
.l-dialog::backdrop { background: rgba(0,0,0,.6); }
.l-dialog h2 { margin: 0 0 10px; font-family: var(--head); color: var(--felt-2); }
.l-dialog ol { padding-left: 20px; line-height: 1.5; }
.l-dialog .l-btn { background: var(--felt-2); border-color: var(--felt-2); color: var(--cream); }

/* ---------- smaller screens: stack ---------- */
@media (max-width: 980px) {
  .l-main { grid-template-columns: 1fr; }
  .l-side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 560px) {
  :root { --card-w: 21vw; }
  .l-row { gap: 14px; }
  .l-table { border-width: 6px; border-radius: 24px; padding: 14px; }
  .l-spot { width: 21vw; min-width: 76px; }
  .l-chip { width: 50px; height: 50px; font-size: .95rem; }
}

/* ---------- command buttons: one size, raised (2026-11-14) ---------- */
.l-controls { display: grid; grid-template-columns: repeat(auto-fit, 10.5em); justify-content: center; gap: 16px; }
.l-controls .l-total { grid-column: 1 / -1; text-align: center; }
.l-btn {
  position: relative; padding: 14px 12px; border: 0; border-radius: 16px; text-align: center;
  background: linear-gradient(#fffdf6, #e4d9c2); color: var(--ink); font-size: 1.2rem; font-weight: 700;
  box-shadow: 0 6px 0 #978a6c, 0 10px 16px rgba(0,0,0,.4); transition: transform .06s ease, box-shadow .06s ease;
}
.l-btn:hover:not(:disabled) { background: linear-gradient(#ffffff, #ece3cf); }
.l-btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 #978a6c, 0 3px 6px rgba(0,0,0,.4); }
.l-btn-gold { background: linear-gradient(#ffdd80, #f0b52e); color: var(--ink); box-shadow: 0 6px 0 #a3760f, 0 10px 16px rgba(0,0,0,.4); }
.l-btn-gold:hover:not(:disabled) { background: linear-gradient(#ffe599, #f4bf45); }
.l-btn-gold:active:not(:disabled) { box-shadow: 0 1px 0 #a3760f, 0 3px 6px rgba(0,0,0,.4); }
.l-btn:disabled { opacity: .4; box-shadow: 0 3px 0 #6f6650; }
.l-btn-sm { padding: 8px 16px; font-size: .95rem; box-shadow: 0 4px 0 #978a6c, 0 6px 10px rgba(0,0,0,.35); }
@media (max-width: 560px) {
  .l-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
