.game-shell { width: min(calc(100% - 24px), 1320px); margin: 28px auto 0; }
.game-topbar { display:flex; justify-content:space-between; gap:20px; align-items:end; margin-bottom:18px; }
.game-topbar h1 { font-size:clamp(2rem,5vw,3.8rem); margin:.15em 0 .1em; }
.game-topbar p { color:var(--muted); margin:0; }
.game-actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.mini-btn,.danger-btn { color:var(--muted); background:rgba(255,255,255,.05); border:1px solid var(--line); border-radius:12px; padding:9px 11px; cursor:pointer; }
.mini-btn:hover { color:#fff; background:rgba(255,255,255,.09); }
.danger-btn { width:100%; color:#ffb4b4; margin-top:14px; }
.game-layout { display:grid; grid-template-columns:230px minmax(340px,620px) 230px; justify-content:center; gap:16px; align-items:start; }
.game-panel { border:1px solid var(--line); background:rgba(23,26,35,.92); border-radius:20px; padding:17px; box-shadow:var(--shadow); }
.next-box { text-align:center; }
.next-box>span { color:var(--muted); font-size:.85rem; font-weight:800; }
.next-item { width:98px; aspect-ratio:1; margin:10px auto; display:grid; place-items:center; border-radius:24px; border:1px solid var(--line); background:linear-gradient(145deg,#2b3140,#171a23); font-size:3.2rem; box-shadow:inset 0 1px rgba(255,255,255,.08); }
.next-item small { display:block; font-size:.7rem; color:var(--muted); line-height:1.1; }
.reroll { width:100%; font-size:.88rem; }
.stat-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:18px; }
.stat-grid div { border:1px solid var(--line); border-radius:12px; padding:9px; background:rgba(255,255,255,.035); }
.stat-grid span { display:block; color:var(--muted); font-size:.72rem; }
.stat-grid strong { font-size:1.13rem; }
.goal-box { margin-top:16px; padding-top:15px; border-top:1px solid var(--line); }
.goal-row { display:flex; justify-content:space-between; gap:8px; font-size:.86rem; }
.progress { height:8px; background:#0e1016; border-radius:999px; overflow:hidden; margin:9px 0; }
.progress i { display:block; height:100%; width:0; background:linear-gradient(90deg,var(--accent-2),var(--accent)); transition:width .3s ease; }
.goal-box p { color:var(--muted); font-size:.76rem; line-height:1.5; margin:0; }
.board-wrap { position:relative; border:1px solid rgba(240,163,74,.2); border-radius:26px; padding:16px; background:radial-gradient(circle at 50% 20%,rgba(240,163,74,.12),transparent 50%),#12151c; box-shadow:var(--shadow); }
.game-board { display:grid; grid-template-columns:repeat(5,1fr); gap:9px; aspect-ratio:1; }
.cell { position:relative; border:1px solid rgba(255,255,255,.08); border-radius:17px; background:linear-gradient(145deg,#242a37,#171a22); color:#fff; cursor:pointer; min-width:0; padding:0; overflow:hidden; box-shadow:inset 0 1px rgba(255,255,255,.05),0 5px 12px rgba(0,0,0,.18); transition:transform .1s ease,border-color .15s ease,filter .15s ease; }
.cell:hover:not(:disabled),.cell:focus-visible { transform:translateY(-2px); border-color:rgba(240,163,74,.65); outline:none; }
.cell.empty::after { content:"＋"; color:rgba(255,255,255,.13); font-size:1.4rem; }
.cell .item-emoji { display:block; font-size:clamp(1.65rem,5vw,3.3rem); line-height:1; }
.cell .item-name { display:block; margin-top:4px; font-size:clamp(.5rem,1.3vw,.72rem); color:#ddd5c9; line-height:1; white-space:nowrap; }
.cell.spawn { animation:pop .22s ease; }
.cell.merge { animation:merge .35s ease; }
.cell[data-level="4"],.cell[data-level="5"],.cell[data-level="6"],.cell[data-level="7"],.cell[data-level="8"],.cell[data-level="9"] { background:linear-gradient(145deg,rgba(238,109,122,.26),rgba(240,163,74,.13)),#202430; }
@keyframes pop { 0%{transform:scale(.5);opacity:.3} 75%{transform:scale(1.08)} 100%{transform:scale(1);opacity:1} }
@keyframes merge { 0%{transform:scale(.7);filter:brightness(1.8)} 60%{transform:scale(1.14)} 100%{transform:scale(1)} }
.combo-toast { position:absolute; z-index:5; left:50%; top:50%; transform:translate(-50%,-50%) scale(.8); pointer-events:none; opacity:0; font-weight:950; font-size:clamp(1.5rem,5vw,3.2rem); color:#ffe09c; text-shadow:0 5px 18px #000; }
.combo-toast.show { animation:toast .8s ease; }
@keyframes toast { 0%{opacity:0;transform:translate(-50%,-40%) scale(.6)} 25%{opacity:1;transform:translate(-50%,-55%) scale(1.1)} 100%{opacity:0;transform:translate(-50%,-90%) scale(1)} }
.game-over { position:absolute; inset:0; display:grid; place-items:center; background:rgba(8,9,13,.88); backdrop-filter:blur(7px); border-radius:26px; text-align:center; padding:28px; z-index:10; }
.game-over[hidden] { display:none; }
.game-over>div { max-width:380px; }.game-over-icon{font-size:4rem}.game-over p{color:var(--muted)}
.collection-panel h2 { font-size:1.1rem; }
.collection { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.collection-item { border:1px solid var(--line); border-radius:11px; padding:7px; text-align:center; background:rgba(255,255,255,.03); opacity:.28; }
.collection-item.unlocked { opacity:1; }
.collection-item span { display:block; font-size:1.5rem; }.collection-item small{font-size:.63rem;color:var(--muted)}
.game-dialog { width:min(520px,calc(100% - 28px)); color:var(--text); background:#1c202b; border:1px solid var(--line); border-radius:22px; padding:24px; box-shadow:0 30px 80px #000; }
.game-dialog::backdrop { background:rgba(0,0,0,.72); backdrop-filter:blur(5px); }.game-dialog form{position:relative}.game-dialog p,.game-dialog li{color:var(--muted)}
.dialog-close { position:absolute; right:-10px; top:-13px; width:35px;height:35px;border-radius:50%;border:1px solid var(--line);background:#282d39;color:#fff;cursor:pointer; }.dialog-buttons{display:grid;gap:10px}.file-label{cursor:pointer}
@media(max-width:1040px){.game-layout{grid-template-columns:190px minmax(320px,620px)}.collection-panel{grid-column:1/-1}.collection{grid-template-columns:repeat(5,1fr)}}
@media(max-width:720px){.game-topbar{display:block}.game-actions{justify-content:flex-start;margin-top:14px}.game-layout{display:flex;flex-direction:column}.stats-panel{width:100%;display:grid;grid-template-columns:130px 1fr;gap:14px}.stat-grid{margin-top:0}.goal-box{grid-column:1/-1;margin-top:0}.board-wrap{width:100%;padding:10px}.game-board{gap:6px}.cell{border-radius:12px}.collection-panel{width:100%}.collection{grid-template-columns:repeat(5,1fr)}}
@media(max-width:440px){.stats-panel{grid-template-columns:110px 1fr;padding:12px}.next-item{width:76px}.game-shell{width:min(calc(100% - 12px),1320px)}.collection-item small{font-size:.54rem}}
