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

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

*,*::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: #241812; touch-action: none; }

canvas { display: block; position: fixed; inset: 0; cursor: grab; }
canvas:active { cursor: grabbing; }
/* once firing the piece can't be shaped — drop the grab cursor */
canvas.is-done, canvas.is-done:active { cursor: default; }
/* painting the fired piece */
canvas.is-paint, canvas.is-paint:active { cursor: crosshair; }

.palette {
  position: fixed; bottom: clamp(52px, 8.5vw, 84px); left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px; z-index: 10; padding: 9px 12px; border-radius: 16px;
  background: rgba(44, 28, 18, 0.55); border: 1px solid rgba(220, 180, 140, 0.22);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(10, 6, 2, 0.4);
}
.palette[hidden] { display: none; }
.swatch {
  width: 26px; height: 26px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.25), 0 2px 4px rgba(0, 0, 0, 0.35);
  transition: transform .12s, border-color .12s;
}
.swatch:hover { transform: scale(1.1); }
.swatch.is-active { border-color: #fff; transform: scale(1.16); }
@media (max-width: 600px) {
  .swatch { width: 30px; height: 30px; }
  .palette { gap: 8px; }
}

.controls {
  position: fixed; top: clamp(16px, 3vw, 30px); left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 10;
}
.ctrl-btn {
  appearance: none; font-family: var(--font); font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.02em; cursor: pointer; color: rgba(240, 224, 208, 0.92);
  padding: 8px 15px; border-radius: 11px;
  background: rgba(58, 38, 26, 0.55); border: 1px solid rgba(220, 180, 140, 0.26);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(10, 6, 2, 0.34);
  transition: background .15s, transform .1s, color .15s;
}
.ctrl-btn:hover { background: rgba(78, 52, 36, 0.65); }
.ctrl-btn:active { transform: scale(0.96); }
.ctrl-btn[aria-pressed="true"] { color: rgba(210, 188, 168, 0.55); }
.ctrl-btn--fire { color: #ffd9a8; border-color: rgba(255, 150, 70, 0.5); background: rgba(120, 56, 24, 0.5); }
.ctrl-btn--fire:hover { background: rgba(150, 72, 30, 0.62); }
.ctrl-btn--fire:disabled { opacity: 0.4; cursor: default; transform: none; }
.ctrl-btn:disabled { pointer-events: none; }

.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(232, 206, 180, 0.42);
  white-space: nowrap; font-family: var(--font); text-shadow: 0 1px 8px rgba(0,0,0,0.85);
}
.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(248, 232, 216, 0.95); border-bottom-color: rgba(232, 206, 180, 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.18em; text-transform: uppercase;
  color: rgba(232, 206, 180, 0.4); pointer-events: none; z-index: 10; white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0,0,0,0.85); transition: opacity .6s;
}
.hint.is-hidden { opacity: 0; }

@media (max-width: 600px) {
  .hint { font-size: 0.58rem; white-space: normal; text-align: center; width: 84%; }
}
