/* Tassie's Winners Circle — warm casino, big type, nothing small. */
:root {
  --wine: #5a0f1d; --wine-2: #7a1a2e; --gold: #e0b34a; --gold-2: #f6d77b; --cream: #fff7e8; --paper: #fffdf8;
  --ink: #2b1a1e; --muted: #7a6a6d; --green: #1d7a3a; --green-2: #27a04b; --red: #c0392b; --blue: #1f5fa8;
  --shadow: 0 6px 18px rgba(60, 20, 30, .18); --radius: 22px;
  font-size: 20px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--ink); background: var(--cream); line-height: 1.35; overscroll-behavior: none; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
input, textarea, select { font: inherit; }
#app { min-height: 100%; display: flex; flex-direction: column; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* ---- header ---- */
.top { background: linear-gradient(180deg, var(--wine), var(--wine-2)); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 18px 10px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 20; }
.top .brand { font-size: 1.35rem; font-weight: 800; letter-spacing: .3px; color: var(--gold-2); text-shadow: 0 2px 0 rgba(0,0,0,.35); display: flex; align-items: center; gap: 10px; }
.top .brand small { display: block; font-size: .7rem; font-weight: 600; color: #fff; opacity: .9; letter-spacing: .5px; }
.top .spacer { flex: 1; }
.tokens { background: rgba(0,0,0,.28); border: 2px solid var(--gold); border-radius: 999px; padding: 6px 18px; font-weight: 800; font-size: 1.25rem; color: var(--gold-2); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tokens.bump { animation: bump .5s ease; }
@keyframes bump { 30% { transform: scale(1.12); background: var(--green-2); color: #fff; } }
.navbtn { background: rgba(255,255,255,.12); color: #fff; border: 2px solid rgba(255,255,255,.35); border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 1rem; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; }
.navbtn.active, .navbtn:hover { background: var(--gold); color: var(--wine); border-color: var(--gold); }
.navbtn .badge { background: var(--red); color: #fff; border-radius: 999px; min-width: 26px; height: 26px; display: inline-grid; place-items: center; font-size: .85rem; }

main { flex: 1; padding: 18px; max-width: 1200px; margin: 0 auto; width: 100%; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
h1 { font-size: 1.9rem; margin: 6px 0 12px; color: var(--wine); }
h2 { font-size: 1.35rem; margin: 0 0 10px; color: var(--wine); }
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.btn { background: var(--wine); color: #fff; border: 0; border-radius: 16px; padding: 14px 24px; font-size: 1.15rem; font-weight: 800; min-height: 60px; box-shadow: 0 4px 0 rgba(0,0,0,.25); display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn.gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--wine); }
.btn.green { background: linear-gradient(180deg, var(--green-2), var(--green)); }
.btn.ghost { background: #fff; color: var(--wine); border: 2px solid var(--wine); box-shadow: none; }
.btn.big { font-size: 1.5rem; padding: 18px 34px; min-height: 76px; }
.btn.small { min-height: 46px; padding: 8px 16px; font-size: 1rem; }

/* ---- sign in ---- */
.signin { max-width: 720px; margin: 30px auto; text-align: center; }
.signin .welcome { font-size: 2.2rem; color: var(--wine); font-weight: 900; margin: 20px 0 6px; }
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 24px 0; }
.person { background: var(--paper); border: 3px solid transparent; border-radius: var(--radius); padding: 22px 12px; box-shadow: var(--shadow); font-size: 1.3rem; font-weight: 800; color: var(--wine); }
.person .face { font-size: 4rem; line-height: 1; margin-bottom: 8px; }
.person.selected { border-color: var(--gold); background: #fff3d6; }
.pinpad { display: grid; grid-template-columns: repeat(3, 96px); gap: 12px; justify-content: center; margin: 14px auto; }
.pinpad button { height: 84px; border-radius: 20px; font-size: 2rem; font-weight: 800; background: #fff; border: 2px solid #d8c7c9; color: var(--ink); box-shadow: var(--shadow); }
.pindots { display: flex; justify-content: center; gap: 16px; margin: 12px; }
.pindots span { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--wine); }
.pindots span.on { background: var(--wine); }
.error { color: var(--red); font-weight: 700; min-height: 1.4em; }

/* ---- lobby ---- */
.lobby { display: grid; grid-template-columns: 1fr 360px; gap: 18px; }
@media (max-width: 960px) { .lobby { grid-template-columns: 1fr; } }
.hello { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.hello .face { font-size: 3.6rem; }
.hello .name { font-size: 1.9rem; font-weight: 900; color: var(--wine); }
.streak { background: #fff3d6; border: 2px solid var(--gold); border-radius: 999px; padding: 6px 16px; font-weight: 800; color: #7a4a00; display: inline-block; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.gametile { background: var(--paper); border-radius: var(--radius); padding: 22px 16px; box-shadow: var(--shadow); text-align: left; border: 3px solid transparent; display: flex; flex-direction: column; gap: 6px; min-height: 170px; position: relative; overflow: hidden; }
.gametile:hover, .gametile:focus-visible { border-color: var(--gold); transform: translateY(-2px); }
.gametile .icon { font-size: 3rem; line-height: 1; }
.gametile .title { font-size: 1.3rem; font-weight: 900; color: var(--wine); }
.gametile .sub { color: var(--muted); font-size: .95rem; }
.gametile .played { position: absolute; top: 12px; right: 12px; background: var(--green); color: #fff; border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: .85rem; }
.gametile.hot::after { content: "HOT!"; position: absolute; top: 12px; right: 12px; background: var(--red); color: #fff; border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: .85rem; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.1); } }

.program li { list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eee2d2; font-size: 1.05rem; }
.program li:last-child { border: 0; }
.program ul { padding: 0; margin: 0; }
.program .tick { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #cbb; display: grid; place-items: center; font-weight: 900; color: #fff; flex: none; font-size: 1.2rem; }
.program li.done .tick { background: var(--green); border-color: var(--green); }
.program li.done .label { text-decoration: line-through; color: var(--muted); }
.program .go { margin-left: auto; }
.program .complete { background: #e8f8ec; border: 2px solid var(--green); border-radius: 14px; padding: 10px 14px; font-weight: 800; color: var(--green); margin-top: 10px; text-align: center; }

.board table { width: 100%; border-collapse: collapse; }
.board td { padding: 8px 6px; border-bottom: 1px solid #eee2d2; font-size: 1rem; vertical-align: middle; }
.board tr.me td { background: #fff3d6; font-weight: 900; }
.board .rank { width: 44px; font-weight: 900; color: var(--wine); text-align: center; font-size: 1.15rem; }
.board .rank.top { color: #b8860b; font-size: 1.4rem; }
.board .pts { text-align: right; font-weight: 800; white-space: nowrap; }
.board .town { color: var(--muted); font-size: .85rem; display: block; }

.ticker { background: var(--wine); color: #fff; border-radius: 14px; padding: 10px 14px; overflow: hidden; white-space: nowrap; position: relative; margin: 14px 0; font-weight: 700; }
.ticker .strip { display: inline-block; padding-left: 100%; animation: ticker 60s linear infinite; }
.ticker .strip span { margin-right: 60px; }
.ticker .strip span.real { color: var(--gold-2); }
@keyframes ticker { to { transform: translateX(-100%); } }

/* ---- game page ---- */
.gamebar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.gamebar h1 { margin: 0; flex: 1; }
.gamewrap { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-height: 60vh; }
.controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center; margin-top: 14px; }
.stat { background: #fff3d6; border: 2px solid var(--gold); border-radius: 14px; padding: 8px 16px; font-weight: 800; color: #6b3a00; white-space: nowrap; }
.stat b { color: var(--wine); font-size: 1.25rem; }

/* ---- feed & mail ---- */
.composer textarea { width: 100%; min-height: 110px; border-radius: 16px; border: 2px solid #d8c7c9; padding: 14px; font-size: 1.1rem; resize: vertical; }
.post { margin-top: 16px; }
.post .who { display: flex; align-items: center; gap: 12px; }
.post .who .face { font-size: 2.4rem; }
.post .who b { font-size: 1.15rem; }
.post .when { color: var(--muted); font-size: .9rem; }
.post .text { font-size: 1.15rem; margin: 10px 0; white-space: pre-wrap; }
.post img { max-width: 100%; border-radius: 16px; display: block; max-height: 70vh; object-fit: contain; background: #000; }
.post .actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.comment { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid #eee2d2; }
.comment .face { font-size: 1.6rem; }
.mailrow { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid #eee2d2; }
.mailrow.unread { background: #fff3d6; border-radius: 14px; padding: 14px; }
.mailrow .face { font-size: 2.2rem; }
.mailrow .text { white-space: pre-wrap; font-size: 1.1rem; }
.mailrow img { max-width: 100%; border-radius: 12px; margin-top: 8px; max-height: 50vh; }
.picker { display: flex; gap: 10px; flex-wrap: wrap; }
.picker button { border-radius: 999px; border: 2px solid var(--wine); background: #fff; color: var(--wine); padding: 8px 16px; font-weight: 800; min-height: 50px; }
.picker button.on { background: var(--wine); color: #fff; }
.filebtn input { display: none; }
.preview { max-height: 220px; border-radius: 12px; margin-top: 10px; display: block; }

/* ---- overlay & toast ---- */
#overlay:empty { display: none; }
#overlay { position: fixed; inset: 0; background: rgba(40, 5, 15, .82); z-index: 50; display: grid; place-items: center; padding: 20px; }
.celebrate { background: radial-gradient(circle at 50% 20%, #fff8dc, #f6d77b 60%, #e0b34a); border-radius: 30px; padding: 34px 28px; text-align: center; max-width: 620px; width: 100%; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: pop .5s cubic-bezier(.2,1.6,.4,1); border: 6px solid var(--wine); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.celebrate .title { font-size: 2.4rem; font-weight: 900; color: var(--wine); text-shadow: 0 2px 0 #fff; margin-bottom: 8px; }
.celebrate .text { font-size: 1.3rem; margin: 12px 0 18px; }
.celebrate .amount { font-size: 3rem; font-weight: 900; color: var(--green); margin: 8px 0; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 14px 24px; border-radius: 999px; font-weight: 800; font-size: 1.1rem; z-index: 70; box-shadow: var(--shadow); animation: pop .3s; max-width: 90vw; text-align: center; }
.toast.bad { background: var(--red); }

.drawing { background: linear-gradient(135deg, #1f1030, #5a0f1d); color: #fff; border-radius: var(--radius); padding: 20px; }
.drawing h2 { color: var(--gold-2); }
.drawing .big { font-size: 2.6rem; font-weight: 900; color: var(--gold-2); }
.winners li { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.15); }
.winners li.real { color: var(--gold-2); font-weight: 900; }

/* ---- winnings ---- */
.winhero { background: linear-gradient(135deg, #5a0f1d, #1f1030); color: #fff; border-radius: var(--radius); padding: 22px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 16px; box-shadow: var(--shadow); }
.winhero .muted { color: #f6d77b; letter-spacing: 2px; font-weight: 800; font-size: .85rem; }
.winhero .num { font-size: 3rem; font-weight: 900; color: var(--gold-2); text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.winhero .wstats { display: flex; gap: 10px; flex-wrap: wrap; }
.goalcard { border: 3px solid var(--gold); margin-bottom: 16px; }
.bar { background: #eee2d2; border-radius: 999px; height: 38px; overflow: hidden; border: 2px solid var(--gold); }
.bar .fill { background: linear-gradient(90deg, var(--green-2), var(--gold)); height: 100%; color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: flex-end; padding-right: 12px; transition: width 1s; min-width: 48px; }
.shelf span { font-size: 2rem; margin-right: 4px; }
.wtable { width: 100%; border-collapse: collapse; } .wtable td { padding: 8px 6px; border-bottom: 1px solid #eee2d2; vertical-align: middle; } .wtable .pts { text-align: right; font-weight: 900; color: var(--green); white-space: nowrap; }
.prizelist { padding-left: 1.2em; } .prizelist li { padding: 6px 0; border-bottom: 1px solid #eee2d2; } .prizelist .pts { color: var(--green); font-weight: 900; }
.wtable .town { display: block; color: var(--muted); font-size: .85rem; }

/* ---- radio ---- */
.radio { display: inline-flex; align-items: center; gap: 6px; background: rgba(0,0,0,.28); border: 2px solid rgba(255,255,255,.35); border-radius: 999px; padding: 4px 6px 4px 14px; color: #fff; font-weight: 700; min-height: 48px; max-width: 360px; }
.radio .rtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; font-size: .95rem; }
.radio button { background: var(--gold); color: var(--wine); border: 0; border-radius: 999px; width: 40px; height: 40px; font-size: 1.1rem; font-weight: 900; }
.pinpad button.go { background: var(--green); color: #fff; border-color: var(--green); }
/* ---- sponsor tile ---- */
.gametile.sponsor { text-decoration: none; color: inherit; background: #fff; border: 3px dashed #e0b34a; }
.gametile.sponsor img { width: 100%; border-radius: 12px; }
.gametile.sponsor .adlabel { font-size: .7rem; letter-spacing: 2px; color: var(--muted); font-weight: 800; }
.gametile.sponsor .sub { font-size: .85rem; }
/* ---- themes ---- */
.themebanner { background: linear-gradient(90deg, var(--gold-2), var(--gold)); color: var(--wine); border-radius: 16px; padding: 12px 18px; font-weight: 800; font-size: 1.15rem; margin-bottom: 14px; text-align: center; }
.deco { font-size: 1.2rem; }
body[data-theme="christmas"] { --wine: #8b1a1a; --wine-2: #1d7a3a; --cream: #f4f9f4; }
body[data-theme="christmas"] .top { background: linear-gradient(180deg, #8b1a1a, #1d7a3a); }
body[data-theme="newyear"] { --wine: #1f1030; --wine-2: #3a2060; --gold: #f6d77b; }
body[data-theme="thanksgiving"] { --wine: #7a3a00; --wine-2: #b35a00; --cream: #fbf1e3; }
body[data-theme="easter"] { --wine: #6d1a2e; --wine-2: #b03050; --cream: #fff4f6; --gold: #f2c94c; }
body[data-theme="birthday"] { --wine: #8e2a8e; --wine-2: #c04dc0; --cream: #fff3fb; }
body[data-theme="july4"] { --wine: #1f3f8a; --wine-2: #b22234; --cream: #f3f6ff; }
body[data-theme="festival"] { --wine: #0d5eaf; --wine-2: #1f7fd6; --cream: #f2f8ff; }
body[data-theme="halloween"] { --wine: #2b1a1e; --wine-2: #d35400; --cream: #fff3e0; }
body[data-theme="valentine"] { --wine: #a3123f; --wine-2: #d9346b; --cream: #fff1f4; }

/* ---- the room ---- */
.backdrop { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#app { position: relative; z-index: 1; }
.top { position: sticky; overflow: visible; }
.bulbs { position: absolute; left: 0; right: 0; bottom: -6px; height: 12px; pointer-events: none;
  background: radial-gradient(circle, #fff6c2 0 3px, #f6d77b 3.5px, transparent 5px) 0 0 / 22px 12px repeat-x; filter: drop-shadow(0 0 4px #ffe08a);
  animation: chase 1.1s steps(2) infinite; opacity: .95; }
@keyframes chase { to { background-position: 44px 0; } }
body.cheering .bulbs { animation-duration: .25s; filter: drop-shadow(0 0 8px #fff); }
.gametile { box-shadow: var(--shadow), inset 0 -4px 0 rgba(224,179,74,.5); background: linear-gradient(180deg, #fffdf8, #fff3d6); }
.gametile .icon { transition: transform .3s; filter: drop-shadow(0 4px 6px rgba(0,0,0,.2)); animation: idle 3.4s ease-in-out infinite; }
.gametile:nth-child(2n) .icon { animation-delay: -1.1s; } .gametile:nth-child(3n) .icon { animation-delay: -2.2s; }
@keyframes idle { 50% { transform: translateY(-4px) rotate(-3deg); } }
.gametile:hover .icon { transform: scale(1.18) rotate(6deg); }
.crowd { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px; padding: 0 8px 4px; pointer-events: none; z-index: 5; }
.person-mini { position: relative; display: flex; flex-direction: column; align-items: center; width: 64px; }
.person-mini .face { font-size: 1.9rem; line-height: 1; filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); animation: sway 4s ease-in-out infinite; }
.person-mini:nth-child(odd) .face { animation-delay: -2s; }
@keyframes sway { 50% { transform: rotate(4deg) translateY(-2px); } }
body.cheering .person-mini .face { animation: jump .5s ease-in-out infinite; }
@keyframes jump { 50% { transform: translateY(-14px) scale(1.1); } }
.person-mini .nm { font-size: .6rem; font-weight: 800; color: var(--wine); background: rgba(255,255,255,.85); border-radius: 999px; padding: 0 6px; white-space: nowrap; }
.person-mini .bubble { position: absolute; bottom: 100%; margin-bottom: 4px; background: #fff; color: var(--ink); border: 2px solid var(--gold); border-radius: 14px 14px 14px 2px; padding: 5px 10px; font-size: .8rem; font-weight: 700; white-space: nowrap; opacity: 0; transform: translateY(6px) scale(.9); transition: .25s; box-shadow: var(--shadow); max-width: 220px; white-space: normal; width: max-content; }
.person-mini .bubble.on { opacity: 1; transform: none; }
main { padding-bottom: 96px; }
.announce { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 45; background: linear-gradient(135deg, #1f1030, #5a0f1d); color: #fff; border: 4px solid var(--gold); border-radius: 22px; padding: 18px 26px; font-size: 1.5rem; font-weight: 900; text-align: center; max-width: min(90vw, 640px); box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: pop .4s cubic-bezier(.2,1.6,.4,1); display: flex; gap: 12px; align-items: center; }
.announce .mic { font-size: 2.4rem; animation: pulse 1s infinite; }
.announce.out { opacity: 0; transition: .6s; }
@media (prefers-reduced-motion: reduce) { .bulbs, .gametile .icon, .person-mini .face { animation: none; } }

/* ---- radio volume, sized for a mouse on a real screen ---- */
.radio { max-width: none; flex-wrap: nowrap; }
.rvolwrap { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }
.rvol { -webkit-appearance: none; appearance: none; width: 110px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.35); outline: none; cursor: pointer; }
.rvol::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.rvol::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; cursor: pointer; }
@media (max-width: 900px) { .rvolwrap { display: none; } .radio .rtitle { max-width: 120px; } }
@media (min-width: 1100px) { .radio .rtitle { max-width: 260px; } .top { gap: 10px 16px; } }
/* The radio keeps its own width; it is the one thing in the bar that must not be squeezed. */
.radio { flex: 0 0 auto; }
.top .brand { flex: 0 1 auto; min-width: 0; }
@media (min-width: 1100px) { .radio .rtitle { max-width: none; width: auto; } }
