/* GuffGammon: Le Club Guff, Mayfair, 1973. Walnut, oxblood leather, smoke, brass, one lamp over the table. */
:root {
  --night: #140E0C;
  --smoke: #241A17;
  --walnut: #4A2C1D;
  --walnut2: #6B3F26;
  --leather: #3A1416;
  --oxblood: #5E1A1F;
  --claret: #7A2030;
  --brass: #C9A24A;
  --brass-hi: #E8CF86;
  --brass-lo: #8A6A1E;
  --ivory: #F3E6C8;
  --muted: #B9A78C;
  --felt: #1B4433;
  --amber: #E29A2E;
  --pink: #FF5FA2;
  --good: #7FD39A;
  --bad: #FF7B6B;
  --display: "Fraunces", Georgia, serif;
  --body: "Nunito", -apple-system, system-ui, sans-serif;
  --neon: "Monoton", "Fraunces", serif;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0; min-height: 100dvh; color: var(--ivory); font: 500 16px/1.45 var(--body);
  background: radial-gradient(ellipse 80% 45% at 50% 0%, rgba(226, 154, 46, .16), transparent 70%), radial-gradient(ellipse at 50% 120%, #2A1210, transparent 60%), var(--night);
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--brass-hi); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; margin: 0; line-height: 1.15; }
h2 { font-size: 1.2rem; margin: 26px 0 10px; color: var(--brass-hi); font-style: italic; letter-spacing: .01em; }
h3 { font-size: 1.05rem; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.err { color: var(--bad); }
.loading { text-align: center; color: var(--muted); font-style: italic; font-family: var(--display); margin-top: 60px; }

/* the smoke: three slow drifting clouds behind everything */
.smoke { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.smoke i { position: absolute; width: 80vmax; height: 50vmax; border-radius: 50%; background: radial-gradient(closest-side, rgba(200, 190, 175, .07), transparent); filter: blur(20px); }
.smoke i:nth-child(1) { left: -20vmax; top: 10vh; animation: drift 46s ease-in-out infinite alternate; }
.smoke i:nth-child(2) { right: -30vmax; top: 40vh; animation: drift 61s ease-in-out infinite alternate-reverse; }
.smoke i:nth-child(3) { left: 10vmax; bottom: -20vmax; animation: drift 53s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(12vmax, -6vmax) scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .smoke i { animation: none; } }

.top, .app, .toast { position: relative; z-index: 1; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 8px; max-width: 760px; margin: 0 auto; }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1; }
.neon {
  font-family: var(--neon); font-size: 1.55rem; white-space: nowrap; color: #FFE3F0; letter-spacing: .02em;
  text-shadow: 0 0 4px #fff, 0 0 10px var(--pink), 0 0 22px var(--pink), 0 0 40px #C2307A;
  animation: buzz 7s infinite;
}
@keyframes buzz { 0%, 92%, 100% { opacity: 1; } 93% { opacity: .55; } 94% { opacity: 1; } 96% { opacity: .7; } 97% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .neon { animation: none; } }
.brand small { color: var(--muted); font-size: .62rem; letter-spacing: .12em; white-space: nowrap; text-transform: uppercase; margin-top: 4px; }
.topnav { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .86rem; margin-left: auto; }
.topnav a { text-decoration: none; color: var(--ivory); opacity: .85; }
.iconbtn { background: transparent; border: 1px solid rgba(201, 162, 74, .4); border-radius: 999px; width: 32px; height: 32px; color: var(--ivory); cursor: pointer; }

.app { max-width: 760px; margin: 0 auto; padding: 4px 12px 40px; }
.card { background: linear-gradient(180deg, rgba(74, 44, 29, .55), rgba(36, 26, 23, .75)); border: 1px solid rgba(201, 162, 74, .28); border-radius: 14px; padding: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .04); margin-bottom: 12px; }

.btn { font: 800 1rem var(--body); border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer; color: var(--night); transition: transform .08s; }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.brass { background: linear-gradient(180deg, var(--brass-hi), var(--brass)); box-shadow: 0 3px 0 var(--brass-lo), 0 0 18px rgba(232, 207, 134, .2); }
.btn.claret { background: linear-gradient(180deg, #A83248, var(--claret)); color: var(--ivory); box-shadow: 0 3px 0 #4A1220; }
.btn.ghost { background: transparent; color: var(--ivory); border: 1px solid rgba(243, 230, 200, .35); }
.btn.ghost.armed { border-color: var(--bad); color: var(--bad); }
.btn.small { padding: 8px 14px; font-size: .88rem; }
.btn.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 3px 0 var(--brass-lo), 0 0 26px rgba(232, 207, 134, .65); } }
.linkish { background: none; border: 0; color: var(--brass-hi); text-decoration: underline; font: inherit; cursor: pointer; padding: 0; }

.patter { font-family: var(--display); font-style: italic; font-size: 1.08rem; line-height: 1.35; margin: 6px 0; }
.patter.loud { color: var(--brass-hi); font-weight: 700; }
.caption { font-family: var(--display); font-style: italic; color: var(--muted); }

/* the door */
.door { text-align: center; padding-top: 6px; }
.door .doorman svg { filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .6)); }
.form { display: grid; gap: 10px; text-align: left; max-width: 360px; margin: 12px auto; }
.form label { display: grid; gap: 4px; font-weight: 700; font-size: .9rem; color: var(--muted); }
.form input, .chatform input { font: 600 1.05rem var(--body); padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(201, 162, 74, .35); background: rgba(20, 14, 12, .7); color: var(--ivory); }
.form summary { color: var(--muted); cursor: pointer; font-size: .9rem; }

/* the lobby */
.welcome { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px; }
.doorman.sm svg { display: block; }
.tables { display: grid; gap: 8px; }
.tablerow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; text-decoration: none; color: var(--ivory); background: rgba(36, 26, 23, .8); border: 1px solid rgba(201, 162, 74, .2); border-radius: 12px; padding: 8px 12px; }
.tablerow.go { border-color: var(--brass); box-shadow: inset 4px 0 0 var(--brass), 0 0 16px rgba(232, 207, 134, .12); }
.tablerow .heads { display: flex; }
.tablerow .heads svg + svg { margin-left: -10px; }
.tablerow .who { font-weight: 800; }
.tablerow .who small { display: block; font-weight: 600; color: var(--muted); }
.tablerow .who b { color: var(--brass-hi); }
.tablerow .sc { font-family: var(--display); font-weight: 800; font-size: 1.15rem; text-align: right; }
.tablerow .sc small { display: block; font-family: var(--body); font-size: .72rem; color: var(--muted); font-weight: 600; }
.done summary, .howto summary, .log summary, .menu summary { cursor: pointer; color: var(--muted); font-weight: 700; margin: 10px 0; }
.done .tablerow { margin-bottom: 6px; opacity: .85; }
.seat h3 { color: var(--brass-hi); }
.house { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.housecard { display: grid; justify-items: center; gap: 2px; background: rgba(20, 14, 12, .55); border: 1px solid rgba(201, 162, 74, .3); border-radius: 12px; padding: 8px 6px 10px; color: var(--ivory); cursor: pointer; font: inherit; text-align: center; transition: transform .12s, border-color .12s; }
.housecard:hover, .housecard:active { transform: translateY(-2px) rotate(-.6deg); border-color: var(--brass); }
.housecard b { font-family: var(--display); font-size: 1.05rem; }
.housecard small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { border: 1px solid rgba(201, 162, 74, .35); background: rgba(20, 14, 12, .6); color: var(--ivory); border-radius: 999px; padding: 7px 13px; font: 700 .88rem var(--body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.person { padding: 3px 12px 3px 3px; }
.chip.on { background: linear-gradient(180deg, var(--brass-hi), var(--brass)); color: var(--night); border-color: var(--brass-hi); }
.wardrobe { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.howto p { color: var(--ivory); opacity: .9; }
.foot { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 26px; }
.avatar { flex: none; border-radius: 50%; background: rgba(243, 230, 200, .08); }

/* the game */
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; background: rgba(20, 14, 12, .65); border: 1px solid rgba(201, 162, 74, .25); border-radius: 12px; padding: 6px 10px; }
.scoreboard .side { display: flex; align-items: center; gap: 8px; }
.scoreboard .side:last-child { flex-direction: row-reverse; text-align: right; }
.scoreboard .side span { display: grid; line-height: 1.1; }
.scoreboard .side i { font: 800 1.5rem var(--display); font-style: normal; color: var(--brass-hi); }
.scoreboard .side small { color: var(--muted); font-size: .72rem; }
.scoreboard .mid { text-align: center; font-family: var(--display); font-style: italic; color: var(--muted); font-size: .9rem; }
.scoreboard .mid small { display: block; font-style: normal; font-family: var(--body); font-size: .72rem; }
.scoreboard.chou { grid-template-columns: auto 1fr; }
.scoreboard.chou .mid { grid-column: 2; grid-row: 1; text-align: right; }
.scoreboard.chou .team { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.mate { display: inline-grid; grid-template-columns: auto auto; column-gap: 6px; align-items: center; background: rgba(243, 230, 200, .06); border-radius: 10px; padding: 3px 8px 3px 3px; font-size: .82rem; }
.mate svg { grid-row: span 3; }
.mate em { color: var(--brass-hi); font-size: .7rem; font-style: normal; text-transform: uppercase; letter-spacing: .08em; }
.mate small { color: var(--muted); }
.mate i { font-style: normal; font-weight: 800; }
.mate.out { opacity: .5; }
.mate.cap { box-shadow: inset 0 0 0 1px var(--brass); }
.status { min-height: 2.6em; }
.status .rolled { font-style: normal; font-family: var(--body); font-size: .9rem; color: var(--brass-hi); }

.boardwrap { position: relative; margin: 4px -6px 0; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .55)); }
.boardwrap::before { content: ""; position: absolute; left: 10%; right: 10%; top: -30px; height: 60px; background: radial-gradient(ellipse at center, rgba(255, 210, 140, .14), transparent 70%); pointer-events: none; }
.board { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.board .pt.pa { fill: #E9DDBF; }
.board .pt.pb { fill: #8E2533; }
.board .num { fill: rgba(243, 230, 200, .55); font: 700 7.5px var(--body); text-anchor: middle; }
.board .brass circle { fill: var(--brass); }
.ck .body { stroke-width: 1.2; }
.ck.mine .body { fill: url(#ckI); stroke: #8C7A55; }
.ck.theirs .body { fill: url(#ckJ); stroke: #C9A24A; }
.ck .ring { fill: none; stroke-width: .9; }
.ck.mine .ring { stroke: rgba(140, 122, 85, .55); }
.ck.theirs .ring { stroke: rgba(201, 162, 74, .55); }
.ck .n { font: 800 8.5px var(--body); text-anchor: middle; }
.ck.mine .n { fill: #3A2A1A; }
.ck.theirs .n { fill: var(--brass-hi); }
.ck.src .body { stroke: var(--brass-hi); stroke-width: 2.4; filter: drop-shadow(0 0 3px rgba(232, 207, 134, .9)); }
.ck.sel .body { stroke: #fff; stroke-width: 2.6; filter: drop-shadow(0 0 5px #fff); }
.ck.src { animation: glint 1.6s ease-in-out infinite; }
@keyframes glint { 50% { opacity: .82; } }
.ck.flying { filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .5)); }
.slab.mine { fill: #EBDDBC; stroke: #8C7A55; stroke-width: .6; }
.slab.theirs { fill: #2A1C22; stroke: #C9A24A; stroke-width: .6; }
.ghost circle { fill: rgba(232, 207, 134, .28); stroke: var(--brass-hi); stroke-width: 1.6; stroke-dasharray: 3 2; }
.ghost .n { fill: var(--brass-hi); font: 800 9px var(--body); text-anchor: middle; }
.ghost.tray { fill: rgba(232, 207, 134, .22); stroke: var(--brass-hi); stroke-width: 1.6; stroke-dasharray: 3 2; }
.die rect { stroke-width: 1.2; }
.die.mine rect { fill: #FBF5E6; stroke: #9C8A62; }
.die.mine circle { fill: #2A1C22; }
.die.theirs rect { fill: #8E2533; stroke: #4A1220; }
.die.theirs circle { fill: #F3E6C8; }
.die.used { opacity: .35; }
.die .dinner { transform-box: fill-box; transform-origin: center; }
.die.rolling .dinner { animation: tumble .6s cubic-bezier(.3, .7, .4, 1); }
@keyframes tumble { 0% { transform: translate(-30px, -14px) rotate(-260deg) scale(.7); } 70% { transform: translate(3px, 2px) rotate(12deg); } 100% { transform: none; } }
.dleft { fill: var(--brass-hi); font: 700 8px var(--body); text-anchor: middle; }
.cube rect { fill: #F7EFDC; stroke: var(--brass-lo); stroke-width: 1.5; }
.cube text { font: 800 11px var(--display); text-anchor: middle; fill: var(--night); }
.cube.offered rect { fill: var(--brass-hi); animation: glint 1s infinite; }
.arrow { fill: none; stroke: var(--brass-hi); stroke-width: 2.4; stroke-dasharray: 5 4; filter: drop-shadow(0 0 2px #000); }
.arrowhead { fill: var(--brass-hi); }
.pips { display: flex; justify-content: space-between; gap: 6px; font-size: .78rem; color: var(--muted); margin: 4px 2px 0; flex-wrap: wrap; }
.badge { background: var(--claret); color: var(--ivory); border-radius: 999px; padding: 1px 8px; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 12px 0 6px; min-height: 48px; }
.actions .answer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.actions .answer span { font-weight: 800; }
.hintline { color: var(--muted); font-style: italic; font-family: var(--display); }
.last { text-align: center; color: var(--ivory); opacity: .9; font-size: .92rem; margin: 6px 0; }
.last b { color: var(--bad); }
.tale { display: flex; gap: 10px; align-items: flex-start; background: rgba(20, 14, 12, .75); border: 1px dashed rgba(201, 162, 74, .5); border-radius: 12px; padding: 10px 12px; margin: 10px 0; animation: slidein .5s ease-out; }
.tale.caught { border-color: rgba(255, 123, 107, .6); }
.tale p { margin: 0; font-family: var(--display); font-style: italic; }
.tale .icon { font-size: 1.4rem; }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tale, .die.rolling .dinner, .ck.src, .btn.pulse, .cube.offered rect { animation: none; } }
.final h3 { color: var(--brass-hi); }
.final ol { padding-left: 20px; margin: 8px 0 12px; }
.standings .lrow, .record .lrow { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 4px 0; }
.record .lrow { grid-template-columns: auto auto 1fr auto; }
.record .lrow span small { display: block; color: var(--muted); font-size: .76rem; }
.lrow b.won { color: var(--good); }
.cast { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; }
.cast figure { margin: 0; text-align: center; }
.cast figcaption { font-weight: 800; font-size: .86rem; }
.cast figure.me figcaption { color: var(--brass-hi); }
.figure .wisp path { animation: wisp 3.2s ease-in-out infinite; }
.figure .wisp .w2 { animation-delay: 1.4s; }
@keyframes wisp { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-12px); } }
@media (prefers-reduced-motion: reduce) { .figure .wisp path { animation: none; } }
.chat { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.chat p { margin: 0; display: flex; gap: 6px; align-items: center; }
.chat p b { color: var(--brass-hi); }
.chatform { display: flex; gap: 6px; margin-top: 8px; }
.chatform input { flex: 1; }
.log ul { padding-left: 18px; margin: 0 0 8px; font-size: .88rem; }
.log li i { color: var(--muted); }
.menu .btn { margin: 4px 6px 4px 0; }

/* the dice page */
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; height: 170px; margin: 12px 0; }
.barcol { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; height: 100%; gap: 4px; }
.barcol .b { width: 70%; align-self: end; background: linear-gradient(180deg, var(--brass-hi), var(--brass-lo)); border-radius: 6px 6px 0 0; min-height: 2px; }
.barcol .pct { font-size: .74rem; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #2A1C18; border: 1px solid var(--brass); color: var(--ivory); padding: 10px 16px; border-radius: 12px; max-width: 92vw; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); z-index: 5; }
