html, body { margin: 0; padding: 0; background: #050505; color: var(--ink); }
#p-root { width: 100%; max-width: 440px; height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; background: #0E0E0E; font-family: var(--font-body); font-size: 13px; line-height: 1.5; --mint: #84efbe; --amber: #f4c879; }
#p-root *, #p-dialog * { box-sizing: border-box; }
#p-root [hidden], #p-dialog [hidden] { display: none !important; }
.p-brand { display: flex; gap: 10px; align-items: center; padding: 14px 16px 10px; flex-shrink: 0; }
.p-brand .mark { border: 2px dashed var(--mint); color: var(--mint); border-radius: 50%; width: 35px; height: 35px; display: grid; place-items: center; font-size: 23px; }
.p-brand strong { font-family: var(--font-header); font-size: 25px; letter-spacing: .07em; }
.p-brand small { margin-left: auto; font: 9px var(--font-mono); color: #b7b7b7; text-transform: uppercase; }
#p-tabs { display: grid; grid-template-columns: 1.2fr .8fr .95fr 1.1fr .9fr; padding: 0 10px 10px; gap: 2px; }
#p-root #p-tabs button { font-size: 10px; border-radius: 6px; padding: 6px 1px; min-height: 44px; background: #171717; border-color: transparent; color: #b8b8b8; }
#p-root #p-tabs [aria-selected="true"] { background: #22362d; color: var(--mint); border-color: #365745; }
#p-content { flex: 1; min-height: 0; overflow: hidden auto; overscroll-behavior-y: contain; padding: 4px 14px 20px; }
#p-root button, #p-dialog button { font: inherit; font-weight: 600; min-height: 44px; border: 1px solid #383838; border-radius: 8px; background: #242424; color: #f4f1ec; padding: 10px 12px; cursor: pointer; touch-action: manipulation; }
#p-root button.primary, #p-dialog button.primary { background: var(--mint); border-color: var(--mint); color: #092519; }
#p-root button.amber, #p-dialog button.amber { background: #372c19; border-color: #796039; color: var(--amber); }
#p-root button.danger, #p-dialog button.danger { background: #521c23; border-color: #9e3941; color: #ffb4b9; }
#p-root button.quiet, #p-dialog button.quiet { background: transparent; border-color: #333; }
#p-root button:disabled, #p-dialog button:disabled { opacity: .45; cursor: not-allowed; }
#p-root :focus-visible, #p-dialog :focus-visible { outline: 2px solid #84efbe; outline-offset: 2px; }
#p-content h1 { font: 700 29px/1.1 var(--font-header); margin: 8px 0; }
#p-content h2, #p-dialog h2 { font: 700 21px/1.2 var(--font-header); margin: 0; }
#p-content h3, #p-dialog h3 { font-size: 14px; margin: 0 0 10px; }
#p-content p, #p-dialog p { color: #bdbdbd; margin: 8px 0 14px; }
#p-content small, #p-dialog small { display: block; color: #b8b8b8; font-size: 11px; }
.eyebrow { color: var(--mint); font: 10px var(--font-mono); letter-spacing: .15em; text-transform: uppercase; }
.panel { margin: 12px 0; padding: 15px; border: 1px solid #303030; border-radius: 12px; background: #181818; }
.hero { background: radial-gradient(ellipse at top right, #203b2e, #161c19 75%); border-color: #355842; }
.hero .pot { display: block; font: 700 43px/1.2 var(--font-header); color: var(--mint); margin: 4px 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row > .grow { flex: 1; min-width: 0; }
.row h2, .row strong, .row span, .row label { overflow-wrap: anywhere; }
.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid2, .grid3 { display: grid; gap: 8px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { background: #1b1b1b; border: 1px solid #303030; border-radius: 8px; padding: 12px 5px; text-align: center; min-width: 0; }
.metric strong { display: block; font: 700 24px var(--font-header); overflow-wrap: anywhere; }
.metric small { text-transform: uppercase; font: 9px var(--font-mono) !important; margin-top: 5px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid #46594e; border-radius: 50%; background: #26352d; color: #beedcf; font-size: 12px; font-weight: 700; }
.player { border-top: 1px solid #303030; padding: 14px 0; }
.player:last-child { padding-bottom: 0; }
.player .row + .row { margin-top: 10px; }
.badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font: 10px var(--font-mono); background: #303030; color: #f4f1ec; }
.badge.D { color: #111; background: #f4f1ec; }
.badge.SB { color: #071c32; background: #8bbbef; }
.badge.BB, .badge.bank { color: #342408; background: #f4c879; }
.badge.active { color: var(--mint); background: #203a2b; }
.positive { color: #84efbe !important; }
.negative { color: #ff929c !important; }
.wide { width: 100%; }
.hint, .banner { padding: 10px 12px; border-radius: 7px; font-size: 12px; background: #242e27; color: #b8e5c8; margin: 10px 0; }
.empty { padding: 30px 12px; text-align: center; }
.empty .symbol { color: var(--mint); font-size: 48px; }
.notice { margin: 0; padding: 0 14px; font-size: 12px; color: #bce5ce; }
.notice:not(:empty) { padding-top: 8px; padding-bottom: 8px; }
.undo-bar { display: flex; flex-shrink: 0; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 14px; background: #203a2b; }
.undo-bar[hidden] { display: none; }
.undo-bar span, .payment-name { overflow-wrap: anywhere; }
.payment-name { font-size: 12px; font-weight: 400; }
#p-root .player .row > span { min-width: 0; overflow-wrap: anywhere; }
#p-root input, #p-root select, #p-root textarea, #p-dialog input, #p-dialog select, #p-dialog textarea { width: 100%; max-width: 100%; min-width: 0; min-height: 44px; background: #101010; border: 1px solid #474747; border-radius: 7px; padding: 10px; color: #f4f1ec; font: 16px var(--font-body); }
#p-root label, #p-dialog label { display: flex; flex-direction: column; gap: 6px; color: #cbcbcb; font-size: 12px; min-width: 0; }
#p-dialog form, #p-content form { display: flex; flex-direction: column; gap: 13px; }
#p-root .check, #p-dialog .check { flex-direction: row; align-items: center; gap: 10px; }
#p-root .check input, #p-dialog .check input { width: 22px; height: 22px; min-height: 22px; accent-color: #84efbe; }
#p-dialog { --mint: #84efbe; --amber: #f4c879; position: fixed; inset: 8px 0 calc(var(--dds-nav-height) + var(--dds-nav-bottom, 0px) + 10px); margin: auto; box-sizing: border-box; width: calc(100% - 16px); max-width: 424px; max-height: calc(var(--dds-view-height, 100dvh) - var(--dds-nav-height) - 18px); overflow: auto; overscroll-behavior: contain; padding: 0; border: 1px solid #414141; border-radius: 17px; background: #171717; color: #f4f1ec; font: 13px/1.5 var(--font-body); }
#p-dialog::backdrop { background: rgba(0,0,0,.8); }
#p-dialog[data-layout="count"][open] { display: flex; flex-direction: column; top: var(--p-count-top, 8px); left: var(--p-count-left, 8px); right: auto; bottom: auto; margin: 0; width: min(var(--p-count-width, 424px), calc(100vw - 16px)); height: var(--p-count-height, calc(100dvh - var(--dds-nav-height) - 18px)); max-height: min(var(--p-count-height, 100dvh), calc(100dvh - var(--dds-nav-height) - 18px)); overflow: clip; }
#p-dialog[data-layout="count"] .sheet-head { position: static; flex-shrink: 0; }
#p-dialog[data-layout="count"] .sheet-body { display: flex; flex: 1; min-height: 0; min-width: 0; padding: 0; overflow: clip; }
#p-dialog [data-p-form="finish-cash"] { flex: 1; min-height: 0; min-width: 0; gap: 0; overflow: clip; }
#p-dialog .count-summary { flex-shrink: 0; margin: 0; padding: 10px 16px; }
#p-dialog .count-players { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 16px 12px; }
#p-dialog .count-footer { flex-shrink: 0; padding: 12px 16px; border-top: 1px solid #333; background: #171717; }
#p-dialog .count-footer .hint { margin: 0 0 10px; }
#p-dialog[data-layout="count"] #p-sheet-error { flex-shrink: 0; max-height: 64px; overflow: auto; }
#p-dialog[data-layout="count"] #p-sheet-error:empty { display: none; }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px; background: #171717; border-bottom: 1px solid #333; }
.sheet-body { padding: 16px; }
#p-sheet-error { margin: 0; padding: 0 16px 16px; }
.choice { padding: 11px 0; border-bottom: 1px solid #333; }
.rank { font: 700 20px var(--font-header); width: 28px; }
.result-row { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid #333; }
.result-row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.progress { height: 7px; border-radius: 8px; overflow: hidden; background: #343434; margin: 14px 0 6px; }
.progress span { display: block; height: 100%; background: var(--mint); }
details > summary { cursor: pointer; min-height: 44px; padding: 10px 0; }
.level { padding: 12px; border: 1px solid #373737; border-radius: 8px; margin-bottom: 10px; }
.clock { font: 700 40px/1.1 var(--font-header); color: var(--mint); margin: 12px 0; }
#p-room { position: fixed; inset: 0 0 calc(var(--dds-nav-height) + var(--dds-nav-bottom, 0px) + 2px); box-sizing: border-box; z-index: 2147483646; background: #0e0e0e; color: #f4f1ec; padding: 25px; overflow: auto; text-align: center; font-family: var(--font-body); }
#p-room:fullscreen { inset: 0; padding-bottom: calc(25px + env(safe-area-inset-bottom, 0px)); }
#p-room .clock { font-size: clamp(52px, 14vw, 140px); }
#p-room h1 { font: 700 40px var(--font-header); }
#p-room .grid3 { max-width: 650px; margin: 20px auto; }
#p-room button { min-height: 44px; background: #84efbe; color: #092519; border: 0; border-radius: 8px; padding: 12px 20px; font: inherit; }
@media (prefers-reduced-motion: reduce) { #p-root *, #p-dialog * { scroll-behavior: auto; } }
