* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; font-family: Arial, Helvetica, sans-serif; background: #16110d; color: #fff8eb; }
#gameRoot { position: fixed; inset: 0; z-index: 0; }
canvas { display: block; touch-action: none; }
#ui { position: fixed; top: 10px; left: 10px; right: 10px; z-index: 5; pointer-events: none; }
.topbar, .panel { pointer-events: auto; backdrop-filter: blur(10px); background: rgba(30, 20, 12, .78); border: 1px solid rgba(255,255,255,.15); border-radius: 18px; box-shadow: 0 12px 32px rgba(0,0,0,.28); }
.topbar { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; align-items: center; }
h1 { margin: 0; font-size: clamp(20px, 4vw, 34px); letter-spacing: .5px; }
p { margin: 4px 0 0; opacity: .9; font-size: 14px; }
.scorebox { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.scorebox span { background: rgba(255,255,255,.12); padding: 8px 10px; border-radius: 12px; white-space: nowrap; }
.panel { margin-top: 10px; padding: 10px; max-width: 760px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
button, input { border: 0; border-radius: 14px; padding: 11px 12px; font-weight: 700; font-size: 14px; }
button { color: #2b1607; background: linear-gradient(180deg, #ffe49b, #f4aa3c); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 6px 14px rgba(0,0,0,.25); }
button:active { transform: translateY(1px); }
input { width: 120px; color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); text-transform: uppercase; }
.hint { margin-top: 8px; font-size: 13px; color: #f7dca6; }
#toast { position: fixed; z-index: 10; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: min(90vw, 520px); padding: 12px 16px; background: rgba(0,0,0,.82); color: #fff; border-radius: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; text-align: center; }
#toast.show { opacity: 1; }
.a-dom-overlay button { font-size: 18px; }
@media (max-width: 640px) {
  #ui { top: 6px; left: 6px; right: 6px; }
  .topbar { padding: 9px 10px; align-items: flex-start; }
  .panel { padding: 8px; }
  button, input { flex: 1 1 30%; min-width: 96px; padding: 10px 8px; font-size: 12px; }
  .roomrow input { flex: 1 1 100px; }
  .hint { display: none; }
}
