/* ── app.css — SLAPPY HOUR, 2003 called and wants its UI back ───────────── */
@import url("assets/fonts/fonts.css");

:root {
  --ink: #17191d;
  --paper: #f3efe6;
  --asphalt: #14161a;
  --acc: #ffb52e;       /* safety orange */
  --teal: #1fb59b;
  --pink: #ff5fa2;
  --sticker: rgba(20, 22, 26, 0.82);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  background: var(--asphalt);
  color: var(--paper);
  user-select: none;
  -webkit-user-select: none;
}
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; }

.hidden { display: none !important; }

/* ── top bar ─────────────────────────────────────────────────────────────── */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; z-index: 20;
  background: linear-gradient(180deg, rgba(13, 14, 17, 0.92), rgba(13, 14, 17, 0.55) 80%, transparent);
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }
.logo { display: flex; flex-direction: column; line-height: 1; transform: rotate(-1.2deg); }
.logo-main {
  font-weight: 800; font-style: italic; font-size: 34px; letter-spacing: 1px;
  color: var(--paper);
  text-shadow: 3px 3px 0 var(--ink), 5px 5px 0 rgba(255, 181, 46, 0.55);
}
.logo-main .logo-accent { color: var(--acc); }
.logo-sub {
  margin-top: 4px; font-size: 11.5px; font-weight: 600; letter-spacing: 2.6px;
  color: #c9c2b2;
}
.top-actions { display: flex; gap: 10px; align-items: center; }

.tb-btn {
  font-family: inherit; font-weight: 800; font-style: italic;
  font-size: 17px; letter-spacing: 1.2px;
  color: var(--ink); background: var(--paper);
  border: 3px solid var(--ink);
  padding: 8px 16px 7px; cursor: pointer;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
  transform: rotate(-0.6deg);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.08s;
}
.tb-btn:hover { transform: rotate(-0.6deg) translate(-1px, -1px); box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5); }
.tb-btn:active { transform: rotate(-0.6deg) translate(2px, 2px); box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4); }
.tb-btn.big { background: var(--acc); font-size: 20px; padding: 10px 22px 9px; }
.tb-btn.ghost { background: transparent; color: var(--paper); border-color: #6b6f76; box-shadow: none; }
.tb-btn.ghost:hover { border-color: var(--paper); }

#share-note {
  font-size: 13px; color: var(--teal); font-weight: 700; letter-spacing: 1px;
  opacity: 0; transition: opacity 0.3s; max-width: 150px;
}
#share-note.show { opacity: 1; }

#rot-indicator {
  font-weight: 800; font-style: italic; font-size: 16px; color: var(--teal);
  letter-spacing: 1px; opacity: 0; min-width: 70px; text-align: right;
}
#rot-indicator.pulse { animation: rotpulse 0.7s ease; }
@keyframes rotpulse { 0% { opacity: 1; transform: scale(1.25); } 100% { opacity: 0; } }

/* ── palette ─────────────────────────────────────────────────────────────── */
#palette-wrap {
  position: fixed; left: 0; top: 64px; bottom: 0; width: 230px; z-index: 15;
  display: flex; flex-direction: column;
  background: linear-gradient(90deg, rgba(13, 14, 17, 0.93), rgba(13, 14, 17, 0.82));
  border-right: 2px solid rgba(255, 181, 46, 0.25);
  padding: 12px 10px 10px;
}
.pal-head {
  font-weight: 800; font-style: italic; font-size: 15px; letter-spacing: 3px;
  color: var(--acc); margin-bottom: 8px;
  border-bottom: 2px dashed rgba(255, 181, 46, 0.35); padding-bottom: 6px;
}
#palette { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding-right: 4px; }
#palette::-webkit-scrollbar { width: 8px; }
#palette::-webkit-scrollbar-thumb { background: #3a3e46; border-radius: 4px; }
.pal-item {
  display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto;
  gap: 0 10px; align-items: center; text-align: left;
  background: rgba(30, 33, 39, 0.85);
  border: 2px solid transparent; outline: 2px solid rgba(255, 255, 255, 0.06);
  cursor: pointer; padding: 5px 6px; color: var(--paper);
  font-family: inherit;
  transform: rotate(-0.4deg);
  transition: border-color 0.1s, transform 0.1s;
}
.pal-item:nth-child(2n) { transform: rotate(0.4deg); }
.pal-item:hover { border-color: #6b6f76; }
.pal-item.sel { border-color: var(--teal); background: rgba(28, 62, 55, 0.9); }
.pal-preview {
  grid-row: 1 / 3; width: 54px; height: 54px; border-radius: 3px;
  background-color: #2a2d33; background-size: cover; border: 1px solid #000;
}
.pal-name { font-weight: 800; font-size: 16.5px; letter-spacing: 0.5px; line-height: 1.05; }
.pal-meta { font-size: 11.5px; color: #a29b8a; font-weight: 500; letter-spacing: 0.4px; }
.pal-foot {
  border-top: 2px dashed rgba(255, 255, 255, 0.14); padding-top: 8px; margin-top: 8px;
  font-size: 12px; color: #a29b8a; display: flex; flex-direction: column; gap: 3px;
}
#piece-count { font-weight: 800; color: var(--paper); letter-spacing: 1px; font-size: 14px; }

/* ── hint bars ───────────────────────────────────────────────────────────── */
.hint-bar {
  position: fixed; bottom: 14px; left: 244px; right: 320px; z-index: 14;
  text-align: center; font-size: 14.5px; font-weight: 600; letter-spacing: 0.8px;
  color: #e7e0d0; background: rgba(13, 14, 17, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  padding: 7px 14px; pointer-events: none;
}
.hint-bar b { color: var(--acc); font-weight: 800; }
.hint-bar .acc { color: var(--acc); font-weight: 800; }

.hint-card {
  position: fixed; left: 18px; bottom: 18px; z-index: 14;
  background: var(--sticker); border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.4);
  transform: rotate(-0.8deg);
  padding: 10px 14px; max-width: 560px;
  transition: opacity 0.6s;
}
.hint-card.faded { opacity: 0.25; }
.hint-card:hover { opacity: 1; }
.hc-title { font-weight: 800; font-style: italic; letter-spacing: 3px; color: var(--acc); font-size: 14px; margin-bottom: 6px; }
.hc-cols { display: flex; gap: 22px; font-size: 14.5px; line-height: 1.65; color: #e7e0d0; }
.hc-cols b { color: var(--teal); font-weight: 800; }
.hc-foot { margin-top: 6px; font-family: "Permanent Marker", cursive; font-size: 13px; color: var(--pink); }

/* ── tricks hud ──────────────────────────────────────────────────────────── */
#hud-tricks {
  position: fixed; top: 86px; left: 246px; z-index: 13;
  display: flex; flex-direction: column; gap: 4px; pointer-events: none;
  font-style: italic; font-weight: 800;
}
.combo-line { display: flex; align-items: baseline; gap: 10px; }
.combo-pts {
  font-size: 42px; color: var(--acc);
  text-shadow: 3px 3px 0 var(--ink);
}
.combo-names { font-size: 19px; color: var(--paper); text-shadow: 2px 2px 0 var(--ink); max-width: 420px; }
.feed-line { font-size: 24px; color: var(--teal); text-shadow: 2px 2px 0 var(--ink); letter-spacing: 0.5px; }
.feed-line.bail { color: var(--pink); font-family: "Permanent Marker", cursive; font-style: normal; }

/* speed readout (skate mode) */
#hud-speed {
  display: none; position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%) rotate(-0.5deg);
  z-index: 13; pointer-events: none; align-items: baseline; gap: 7px;
  font-style: italic; font-weight: 800;
  background: rgba(13, 14, 17, 0.78); border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px 14px;
}
body.skate #hud-speed { display: flex; }
#spd-num { font-size: 30px; color: var(--paper); text-shadow: 2px 2px 0 var(--ink); min-width: 44px; text-align: right; }
.spd-unit { font-size: 12px; letter-spacing: 2px; color: #a29b8a; }
#spd-state {
  font-size: 14px; letter-spacing: 2px; color: var(--acc); margin-left: 6px; min-width: 70px;
}

#fisheye-tag {
  display: none; position: fixed; top: 86px; right: 22px; z-index: 13;
  font-weight: 800; font-style: italic; color: var(--pink);
  letter-spacing: 2px; text-shadow: 2px 2px 0 var(--ink);
  border: 2px solid var(--pink); padding: 3px 10px; transform: rotate(2deg);
  background: rgba(13, 14, 17, 0.6);
}

/* mode visibility */
body.build #skate-actions { display: none; }
body.skate #build-actions { display: none; }
body.skate #palette-wrap { display: none; }
body.skate #hud-hint-build { display: none; }

/* ── the SKIPMAN SK-2003 ─────────────────────────────────────────────────── */
#discman {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  width: 296px;
  background: linear-gradient(160deg, #d7dee5 0%, #aeb9c3 45%, #97a5b1 100%);
  border-radius: 18px 22px 14px 16px;
  border: 2px solid #6d7781;
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.7), inset 0 -3px 5px rgba(30, 40, 50, 0.35),
    0 10px 24px rgba(0, 0, 0, 0.5);
  padding: 10px 10px 7px;
  transform: rotate(-1.1deg);
  font-family: "Barlow Condensed", sans-serif;
}
#discman::before {  /* screw + corner detail */
  content: ""; position: absolute; top: 9px; left: 12px; width: 7px; height: 7px;
  border-radius: 50%; background: radial-gradient(circle at 35% 35%, #e8edf1, #7b8791);
  box-shadow: 264px 0 0 #93a0ab;
}
.dm-head { display: flex; gap: 9px; }

.dm-discwrap {
  width: 86px; height: 86px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #39424b 0 30%, #232a31 31% 100%);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.7), inset 0 -1px 2px rgba(255, 255, 255, 0.25);
  display: flex; align-items: center; justify-content: center;
}
.dm-disc {
  width: 76px; height: 76px; border-radius: 50%; position: relative;
  background:
    radial-gradient(circle at 50% 50%, #cfd6da 0 13%, #1d2f3f 14% 15%, transparent 16%),
    conic-gradient(from 0deg,
      #9fb6c9 0deg, #7595ad 30deg, #b9cddb 60deg, #6d8ca6 105deg,
      #a8c0d2 150deg, #7fa0b8 200deg, #b4cbda 250deg, #6f90aa 300deg, #9fb6c9 360deg);
  animation: dmspin 1.8s linear infinite;
  animation-play-state: paused;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}
@keyframes dmspin { to { transform: rotate(360deg); } }
.dm-hub {
  position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f2f5f7, #aab6bf 70%);
  border: 2px solid #7d8a94;
}
.dm-hub::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 8px; height: 8px;
  border-radius: 50%; background: #2c353d;
}

.dm-lcd {
  flex: 1; min-width: 0;
  background: linear-gradient(170deg, #12303c, #0a1c26);
  border-radius: 6px; border: 2px solid #454f58;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.5);
  padding: 5px 8px 6px;
  color: #5df0c4;
  text-shadow: 0 0 5px rgba(93, 240, 196, 0.65);
  overflow: hidden;
}
.dm-top { display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 700; letter-spacing: 1px; color: #7de8c8; }
.dm-esp { color: #ffb52e; text-shadow: 0 0 6px rgba(255, 181, 46, 0.8); opacity: 0.25; transition: opacity 0.2s; }
.dm-esp.on { opacity: 1; }
.dm-titlewindow { overflow: hidden; white-space: nowrap; height: 19px; margin-top: 2px; }
.dm-title {
  display: inline-block; font-size: 15px; font-weight: 700; letter-spacing: 0.6px;
  animation: dmscroll 9s linear infinite;
  padding-right: 60px;
}
@keyframes dmscroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.dm-mid { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 3px; }
.dm-eq { display: flex; gap: 2px; align-items: flex-end; height: 15px; }
.dm-eq i {
  width: 4.5px; height: 15px; background: #2fae93; transform: scaleY(0.1); transform-origin: bottom;
  box-shadow: 0 0 4px rgba(47, 174, 147, 0.7);
}
.dm-status { font-size: 10.5px; font-weight: 800; letter-spacing: 1.4px; color: #ffd98a; text-shadow: 0 0 5px rgba(255, 217, 138, 0.5); }
.dm-progrow { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.dm-prog { flex: 1; height: 5px; background: #0b2430; border-radius: 3px; overflow: hidden; box-shadow: inset 0 1px 2px #000; }
.dm-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #2fae93, #5df0c4); }
.dm-time { font-size: 10.5px; font-weight: 700; color: #7de8c8; min-width: 62px; text-align: right; }

#discman.empty .dm-lcd { color: #6c7a84; text-shadow: none; }
#discman.empty .dm-disc { animation: none; filter: saturate(0.25) brightness(0.8); }
#discman.empty .dm-status { color: #ff7d7d; }

.dm-controls { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.dm-btn {
  font-family: inherit; font-size: 13px; font-weight: 800; letter-spacing: 0.5px;
  color: #26313a; background: linear-gradient(180deg, #f4f7f9, #c2ccd4);
  border: 1.5px solid #6d7781; border-radius: 10px;
  padding: 6px 10px; cursor: pointer;
  box-shadow: 0 3px 0 #6d7781, inset 0 1px 0 #fff;
  transition: transform 0.05s, box-shadow 0.05s;
}
.dm-btn:hover { filter: brightness(1.06); }
.dm-btn:active, .dm-btn.pressed { transform: translateY(2px); box-shadow: 0 1px 0 #6d7781, inset 0 1px 0 #fff; }
.dm-play { background: linear-gradient(180deg, #ffe2ae, #ffb52e); padding: 6px 16px; }
.dm-side { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.dm-venv { display: flex; gap: 4px; }
.dm-mini {
  font-family: inherit; font-size: 10px; font-weight: 800; color: #3c4854;
  background: #b7c2cb; border: 1px solid #6d7781; border-radius: 6px;
  padding: 3px 6px; cursor: pointer;
}
.dm-mini:hover { background: #c9d3da; }
.dm-vol { display: flex; align-items: center; gap: 4px; }
.dm-volrange { width: 64px; accent-color: #ffb52e; height: 14px; cursor: pointer; }
.dm-vollabel { font-size: 9.5px; font-weight: 800; letter-spacing: 1.5px; color: #55616c; }
.dm-brand {
  margin-top: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: 1.6px; color: #5b6772;
  display: flex; align-items: center; gap: 4px;
}
.dm-brand span { color: #33434f; font-weight: 800; font-size: 11px; letter-spacing: 2.4px; }
.dm-holdbadge { color: #8a97a2; font-weight: 800; }

/* ── gl failure banner ───────────────────────────────────────────────────── */
#glfail {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: #2a0d12; color: #ffd7d7; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; text-align: center; padding: 40px;
  border: 6px solid #ff4d5e;
}
