@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@500;600&display=swap");

:root { --font: "Geist", system-ui, -apple-system, sans-serif; --mono: "Geist Mono", ui-monospace, monospace; }

*,*::before,*::after { box-sizing: border-box; }
html, body {
  -webkit-tap-highlight-color: transparent; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { font-family: var(--font); background: #10131c; touch-action: none; }

canvas { display: block; position: fixed; inset: 0; cursor: pointer; }

.hud {
  position: fixed; top: clamp(16px, 2.8vw, 28px); left: 50%; transform: translateX(-50%); z-index: 10;
}
.hud-chip {
  font-family: var(--mono); font-size: 0.9rem; font-weight: 600; letter-spacing: 0.02em; color: #dbe2f0;
  padding: 5px 14px; border-radius: 11px; background: rgba(28, 34, 50, 0.55);
  border: 1px solid rgba(150, 170, 210, 0.24); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  white-space: nowrap; text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.hud-chip.is-solved { color: #7dffb0; border-color: rgba(120, 240, 170, 0.5); }

.controls {
  position: fixed; top: clamp(52px, 8.2vw, 72px); left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 10; flex-wrap: wrap; justify-content: center; max-width: 94vw;
}
.ctrl-btn {
  appearance: none; font-family: var(--font); font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.02em; cursor: pointer; color: rgba(224, 230, 244, 0.92);
  padding: 8px 15px; border-radius: 11px;
  background: rgba(26, 32, 48, 0.6); border: 1px solid rgba(150, 170, 210, 0.24);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: background .15s, transform .1s, color .15s;
}
.ctrl-btn:hover { background: rgba(42, 50, 74, 0.7); }
.ctrl-btn:active { transform: scale(0.96); }
.ctrl-btn[aria-pressed="true"] { background: rgba(224, 230, 244, 0.92); color: #10131c; border-color: rgba(224, 230, 244, 0.92); }

.frame { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.frame__corner {
  position: absolute; font-size: clamp(0.56rem, 1.2vw, 0.7rem); font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: rgba(200, 210, 235, 0.4);
  white-space: nowrap; font-family: var(--font); text-shadow: 0 1px 8px rgba(0,0,0,0.9);
}
.frame__corner--tl { top: clamp(18px, 3.5vw, 34px); left: clamp(18px, 3.5vw, 34px); }
.frame__corner--tr { top: clamp(18px, 3.5vw, 34px); right: clamp(18px, 3.5vw, 34px); }
.frame__corner--bl { bottom: clamp(20px, 3.5vw, 34px); left: clamp(18px, 3.5vw, 34px); }
.frame__corner a { color: inherit; text-decoration: none; pointer-events: auto; border-bottom: 1px solid transparent; transition: color .14s, border-color .14s; }
.frame__corner a:hover { color: rgba(235, 240, 250, 0.95); border-bottom-color: rgba(200, 210, 235, 0.5); }

.hint {
  position: fixed; bottom: clamp(20px, 3.5vw, 34px); left: 50%; transform: translateX(-50%);
  margin: 0; font-size: 0.64rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(200, 210, 235, 0.42); pointer-events: none; z-index: 10; white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0,0,0,0.9); transition: opacity .6s;
}
.hint.is-hidden { opacity: 0; }

@media (max-width: 640px) {
  .hint { font-size: 0.54rem; white-space: normal; text-align: center; width: 88%; letter-spacing: 0.1em; }
}
