@font-face { font-family: Barlow; src: url(/Barlow-Regular.ttf); font-display: swap; }
@font-face { font-family: Rajdhani; src: url(/Rajdhani-SemiBold.ttf); font-weight: 600; font-display: swap; }

:root { color-scheme: dark; --ink: #eef3f2; --muted: #8fa3a8; --line: #2c4a50; --accent: #82e0b5; --panel: rgba(6, 12, 14, 0.92); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #070b0e; color: var(--ink); font: 15px/1.45 Barlow, system-ui, sans-serif; }
body { display: flex; flex-direction: column; overflow: hidden; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: #0b1215; }
.identity { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.identity strong { font: 600 18px Rajdhani, sans-serif; letter-spacing: 0.08em; }
.identity span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: 8px; }

button, .button, select { font: 600 15px Rajdhani, sans-serif; letter-spacing: 0.04em; color: var(--ink); background: #0f1a1d; border: 1px solid #3b6f78; border-radius: 6px; min-height: 40px; padding: 0 14px; text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
button:hover, .button:hover { background: #16262a; }
button:focus-visible, .button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: 0.6; cursor: progress; }

main { position: relative; flex: 1; min-height: 0; }
canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }

.loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: radial-gradient(circle at 50% 35%, #132227, #070b0e 70%); }
.loading[hidden] { display: none; }
.loading h1 { margin: 0; font: 600 40px Rajdhani, sans-serif; letter-spacing: 0.06em; }
.lede { max-width: 520px; margin: 0; color: #cfd8da; }
.picker { display: flex; align-items: center; gap: 10px; color: var(--muted); }
#start { min-height: 48px; padding: 0 28px; font-size: 18px; border-color: var(--accent); }
progress { width: min(320px, 80vw); accent-color: var(--accent); }
#status { margin: 0; color: var(--muted); max-width: 520px; }
.fine { margin: 0; color: #62757a; font-size: 13px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 16px; border-radius: 6px; background: var(--panel); border: 1px solid #3b6f78; }

@media (max-width: 520px) {
  .identity span { display: none; }
  .actions .button { display: none; }
}
@media (max-height: 460px) {
  .toolbar { padding-top: 4px; padding-bottom: 4px; }
  button, .button { min-height: 34px; }
  .loading { gap: 8px; }
  .loading img, .fine { display: none; }
  .loading h1 { font-size: 30px; }
}
