/* Drum Cipher: brass rim, cream drumhead, lacquer pads on a warm black stage. */
.dc{--ink:#1b1410;--cream:#efe6d2;--brass:#c8963e;--brass-d:#7d5a22;--stage:#14110f;--line:#3a2f26;
 position:relative;background:var(--stage);color:var(--cream);border:2px solid var(--brass-d);border-radius:18px;
 padding:10px 10px calc(10px + env(safe-area-inset-bottom,0px));font-family:ui-rounded,"Trebuchet MS",system-ui,sans-serif;
 -webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;overflow:hidden}
.dc button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation}
.dc button:disabled{opacity:.4;cursor:default}
.dc :focus-visible{outline:3px solid #f2c96a;outline-offset:2px}
.dc-hud{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px}
.dc-hud .lv{font-weight:800;font-size:1rem;letter-spacing:.02em}
.dc-hud .pl{font-size:.78rem;opacity:.8;font-variant-numeric:tabular-nums;white-space:pre}
.dc-hud .col{display:grid;gap:2px;min-width:0}
.dc-ibtn{min-width:44px;min-height:44px;padding:0 10px;border:1.5px solid var(--brass-d);border-radius:12px;background:#221b16;font-size:.78rem;font-weight:700}
.dc-stage{position:relative;display:flex;justify-content:center;margin:2px auto 4px;width:100%}
.dc-stage canvas{transition:box-shadow .5s ease-out;display:block;touch-action:none;border-radius:50%;max-width:100%;outline-offset:4px}
.dc-stage.lockfx canvas{box-shadow:0 0 30px 8px #f2c96acc}
.dc[data-low="1"] .dc-hud .pl{color:#ff9a7a;font-weight:800;opacity:1}
.dc-tabs{display:flex;gap:6px;margin:4px 0}
.dc-tab{flex:1 1 0;min-width:0;min-height:48px;padding:4px 2px;border:1.5px solid var(--line);border-radius:12px;background:#1d1713;
 display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;column-gap:5px;align-items:center;text-align:left;justify-items:start}
.dc-tab .dot{grid-row:1/3;width:12px;height:12px;border-radius:50%;background:var(--c);margin-left:6px}
.dc-tab .nm{font-weight:800;font-size:.8rem;line-height:1.1}
.dc-tab .bd{font-size:.68rem;opacity:.8;min-height:.8rem;font-variant-numeric:tabular-nums}
.dc-tab.on{border-color:var(--c);background:#2b221b;box-shadow:0 0 0 1px var(--c) inset}
.dc-tab.locked .bd{color:#7fd6c3;opacity:1;font-weight:700}
.dc-hist{display:flex;flex-wrap:wrap;gap:6px;min-height:30px;align-items:center;margin:2px 0 4px}
.dc-hint{font-size:.78rem;opacity:.75}
.dc-row{display:inline-flex;align-items:center;gap:4px;padding:3px 7px;border-radius:9px;background:#221b16;font-size:.78rem}
.dc-row b{opacity:.65;font-weight:700;margin-right:2px}
.dc-row .sc{min-width:20px;text-align:center;padding:1px 4px;border-radius:6px;background:var(--c);color:#14110f;font-weight:800;font-variant-numeric:tabular-nums}
.dc-row .sc.full{outline:2px solid #fff3c4}
.dc-note{min-height:2.4em;font-size:.82rem;line-height:1.25;color:#f2d99a;margin:0 2px 4px}
.dc-ctl{display:grid;grid-template-columns:1fr 1fr 1.6fr;gap:8px}
.dc-ctl button{min-height:50px;border-radius:14px;border:1.5px solid var(--brass-d);background:#221b16;font-weight:800;font-size:.95rem}
.dc-ctl #btnPlay{background:linear-gradient(#e6c06d,#c8963e);color:#14110f;border-color:#f2d99a;font-size:1.05rem}
.dc-ctl #btnPlay:active:not(:disabled){transform:translateY(1px)}
.dc-ov{position:absolute;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;padding:12px;background:rgba(14,11,9,.88);overflow:auto}
.dc-ov[hidden]{display:none}
.dc-card{width:100%;max-width:360px;background:#f1e8d4;color:var(--ink);border:3px solid var(--brass);border-radius:18px;padding:16px;display:grid;gap:10px;
 animation:dcIn .28s ease-out both}
.dc-card h2{font-size:1.7rem;line-height:1;letter-spacing:-.01em;margin:0}
.dc-card.win h2{color:#2a7d6f}.dc-card.lose h2{color:#a8321f}
.dc-card .lead{font-size:.92rem;line-height:1.35;margin:0}
.dc-card .stat{font-size:.78rem;opacity:.75;margin:0;white-space:pre-wrap}
.btn-main,.btn-alt{min-height:48px;border-radius:14px;font-weight:800;font-size:1rem;border:2px solid var(--ink)}
.btn-main{background:#d6402b;color:#fff8ea}
.btn-alt{background:transparent;color:var(--ink)}
.dc-chips{display:grid;grid-template-columns:repeat(6,1fr);gap:6px}
.chip{min-height:44px;border-radius:10px;border:1.5px solid var(--ink);background:#e4d8bd;color:var(--ink);font-weight:800}
.chip[data-s="1"]{box-shadow:inset 0 -4px 0 #c8963e}
.chip[data-s="2"]{box-shadow:inset 0 -4px 0 #c8963e,inset 0 -8px 0 #e0912f}
.chip[data-s="3"]{background:#f2c96a;box-shadow:inset 0 -4px 0 #7d5a22}
.chip.lock{opacity:.35}
.stars{display:flex;gap:6px}
.star{width:30px;height:30px;background:#c9bda3;clip-path:polygon(50% 0,62% 36%,100% 38%,70% 60%,80% 100%,50% 76%,20% 100%,30% 60%,0 38%,38% 36%)}
.star.on{background:#d6a02b;animation:dcStar .5s ease-out both}
.rules{list-style:none;margin:0;padding:0;display:grid;gap:5px;font-size:.8rem;line-height:1.3}
.rules li{padding-left:10px;border-left:5px solid var(--c)}
@keyframes dcIn{from{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:none}}
@keyframes dcStar{from{transform:scale(.3) rotate(-30deg)}to{transform:none}}
@media (prefers-reduced-motion:reduce){.dc *{animation:none!important;transition:none!important}}
.dc{background:radial-gradient(120% 70% at 50% 28%,#2a2018 0,#14110f 70%)}
/* Full screen (native and immersive): fill the stage, no scroll */
html.pip-immersive .game-wrap{display:flex;flex-direction:column;overflow:hidden;padding-bottom:0}
html.pip-immersive .dc{flex:1 1 0;min-height:0;display:flex;flex-direction:column;border-radius:14px;padding:6px 8px calc(8px + env(safe-area-inset-bottom,0px))}
html.pip-immersive .dc-stage{flex:1 1 0;min-height:0;margin:0;position:relative;overflow:hidden}
html.pip-immersive .dc-stage canvas{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);max-width:none}
html.pip-immersive .dc-hist{min-height:0}
html.pip-immersive .dc-note{min-height:0;margin:0 2px 4px;font-size:.78rem}
html.pip-immersive .dc-tabs{margin:2px 0}
@media (orientation:landscape) and (max-height:520px){
 html.pip-immersive .dc{display:grid;grid-template-columns:minmax(0,1fr) minmax(210px,270px);grid-template-rows:auto auto 1fr auto auto;column-gap:10px}
 html.pip-immersive .dc-stage{grid-column:1;grid-row:1/6}
 html.pip-immersive .dc-hud,html.pip-immersive .dc-tabs,html.pip-immersive .dc-hist,html.pip-immersive .dc-note,html.pip-immersive .dc-ctl{grid-column:2}
 html.pip-immersive .dc-hud{grid-row:1}html.pip-immersive .dc-tabs{grid-row:2}html.pip-immersive .dc-hist{grid-row:3;align-content:flex-start;overflow:hidden}
 html.pip-immersive .dc-note{grid-row:4}html.pip-immersive .dc-ctl{grid-row:5}
 html.pip-immersive .dc-ov{padding:6px}
 html.pip-immersive .dc-card{padding:10px;gap:6px;max-height:100%;overflow:auto}
 html.pip-immersive .dc-card h2{font-size:1.3rem}
}
