/* /play */
.play-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;flex-wrap:wrap}
.head-stats{display:flex;gap:36px;padding-bottom:6px}

.play{display:grid;grid-template-columns:250px minmax(0,1fr) 320px;gap:20px;align-items:start}

/* puzzles */
.pz-panel{position:sticky;top:76px;max-height:calc(100vh - 96px);display:flex;flex-direction:column;overflow:hidden}
.pz-list{list-style:none;margin:0;padding:8px;overflow:auto;display:flex;flex-direction:column;gap:2px}
.pz{width:100%;text-align:left;background:transparent;border:1px solid transparent;border-radius:10px;padding:10px 12px;cursor:pointer;display:flex;flex-direction:column;gap:5px;transition:background .15s ease,border-color .15s ease}
.pz:hover{background:rgba(20,20,22,.04)}
.pz[aria-pressed=true]{background:#fff;border-color:var(--line-2);box-shadow:0 8px 20px -14px rgba(20,20,22,.35)}
.pz-top{display:flex;justify-content:space-between;align-items:center;gap:8px}
.pz-name{font-weight:600;font-size:14.5px;letter-spacing:-.01em}
.pz-mark{width:16px;height:16px;flex:none}
.pz.solved .pz-mark{background:no-repeat center/16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23141416' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='6.6'/%3E%3Cpath d='M5.2 8.2l1.9 1.9 3.8-4'/%3E%3C/svg%3E")}
.pz-meta{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:12px;color:var(--ink-3)}
.pz-meta .mono{white-space:nowrap}
.pz-best{font-size:11px;color:var(--ink-3);letter-spacing:.02em}
.diff{display:inline-flex;gap:3px}
.diff i{width:10px;height:3px;border-radius:2px;background:rgba(20,20,22,.12)}
.diff i.on{background:var(--ink)}

/* board */
.board-wrap{min-width:0}
.board-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.board-title{display:flex;align-items:baseline;gap:12px;min-width:0}
.bt-name{font-weight:700;font-size:22px;letter-spacing:-.025em}
.bt-pins{font-size:12px;color:var(--ink-3);letter-spacing:.18em}
.tools{display:flex;gap:6px}
.die-frame{position:relative;border-radius:18px;padding:14px;background:linear-gradient(160deg,#fbfaf6,#ebe7dd);border:1px solid var(--line);box-shadow:var(--shadow)}
.board{display:block;width:100%;height:auto;user-select:none;-webkit-user-select:none;touch-action:manipulation}
.hint{margin-top:12px;font-size:13.5px;color:var(--ink-2);min-height:20px;text-align:center}
.hint b{font-weight:600;color:var(--ink)}

/* svg parts */
.board .slot{cursor:pointer}
.board .slot rect{fill:rgba(255,255,255,.015);stroke:rgba(255,255,255,.06);transition:fill .15s ease,stroke .15s ease}
.board .slot:hover rect{fill:rgba(255,255,255,.07);stroke:rgba(255,255,255,.22)}
.board .slot .plus{stroke:rgba(255,255,255,.0);transition:stroke .15s ease}
.board .slot:hover .plus{stroke:rgba(255,255,255,.55)}
.board .gate{cursor:pointer}
.board .gate .body{fill:#2a2b30;stroke:#e9e5da;stroke-width:1.5}
.board .gate:hover .body{fill:#33343a}
.board .gate.sel .body{fill:#f2efe7;stroke:#fff}
.board .gate.sel .gnum{fill:#141416}
.board .gate.dim{opacity:.35}
.board .gnum{fill:#f2efe7;font:600 12px Inter,sans-serif}
.board .gbit{font:500 10px 'JetBrains Mono',monospace;fill:rgba(242,239,231,.7)}
.board .lead{stroke:#cfcabd;stroke-width:1.5}
.board .pin{fill:#16171a;stroke:#cfcabd;stroke-width:1.4}
.board .pin.on{fill:#cfcabd}
.board .pin.ok{stroke:#fff;stroke-width:2}
.board .hit{fill:transparent;cursor:pointer}
.board .hit:hover + .pin,.board .pinwrap:hover .pin{stroke:#fff;stroke-width:2.2}
.board .pad rect{fill:#26272c;stroke:#bdb8aa;stroke-width:1.2}
.board .pad text{fill:#f2efe7;font:600 13px 'JetBrains Mono',monospace}
.board .pad{cursor:pointer}
.board .pad:hover rect{fill:#34353b;stroke:#fff}
.board .pad.sel rect{fill:#f2efe7;stroke:#fff}
.board .pad.sel text{fill:#141416}
.board .pad.ok rect{stroke:#fff;stroke-width:2}
.board .pad.idle{opacity:.28;cursor:default}
.board .pad.idle:hover rect{fill:#26272c;stroke:#bdb8aa}
.board .wire{fill:none;stroke:#d8d3c6;stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round}
.board .wire.v0{stroke:rgba(216,211,198,.35);stroke-dasharray:3 4}
.board .wire.v1{stroke:#fff;stroke-width:2.4}
.board .wire.hl{stroke:#fff;stroke-width:2.6}
.board .outlbl{font:500 10px 'JetBrains Mono',monospace;fill:rgba(242,239,231,.55);letter-spacing:.12em}
.board .stamp{pointer-events:none}

/* side */
.side{position:sticky;top:76px}
.tt-wrap{max-height:340px;overflow:auto;padding:4px 8px}
.tt{width:100%;border-collapse:collapse;font-family:var(--mono);font-size:13px;font-variant-numeric:tabular-nums}
.tt th{font-size:10.5px;letter-spacing:.14em;color:var(--ink-3);font-weight:500;padding:8px 6px;text-align:center;position:sticky;top:0;background:rgba(255,255,255,.92)}
.tt tr.grp th{padding:8px 6px 0;font-size:9.5px;letter-spacing:.18em;text-transform:uppercase}
.tt thead tr:nth-child(2) th{top:24px}
.tt th.sep,.tt td.sep{border-left:1px solid var(--line)}
.tt td{text-align:center;padding:6px;border-top:1px solid var(--line);color:var(--ink-2)}
.tt tr.row{cursor:pointer}
.tt tr.row:hover td{background:rgba(20,20,22,.035)}
.tt tr.probe td{background:rgba(20,20,22,.07)}
.tt td.got{font-weight:600;color:var(--ink)}
.tt td.got.q{color:var(--ink-3);font-weight:400}
.tt td.res{width:28px}
.tt .ok,.tt .no{display:inline-block;width:14px;height:14px;vertical-align:-2px}
.tt .ok{background:no-repeat center/14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23141416' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E")}
.tt .no{background:no-repeat center/12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a8a49b' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 4l8 8M12 4l-8 8'/%3E%3C/svg%3E")}
.tt tr.pass td{color:var(--ink)}
.nums{display:grid;grid-template-columns:1fr 1fr;gap:18px 16px;padding:18px 20px;border-top:1px solid var(--line)}
.nums .stat-wide{grid-column:1/-1}
.nums .big{font-size:30px}
#nHash.dim{color:var(--ink-3)}
.best-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 20px;border-top:1px solid var(--line)}
.best-val{font-weight:600;font-size:14px;font-variant-numeric:tabular-nums;text-align:right}
.best-val a{text-decoration:none;border-bottom:1px solid var(--line-2)}
.tape{padding:16px 20px 20px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:10px}
.wide{width:100%}
.tape-btn{padding:14px 18px;font-size:15px}
.tape-msg{margin:0;font-size:13px;color:var(--ink-2);min-height:20px;line-height:1.45}
.tape-msg a{font-weight:600}
.tape-msg.err{color:#141416}
.tape-msg.err::before{content:'';display:inline-block;width:12px;height:12px;margin-right:6px;vertical-align:-1px;background:no-repeat center/12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23141416' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6.5'/%3E%3Cpath d='M8 4.5v4.2M8 11.2v.3'/%3E%3C/svg%3E")}
.tape-quiet{margin:0;font-size:13.5px;color:var(--ink-2);line-height:1.5}
.tape-wallet{display:flex;flex-direction:column;gap:6px}
.wallet-chip{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:13px}
.wallet-chip button{background:none;border:0;padding:0;color:var(--ink-3);cursor:pointer;font-size:12.5px}
.wallet-chip button:hover{color:var(--ink)}
.wallet-pick{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:6px}

/* below */
.below{display:grid;grid-template-columns:1.35fr 1fr;gap:20px;margin-top:28px;align-items:start}
.mine-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;padding:18px 20px;border-bottom:1px solid var(--line)}
.mine-stats .big{font-size:24px}
.sub-h{padding:14px 20px 0}
.rank{font-family:var(--mono);color:var(--ink-3);width:36px}
.strong{font-weight:600}

/* toast */
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:60;background:var(--ink);color:#fff;padding:11px 16px;border-radius:10px;font-size:13.5px;box-shadow:0 16px 40px -16px rgba(0,0,0,.5);max-width:calc(100vw - 32px)}

@media (max-width:1180px){
  .play{grid-template-columns:220px minmax(0,1fr)}
  .side{grid-column:1/-1;position:static;display:grid;grid-template-columns:1.2fr 1fr}
  .side .panel-head{grid-column:1/-1}
  .side .tt-wrap{grid-row:span 3}
}
@media (max-width:860px){
  .play{grid-template-columns:minmax(0,1fr)}
  .pz-panel{position:static;max-height:none}
  .pz-list{flex-direction:row;overflow-x:auto;padding:8px;gap:6px;scroll-snap-type:x mandatory}
  .pz-list li{flex:none;width:178px;scroll-snap-align:start}
  .pz{height:100%}
  .side{display:block}
  .below{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:720px){
  .head-stats{gap:24px}
  .die-frame{padding:6px;border-radius:14px}
  .bt-name{font-size:19px}
  .mine-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .nums .big{font-size:26px}
}
@media (max-width:520px){
  .die-frame{margin:0 -12px;padding:4px;border-radius:12px}
  .tools .btn-sm{padding:7px 11px}
}
