/* Thirteen Chairs: the look. Lavish Leaf Inc, all rights reserved.
   A dark hall lit by one candle: wine-dark ground, parchment cards, candle gold for what you press. Laid out like a phone app: a slim top line, one
   screen of content, and the buttons fixed at the bottom where a thumb is. */
:root { --ground: #170d12; --ground-2: #22131a; --panel: #2c1921; --line: #4a2c37; --wine: #8e1f2f; --wine-2: #b5283c; --gold: #d9a441; --gold-2: #f0c468; --parch: #efe4cf; --parch-2: #dccdb0; --ink: #24140f; --text: #f3e9dc; --dim: #b9a59b; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { background: radial-gradient(120% 70% at 50% 0%, #3a1c26 0%, var(--ground) 62%) fixed, var(--ground); color: var(--text); font-family: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input { font-family: inherit; font-size: inherit; color: inherit; }
.app { max-width: 520px; min-height: 100%; margin: 0 auto; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 18px 10px; background: rgba(23, 13, 18, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .brand { font-family: 'Fraunces', Georgia, serif; font-weight: 700; letter-spacing: .02em; color: var(--gold-2); }
.top .sub { color: var(--dim); font-size: .82rem; flex: 1; }
.top .link { margin-left: auto; background: none; border: 0; color: var(--dim); font-weight: 700; padding: 8px 4px; cursor: pointer; }
.screen { flex: 1; padding: 20px 18px 24px; }
.bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; gap: 10px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(23, 13, 18, 0) 0, rgba(23, 13, 18, .96) 26%); }
.bar:empty { display: none; }

h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 700; line-height: 1.15; }
h1 { font-size: 2.5rem; letter-spacing: .01em; }
h2 { font-size: 1.45rem; margin: 22px 0 6px; }
h2:first-child { margin-top: 0; }
h3 { font-size: 1.15rem; margin: 22px 0 8px; color: var(--gold-2); }
.dim { color: var(--dim); font-size: .92rem; }
.center { text-align: center; }
.lead { font-size: 1.08rem; margin-top: 10px; }
.err { color: #ff9c8f; font-weight: 700; min-height: 1.5em; margin-top: 12px; }

.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 15px 18px; font-weight: 800; font-size: 1.05rem; cursor: pointer; transition: transform .08s ease, filter .15s ease; }
.btn:active { transform: scale(.98); }
.btn.gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--ink); box-shadow: 0 6px 18px rgba(217, 164, 65, .22); }
.btn.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.btn.danger { color: #ff9c8f; border-color: #6d2b2b; }
.btn.small { padding: 11px 14px; font-size: .95rem; margin-top: 10px; }
.btn[disabled] { filter: grayscale(1) brightness(.6); cursor: not-allowed; box-shadow: none; }
.btn:focus-visible, .row:focus-visible, .opt:focus-visible, .chip:focus-visible, .mask:focus-visible, .hold:focus-visible, input:focus-visible, .link:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; }

/* home */
.hero { text-align: center; padding: 18px 0 8px; }
.crest { color: var(--parch); width: 148px; margin: 0 auto 10px; line-height: 0; }
.crest svg { width: 100%; height: auto; }
.tag { font-family: 'Fraunces', Georgia, serif; font-style: italic; color: var(--gold-2); font-size: 1.1rem; margin-top: 6px; }
.lore { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--wine-2); border-radius: 12px; padding: 16px 18px; margin: 20px 0 16px; font-size: 1.02rem; }

/* seating */
.nm { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.nm span { width: 26px; text-align: center; color: var(--gold-2); font-family: 'Fraunces', Georgia, serif; font-weight: 700; }
.nm input { flex: 1; min-width: 0; background: var(--ground-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; }
.nm input::placeholder { color: #7f6a66; }
.nm .x { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: transparent; color: var(--dim); font-size: 1.3rem; cursor: pointer; }
.chairs { display: flex; justify-content: center; gap: 6px; margin: 18px 0 4px; }
.chairs i { width: 16px; height: 22px; border-radius: 4px 4px 2px 2px; border: 1.5px solid var(--line); }
.chairs i.in { background: var(--gold); border-color: var(--gold); }
.chairs i.out { background: var(--wine); border-color: var(--wine); transform: rotate(180deg); opacity: .8; }
.opts, .chips, .rows, .masks { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.opt, .chip, .row, .mask { text-align: left; background: var(--ground-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.opt span, .chip span, .row span, .mask span { color: var(--dim); font-size: .88rem; font-weight: 400; }
.opt.sel, .chip.sel, .mask.sel { border-color: var(--gold); background: #33202a; box-shadow: inset 0 0 0 1px var(--gold); }
.chip:not(.sel) { opacity: .55; }
.row.set { border-color: #7b5a2a; }
.row.set span { color: var(--parch); }
.mask.used { opacity: .5; }

/* passing the phone, the mask, the candle */
.pass { text-align: center; padding-top: 8px; }
.over { text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; color: var(--gold-2); font-weight: 800; margin-bottom: 14px; }
.pass h2 { margin: 0; font-size: 1.2rem; font-weight: 500; color: var(--dim); }
.who { font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: 2.6rem; line-height: 1.1; margin: 8px 0 12px; overflow-wrap: anywhere; }
.who.small { font-size: 2rem; margin-bottom: 0; }
.who.out { color: #e7a3a3; }
.who.win { color: var(--gold-2); }
.card { position: relative; width: min(100%, 320px); aspect-ratio: 5 / 6.6; margin: 14px auto; perspective: 900px; }
.card .face { position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; transition: transform .28s ease; display: flex; flex-direction: column; justify-content: center; padding: 22px 20px; box-shadow: 0 14px 36px rgba(0, 0, 0, .45); }
.card .back { background: repeating-linear-gradient(45deg, #5d1522 0 10px, #6c1a29 10px 20px); border: 6px solid var(--gold); color: var(--gold-2); font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: 1.5rem; align-items: center; text-align: center; }
.card .back span { background: var(--ground); padding: 14px 18px; border-radius: 12px; border: 1.5px solid var(--gold); }
.card .front { background: linear-gradient(180deg, var(--parch), var(--parch-2)); color: var(--ink); transform: rotateY(180deg); border: 6px solid #fff8ea; }
.card.lift .back { transform: rotateY(-180deg); }
.card.lift .front { transform: rotateY(0); }
.card.flip .front { animation: flip .5s ease both; }
@keyframes flip { from { transform: rotateY(180deg); } to { transform: rotateY(0); } }
.role { font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: 1.45rem; line-height: 1.2; }
.hint { margin-top: 14px; font-size: .98rem; color: #5a4336; }
.warn { margin-top: 16px; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--wine); }
.hold { display: block; width: min(100%, 320px); margin: 6px auto 8px; padding: 18px; border-radius: 999px; border: 2px dashed var(--gold); background: transparent; color: var(--gold-2); font-weight: 800; font-size: 1.05rem; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.hold:active { background: rgba(217, 164, 65, .14); }
.candle { width: 54px; margin: 6px auto 0; }
.flame { width: 22px; height: 34px; margin: 0 auto -2px; background: radial-gradient(circle at 50% 70%, #fff3c4 0 22%, var(--gold-2) 45%, #e0662b 80%); border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; opacity: .25; }
.candle.lit .flame { opacity: 1; animation: flick 1.1s ease-in-out infinite alternate; box-shadow: 0 0 34px 10px rgba(240, 196, 104, .35); }
@keyframes flick { from { transform: scale(1) rotate(-2deg); } to { transform: scale(1.08, .94) rotate(3deg); } }
.wax { height: 120px; border-radius: 8px 8px 4px 4px; background: linear-gradient(90deg, #d9cbb0, var(--parch) 45%, #cdbd9d); position: relative; overflow: hidden; }
.melt { position: absolute; top: 0; left: 0; right: 0; height: 0; background: var(--ground); transition: height .4s linear; }
.clock { font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: 3.6rem; font-variant-numeric: tabular-nums; margin-top: 10px; }
.two { list-style: none; margin: 14px auto 0; max-width: 340px; text-align: left; }
.two li { padding: 10px 14px; background: var(--panel); border-radius: 10px; margin-top: 8px; border-left: 3px solid var(--wine-2); font-size: .95rem; }

/* score */
.score { width: 100%; border-collapse: collapse; margin-top: 12px; font-variant-numeric: tabular-nums; }
.score th { text-align: right; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 6px 8px; }
.score th:first-child, .score td:first-child { text-align: left; }
.score td { padding: 11px 8px; border-top: 1px solid var(--line); text-align: right; }
.score td i { color: var(--dim); font-size: .82rem; }
.score tr.win td { color: var(--gold-2); font-weight: 800; }
.score tr.gone td:first-child { color: var(--dim); }
.prizes { list-style: none; }
.prizes li { padding: 10px 14px; background: var(--panel); border-radius: 10px; margin-top: 8px; }
.prizes li b { color: var(--gold-2); display: block; font-family: 'Fraunces', Georgia, serif; }
.prizes li span { color: var(--dim); font-size: .88rem; }
.rules { padding-left: 20px; }
.rules li { margin-top: 10px; }

/* the sheet that slides up, as in an app */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(8, 4, 6, .66); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-in { width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto; background: var(--panel); border-radius: 20px 20px 0 0; border-top: 1px solid var(--line); padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; animation: rise .22s ease both; }
.sheet-in h3 { margin: 0; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .card .face, .melt { transition: none; } .card.flip .front, .candle.lit .flame, .sheet-in { animation: none; } }
@media (min-width: 560px) { .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: rgba(23, 13, 18, .5); } }
