*{box-sizing:border-box}html{color-scheme:dark}body{margin:0;background:#121016;color:#f6ecd9;font:16px/1.6 system-ui,sans-serif;padding:max(20px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left))}main{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:22px;min-height:calc(100dvh - 40px);max-width:1600px;margin:auto}section{background:#211c29;border:1px solid #67563c;border-radius:20px;padding:24px}.notepad{display:flex;flex-direction:column;min-height:65dvh}header,footer{display:flex;justify-content:space-between;align-items:center;gap:15px}h1,h2{margin:0;color:#f4d592;font-size:1.3rem}a{color:#c4b897;font-size:.9rem}textarea{flex:1;min-height:360px;resize:vertical;width:100%;background:transparent;color:#f8f1e3;border:0;outline-offset:5px;font:17px/1.9 system-ui;padding:20px 0;margin:15px 0}button{border:1px solid #94794b;background:#342a1d;color:#f8dc9f;border-radius:10px;padding:12px 18px;font:inherit;cursor:pointer}button:focus-visible,a:focus-visible{outline:3px solid #f4d592;outline-offset:3px}footer{font-size:.8rem;color:#b6aebc}.rng{text-align:center;align-self:start}.rng output{display:block;font-size:clamp(80px,10vw,128px);font-weight:800;color:#f5d598;line-height:1.3;margin-top:28px}.rng>p{color:#b6aebc;margin:0 0 22px}.rng>button{width:100%;background:linear-gradient(110deg,#ffe5a7,#c39850);color:#20180f;font-weight:700}input{width:85px;font:inherit;padding:10px;border:1px solid #756143;border-radius:8px;background:#141118;color:#ffe1a2;text-align:center}#note-conflict{padding:12px;border:1px solid #d5ad69}#note-conflict button{font-size:.8rem;margin-right:10px}[hidden]{display:none!important}@media(max-width:740px){main{grid-template-columns:1fr;gap:14px}.notepad{min-height:55dvh}textarea{min-height:220px}.rng output{font-size:80px;margin:8px}section{padding:18px}}
.grind-sidebar{display:grid;grid-template-rows:auto minmax(0,1fr);gap:20px;min-width:0}.grind-sidebar section{width:100%;min-width:0}.player-notes{align-self:stretch;display:flex;flex-direction:column;gap:12px}.player-notes h2{font-size:1.15rem}.player-notes form label,.player-search{display:block;font-size:.8rem;color:#c4b897}.player-add{display:flex;gap:8px;margin-top:6px}.player-add input,.player-search input{width:100%;min-width:0;text-align:left;font-size:.95rem}.player-add button{padding:10px;white-space:nowrap}.player-search input{display:block;margin-top:5px}#player-note-list{display:flex;flex-direction:column;gap:6px;max-height:42dvh;overflow-y:auto}#player-note-list button,#note-general{width:100%;text-align:left;overflow-wrap:anywhere;background:#19151f;padding:10px 12px}#player-note-list button[aria-pressed=true],#note-general[aria-pressed=true]{background:#4b3724;border-color:#e8c480;color:#ffe2a4}#player-note-empty,#player-note-status{font-size:.85rem;color:#b6aebc;margin:0}#player-note-status:empty{display:none}#note-title{overflow-wrap:anywhere;min-width:0}.notepad header a{white-space:nowrap}.notepad footer{flex-wrap:wrap}.notepad footer button{font-size:.8rem;padding:9px 12px}#note-delete{margin-left:auto;color:#e8acac}.rng output{font-size:84px;margin-top:12px}.rng>p{margin-bottom:14px}@media(max-width:740px){.grind-sidebar{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto;gap:14px}.rng,.player-notes{padding:14px}.rng output{font-size:64px}.player-add{flex-wrap:wrap}.player-add button{width:100%}#player-note-list{max-height:300px}}@media(max-width:440px){.grind-sidebar{grid-template-columns:1fr}.player-add{flex-wrap:nowrap}.player-add button{width:auto}.player-notes{order:1}.rng{order:0}}
.random-tools{align-self:start}.grind-tool-tabs{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:4px;border-radius:12px;background:#15121b;border:1px solid #5c4b35}.grind-tool-tabs button{padding:10px 4px;min-height:44px;font-size:.9rem;white-space:nowrap;border-color:transparent;background:transparent;color:#c8bdcf}.grind-tool-tabs button[aria-selected=true]{background:#51402c;color:#ffe2a4;border-color:#977c50}.random-tools .rng{padding:0}.coin-panel{text-align:center}.coin-stage{height:250px;display:grid;place-items:end center;position:relative;padding-bottom:25px;perspective:800px}.coin-flight{width:174px;height:174px;position:relative;z-index:1;transform-style:preserve-3d}.coin{width:100%;height:100%;position:relative;transform-style:preserve-3d}.coin-face{position:absolute;inset:0;border-radius:50%;backface-visibility:hidden;-webkit-backface-visibility:hidden;box-shadow:0 4px 1px #666b6e,0 7px 1px #383c3f}.coin-face svg{display:block;width:100%;height:100%;border-radius:50%}.coin-back{transform:rotateY(180deg)}.coin-shadow{position:absolute;bottom:10px;width:140px;height:16px;border-radius:50%;background:#0007;filter:blur(5px)}.coin-flight.is-tossing{animation:coin-toss 1s cubic-bezier(.35,0,.65,1)}.coin.is-flipping{animation:coin-spin 1s linear}.coin-flight.is-tossing~.coin-shadow{animation:coin-shadow 1s ease-in-out}#coin-result{display:block;color:#ffe2a4;font-size:1.8rem;font-weight:800;line-height:1.4;min-height:1.4em;margin-top:10px}.coin-probability{margin:8px 0 20px;color:#bfb4c9;font-size:.85rem}#coin-toss{width:100%;background:linear-gradient(110deg,#ffe5a7,#c39850);color:#20180f;font-weight:700;min-height:48px}#coin-toss:disabled{cursor:wait;opacity:.7}@keyframes coin-toss{0%,100%{transform:translateY(0)}50%{transform:translateY(-65px)}}@keyframes coin-spin{from{transform:rotateY(var(--coin-start,0deg))}to{transform:rotateY(var(--coin-end,1440deg))}}@keyframes coin-shadow{50%{transform:scale(.6);opacity:.4}}@media(max-width:740px){.random-tools{padding:14px}.coin-flight{width:150px;height:150px}.coin-stage{height:225px}}@media(prefers-reduced-motion:reduce){.coin-flight.is-tossing,.coin.is-flipping,.coin-flight.is-tossing~.coin-shadow{animation:none}}
.player-label-editor{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin-top:16px;padding-bottom:12px;border-bottom:1px solid #67563c66}#player-label-colors{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px;width:min(100%,380px);min-width:0}.player-label-swatch{display:grid;place-items:center;width:100%;height:44px;min-width:0;padding:5px 2px;border:2px solid transparent;background:transparent}.player-label-swatch>span{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;color:#d8cede;font-size:23px;line-height:1}.player-label-swatch .no-label{border:1px solid #8c8194}.player-label-swatch[aria-pressed=true]{border-color:#ffe2a4;background:#4b3724}.player-label-swatch[aria-pressed=true]>span{box-shadow:0 0 0 2px #211c29}#player-note-list button[data-label-color]:not([data-label-color=""]){border-left:5px solid var(--player-label-color);color:var(--player-label-color)}#note-title[data-label-color]:not([data-label-color=""]){color:var(--player-label-color)}
.grind-header-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px}.notepad header{flex-wrap:wrap}.notepad textarea:disabled{opacity:.6}.player-notes input:disabled,.player-label-swatch:disabled{opacity:.5;cursor:wait}
.notepad{min-width:0}
.memo-heading{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.notepad header{flex-wrap:nowrap;gap:8px}
.memo-tabs{display:flex;align-items:center;gap:4px;min-width:0}
.memo-tabs button{min-height:44px;padding:8px 10px;border-color:transparent;background:transparent;color:#b9afc1;font-size:clamp(14px,3.8vw,20px);font-weight:750;white-space:nowrap}
.memo-tabs button[aria-selected="true"]{background:#4b3724;color:#ffe2a4;border-color:#b69a65}
.notepad .grind-header-actions{margin-left:auto;flex:none}
#memo-panel,#memo-editor{display:flex;flex-direction:column;flex:1;min-width:0}
#memo-editor textarea{flex:1}
.grind-page .notepad[data-memo-view="general"] textarea{min-height:clamp(260px,55dvh,600px);margin-top:18px;padding:12px 0}
.grind-sidebar:has(.player-notes[hidden]){grid-template-rows:auto;align-content:start}
.grind-sidebar:has(.player-notes[hidden])>.random-tools{grid-column:1/-1}
@media(max-width:380px){.memo-tabs{gap:2px}.memo-tabs button{padding-inline:6px}.notepad header{gap:4px}}
#table-reset{background:transparent;color:#e8acac;border-color:#956b70}
.memo-table{flex:none;position:relative;width:100%;max-width:740px;aspect-ratio:1.7;margin:10px auto 24px;isolation:isolate}
.memo-table-felt{position:absolute;inset:12% 9%;display:flex;flex-direction:column;align-items:center;justify-content:center;border:12px solid #3e3026;border-radius:48%;background:radial-gradient(ellipse at 50% 35%,#28584b,#15382f 75%);box-shadow:0 0 0 2px #9d8050,inset 0 0 0 2px #8b744c,inset 0 0 24px #0a211b,0 12px 28px #08060b80}
.memo-table-felt span{font-family:Georgia,serif;font-weight:700;font-size:clamp(15px,2.2vw,24px);letter-spacing:.12em;color:#d8c290;opacity:.85}
.memo-table-felt small{margin-top:8px;color:#bec9ba;font-size:12px}
#table-seats{position:absolute;inset:0}
.table-seat{--player-label-color:#a79882;position:absolute;left:var(--seat-x);top:var(--seat-y);transform:translate(-50%,-50%);display:flex;align-items:center;flex-direction:column;justify-content:center;gap:4px;width:clamp(76px,12vw,112px);min-height:76px;padding:8px 5px;border:2px solid var(--player-label-color);border-radius:15px;background:#1a1620;box-shadow:0 5px 12px #0006;touch-action:manipulation;color:#f6ecd9}
.table-seat:hover{background:#302735}
.table-seat[aria-pressed="true"]{outline:3px solid #fff1cb;outline-offset:3px;background:#342b32}
.table-seat:focus-visible{outline:3px solid #fff1cb;outline-offset:4px}
.table-seat .seat-number{display:grid;place-items:center;flex:none;width:30px;height:30px;border-radius:50%;background:var(--player-label-color);color:#17121c;font-size:19px;font-weight:800;line-height:1}
.seat-name{display:block;max-width:100%;font-size:14px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.seat-name:empty{display:none}
.seat-note-mark{position:absolute;right:3px;top:-9px;padding:1px 5px;border:1px solid #9d8050;border-radius:6px;background:#31271c;color:#f5d598;font-size:10px;line-height:1.5}
.table-seat[data-seat="1"]{--seat-x:24%;--seat-y:16%}
.table-seat[data-seat="2"]{--seat-x:10%;--seat-y:38%}
.table-seat[data-seat="3"]{--seat-x:10%;--seat-y:65%}
.table-seat[data-seat="4"]{--seat-x:26%;--seat-y:86%}
.table-seat[data-seat="5"]{--seat-x:50%;--seat-y:92%}
.table-seat[data-seat="6"]{--seat-x:74%;--seat-y:86%}
.table-seat[data-seat="7"]{--seat-x:90%;--seat-y:65%}
.table-seat[data-seat="8"]{--seat-x:90%;--seat-y:38%}
.table-seat[data-seat="9"]{--seat-x:76%;--seat-y:16%}
.note-editor-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #67563c;padding-top:20px}
.note-editor-heading h2{font-size:1.2rem;overflow-wrap:anywhere;min-width:0}
.note-editor-actions{display:flex;align-items:center;gap:8px;flex:none}
.note-editor-actions button{min-height:44px;padding:8px 12px;font-size:.85rem;white-space:nowrap}
#seat-clear{color:#c5bacb;background:transparent}
#table-status{color:#e4c38e;font-size:.85rem;margin:8px 0 0}#table-status:empty{display:none}
.notepad textarea{min-height:200px;margin-bottom:8px}
.notepad button:disabled{cursor:wait;opacity:.55}
/* The dealer stays at the head of the table; seat numbers follow the rail. */
.table-dealer{position:absolute;left:50%;top:1%;transform:translateX(-50%);z-index:2;display:flex;flex-direction:column;align-items:center;gap:3px;width:90px;pointer-events:none}
.table-dealer>svg{display:block;width:42px;height:49px;filter:drop-shadow(0 2px 3px #0008)}
.table-dealer>span{font-size:13px;font-weight:700;line-height:1.4;color:#ffe1a3;background:#211b28;border:1px solid #9d8050;border-radius:12px;padding:1px 12px}
.dealer-chip-tray{display:grid;grid-template-columns:repeat(5,1fr);gap:3px;width:88px;height:20px;padding:3px;border:1px solid #9b815c;border-radius:4px;background:#16141b;box-shadow:0 3px 5px #0005}
.dealer-chip-tray i{--chip-color:#a3484b;border-radius:2px;background:repeating-linear-gradient(0deg,var(--chip-color) 0 3px,#e2d7c8 3px 4px)}
.dealer-chip-tray i:nth-child(1){--chip-color:#578876}.dealer-chip-tray i:nth-child(4){--chip-color:#59759d}.dealer-chip-tray i:nth-child(5){--chip-color:#a69982}
@media(max-width:1060px){
 .table-seat[data-seat="1"]{--seat-x:20%;--seat-y:14%}
 .table-seat[data-seat="2"]{--seat-x:13%;--seat-y:38%}
 .table-seat[data-seat="3"]{--seat-x:13%;--seat-y:62%}
 .table-seat[data-seat="4"]{--seat-x:22%;--seat-y:86%}
 .table-seat[data-seat="5"]{--seat-x:50%;--seat-y:91%}
 .table-seat[data-seat="6"]{--seat-x:78%;--seat-y:86%}
 .table-seat[data-seat="7"]{--seat-x:87%;--seat-y:62%}
 .table-seat[data-seat="8"]{--seat-x:87%;--seat-y:38%}
 .table-seat[data-seat="9"]{--seat-x:80%;--seat-y:14%}
}
@media(min-width:741px) and (max-width:1060px){main{grid-template-columns:minmax(0,1fr) 250px}.memo-table{aspect-ratio:1.05}.table-seat{width:80px}.memo-table-felt{inset:10% 12%}}
@media(max-width:740px){.memo-table{aspect-ratio:1.15;max-width:520px}.table-seat{width:86px}.memo-table-felt{inset:10% 12%}}
@media(max-width:480px){body.grind-page{padding:16px 12px max(16px,env(safe-area-inset-bottom))}.notepad{padding:18px 12px}.memo-table{aspect-ratio:.78;margin-block:8px 20px}.memo-table-felt{border-width:10px;inset:10% 12%;border-radius:46%}.table-seat{width:76px;min-height:76px}.memo-table-felt span{font-size:15px;letter-spacing:.07em}.memo-table-felt small{font-size:11px}.note-editor-heading{gap:8px}.note-editor-heading h2{font-size:1.1rem}.table-dealer{width:76px}.table-dealer>svg{width:36px;height:42px}.dealer-chip-tray{width:74px;height:18px}}
@media(max-width:350px){.table-seat{width:68px}.seat-name{font-size:12px}.memo-table-felt span{font-size:13px}}
