@charset "UTF-8";
:root {
  --ink: #16171a;
  --paper: #eee6d6;
  --accent: #d94f3d;
  --accent2: #3d7fd9;
  --accent3: #e0c23d;
  --panel: #201f1c;
  --panel-light: #2c2a25;
  font-family: 'Arial Black', Impact, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: #0d0d0f; color: var(--paper); overflow: hidden; }
button { font-family: inherit; }

#app-root { position: relative; width: 100vw; height: 100vh; }

.view { position: absolute; inset: 0; display: none; }
.view.active { display: block; }

/* ---------- top bar (both modes) ---------- */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 56px;
  background: linear-gradient(180deg, #1a1917, #100f0e 90%);
  border-bottom: 3px solid var(--accent);
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  z-index: 20;
}
.topbar .logo {
  font-style: italic; font-weight: 900; letter-spacing: 1px;
  font-size: 22px; color: var(--accent3); text-shadow: 2px 2px 0 #000;
  transform: skew(-8deg);
}
.topbar .spacer { flex: 1; }
.topbar button {
  background: var(--accent); color: #fff; border: 2px solid #000; border-radius: 3px;
  padding: 9px 16px; font-weight: 900; letter-spacing: 0.5px; cursor: pointer;
  text-transform: uppercase; font-size: 13px; box-shadow: 2px 2px 0 #000;
}
.topbar button:hover { filter: brightness(1.15); }
.topbar button:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 #000; }
.topbar button.secondary { background: var(--accent2); }
.topbar button.ghost { background: transparent; border-color: #665; color: #ccc; box-shadow: none; }

/* ---------- build mode ---------- */
#build-view .stage { position: absolute; inset: 56px 0 0 0; display: flex; }
#palette {
  width: 216px; flex: 0 0 216px; background: var(--panel);
  border-right: 3px solid #000; overflow-y: auto; padding: 10px 8px 90px;
}
#palette h3 { font-size: 11px; letter-spacing: 1px; color: #999; margin: 10px 4px 6px; text-transform: uppercase; }
.piece-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 6px;
  background: var(--panel-light); border: 2px solid #000; border-radius: 4px;
  padding: 8px; color: var(--paper); cursor: pointer; text-align: left; font-size: 12px;
}
.piece-btn .swatch { width: 26px; height: 26px; border-radius: 3px; border: 2px solid #000; flex: 0 0 auto; }
.piece-btn.selected { outline: 3px solid var(--accent3); }
.piece-btn:hover { background: #3a372f; }
#field-wrap { position: relative; flex: 1; }
#field-wrap canvas { display: block; width: 100%; height: 100%; }
.build-hint {
  position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,0.6);
  padding: 8px 12px; border-radius: 4px; font-size: 12px; color: #ddd; max-width: 420px;
  border: 1px solid #444;
}

/* ---------- skate mode ---------- */
#skate-view canvas { display: block; width: 100%; height: 100%; }
.hud-top-left {
  position: absolute; top: 66px; left: 14px; z-index: 15; pointer-events: none;
  text-shadow: 2px 2px 0 #000;
}
.hud-trick { font-size: 20px; font-weight: 900; color: var(--accent3); min-height: 26px; }
.hud-score { font-size: 13px; color: #fff; opacity: 0.9; }
.hud-combo { font-size: 13px; color: var(--accent); }
.skate-hint {
  position: absolute; left: 14px; bottom: 14px; background: rgba(0,0,0,0.55);
  padding: 8px 12px; border-radius: 4px; font-size: 11.5px; color: #ddd; line-height: 1.5;
  border: 1px solid #444; z-index: 15;
}
.skate-hint b { color: var(--accent3); }
.bail-banner {
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%);
  font-size: 42px; font-weight: 900; font-style: italic; color: var(--accent);
  text-shadow: 3px 3px 0 #000; opacity: 0; pointer-events: none; z-index: 16;
  transition: opacity 0.15s;
}
.bail-banner.show { opacity: 1; }

/* ---------- music player device ---------- */
#music-root { position: absolute; right: 12px; bottom: 12px; z-index: 30; }
.mp-device {
  width: 300px; background: linear-gradient(160deg, #d8d2c2, #b8b09c);
  border: 3px solid #2a2a2a; border-radius: 14px; padding: 10px 12px 8px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.5), inset 0 0 0 2px rgba(255,255,255,0.25);
}
.mp-brand { font-size: 11px; font-weight: 900; letter-spacing: 2px; color: #443; margin-bottom: 4px; }
.mp-brand span { color: var(--accent); }
.mp-body { display: flex; gap: 10px; }
.mp-disc-window {
  width: 62px; height: 62px; border-radius: 50%; background: #111;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  border: 3px solid #333; box-shadow: inset 0 0 8px #000;
}
.mp-disc {
  width: 50px; height: 50px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, #8892a0 0deg 6deg, #b7c2d1 6deg 12deg);
  display: flex; align-items: center; justify-content: center;
}
.mp-disc.spinning { animation: mp-spin 1.6s linear infinite; }
.mp-disc-hole { width: 12px; height: 12px; border-radius: 50%; background: #1a1a1a; }
@keyframes mp-spin { to { transform: rotate(360deg); } }
.mp-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mp-lcd {
  background: #92a86b; border: 2px solid #333; border-radius: 3px; padding: 4px 6px;
  font-family: 'Courier New', monospace; color: #142006;
}
.mp-lcd-row1 { display: flex; justify-content: space-between; font-size: 10px; font-weight: bold; }
.mp-eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; }
.mp-eq i { width: 3px; height: 20%; background: #142006; display: block; }
.mp-marquee-wrap { overflow: hidden; white-space: nowrap; height: 15px; margin: 2px 0; }
.mp-marquee { display: inline-block; font-size: 11px; font-weight: bold; }
.mp-marquee.scrolling { animation: mp-marquee 7s linear infinite; padding-left: 100%; }
@keyframes mp-marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.mp-lcd-row2 { display: flex; align-items: center; gap: 6px; font-size: 9px; }
.mp-progress { flex: 1; height: 5px; background: #6f8151; border-radius: 3px; overflow: hidden; }
.mp-progress-fill { height: 100%; background: #142006; width: 0%; }
.mp-controls { display: flex; align-items: center; gap: 6px; }
.mp-btn {
  background: #333; color: #eee; border: 2px solid #111; border-radius: 50%;
  width: 26px; height: 26px; cursor: pointer; font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.mp-btn-play { width: 30px; height: 30px; background: var(--accent); }
.mp-btn:hover { filter: brightness(1.2); }
.mp-vol { width: 64px; accent-color: var(--accent); }
.mp-hint { margin-top: 6px; font-size: 9px; color: #554; letter-spacing: 0.5px; }

.err-toast {
  position: fixed; top: 62px; right: 14px; background: #4a1414; border: 2px solid var(--accent);
  color: #fff; padding: 8px 12px; border-radius: 4px; font-size: 12px; z-index: 999; max-width: 320px;
}
