* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { height:100%; overflow:hidden; }
body {
  background:#1a0b08;
  color:#f3e2c7;
  font-family:-apple-system,'Apple SD Gothic Neo','Noto Sans KR',sans-serif;
  touch-action:none; user-select:none; -webkit-user-select:none;
}
#app { position:relative; height:100%; max-width:430px; margin:0 auto; display:flex; flex-direction:column; }
.hidden { display:none !important; }

#hud { display:flex; justify-content:space-between; padding:10px 12px; font-size:14px; }
.hud-item { background:rgba(255,255,255,.07); border-radius:8px; padding:4px 10px; }
#hud-phase { color:#ffd98a; }

#clean-bar-wrap { height:6px; background:rgba(255,255,255,.08); margin:0 12px 8px; border-radius:3px; overflow:hidden; }
#clean-bar { height:100%; width:0%; background:linear-gradient(90deg,#c8a24a,#ffe9a8); border-radius:3px; transition:width .15s; }

#board-zone { flex:1; display:flex; align-items:center; justify-content:center; min-height:0; }
#board { width:min(92vw,390px); height:auto; border-radius:14px; box-shadow:0 6px 24px rgba(0,0,0,.55), inset 0 0 0 2px #4a2a18; background:#2a0d0a; touch-action:none; }

#tray { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; padding:10px 8px 14px; min-height:64px; }
.piece-btn {
  min-width:52px; min-height:52px; font-size:30px; border-radius:12px;
  background:#33150e; border:2px solid #5a3322; color:#fff;
  display:flex; align-items:center; justify-content:center; transition:transform .1s, border-color .1s;
}
.piece-btn.sel { border-color:#ffd98a; background:#4a2113; transform:scale(1.12); }
.piece-btn:disabled { opacity:.25; }

#toast {
  position:absolute; left:50%; bottom:96px; transform:translateX(-50%);
  background:rgba(0,0,0,.75); color:#ffe9a8; padding:8px 16px; border-radius:20px;
  font-size:14px; pointer-events:none; white-space:nowrap;
}

.overlay {
  position:absolute; inset:0; z-index:10; background:rgba(12,4,3,.92);
  display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:24px;
}
#title-logo, #result-emoji { font-size:72px; margin-bottom:8px; }
#title-h1 { font-size:28px; color:#ffd98a; margin-bottom:12px; letter-spacing:2px; }
#title-desc { font-size:14px; line-height:1.7; color:#d8c3a5; margin-bottom:16px; }
#title-best { color:#c8a24a; font-size:14px; margin-bottom:10px; }
#result-title { font-size:24px; color:#ffd98a; margin-bottom:8px; }
#result-score { font-size:44px; font-weight:700; color:#fff; margin-bottom:6px; }
#result-sub { font-size:14px; color:#d8c3a5; white-space:pre-line; margin-bottom:18px; line-height:1.6; }

.big-btn {
  min-width:200px; min-height:52px; font-size:18px; font-weight:700; border:none; border-radius:14px;
  background:linear-gradient(180deg,#c8a24a,#8f6c22); color:#20140a; padding:12px 28px;
}
.big-btn:active { transform:scale(.96); }

#btn-mute {
  position:absolute; top:8px; right:10px; z-index:20; width:44px; height:44px;
  font-size:20px; background:rgba(255,255,255,.08); border:none; border-radius:10px;
}
#float-layer { position:absolute; inset:0; pointer-events:none; overflow:hidden; z-index:5; }
.float-txt { position:absolute; font-size:22px; animation:floatUp 1s ease-out forwards; }
@keyframes floatUp { from { opacity:1; transform:translateY(0); } to { opacity:0; transform:translateY(-46px); } }
