/* The look of everything drawn over the game: chunky, rounded, sticker-like panels on a sunny day.
   Preview every piece at /dev/kit.html. Display type: Lilita One. Text: Nunito. (Both OFL, in /fonts.) */
@font-face { font-family: "Lilita One"; src: url("fonts/LilitaOne-Regular.ttf") format("truetype"); font-display: block; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito.ttf") format("truetype"); font-weight: 200 1000; font-display: swap; }

:root {
  --ink: #141a26; --ink2: #2a3346; --paper: #fbf6e9; --paper2: #f0e7d0; --line: #d9ccac;
  --blue: #3b8fe8; --blue2: #2466c4; --red: #ef5a4c; --red2: #c63a31; --gold: #ffd24a; --gold2: #e0a41c; --green: #4cc46a; --green2: #2f9a4d; --mute: #7d8698;
  --display: "Lilita One", "Segoe UI", system-ui, sans-serif; --text: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --drop: 0 6px 0 rgba(10, 14, 22, .32); --r: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0e1420; font-family: var(--text); font-weight: 700; color: var(--ink); user-select: none; -webkit-font-smoothing: antialiased; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: none; }
#hud .ui, #hud .ui * { pointer-events: auto; }
#lost { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 50; }

/* ---------------------------------------------------------------- pieces */
.panel { background: var(--paper); border: 3px solid var(--ink); border-radius: var(--r); box-shadow: var(--drop); padding: 16px 18px; color: var(--ink); }
.panel.dark { background: var(--ink); color: var(--paper); border-color: #05070b; }
.panel h2, .title { font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: .02em; text-transform: uppercase; margin: 0 0 10px; line-height: 1.05; }
.title.big { font-size: 44px; } .title.small { font-size: 18px; }
.label { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); margin: 10px 0 5px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.end { justify-content: flex-end; } .grow { flex: 1; min-width: 0; }
.muted { color: var(--mute); font-weight: 700; }

.btn { font-family: var(--display); font-size: 19px; letter-spacing: .03em; text-transform: uppercase; color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: 13px; padding: 9px 18px 8px; box-shadow: 0 5px 0 var(--ink); cursor: pointer; transition: transform .07s, box-shadow .07s, filter .1s; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 0 var(--ink); }
.btn:active, .btn.down { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--gold); } .btn.blue { background: var(--blue); color: #fff; } .btn.red { background: var(--red); color: #fff; } .btn.green { background: var(--green); color: #fff; }
.btn.small { font-size: 15px; padding: 5px 12px 4px; border-radius: 10px; box-shadow: 0 4px 0 var(--ink); }
.btn.big { font-size: 26px; padding: 13px 28px 11px; border-radius: 16px; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: inherit; } .btn.ghost:hover { background: rgba(20, 26, 38, .08); transform: none; box-shadow: none; }
.btn:disabled, .btn.off { filter: grayscale(.9) opacity(.55); cursor: default; transform: none; box-shadow: 0 5px 0 var(--ink); }

.field { font: 800 17px var(--text); color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 8px 12px; width: 100%; outline: none; user-select: text; }
.field:focus { border-color: var(--blue2); box-shadow: 0 0 0 3px rgba(59, 143, 232, .3); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 13px; padding: 3px 10px; border-radius: 99px; background: var(--paper2); border: 2px solid var(--ink); }
.chip.blue { background: var(--blue); color: #fff; } .chip.red { background: var(--red); color: #fff; } .chip.gold { background: var(--gold); } .chip.green { background: var(--green); color: #fff; }
.coins { display: inline-flex; align-items: center; gap: 7px; font-family: var(--display); font-size: 20px; }
.coin { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0, var(--gold) 45%, var(--gold2)); border: 2px solid #7a5200; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); flex: none; }
.coin.small { width: 14px; height: 14px; border-width: 1.5px; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { font: 900 14px var(--text); text-transform: uppercase; letter-spacing: .05em; padding: 7px 13px; border-radius: 11px; border: 3px solid transparent; background: var(--paper2); color: var(--ink2); cursor: pointer; }
.tabs button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, 34px); gap: 7px; }
.swatches button { width: 34px; height: 34px; border-radius: 10px; border: 3px solid var(--ink); cursor: pointer; padding: 0; position: relative; }
.swatches button.on { outline: 4px solid var(--gold); outline-offset: 1px; transform: scale(1.08); }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 9px; }
.option { position: relative; background: #fff; border: 3px solid var(--ink); border-radius: 13px; padding: 8px 6px 7px; text-align: center; font-size: 13px; font-weight: 900; cursor: pointer; min-height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.option:hover { background: #fffdf4; } .option.on { background: var(--gold); box-shadow: 0 4px 0 var(--ink); transform: translateY(-2px); }
.option .price { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.option.locked { background: var(--paper2); color: var(--ink2); }
.option.locked::after { content: ""; position: absolute; top: 6px; right: 6px; width: 12px; height: 10px; border-radius: 3px; background: var(--ink2); box-shadow: 0 -6px 0 -3px var(--paper2), 0 -6px 0 -1px var(--ink2); }

.list { display: flex; flex-direction: column; gap: 6px; }
.list .item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; background: #fff; border: 2px solid var(--line); font-size: 15px; }
.list .item.me { border-color: var(--ink); background: #fffbe6; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--mute); border: 2px solid var(--ink); flex: none; } .dot.ok { background: var(--green); } .dot.wait { background: var(--gold); } .dot.off { background: #c8ccd4; }
.crown { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 12px solid var(--gold2); flex: none; filter: drop-shadow(0 0 0 var(--ink)); }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.toggle i { width: 46px; height: 26px; border-radius: 99px; background: #c8ccd4; border: 3px solid var(--ink); position: relative; flex: none; transition: background .12s; }
.toggle i::after { content: ""; position: absolute; top: 1px; left: 1px; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: left .12s; }
.toggle.on i { background: var(--green); } .toggle.on i::after { left: 21px; }

.bar { height: 16px; border-radius: 99px; background: rgba(20, 26, 38, .16); border: 3px solid var(--ink); overflow: hidden; } .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--gold) 60%, #ff7a3d); border-radius: 99px; }
.key { display: inline-block; min-width: 26px; padding: 2px 7px 3px; border-radius: 7px; background: #fff; color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font: 900 13px var(--text); text-align: center; margin: 0 2px; }
.hints { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13px; font-weight: 800; color: var(--paper); text-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.hints span { white-space: nowrap; }

.toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 40; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 9px 16px; font-size: 15px; box-shadow: var(--drop); animation: pop .18s ease-out; } .toast.good { background: var(--green2); } .toast.bad { background: var(--red2); }
.modal { position: fixed; inset: 0; background: rgba(10, 14, 22, .55); display: flex; align-items: center; justify-content: center; z-index: 30; pointer-events: auto; }
.modal > .panel { max-width: min(92vw, 560px); max-height: 88vh; overflow: auto; animation: pop .18s ease-out; }
.prompt { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--drop); padding: 8px 14px; font-size: 16px; white-space: nowrap; animation: pop .15s ease-out; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.prompt { animation-name: pop-x; } @keyframes pop-x { from { transform: translateX(-50%) scale(.9); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

/* ---------------------------------------------------------------- volleyball */
.vb-hud .score { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 7px 14px; border-radius: 16px; background: var(--ink); color: var(--paper); border: 3px solid #05070b; box-shadow: var(--drop); font-family: var(--display); }
.vb-hud .score span { font-size: 17px; text-transform: uppercase; padding: 4px 12px 3px; border-radius: 9px; letter-spacing: .03em; color: #fff; }
.vb-hud .score .t0 { background: var(--blue); } .vb-hud .score .t1 { background: var(--red); }
.vb-hud .score b { font-weight: 400; font-size: 38px; min-width: 38px; text-align: center; font-variant-numeric: tabular-nums; line-height: 1; }
.vb-hud .score i { font-style: normal; opacity: .45; font-size: 28px; }
.vb-hud .touches { position: absolute; top: 82px; left: 50%; transform: translateX(-50%); display: flex; gap: 7px; }
.vb-hud .touches i { width: 13px; height: 13px; border-radius: 50%; background: rgba(255, 255, 255, .25); border: 2px solid var(--ink); }
.vb-hud .touches i.on.t0 { background: var(--blue); } .vb-hud .touches i.on.t1 { background: var(--red); }
.vb-hud .banner { position: absolute; top: 24%; left: 50%; transform: translate(-50%, -50%) scale(.85); font-family: var(--display); font-size: 68px; text-transform: uppercase; letter-spacing: .03em; color: #fff; opacity: 0; transition: opacity .16s, transform .16s cubic-bezier(.2, 1.6, .4, 1); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); white-space: nowrap; }
.vb-hud .banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.vb-hud .banner.t0 { color: #9fd0ff; } .vb-hud .banner.t1 { color: #ffb0a6; }
.vb-hud .sub { position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%); font-family: var(--display); font-size: 30px; color: #fff; opacity: 0; transition: opacity .15s; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
.vb-hud .sub.show { opacity: 1; }
.vb-hud .sub.perfect { color: var(--gold); } .vb-hud .sub.good { color: #c9f5cf; } .vb-hud .sub.sloppy { color: #ffb3a8; }
.vb-hud .power { position: absolute; bottom: 92px; left: 50%; transform: translateX(-50%); width: 280px; height: 20px; border-radius: 99px; background: rgba(20, 26, 38, .8); border: 3px solid var(--ink); display: none; box-shadow: var(--drop); }
.vb-hud .power i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--gold) 60%, #ff7a3d); }
.vb-hud .power span { position: absolute; left: 0; right: 0; top: -32px; text-align: center; font-family: var(--display); font-size: 22px; color: #fff; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
.vb-hud .hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 800; padding: 7px 14px; border-radius: 12px; background: rgba(20, 26, 38, .72); color: var(--paper); white-space: nowrap; }
.vb-hud .netstat { position: absolute; top: 12px; right: 14px; font: 12px ui-monospace, Menlo, monospace; color: #fff; opacity: .85; text-align: right; text-shadow: 0 1px 0 rgba(0, 0, 0, .6); }

/* ---------------------------------------------------------------- the club */
.hub-hints { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); padding: 8px 16px; border-radius: 14px; background: rgba(20, 26, 38, .72); }
.result { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); text-align: center; min-width: 340px; }
.result .big { font-family: var(--display); font-size: 64px; line-height: 1; margin: 6px 0 14px; }

/* ---------------------------------------------------------------- the locker room */
.creator { position: absolute; right: 26px; top: 26px; bottom: 26px; width: min(440px, 42vw); display: flex; flex-direction: column; }
.creator .creator-body { flex: 1; overflow-y: auto; padding-right: 6px; min-height: 0; }
.creator .field.num { width: 76px; text-align: center; }
.creator .swatches { grid-template-columns: repeat(auto-fill, 32px); gap: 6px; } .creator .swatches button { width: 32px; height: 32px; }
.creator .options { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); } .creator .option { min-height: 44px; justify-content: center; }

/* ---------------------------------------------------------------- the shared club */
.club-hud { position: absolute; inset: 0; }
.coinbox { position: absolute; top: 16px; right: 18px; font-family: var(--display); font-size: 22px; padding: 6px 16px; box-shadow: var(--drop); }
.party { position: absolute; top: 16px; left: 18px; width: 290px; padding: 12px 14px; }
.party .title.small { margin-bottom: 8px; } .party .toggle { margin-top: 10px; }
.people { position: absolute; top: 70px; right: 18px; width: 340px; max-height: 60vh; overflow: auto; padding: 12px 14px; }
.chat { position: absolute; left: 18px; bottom: 64px; width: 380px; }
.chat-log { max-height: 190px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.chat-log .line { color: #fff; font-size: 15px; text-shadow: 0 1px 0 rgba(0, 0, 0, .7), 0 0 6px rgba(0, 0, 0, .5); padding: 1px 0; transition: opacity 1s; } .chat-log .line.old { opacity: 0; }
.chat-log .line.party { color: #9fd0ff; } .chat-log .line.sys { color: var(--gold); font-style: italic; }
.chat-in { margin-top: 6px; opacity: .55; } .chat-in:focus { opacity: 1; }
.queue { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); min-width: 380px; } .queue .panel { padding: 10px 14px; }
.ask { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); padding: 12px 16px; text-align: center; z-index: 5; } .ask.ready { top: 170px; min-width: 320px; }
.gate, .shop { width: min(92vw, 560px); } .shop { width: min(94vw, 720px); }
.options.tight { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); } .options.tight .option { min-height: 40px; justify-content: center; }
.shop-body { max-height: 60vh; overflow: auto; padding-right: 6px; } .options.shop { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.option .sw { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--ink); }
.swatches button.locked::after { content: ""; position: absolute; right: -4px; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid var(--ink); }
.buybar { display: flex; align-items: center; gap: 10px; background: #fffbe6; border: 3px solid var(--ink); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; position: sticky; top: 0; z-index: 2; }
.result .earned { text-align: left; margin: 0 0 14px; font-size: 15px; } .result .earned .total { border-top: 2px solid var(--line); margin-top: 6px; padding-top: 6px; font-size: 17px; }
.shop-body .label:first-child { margin-top: 0; }
.shopbar { border-top: 3px solid var(--line); padding-top: 10px; margin-top: 8px; min-height: 52px; }
.option.owned { background: #eaf7ec; }
.creator .options.shop { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vb-hud .pts { font-family: var(--display); font-size: 24px; color: #fff; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); white-space: nowrap; }

/* bowling */
.bw-hud .bw-sheet { position: absolute; top: 14px; left: 14px; display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: 14px; }
.bw-hud .bw-sheet .row { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 10px; background: rgba(20, 26, 38, .78); color: var(--paper); border: 2px solid transparent; }
.bw-hud .bw-sheet .row.me { border-color: var(--gold); background: var(--ink); }
.bw-hud .bw-sheet .row > i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #05070b; }
.bw-hud .bw-sheet .who { width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bw-hud .bw-sheet .fr { width: 40px; height: 22px; line-height: 22px; text-align: center; border-radius: 6px; background: rgba(255, 255, 255, .12); font-variant-numeric: tabular-nums; }
.bw-hud .bw-sheet .fr.now { background: rgba(255, 210, 74, .35); }
.bw-hud .bw-sheet b { width: 40px; text-align: right; font-family: var(--display); font-size: 20px; font-weight: 400; color: var(--gold); }
.bw-hud .bw-hook { position: absolute; bottom: 56px; left: 50%; transform: translateX(-50%); width: 200px; height: 10px; border-radius: 99px; background: rgba(20, 26, 38, .8); border: 3px solid var(--ink); display: none; }
.bw-hud .bw-hook b { position: absolute; top: -5px; width: 14px; height: 14px; margin-left: -10px; border-radius: 50%; background: var(--gold); border: 3px solid var(--ink); }
.bw-hud .bw-hook span { position: absolute; left: 100%; top: -5px; margin-left: 10px; font-size: 13px; font-weight: 800; color: #fff; text-shadow: 0 2px 0 var(--ink); }
.bw-hud .bw-clock { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); font-family: var(--display); font-size: 44px; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.leave-match { position: absolute; top: 12px; right: 14px; opacity: .75; z-index: 5; }
.leave-match:hover { opacity: 1; } .leave-match.sure { background: var(--red); color: #fff; opacity: 1; }
