:root{--red:#e60012;--ink:#252525;--muted:#777;--line:#ddd;--page:#f4f4f4}
*{box-sizing:border-box}
html{background:#dedede}
body{margin:0;color:var(--ink);font-family:"Helvetica Neue","Hiragino Kaku Gothic ProN","Yu Gothic",system-ui,sans-serif;-webkit-font-smoothing:antialiased}
button,a{font:inherit;-webkit-tap-highlight-color:transparent}
[hidden]{display:none!important}
.console-shell{width:100%;max-width:520px;min-height:100svh;margin:auto;padding-bottom:92px;overflow:hidden;background:var(--page)}

.console-header{height:72px;padding:max(12px,env(safe-area-inset-top)) 17px 10px;display:flex;align-items:center;justify-content:space-between;color:#fff;background:var(--red)}
.kns-lockup{display:flex;align-items:center;gap:10px}
.souda-logo{width:40px;height:40px;display:grid;place-items:center;flex:none}
.souda-logo img{width:100%;height:100%;display:block;object-fit:contain}
.kns-lockup div{display:flex;flex-direction:column;line-height:1}
.kns-lockup small{font-size:8px;font-weight:800;letter-spacing:.12em}
.kns-lockup strong{margin-top:3px;font-size:24px;letter-spacing:.04em}
.avatar{width:36px;height:36px;border:2px solid #fff;border-radius:50%;color:var(--red);background:#fff;font-weight:900}

.spotlight{position:relative;min-height:220px;overflow:hidden;color:#fff;background:#333}
.spotlight:before,.tile-art:before,.confirm-art:before{content:"";position:absolute;inset:0;opacity:.25}
.spotlight-art{position:absolute;right:-10px;top:14px;width:49%;height:190px;display:grid;place-items:center;transform:rotate(4deg)}
.spotlight-art:before{content:"";position:absolute;width:155px;height:155px;border:7px solid #fff;border-radius:28px;box-shadow:0 18px 35px #0004;background:#ffffff18}
.spotlight-art img{position:relative;z-index:1;width:145px;height:145px;object-fit:contain}
.spotlight-copy{position:relative;z-index:2;width:60%;padding:30px 0 24px 21px}
.spotlight-copy>small{padding:4px 8px;border:1px solid #ffffff9c;border-radius:4px;font-size:9px;font-weight:800}
.spotlight-copy h1{margin:12px 0 7px;font-size:27px;line-height:1.2;letter-spacing:-.5px}
.spotlight-copy p{margin:0;color:#ffffffe0;font-size:12px;line-height:1.5}

.category-all{background:linear-gradient(145deg,#686868,#3d3d3d)}
.category-action{background:linear-gradient(145deg,#ff9f28,#ed5b17)}
.category-puzzle{background:linear-gradient(145deg,#8a64ed,#5035b0)}
.category-shooting{background:linear-gradient(145deg,#28bea5,#087d74)}
.category-other{background:linear-gradient(145deg,#43aaf5,#1768c9)}
.dots:before{background:radial-gradient(circle,#fff 0 3px,transparent 4px);background-size:24px 24px}
.speed:before{background:repeating-linear-gradient(125deg,transparent 0 18px,#fff 19px 22px)}
.bubbles:before{background:radial-gradient(circle at 20% 30%,#fff 0 14px,transparent 15px),radial-gradient(circle at 75% 65%,#fff 0 22px,transparent 23px)}
.grid:before{background:linear-gradient(#fff 1px,transparent 1px),linear-gradient(90deg,#fff 1px,transparent 1px);background-size:28px 28px}

.category-bar{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;padding:14px 13px;background:#fff;border-bottom:1px solid var(--line)}
.category-bar button{min-width:0;height:34px;padding:0 5px;border:2px solid #fff;border-radius:999px;color:#fff;font-size:10px;font-weight:800;line-height:1;opacity:.68;box-shadow:0 2px 5px #0002;transition:transform .12s,opacity .12s}
.category-bar button:active{transform:scale(.95)}
.category-bar button.active{opacity:1;outline:2px solid #2b2b2b;outline-offset:1px;box-shadow:0 3px 8px #0003}

.library{padding:20px 13px 28px}
.library-heading{display:flex;align-items:baseline;justify-content:space-between;margin:0 2px 12px}
.library-heading h2{margin:0;font-size:18px}
.library-heading span{color:var(--muted);font-size:10px}
.game-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px 12px}
.game-tile{min-width:0;padding:0;text-align:left;border:0;background:transparent;color:var(--ink);transition:transform .12s}
.game-tile:active{transform:scale(.97)}
.tile-art{position:relative;width:100%;aspect-ratio:1.36;overflow:hidden;display:grid;place-items:center;border:4px solid transparent;border-radius:5px;color:#fff;box-shadow:0 4px 10px #0002}
.game-tile.selected .tile-art{border-color:#fff;outline:4px solid var(--red);box-shadow:0 5px 16px #e6001240}
.game-tile.selected .tile-title{color:var(--red)}
.tile-art>img{position:relative;z-index:2;width:76%;height:76%;object-fit:contain}
.tile-art>i,.confirm-art>i{position:absolute;z-index:2;right:7px;bottom:5px;color:#ffffffd9;font-size:9px;font-style:normal;font-weight:900;letter-spacing:.08em}
.tile-title{display:block;overflow:hidden;margin-top:8px;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:800}
.tile-meta{display:block;margin-top:2px;color:var(--muted);font-size:9px}

.action-dock{position:fixed;z-index:20;left:50%;bottom:0;width:100%;max-width:520px;min-height:76px;padding:9px 13px calc(9px + env(safe-area-inset-bottom));transform:translateX(-50%);display:flex;align-items:center;gap:10px;background:#fffffff5;border-top:1px solid #ccc;box-shadow:0 -5px 18px #00000012;backdrop-filter:blur(12px)}
.dock-game{min-width:0;flex:1;display:flex;align-items:center;gap:8px}
.mini-art{width:46px;height:46px;display:grid;place-items:center;flex:none;border-radius:4px;color:#fff}
.mini-art img{width:82%;height:82%;object-fit:contain}
.dock-game>span:last-child{min-width:0;display:flex;flex-direction:column}
.dock-game small{color:var(--muted);font-size:8px}
.dock-game strong{overflow:hidden;margin-top:2px;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.action-dock>button{height:46px;padding:0 15px;border:0;border-radius:4px;color:#fff;background:var(--red);font-size:12px;font-weight:900;box-shadow:0 3px 0 #a5000d}
.action-dock>button:disabled{opacity:.5}
.action-dock>button span,.confirm-card>a span,.back-button span{display:inline-grid;place-items:center;width:23px;height:23px;margin-right:5px;border:2px solid currentColor;border-radius:50%;font-size:11px}
footer{padding:0 15px 24px;display:flex;justify-content:space-between;color:#999;font-size:9px}
footer small{font-size:8px}

.confirm-layer{position:fixed;z-index:40;inset:0;padding:20px;display:grid;place-items:center;background:#111d;backdrop-filter:blur(7px);animation:fade .15s}
.confirm-card{position:relative;width:100%;max-width:390px;padding:20px;text-align:center;border-radius:7px;background:#fff;box-shadow:0 18px 60px #0008;animation:pop .18s}
.confirm-close{position:absolute;z-index:3;right:9px;top:9px;width:32px;height:32px;border:0;border-radius:50%;color:#555;background:#fff;font-size:21px;box-shadow:0 2px 8px #0003}
.confirm-art{position:relative;width:100%;aspect-ratio:1.65;overflow:hidden;display:grid;place-items:center;margin-bottom:18px;border-radius:5px;color:#fff}
.confirm-art>img{position:relative;z-index:2;width:68%;height:88%;object-fit:contain}
.confirm-card>small{color:var(--red);font-size:10px;font-weight:900}
.confirm-card h2{margin:5px 0 6px;font-size:22px}
.confirm-card>p{margin:0;color:#666;font-size:12px}
.confirm-card>a,.back-button{height:48px;margin-top:18px;display:flex;align-items:center;justify-content:center;border:0;border-radius:4px;text-decoration:none;font-size:13px;font-weight:900}
.confirm-card>a{color:#fff;background:var(--red);box-shadow:0 3px 0 #a5000d}
.back-button{width:100%;margin-top:9px;color:#666;background:#eee}

.empty-state{margin:20px 13px;padding:24px;text-align:center;color:var(--muted);border:1px dashed var(--line);border-radius:8px;background:#fff}

@keyframes fade{from{opacity:0}}
@keyframes pop{from{opacity:0;transform:scale(.92)}}
@media(min-width:650px){.console-shell{box-shadow:0 0 45px #0003}.confirm-card{max-width:400px}}
@media(max-width:360px){.spotlight-copy{width:65%;padding-left:16px}.spotlight-copy h1{font-size:23px}.spotlight-art{right:-25px}.category-bar{gap:4px;padding-inline:8px}.category-bar button{height:32px;padding-inline:3px;font-size:8px}.game-grid{gap:15px 9px}.tile-title{font-size:12px}.action-dock>button{padding:0 10px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
