/* 사천성 — 옥빛 패 테이블 UI (자체 테마, 사이트 라이트/다크 동일) */
#sh-game { position:relative; width:100%; max-width:100%; margin:0 auto; border:1px solid #2a4a3e; border-radius:20px; overflow:hidden; background:linear-gradient(180deg,#123328,#0b2019); color:#eaf6f0; box-shadow:0 18px 45px rgba(5,25,18,.35); user-select:none; -webkit-user-select:none; }
#sh-game, #sh-game * { box-sizing:border-box; }
#sh-game [hidden] { display:none !important; }
#sh-game button { font-family:inherit; }
#sh-game button:focus-visible { outline:3px solid #9be7c4; outline-offset:-3px; }

.sh-toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:12px 16px; background:linear-gradient(110deg,#183f32,#102a22); border-bottom:1px solid #ffffff12; }
.sh-brand { display:flex; align-items:center; gap:10px; min-width:0; flex-shrink:0; font-weight:900; letter-spacing:.14em; font-size:.72rem; color:#9be7c4; }
.sh-brand > i { font-size:22px; color:#5fd6a8; }
.sh-brand small { display:block; margin-top:2px; font-size:.65rem; font-weight:600; color:#b6d6c8; letter-spacing:.02em; }
/* 레벨 진행 표시 1…7 */
.sh-steps { display:flex; align-items:center; gap:4px; flex:1 1 auto; justify-content:center; min-width:0; }
.sh-steps span { display:inline-flex; align-items:center; justify-content:center; width:19px; height:19px; border-radius:50%; flex-shrink:0;
    background:#ffffff10; border:1px solid #ffffff1f; color:#8fb6a5; font-size:.62rem; font-weight:800; font-variant-numeric:tabular-nums; }
.sh-steps span.done { background:#2fb38133; border-color:#5fd6a866; color:#9be7c4; }
.sh-steps span.now { background:linear-gradient(135deg,#5fd6a8,#2fb381); border-color:#9be7c4; color:#06251a; box-shadow:0 0 0 2px #5fd6a840; transform:scale(1.14); }
@media (max-width:420px) { .sh-brand small { display:none; } .sh-steps span { width:17px; height:17px; font-size:.58rem; } }
.sh-tools { display:flex; gap:6px; flex-shrink:0; }
.sh-tools button { min-height:36px; padding:0 11px; border-radius:8px; border:1px solid #9fd8bf44; background:#ffffff0a; color:#e2f5ea; font-weight:700; font-size:.74rem; cursor:pointer; }
.sh-tools button:disabled { opacity:.4; cursor:default; }

.sh-hud { display:grid; grid-template-columns:repeat(6,1fr); gap:6px; padding:12px 12px 8px; align-items:center; }
.sh-hud > div { text-align:center; border-left:1px solid #ffffff12; }
.sh-hud > div:first-child { border-left:0; }
.sh-hud small { display:block; font-size:.62rem; font-weight:600; color:#a9cdbb; letter-spacing:.03em; }
.sh-hud strong { display:block; line-height:1.4; font-size:1.02rem; font-weight:800; font-variant-numeric:tabular-nums; }
.sh-hud .sh-scorebox strong { color:#ffd166; font-size:1.3rem; }
@media (max-width:560px) { .sh-hud { grid-template-columns:repeat(3,1fr); row-gap:10px; }
    .sh-hud > div:nth-child(3n+1) { border-left:0; } }
#sh-time.warn { color:#ff7b7b; animation:shWarn .55s ease-in-out infinite alternate; }
@keyframes shWarn { from { opacity:1; transform:scale(1); } to { opacity:.55; transform:scale(1.08); } }
@media (prefers-reduced-motion:reduce) { #sh-time.warn { animation:none; } .sh-tile, .sh-tile.pop, .sh-tile.shake { animation:none !important; transition:none !important; } }

#sh-stage { position:relative; margin:0 10px 10px; padding:8px 0 4px; border:1px solid #ffffff14; border-radius:14px; background:radial-gradient(120% 90% at 50% 0%,#1a4a3a 0%,#0d241c 100%); overflow-x:auto; }
#sh-boardwrap { position:relative; margin:0 auto; width:max-content; }
#sh-board { position:relative; display:grid; margin:0 auto; background:#0a1c15; border-radius:12px; box-shadow:inset 0 0 0 1px #ffffff10, inset 0 10px 30px #00000055; }
#sh-board.paused .sh-tile { filter:blur(4px) brightness(.6); pointer-events:none; }
#sh-path { position:absolute; left:0; top:0; pointer-events:none; opacity:0; transition:opacity .12s; z-index:3; }
#sh-path.on { opacity:1; }

.sh-tile { position:relative; display:flex; align-items:center; justify-content:center; width:100%; aspect-ratio:1/1; padding:0; border:0; border-radius:16%; cursor:pointer; touch-action:manipulation; -webkit-tap-highlight-color:transparent;
    background:linear-gradient(160deg,#fdfcf7,#e9e4d3); box-shadow:0 2px 0 #b9b19a, 0 3px 6px #00000055; line-height:1; transition:transform .1s ease, box-shadow .1s ease, opacity .2s ease; }
.sh-tile:active { transform:translateY(1px); }
.sh-tile.sel { transform:translateY(-3px) scale(1.06); box-shadow:0 0 0 3px #ffd166, 0 6px 14px #00000066; z-index:2; }
.sh-tile.hint { box-shadow:0 0 0 3px #5fd6a8, 0 0 16px #5fd6a8aa; animation:shHint .5s ease-in-out infinite alternate; }
@keyframes shHint { from { transform:scale(1); } to { transform:scale(1.08); } }
.sh-tile.gone { visibility:hidden; pointer-events:none; }
.sh-tile.pop { animation:shPop .22s ease forwards; }
@keyframes shPop { to { transform:scale(.2); opacity:0; } }
.sh-tile.shake { animation:shShake .3s ease; }
@keyframes shShake { 0%,100% { transform:translateX(0); } 25% { transform:translateX(-4px); } 75% { transform:translateX(4px); } }

.sh-controls { display:flex; gap:8px; padding:0 12px 12px; }
.sh-controls button { flex:1; min-width:0; min-height:52px; border-radius:10px; border:1px solid #9fd8bf3d; background:linear-gradient(160deg,#1e4a3b,#15352b); color:#eaf6f0; font-size:.88rem; font-weight:800; cursor:pointer; touch-action:manipulation; box-shadow:0 3px 0 #08150f; transition:transform .08s,filter .08s; }
.sh-controls button:active { transform:translateY(2px); box-shadow:0 1px 0 #08150f; filter:brightness(1.15); }
.sh-controls button:disabled { opacity:.38; cursor:default; box-shadow:none; }
.sh-controls button small { display:block; margin-top:3px; font-size:.62rem; font-weight:600; opacity:.7; }
#sh-giveup { flex:0 0 88px; background:linear-gradient(160deg,#3a2233,#26172a); border-color:#d59ec03d; }

#sh-toast { position:absolute; left:50%; bottom:84px; transform:translate(-50%,10px); z-index:11; max-width:86%; padding:9px 15px; border-radius:999px; background:#08150fe8; border:1px solid #9fd8bf3d; color:#eaf6f0; font-size:.76rem; font-weight:700; text-align:center; opacity:0; pointer-events:none; transition:opacity .18s,transform .18s; }
#sh-toast.on { opacity:1; transform:translate(-50%,0); }

.sh-overlay { position:absolute; inset:0; z-index:12; display:none; align-items:center; justify-content:center; padding:22px; background:linear-gradient(180deg,#08150faa,#08150fe8 45%); }
.sh-overlay.on { display:flex; }
.sh-panel { width:100%; max-width:400px; text-align:center; padding:26px 20px; border:1px solid #9fd8bf3d; border-radius:16px; background:linear-gradient(155deg,#173a2ff2,#0e261df7); box-shadow:0 16px 45px #04120c66; }
.sh-eyebrow { display:inline-block; padding:4px 12px; border-radius:999px; background:#5fd6a822; color:#9be7c4; font-size:.72rem; font-weight:800; letter-spacing:.04em; }
.sh-panel h2 { margin:12px 0 10px; font-size:1.3rem; font-weight:900; color:#fff; line-height:1.3; word-break:keep-all; }
.sh-panel p { margin:0 0 14px; font-size:.86rem; line-height:1.7; color:#cfe8dc; word-break:keep-all; }
.sh-demo { display:flex; justify-content:center; gap:8px; margin:6px 0 14px; font-size:1.5rem; }
.sh-demo i { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; border-radius:8px; background:linear-gradient(160deg,#fdfcf7,#e9e4d3); font-style:normal; box-shadow:0 2px 0 #b9b19a; }
.sh-demo i.dim { opacity:.35; }
.sh-best { min-height:18px; margin-bottom:8px; font-size:.78rem; font-weight:700; color:#ffd166; }
.sh-primary { display:block; width:100%; min-height:54px; padding:0 18px; border:0; border-radius:12px; background:linear-gradient(135deg,#5fd6a8,#2fb381); color:#06251a; font-size:1.02rem; font-weight:900; cursor:pointer; touch-action:manipulation; box-shadow:0 6px 18px #2fb38166; }
.sh-primary:active { transform:translateY(2px); }
.sh-panel small { display:block; margin-top:10px; font-size:.7rem; color:#9fc3b3; }
#sh-newrecord { margin:6px 0; font-size:.82rem; font-weight:900; color:#ffd166; }
#sh-final { display:inline-block; font-size:3rem; font-weight:900; color:#ffd166; line-height:1.1; }
.sh-final-unit { font-size:1rem; font-weight:800; color:#ffd166; margin-left:4px; }
#sh-grade { margin:6px 0 4px; font-size:1.1rem; font-weight:900; color:#fff; }
#sh-reason { font-size:.84rem; }
#sh-detail { display:flex; flex-wrap:wrap; justify-content:center; gap:6px 12px; margin:0 0 16px; font-size:.76rem; color:#cfe8dc; }
#sh-detail b { color:#fff; }

/* 인트로 레벨 표 */
.sh-lv-table { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; margin:0 0 14px; }
.sh-lv-table span { display:flex; flex-direction:column; align-items:center; gap:2px; padding:6px 1px; border-radius:7px; background:#ffffff0d; border:1px solid #ffffff14; font-size:.6rem; font-weight:700; color:#8fb6a5; }
.sh-lv-table b { font-size:.62rem; color:#eaf6f0; letter-spacing:-.02em; }

/* 레벨 클리어 패널 */
.sh-lv-gain { margin:10px 0 12px; line-height:1.1; }
.sh-lv-gain b { font-size:2.6rem; font-weight:900; color:#ffd166; }
.sh-lv-gain span { margin-left:4px; font-size:.9rem; font-weight:800; color:#ffd166; }
#sh-lv-detail { display:flex; flex-wrap:wrap; justify-content:center; gap:6px 12px; margin:0 0 14px; font-size:.76rem; color:#cfe8dc; }
#sh-lv-detail b { color:#fff; }
.sh-lv-next { margin:0 0 16px; padding:10px 12px; border-radius:10px; background:#5fd6a814; border:1px dashed #5fd6a855; font-size:.84rem; font-weight:700; color:#cfe8dc; word-break:keep-all; }
.sh-lv-next b { color:#9be7c4; }
#sh-lv-count { min-height:16px; }

.sh-guide { text-align:left; line-height:1.7; margin-top:18px; }
.sh-guide h3 { font-size:1rem; font-weight:800; margin:0 0 10px; }
.sh-guide p { font-size:.88rem; line-height:1.7; margin:0 0 8px; }
.sh-guide small { color:#888; font-size:.78rem; }
