:root {
  --accent: #ffd21e;
  --ink: #12151a;
  --panel: rgba(18,21,26,0.82);
  --line: rgba(255,255,255,0.14);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0d0f12; }
body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; color: #f2f4f7; user-select: none; -webkit-user-select: none; }

#game { position: fixed; inset: 0; display: block; touch-action: none; cursor: pointer; }
body.editing #game { cursor: crosshair; }

#loading {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 15px; letter-spacing: 0.08em; color: #9aa3ad; background: #0d0f12; z-index: 50;
}

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
#topbar {
  position: absolute; top: 10px; left: 10px; right: 10px;
  display: flex; align-items: center; gap: 8px; pointer-events: none;
}
#topbar .title {
  font-weight: 800; letter-spacing: 0.12em; font-size: 14px; color: var(--accent);
  background: var(--panel); padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line);
}
#topbar .spacer { flex: 1; }

.btn {
  pointer-events: auto; cursor: pointer; font-size: 12.5px; font-weight: 600;
  color: #f2f4f7; background: var(--panel); border: 1px solid var(--line);
  padding: 7px 11px; border-radius: 8px; transition: background .12s, border-color .12s;
}
.btn:hover { background: rgba(40,46,54,0.9); border-color: rgba(255,255,255,0.28); }
.btn:active { transform: translateY(1px); }

#hint {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  font-size: 12.5px; color: #cfd5db; background: var(--panel); padding: 7px 14px;
  border-radius: 20px; border: 1px solid var(--line); white-space: nowrap;
}
#hint b { color: var(--accent); }

#editorbar {
  position: absolute; bottom: 52px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  background: var(--panel); padding: 8px 12px; border-radius: 12px; border: 1px solid var(--accent);
  pointer-events: auto; max-width: 96vw;
}
#editorbar .ed-label { font-size: 12px; color: var(--accent); font-weight: 700; margin-right: 4px; }

#flash {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #12151a; font-weight: 700; font-size: 13px;
  padding: 8px 16px; border-radius: 20px; opacity: 0; transition: opacity .25s; z-index: 40; pointer-events: none;
}

@media (max-width: 640px) {
  #hint { font-size: 11px; white-space: normal; max-width: 92vw; text-align: center; }
  #topbar .title { font-size: 12px; }
}
