* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
body { font-family:"Hiragino Maru Gothic ProN","Hiragino Sans","Noto Sans JP",sans-serif; color:#263238;
  background:linear-gradient(180deg,#1b5e20 0%,#2e7d32 40%,#66bb6a 78%,#aed581 130%); min-height:100vh; overflow-x:hidden; }
#app { max-width:680px; margin:0 auto; padding:10px; position:relative; z-index:1; }
.hidden { display:none !important; }
.screen { animation:fadein .3s; }
@keyframes fadein { from{opacity:0} to{opacity:1} }
.title-video-wrap { position:relative; border-radius:18px; overflow:hidden; box-shadow:0 10px 30px rgba(0,0,0,.4); }
.title-video { width:100%; height:280px; object-fit:cover; display:block; }
.game-title { position:absolute; inset:auto 0 12px 0; text-align:center; font-size:38px; color:#fff;
  text-shadow:0 2px 0 #1b5e20, 0 4px 14px rgba(0,0,0,.55); letter-spacing:2px; }
.game-title .title-sub { display:block; font-size:18px; color:#dcedc8; letter-spacing:6px; margin-top:2px; }
.game-title.small { position:static; font-size:24px; margin:8px 0 6px; }
.panel { background:rgba(255,253,247,.96); border-radius:18px; padding:16px; margin-top:12px; box-shadow:0 8px 24px rgba(0,0,0,.3); }
.panel.center { text-align:center; }
.host-img { width:112px; animation:bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform:translateY(0) } 50%{ transform:translateY(-6px) } }
.host-line { font-size:15px; font-weight:bold; color:#37474f; margin:6px 0 8px; line-height:1.5; }
.progress-summary { font-size:13.5px; color:#546e7a; margin-bottom:10px; }
.progress-summary b { color:#e65100; font-size:16px; }
.world-list { display:flex; flex-direction:column; gap:8px; }
.world-btn { display:flex; align-items:center; gap:10px; padding:13px 16px; border-radius:14px; border:2.5px solid #a5d6a7; background:#fff; cursor:pointer; font-family:inherit; text-align:left; }
.world-btn:hover { border-color:#43a047; }
.world-btn .w-emoji { font-size:26px; }
.world-btn .w-name { font-size:16.5px; font-weight:bold; color:#263238; }
.world-btn .w-stars { margin-left:auto; font-size:13px; color:#fb8c00; font-weight:bold; white-space:nowrap; }
.sub-btn { display:block; width:100%; padding:11px; font-size:15px; font-weight:bold; color:#37474f; background:#eceff1; border:2px solid #b0bec5; border-radius:999px; cursor:pointer; margin-top:10px; font-family:inherit; }
.big-btn { display:block; width:100%; margin:12px 0 6px; padding:15px; font-size:19px; font-weight:bold; color:#fff; font-family:inherit;
  background:linear-gradient(180deg,#ff7043,#e53935); border:none; border-radius:999px; cursor:pointer; box-shadow:0 5px 0 #b71c1c; }
.big-btn:active { transform:translateY(3px); box-shadow:0 1px 0 #b71c1c; }
.mini-btn { padding:7px 13px; border-radius:999px; border:2px solid #ccc; background:#fff; cursor:pointer; font-size:13px; font-family:inherit; }
.title-footer { display:flex; gap:8px; justify-content:center; margin-top:12px; }
.stage-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(104px,1fr)); gap:9px; margin:10px 0 14px; }
.scard { background:rgba(255,253,247,.97); border-radius:13px; padding:11px 7px; text-align:center; cursor:pointer; border:2.5px solid transparent; box-shadow:0 3px 8px rgba(0,0,0,.25); }
.scard:hover { border-color:#ffb300; }
.scard .sno { font-size:12px; color:#90a4ae; font-weight:bold; }
.scard .sname { font-size:13px; font-weight:bold; color:#263238; margin:3px 0; min-height:32px; display:flex; align-items:center; justify-content:center; }
.scard .sstars { font-size:14px; color:#ffb300; letter-spacing:2px; }
.scard .sstars .off { color:#ddd; }
.scard .sgimmick { font-size:12px; margin-top:2px; }
/* ---------- play ---------- */
.play-head { display:flex; align-items:center; gap:8px; color:#fff; font-weight:bold; margin:4px 2px 8px; flex-wrap:wrap; font-size:13.5px; }
.badge { background:linear-gradient(180deg,#ffb300,#fb8c00); padding:4px 11px; border-radius:999px; font-size:13px; box-shadow:0 2px 0 #d35400; }
#hud-keys { margin-left:auto; font-size:15px; }
#board-wrap { display:flex; justify-content:center; }
#board { position:relative; border-radius:14px; overflow:hidden; box-shadow:0 12px 30px rgba(0,0,0,.45); touch-action:none; }
#cells { display:grid; width:100%; height:100%; }
.cell { position:relative; }
.cell .decor { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; opacity:.5; pointer-events:none; }
.cell .item { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; pointer-events:none; z-index:2; }
.cell .item.got { opacity:.16; filter:grayscale(1); }
.cell.portal-a .item, .cell.portal-b .item, .cell.portal-c .item { animation:spinPulse 2.2s ease-in-out infinite; }
@keyframes spinPulse { 0%,100%{ transform:scale(1) } 50%{ transform:scale(1.18) } }
.cell.switch-on { filter:brightness(1.12); }
.token { position:absolute; z-index:5; display:flex; align-items:center; justify-content:center; pointer-events:none;
  transition:left .13s linear, top .13s linear; }
#player-token img { width:92%; height:92%; object-fit:contain; filter:drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
#player-token { animation:none; }
#player-token.bump { animation:bumpA .18s; }
@keyframes bumpA { 0%,100%{ transform:scale(1) } 50%{ transform:scale(.86) } }
.token.ghost { filter:drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.edge { position:absolute; z-index:4; border-radius:4px; pointer-events:none; display:flex; align-items:center; justify-content:center; }
.edge.door { box-shadow:0 0 0 1.5px rgba(0,0,0,.35); }
.edge.open { opacity:.18; }
#path-layer { position:absolute; inset:0; z-index:3; pointer-events:none; }
.path-dot { position:absolute; border-radius:50%; background:rgba(255,213,79,.9); box-shadow:0 0 0 2px rgba(230,81,0,.65); transform:translate(-50%,-50%); animation:dotPulse .8s ease-in-out infinite; }
@keyframes dotPulse { 0%,100%{ opacity:.95 } 50%{ opacity:.45 } }
.msg-bar { margin-top:9px; background:#fffdf7; border:2.5px solid #a5d6a7; border-radius:12px; padding:8px 13px; font-size:14px; min-height:42px; display:flex; align-items:center; }
.msg-bar.warn { border-color:#ef9a9a; background:#ffebee; }
.dpad { position:relative; width:168px; height:168px; margin:12px auto 2px; }
.dpad-btn { position:absolute; width:54px; height:54px; border-radius:16px; border:2.5px solid #1b5e20; background:linear-gradient(180deg,#81c784,#43a047); color:#fff; font-size:20px; cursor:pointer; box-shadow:0 4px 0 #1b5e20; font-family:inherit; }
.dpad-btn:active { transform:translateY(3px); box-shadow:0 1px 0 #1b5e20; }
.dpad-btn.up { top:0; left:57px; } .dpad-btn.down { bottom:0; left:57px; }
.dpad-btn.left { top:57px; left:0; } .dpad-btn.right { top:57px; right:0; }
.play-btns { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
.act-btn { flex:1; padding:11px 4px; font-size:13px; font-weight:bold; border-radius:999px; cursor:pointer; white-space:nowrap; font-family:inherit; }
.act-btn.alt { background:#fff; color:#37474f; border:2px solid #b0bec5; }
.legend { margin-top:10px; background:rgba(255,253,247,.92); border-radius:12px; padding:9px 13px; font-size:12.5px; color:#37474f; line-height:1.9; }
.clear-video { width:100%; height:170px; object-fit:cover; border-radius:12px; display:block; }
.clear-stars { font-size:42px; color:#ffb300; letter-spacing:6px; margin-top:10px; text-shadow:0 2px 0 #d35400; }
.clear-stars .off { color:#e0e0e0; text-shadow:none; }
#confetti { position:fixed; inset:0; pointer-events:none; z-index:80; }
/* themes */
#board.theme-forest { background:#c8e6c9; } #board.theme-forest .cell { background:#dcf2dc; }
#board.theme-ice { background:#b3e5fc; } #board.theme-ice .cell { background:#e6f7ff; }
#board.theme-sweets { background:#f8bbd0; } #board.theme-sweets .cell { background:#fdeef4; }
#board.theme-space { background:#311b92; } #board.theme-space .cell { background:#4527a0; }
#board.theme-castle { background:#bcaaa4; } #board.theme-castle .cell { background:#efebe9; }
.cell.ice-floor { background:#b2ebf2 !important; box-shadow:inset 0 0 0 2px rgba(255,255,255,.75); }
#board.theme-space .cell.ice-floor { background:#5e35b1 !important; box-shadow:inset 0 0 0 2px rgba(179,157,217,.8); }
.cell.goal-cell { background:#fff9c4 !important; }
#board.theme-space .cell.goal-cell { background:#7e57c2 !important; }
@media (max-width:560px) { .title-video { height:220px; } .game-title { font-size:30px; } }
