:root {
  --cream: #fbf1d8; --gold: #f3cf7c; --cyan: #45e3ff; --muted: #b8c0ee; --ok: #5be39a; --bad: #ff7b8c;
  --silver: linear-gradient(160deg, #ffffff 0%, #8c93a8 18%, #f1f3f8 34%, #5a6075 52%, #dfe3ec 68%, #767c92 84%, #f4f6fb 100%);
  --plate: linear-gradient(180deg, #ffffff 0%, #dfe3ec 30%, #9aa1b4 55%, #eef1f7 75%, #b9bfcd 100%);
  --navy: linear-gradient(180deg, #1633bd 0%, #0c1c78 55%, #08124f 100%);
  --num-fill: linear-gradient(180deg, #fffdf6 0%, #fbf0d2 45%, #efd9a6 75%, #d9b66f 100%);
}
* { box-sizing: border-box; }
html { background: #1b0748; }
body { margin: 0; min-height: 100vh; color: var(--cream); font: 16px/1.5 Heebo, system-ui, sans-serif;
  background: radial-gradient(ellipse 70% 40% at 50% 0%, rgba(170,110,255,.45), transparent 70%), url(../img/velvet.jpg) center top / 100% 1000px repeat-y; font-variant-numeric: lining-nums; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
a { color: var(--cyan); }

/* inputs */
input, select { width: 100%; background: rgba(4,10,48,.75); color: var(--cream); border: 1px solid rgba(200,210,255,.35); border-radius: 10px;
  padding: 10px 12px; font: inherit; box-shadow: inset 0 2px 6px rgba(0,0,0,.5); }
input:focus, select:focus { outline: 2px solid var(--cyan); outline-offset: 0; }
select option { background: #0c1c78; }
label { display: block; font-size: 14px; color: var(--muted); }
label > input, label > select { margin-top: 6px; }

/* buttons */
button, .btn { font: inherit; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; color: var(--cream); }
.btn { padding: 9px 16px; border-radius: 10px; border: 2px solid transparent;
  background: var(--navy) padding-box, var(--silver) border-box; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.btn:hover { filter: brightness(1.15); }
.btn.small { padding: 5px 10px; font-size: 14px; }
.plate { margin-top: 14px; padding: 12px 34px; border: 0; font-family: 'Frank Ruhl Libre', serif; font-weight: 900; font-size: 19px; color: #10205c;
  background: var(--plate); clip-path: polygon(4% 0, 96% 0, 100% 50%, 96% 100%, 4% 100%, 0 50%);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.plate:hover { filter: drop-shadow(0 0 12px rgba(69,227,255,.7)); }
label > .plate { width: 100%; margin-top: 6px; }
.plate.big { font-size: 20px; padding: 14px 50px; }
.plate.resume { background: linear-gradient(180deg, #e9fff1, #8fe7b4 50%, #4fbf83 75%, #c8f5da); }

/* the silver-framed royal blue panel, like the reference */
.frame { position: relative; border-radius: 24px; padding: 26px 22px 22px; border: 5px solid transparent; min-width: 0;
  background: radial-gradient(ellipse 90% 50% at 50% 0%, rgba(80,130,255,.35), transparent 70%) padding-box, var(--navy) padding-box, var(--silver) border-box;
  box-shadow: 0 0 0 2px rgba(0,0,0,.45), 0 0 26px rgba(120,150,255,.35), inset 0 0 40px rgba(0,0,0,.45), 0 14px 30px rgba(0,0,0,.45); }
.frame::before { content: ''; position: absolute; top: -14px; left: 50%; width: 22px; height: 22px; transform: translateX(-50%) rotate(45deg);
  background: linear-gradient(135deg, #c9f8ff, #2bb8ff 50%, #0a4fa8); border: 3px solid #e8ebf3; box-shadow: 0 0 14px var(--cyan); }
.frame h2 { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; font-family: 'Frank Ruhl Libre', serif; font-weight: 900; font-size: 24px;
  color: var(--gold); text-shadow: 0 2px 0 #3a2508, 0 0 12px rgba(255,200,100,.3); }
.frame h2::before, .frame h2::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, transparent, rgba(243,207,124,.7), transparent); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .box { width: min(420px, 100%); display: grid; gap: 14px; }
.login .title { margin: 0; text-align: center; font-family: 'Frank Ruhl Libre', serif; font-size: 26px; color: var(--gold); }
.err { color: var(--bad); min-height: 1.2em; text-align: center; }

/* the clean, transparent Texas Hold'em logo */
.logo { width: 100%; aspect-ratio: 900 / 424; background: url(../img/logo.png) 50% 50% / contain no-repeat; }
.logo.small { width: 120px; }

/* header */
.top { position: relative; z-index: 5; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 6px 20px;
  background: linear-gradient(180deg, rgba(27,7,72,.96), rgba(27,7,72,.85)); backdrop-filter: blur(8px); border-bottom: 2px solid rgba(200,210,255,.25); }
.status { display: flex; align-items: center; gap: 8px; font-weight: 700; }
#logout { margin-inline-start: auto; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot.paused { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.demo { background: rgba(90,60,10,.85); color: #ffe7a8; padding: 8px 20px; font-size: 14px; text-align: center; }

/* hero: the live plaques */
.hero { display: flex; flex-direction: column; align-items: center; padding: 18px 16px 4px; }
.plaques { position: relative; width: min(100%, 560px); aspect-ratio: 952 / 539; container-type: inline-size; direction: ltr;
  background: url(../img/stage.jpg) 50% 41.63% / 104.2% auto no-repeat;
  -webkit-mask: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); mask: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.num { position: absolute; left: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.num span { display: inline-block; font-family: 'Playfair Display', serif; font-weight: 900; line-height: 1; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums;
  background: var(--num-fill); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 #7a5a24) drop-shadow(0 3px 0 #2a1a06) drop-shadow(0 5px 6px rgba(0,0,0,.5)); }
.num.mega { top: 2.97%; height: 25.2%; } .num.mega span { font-size: 14.5cqw; }
.num.major { top: 40.8%; height: 19.3%; } .num.major span { font-size: 10.9cqw; }
.num.minor { top: 72%; height: 15.6%; } .num.minor span { font-size: 8.4cqw; }

main { max-width: 640px; margin: 0 auto; padding: 22px 12px 120px; display: grid; gap: 30px; }
.frame.wide { grid-column: 1 / -1; }
.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; margin-top: 10px; }
.row { display: flex; gap: 8px; align-items: center; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--cream); margin-top: 14px; }
label.check input { width: 20px; height: 20px; }
details.sub { margin-top: 16px; border-top: 1px dashed rgba(200,210,255,.3); padding-top: 10px; }
details.sub summary { cursor: pointer; color: var(--cyan); font-size: 15px; }
details.sub[open] summary { margin-bottom: 10px; }

/* tables */
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { font-family: 'Frank Ruhl Libre', serif; font-weight: 700; color: var(--cream); text-align: start; padding: 8px; border-bottom: 2px solid rgba(225,232,255,.55); white-space: nowrap; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid rgba(225,232,255,.25); white-space: nowrap; }
.tbl .num-c { direction: ltr; text-align: end; font-variant-numeric: tabular-nums; }
.tbl .cards { direction: ltr; text-align: end; }
.tbl .del { background: transparent; border: 0; color: var(--bad); padding: 2px 6px; font-size: 16px; }
.tbl.form td { padding: 6px; }
.tbl.form input { min-width: 100px; }
.tier-name { font-family: 'Cinzel', serif; font-weight: 900; color: #10205c; background: var(--plate); padding: 4px 14px; border-radius: 6px; font-size: 14px; letter-spacing: 1px; }
.tier-now { font-variant-numeric: lining-nums tabular-nums; font-family: 'Playfair Display', serif; font-weight: 900; font-size: 20px; color: var(--gold); direction: ltr; display: inline-block; }

/* card picker */
.picker { display: flex; gap: 8px; margin: 16px 0 10px; flex-wrap: wrap; direction: ltr; justify-content: center; }
.slot { display: grid; gap: 4px; width: 78px; }
.slot .face { height: 104px; border-radius: 8px; background: linear-gradient(165deg, #fffef8, #f4ead0); color: #121212; display: grid; place-items: center;
  font-family: 'Playfair Display', serif; font-weight: 900; font-size: 28px; box-shadow: 0 5px 10px rgba(0,0,0,.45); }
.slot .face.red { color: #c3122c; }
.slot .face.empty { background: rgba(4,10,48,.6); color: var(--muted); font: 13px Heebo, sans-serif; border: 2px dashed rgba(200,210,255,.35); box-shadow: none; }
.slot select { padding: 6px 4px; font-size: 15px; text-align: center; }

/* entries */
.entries { display: flex; gap: 14px; justify-content: center; margin-bottom: 14px; }
.gem-btn { width: 92px; height: 92px; border-radius: 50%; border: 0; font-family: 'Playfair Display', serif; font-weight: 900; font-size: 30px; color: #fff;
  background: radial-gradient(circle at 50% 50%, #2b54ff 0 42%, #0e2a9e 43% 54%, transparent 55%), repeating-conic-gradient(from 10deg, #fff 0 12deg, #1530b0 12deg 30deg);
  box-shadow: 0 6px 14px rgba(0,0,0,.5), 0 0 0 3px rgba(255,255,255,.25); text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.gem-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 18px rgba(0,0,0,.5), 0 0 16px rgba(69,227,255,.6); }
.gem-btn:active { transform: scale(.96); }
.today { margin-top: 12px; text-align: center; font-family: 'Frank Ruhl Libre', serif; font-size: 20px; color: var(--gold); }

/* stats */
.seg { display: inline-flex; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--navy) padding-box, var(--silver) border-box; }
.seg button { border: 0; background: transparent; padding: 8px 16px; }
.seg button.on { background: var(--plate); color: #10205c; font-weight: 800; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.kpi { background: rgba(4,10,48,.55); border: 1px solid rgba(200,210,255,.25); border-radius: 14px; padding: 12px 14px; }
.kpi .v { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 900; direction: ltr; text-align: right; color: var(--cream); font-variant-numeric: lining-nums tabular-nums; }
.kpi .k { font-size: 13px; color: var(--muted); }
.kpi.good .v { color: var(--ok); } .kpi.bad .v { color: var(--bad); } .kpi.gold .v { color: var(--gold); }
.current { padding: 12px 14px; background: rgba(4,10,48,.55); border-radius: 14px; border: 1px solid rgba(200,210,255,.25); }
.current .v { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 900; color: var(--gold); direction: ltr; display: inline-block; }

/* screens */
.screens { display: grid; gap: 8px; }
.scr { display: grid; grid-template-columns: auto 1fr 120px auto; gap: 10px; align-items: center; background: rgba(4,10,48,.55); border: 1px solid rgba(200,210,255,.25); border-radius: 12px; padding: 8px 12px; }
.scr input[type=checkbox] { width: 20px; height: 20px; }
.scr .sec { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.scr .mv { display: flex; gap: 4px; }
.scr .mv button { padding: 3px 8px; }
.pt { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr auto; gap: 6px; margin-bottom: 6px; direction: ltr; }
.pt.head span { font-family: 'Frank Ruhl Libre', serif; font-weight: 700; padding: 0 6px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(140px); padding: 12px 22px; border-radius: 12px; z-index: 20;
  border: 2px solid transparent; background: var(--navy) padding-box, var(--silver) border-box; box-shadow: 0 0 20px rgba(69,227,255,.4); transition: transform .3s; }
.toast.on { transform: translateX(-50%); }
.foot { text-align: center; padding: 10px 0 30px; color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .top .actions .btn { padding: 7px 10px; font-size: 14px; } .gem-btn { width: 78px; height: 78px; } }

/* ---------- round 2: phone-first pieces ---------- */
.hero { padding: 10px 8px 0; }
.frame { padding: 24px 16px 18px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-radius: 12px; overflow: hidden; margin-bottom: 14px; border: 2px solid transparent;
  background: var(--navy) padding-box, var(--silver) border-box; }
.tabs button { border: 0; background: transparent; padding: 12px 6px; font-family: 'Frank Ruhl Libre', serif; font-weight: 900; font-size: 18px; color: var(--muted); }
.tabs button.on { background: var(--plate); color: #10205c; }
.newwin-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tier-row { margin-bottom: 12px; }
.cards-block { margin: 16px 0 10px; }
.cards-label { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 6px; font-family: 'Frank Ruhl Libre', serif; font-weight: 700; color: var(--cream); }
.link { background: none; border: 0; color: var(--cyan); font-size: 14px; padding: 0; text-decoration: underline; }
.slots { display: flex; gap: 8px; direction: ltr; justify-content: center; }
.slot { width: 18%; max-width: 70px; aspect-ratio: 5 / 7; border-radius: 9px; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: linear-gradient(165deg, #fffef8, #f4ead0); color: #121212; font-family: 'Playfair Display', serif; font-weight: 900; font-size: 22px; line-height: 1; box-shadow: 0 5px 10px rgba(0,0,0,.45); }
.slot.red { color: #c3122c; }
.slot span:last-child { font-size: 24px; }
.slot.empty { background: rgba(4,10,48,.6); color: var(--muted); border: 2px dashed rgba(200,210,255,.4); box-shadow: none; font: 26px Heebo, sans-serif; }
#holeSlots .slot:not(.empty) { box-shadow: 0 0 0 3px var(--gold), 0 5px 10px rgba(0,0,0,.45); }
.strength { margin: 12px 0; padding: 10px 14px; border-radius: 12px; background: rgba(4,10,48,.55); border: 1px solid rgba(200,210,255,.25); }
.strength b { font-family: 'Playfair Display', serif; font-size: 22px; color: var(--gold); margin-inline-start: 6px; }
.tiers { display: grid; gap: 12px; margin-bottom: 12px; }
.tier { padding: 12px; border-radius: 14px; background: rgba(4,10,48,.55); border: 1px solid rgba(200,210,255,.25); }
.tier-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tier-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tier-fields label { font-size: 12px; }
.tier-fields input { padding: 8px; }
.wide-btn { width: 100%; margin-top: 14px; padding: 14px; font-size: 17px; font-weight: 700; }
.wide-btn.go { background: linear-gradient(180deg, #1f8a52, #11603a) padding-box, var(--silver) border-box; }
input.mini { width: 74px; padding: 6px 8px; }
.tv-url { text-align: center; }
.tv-url b { color: var(--cream); }

.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(27,7,72,.85), rgba(14,4,40,.98)); border-top: 2px solid rgba(200,210,255,.3); backdrop-filter: blur(8px); }
.savebar .dirty { flex: 1; font-size: 13px; color: var(--gold); }
.savebar .plate { margin: 0; padding: 12px 40px; font-size: 20px; }
.savebar.dirty-on .plate { filter: drop-shadow(0 0 12px rgba(255,210,110,.9)); }

.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(5,0,20,.65); }
.sheet-box { width: min(560px, 100%); margin: 0 8px calc(8px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; display: grid; gap: 12px; }
.sheet-actions { justify-content: space-between; }
.suits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; direction: ltr; }
.suits button, .ranks button { border: 0; border-radius: 10px; background: linear-gradient(165deg, #fffef8, #f4ead0); color: #121212; font-family: 'Playfair Display', serif; font-weight: 900; }
.suits button { font-size: 34px; padding: 6px 0; opacity: .55; }
.suits button.on { opacity: 1; box-shadow: 0 0 0 3px var(--cyan); }
.ranks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; direction: ltr; }
.ranks button { font-size: 24px; padding: 12px 0; }
.red { color: #c3122c !important; }
.ranks button.on { box-shadow: 0 0 0 3px var(--cyan); }
.ranks button:disabled { opacity: .25; }
.save-list { display: grid; gap: 8px; }
.save-item { display: grid; gap: 2px; text-align: start; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(200,210,255,.3); background: rgba(4,10,48,.6); }
.save-item:hover { border-color: var(--cyan); }
