*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans",sans-serif}body{background:#eee;color:#fff}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}button:focus-visible{outline:3px solid #f7c970;outline-offset:2px}[hidden]{display:none!important}.game-nav-header{--game-header-center-bg:#fff}main{position:relative;max-width:450px;height:calc(100svh - 51px);min-height:460px;margin:auto;display:flex;flex-direction:column;background:radial-gradient(ellipse at 30% 0%,var(--glow),transparent 70%),var(--felt);overflow:hidden}.toolbar{height:40px;display:flex;align-items:center;gap:8px;padding:4px 10px;flex-shrink:0;background:#0003}.toolbar b{font-size:14px}.toolbar span{flex:1;font-size:13px}.toolbar button,.actions button{border:1px solid #fff3;border-radius:8px;background:#fff;color:#25222c;min-height:36px;padding:6px 12px;font-weight:700}.toolbar button{min-width:38px}.stage{flex:1;min-height:0;overflow:auto;padding:8px 10px 12px;display:flex;flex-direction:column;justify-content:space-evenly;gap:8px;overscroll-behavior:contain}.section{flex-shrink:0}.section h2{font-size:11px;font-weight:500;color:#fffd;margin:0 0 5px;letter-spacing:.03em}.cells{display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));gap:5px}.cell{min-width:0;min-height:44px;border:1px solid #fff3;border-radius:9px;background:linear-gradient(145deg,#ffffff20,#ffffff08);color:#fff;font-size:clamp(12px,3.5vw,17px);font-weight:700;padding:8px 3px;display:flex;align-items:center;justify-content:center;white-space:pre-line;overflow-wrap:anywhere}.cell[disabled]{cursor:default;opacity:.48}.cell.card{background:#fff9e9;color:#252334;border:2px solid #ead6aa;box-shadow:0 3px 0 #17151f55;min-height:65px;font-family:Georgia,serif;font-size:clamp(16px,5vw,24px)}.cell.card.red{color:#ce354a}.cell.card[disabled]{opacity:.42;background:#d6d2c9}.cell.selected{outline:3px solid #ffd66d;outline-offset:-3px;background:#69573a}.cell.hero{font-size:clamp(40px,13vw,68px);min-height:95px;border:0;background:#0002;text-shadow:0 3px 0 #0004}.cell.pit{min-height:84px;border-radius:45%;background:radial-gradient(ellipse,#352120,#694236);box-shadow:inset 0 4px 9px #0007;font-size:16px}.cell[data-piece="1"]{color:#ffd46d;text-shadow:0 2px 6px #0009;background:#fff1;opacity:1}.cell[data-piece="2"]{color:#fff;opacity:1;text-shadow:0 1px 5px #0009}.cell.compact{aspect-ratio:1;padding:0;min-height:0;border-radius:2px;font-size:clamp(19px,6vw,30px);border:1px solid #fff2;background:#b2854a}.cell.compact[disabled]{opacity:1}.actions{display:flex;flex-wrap:wrap;gap:6px;padding:6px 10px;flex-shrink:0}.actions button{flex:1;min-height:44px}.actions button:disabled{opacity:.4}.companion{display:flex;align-items:center;min-height:74px;padding:3px 10px max(5px,env(safe-area-inset-bottom));gap:7px;background:#0003;flex-shrink:0}.companion img{width:66px;height:66px;object-fit:contain;filter:drop-shadow(0 3px 3px #0005);flex-shrink:0}.companion p{margin:0;font-size:12px;line-height:1.5}.companion b{font-size:10px;color:#ffdf9e}.panel{position:absolute;inset:40px 0 0;z-index:5;overflow:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px 24px;background:radial-gradient(ellipse at top,var(--glow),var(--felt) 70%);text-align:center}.panel img{width:148px;height:148px;object-fit:contain;filter:drop-shadow(0 7px 8px #0005)}.panel h2{font-size:23px;margin:12px 0 8px}.panel p{font-size:14px;line-height:1.6;margin:4px 0 14px;max-width:320px}.panel #rules{font-size:13px;max-height:45vh;overflow:auto;text-align:left;padding:12px;border-radius:10px;background:#0002}.panel button{min-height:48px;min-width:180px;padding:10px 24px;margin:7px;border:0;border-radius:10px;background:#fff4d5;color:#29242b;font-weight:800;box-shadow:0 4px 0 #0003}.panel #best{font-size:12px;color:#fff9}.save-error{font-size:10px;padding:3px;text-align:center;background:#fff;color:#7c2332}.theme-pyramid .stage{gap:4px;justify-content:flex-start}.theme-pyramid .section h2{display:none}.theme-pyramid .cell.card{min-height:45px;font-size:17px}.theme-pyramid .cells{max-width:calc(var(--cols)*64px);width:100%;margin:auto}.theme-gomoku .stage{justify-content:center}.theme-connect .cell{padding:0;min-height:38px;font-size:32px}.theme-sevens .cell.card{font-size:17px;min-height:51px}.theme-baccarat .cell.card{min-height:75px}.female{--glow:#8a6b9e;--felt:#332345}.male{--glow:#4c7566;--felt:#142f2d}.theme-roulette,.theme-dice,.theme-sicbo{--glow:#695284;--felt:#201e3a}.theme-mancala,.theme-gomoku{--glow:#776047;--felt:#362e25}@media(max-height:720px){.panel img{width:110px;height:110px}.panel h2{font-size:20px}.companion{min-height:60px}.companion img{width:54px;height:54px}.stage{padding-top:4px;gap:5px}.cell.card{min-height:52px}.theme-pyramid .cell.card{min-height:38px}.cell.hero{min-height:76px;font-size:48px}}@media(prefers-reduced-motion:no-preference){.cell{transition:background .15s,outline-color .15s}.panel img{animation:arrive .25s ease-out}@keyframes arrive{from{transform:translateY(8px);opacity:0}to{transform:none;opacity:1}}}
.roulette-wheel{display:block;width:min(100%,310px);height:auto;margin:0 auto;filter:drop-shadow(0 5px 9px #0006)}.rolling{pointer-events:none}.rolling~.actions{pointer-events:none}.rolling .roulette-wheel{animation:wheel-spin .46s ease-out}.rolling .hero{animation:dice-shake .09s linear infinite}@keyframes wheel-spin{from{transform:rotate(0)}to{transform:rotate(720deg)}}@keyframes dice-shake{0%{transform:rotate(-8deg) translateY(-3px)}50%{transform:rotate(8deg) translateY(2px)}100%{transform:rotate(-8deg) translateY(-3px)}}@media(prefers-reduced-motion:reduce){.rolling .roulette-wheel,.rolling .hero{animation:none}}

.theme-sevens .stage{justify-content:flex-start;gap:10px}.theme-sevens .section:last-child{flex:1;display:flex;flex-direction:column}.theme-sevens .section:last-child .cells{flex:1;align-content:start}.theme-sevens .cell.card{aspect-ratio:.70;min-height:62px;font-size:18px}

.cell.display{opacity:1;cursor:default}.cell.card.display{background:#fff9e9;color:#252334;opacity:1}.cell.card.display.red{color:#ce354a}

.theme-connect .stage{justify-content:center;gap:8px}.theme-connect .section:last-child .cell{aspect-ratio:1;min-height:0;font-size:clamp(24px,8vw,39px)}.theme-mancala .stage{justify-content:center;gap:18px}.theme-golf .section:first-child .cell.card{height:clamp(100px,23svh,190px);font-size:clamp(25px,9vw,40px)}.theme-pyramid .cell.card{min-height:clamp(42px,8svh,68px);font-size:clamp(17px,5vw,25px)}.theme-baccarat .cell.card{min-height:clamp(80px,15svh,120px)}

#resultScore{font-size:38px;color:#ffdf91;margin:4px 0 12px;font-variant-numeric:tabular-nums}

.save-error{position:absolute;bottom:0;left:0;right:0;z-index:8}
