/* Cairnvale — game UI styles (dark slate + lichen accents). */
:root {
  --ink: #101421;
  --panel: rgba(16, 21, 33, 0.82);
  --edge: #2c3952;
  --accent: #7fd48f;
  --accent2: #f0b35e;
  --text: #e9eef7;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100vh; overflow: hidden; background: var(--ink); }
body { font-family: ui-monospace, "Segoe UI", system-ui, sans-serif; color: var(--text); }
#stage { position: fixed; inset: 0; overflow: hidden; }
#stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#crosshair {
  position: absolute; left: 50%; top: 50%; width: 18px; height: 18px;
  transform: translate(-50%, -50%); pointer-events: none; opacity: 0.9;
}
#crosshair::before, #crosshair::after {
  content: ""; position: absolute; background: var(--text);
}
#crosshair::before { left: 8px; top: 0; width: 2px; height: 18px; }
#crosshair::after { left: 0; top: 8px; width: 18px; height: 2px; }

#hotbar {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; gap: 8px; padding: 8px 10px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--edge);
  pointer-events: none;
}
#hotbar > div {
  display: flex; align-items: center; gap: 6px; padding: 3px 7px;
  border-radius: 8px; border: 1px solid var(--edge);
  font-size: 13px; letter-spacing: 0.02em;
}
#hotbar > div[aria-selected="true"] {
  border: 2px solid var(--accent); box-shadow: 0 0 10px rgba(127, 212, 143, 0.4);
}
#hotbar i { font-style: normal; }
#hotbar kbd { font-family: inherit; color: var(--dim, #9fb0c8); margin-left: 2px; }

#hud {
  position: absolute; left: 14px; top: 12px; max-width: 60vw;
  padding: 6px 10px; border-radius: 10px; background: var(--panel);
  border: 1px solid var(--edge); font-size: 12px; letter-spacing: 0.04em;
  color: var(--text); pointer-events: none;
}
#toast {
  position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%);
  padding: 5px 12px; border-radius: 8px; background: var(--panel);
  border: 1px solid var(--edge); font-size: 13px; opacity: 0;
  transition: opacity 0.35s ease; pointer-events: none; white-space: pre-line;
}

#start {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 50% 40%, rgba(16,21,33,0.35), rgba(16,21,33,0.92));
}
#start h1 { font-size: 42px; margin: 0; letter-spacing: 0.06em; color: var(--text); }
#start p { font-size: 15px; color: var(--dim, #9fb0c8); }

#touch-controls { position: absolute; inset: 0; pointer-events: none; }
#touch-controls[hidden] { display: none; }
#touch-controls > div {
  position: absolute; width: 108px; height: 108px; border-radius: 50%;
  background: rgba(16, 21, 33, 0.4); border: 2px solid rgba(233, 238, 247, 0.35);
  color: var(--text); font-size: 13px; display: flex; align-items: center;
  justify-content: center; opacity: 0.85; pointer-events: auto; touch-action: none;
}
#touch-controls > div[data-touch="move"] { left: 16px; bottom: 16px; width: 140px; height: 140px; }
#touch-controls > div[data-touch="jump"] { right: 16px; bottom: 150px; }
#touch-controls > div[data-touch="break"] { right: 150px; bottom: 24px; width: 92px; height: 92px; }
#touch-controls > div[data-touch="place"] { right: 16px; bottom: 26px; width: 92px; height: 92px; }

@media (max-width: 700px) {
  #hotbar { gap: 3px; font-size: 10px; bottom: 8px; padding: 4px 6px; }
  #hotbar > div { padding: 1px 4px; font-size: 10px; gap: 3px; }
  #hud { left: 10px; top: 8px; font-size: 11px; }
}
