* { 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:#333;
  background:linear-gradient(180deg,#263238 0%,#455a64 45%,#78909c 80%,#ffca28 140%); min-height:100vh; overflow-x:hidden; }
#app { max-width:720px; 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:36px; color:#fff;
  text-shadow:0 2px 0 #37474f, 0 4px 14px rgba(0,0,0,.55); letter-spacing:1px; }
.game-title .title-sub { display:block; font-size:18px; color:#ffe082; letter-spacing:6px; margin-top:2px; }
.game-title.small { position:static; font-size:25px; margin:8px 0 4px; }
.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:4px 0 8px; }
.progress-summary { font-size:13.5px; color:#546e7a; margin-bottom:8px; }
.progress-summary b { color:#e65100; font-size:16px; }
.lang-row { display:flex; gap:8px; justify-content:center; margin:8px 0 2px; }
.lang-btn { padding:9px 22px; border-radius:999px; border:2.5px solid #90a4ae; background:#fff; font-weight:bold; font-size:15px; cursor:pointer; color:#37474f; }
.lang-btn.sel { background:linear-gradient(180deg,#42a5f5,#1e88e5); color:#fff; border-color:#1e88e5; box-shadow:0 3px 0 #0d47a1; }
.diff-row { display:flex; gap:7px; flex-wrap:wrap; justify-content:center; margin:8px 0; }
.diff-btn { padding:8px 13px; border-radius:999px; border:2.5px solid #b0bec5; background:#fff; font-weight:bold; font-size:13.5px; cursor:pointer; color:#37474f; }
.diff-btn.sel { background:linear-gradient(180deg,#ffb300,#fb8c00); color:#fff; border-color:#fb8c00; box-shadow:0 3px 0 #d35400; }
.big-btn { display:block; width:100%; margin:12px 0 6px; padding:16px; font-size:20px; font-weight:bold; color:#fff;
  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; }
.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:6px; }
.mini-btn { padding:7px 13px; border-radius:999px; border:2px solid #ccc; background:#fff; cursor:pointer; font-size:13px; }
.title-footer { display:flex; gap:8px; justify-content:center; margin-top:10px; }
.puzzle-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(100px,1fr)); gap:8px; margin:10px 0 14px; }
.pcard { background:rgba(255,253,247,.96); border-radius:12px; padding:10px 6px; text-align:center; cursor:pointer; border:2.5px solid transparent; box-shadow:0 3px 8px rgba(0,0,0,.25); }
.pcard:hover { border-color:#ffb300; }
.pcard .pno { font-size:12px; color:#90a4ae; font-weight:bold; }
.pcard .psize { font-size:17px; font-weight:bold; color:#263238; margin:2px 0; }
.pcard .pwords { font-size:11px; color:#78909c; }
.pcard .pstar { font-size:14px; color:#ddd; }
.pcard.cleared .pstar { color:#ffb300; }
/* play */
.play-head { display:flex; align-items:center; gap:9px; color:#fff; font-weight:bold; margin:4px 2px 8px; }
.badge { background:linear-gradient(180deg,#ffb300,#fb8c00); padding:4px 11px; border-radius:999px; font-size:13px; box-shadow:0 2px 0 #d35400; }
#play-progress { margin-left:auto; background:rgba(0,0,0,.35); padding:4px 11px; border-radius:999px; font-size:13px; }
#grid-wrap { display:flex; justify-content:center; }
.grid { display:grid; gap:2px; background:#263238; padding:5px; border-radius:12px; box-shadow:0 10px 26px rgba(0,0,0,.4); width:min(96vw,540px); }
.cell { position:relative; aspect-ratio:1; border:none; padding:0; font-family:inherit; }
.cell.black { background:#263238; }
.cell.white { background:#fffdf7; cursor:pointer; border-radius:3px; }
.cell.white .num { position:absolute; top:1px; left:3px; font-size:9px; color:#78909c; font-weight:bold; pointer-events:none; }
.cell.white .ch { display:flex; align-items:center; justify-content:center; width:100%; height:100%; font-weight:bold; color:#263238; pointer-events:none; }
.cell.white.inword { background:#fff3c4; }
.cell.white.cursor { background:#ffe082; box-shadow:inset 0 0 0 3px #fb8c00; }
.cell.white.locked .ch { color:#2e8b2e; }
.cell.white.locked { background:#e8f5e9; }
.cell.white.wrong { background:#ffdde0; animation:shake .3s; }
@keyframes shake { 0%,100%{ transform:translateX(0) } 25%{ transform:translateX(-2.5px) } 75%{ transform:translateX(2.5px) } }
.grid.size7 .ch { font-size:24px; } .grid.size9 .ch { font-size:20px; } .grid.size11 .ch { font-size:16.5px; }
.clue-bar { margin-top:10px; background:#fffdf7; border:2.5px solid #ffca28; border-radius:12px; padding:9px 13px; font-size:14.5px; min-height:46px; display:flex; align-items:center; gap:8px; }
.clue-bar .cnum { background:#fb8c00; color:#fff; font-weight:bold; border-radius:8px; padding:2px 8px; flex:none; }
.clue-bar.done { border-color:#81c784; background:#e8f5e9; }
/* keyboard */
.keyboard { margin-top:10px; background:rgba(255,253,247,.94); border-radius:14px; padding:8px; box-shadow:0 6px 18px rgba(0,0,0,.3); }
.kb-row { display:flex; gap:4px; justify-content:center; margin-bottom:4px; }
.kb-row:last-child { margin-bottom:0; }
.kkey { flex:1; max-width:52px; padding:10px 0; font-size:16px; font-weight:bold; border-radius:8px; border:1.5px solid #b0bec5; background:#fff; cursor:pointer; color:#263238; font-family:inherit; }
.kkey:active { background:#ffe082; }
.kkey.wide { max-width:76px; flex:1.4; font-size:13.5px; background:#eceff1; }
.kkey.daku { background:#fff3c4; }
.play-btns { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
.act-btn { flex:1; padding:11px 4px; font-size:13.5px; font-weight:bold; border-radius:999px; border:none; cursor:pointer; background:#7a9e43; color:#fff; box-shadow:0 3px 0 #4e6b24; white-space:nowrap; }
.act-btn.alt { background:#fff; color:#37474f; border:2px solid #b0bec5; box-shadow:none; }
.clue-cols { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; }
@media (max-width:560px) { .clue-cols { grid-template-columns:1fr; } }
.clue-col { background:rgba(255,253,247,.95); border-radius:12px; padding:10px 12px; }
.clue-col h3 { font-size:14px; color:#37474f; margin-bottom:5px; }
.clue-list { list-style:none; }
.clue-list li { font-size:13px; padding:4px 6px; border-radius:7px; cursor:pointer; line-height:1.4; }
.clue-list li:hover { background:#fff3c4; }
.clue-list li.active { background:#ffe082; font-weight:bold; }
.clue-list li.done { color:#9e9e9e; text-decoration:line-through; }
.clue-list li b { color:#e65100; margin-right:4px; }
.clear-actions { margin-top:8px; }
#confetti { position:fixed; inset:0; pointer-events:none; z-index:80; }
@media (max-width:560px) { .title-video { height:220px; } .game-title { font-size:29px; } }
