/* ── official fonts ───────────────────────────────────────────────────── */
@font-face {
  font-family: "Geeeki";
  src: url("fonts/Geeeki.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Astrovans";
  src: url("fonts/Astrovans-Font/Astrovans.otf") format("opentype"),
       url("fonts/Astrovans-Font/Astrovans.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── design tokens: matched to localfrequency.mindbase.ca ──────────────── */
:root {
  --cream: #FBF3E7;
  --cream-soft: #F3E8D8;
  --ink: #2A2320;
  --ink-soft: #5C534C;
  --red: #C0281A;
  --red-dark: #9A1F14;
  --orange: #E8A855;
  --peach: #F2C879;
  --peach-soft: #F6D9A0;
  --surface: var(--cream);

  --shadow-soft: rgba(42, 35, 32, 0.12);
  --shadow-glow: rgba(154, 31, 20, 0.28);

  --font-display: "Geeeki", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Geeeki", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-accent: "Astrovans", Georgia, serif;
}

[data-theme="dark"] {
  --cream: #121113;
  --cream-soft: #1C1A1E;
  --ink: #F4F0E9;
  --ink-soft: #ADA79E;
  --red: #C6F135;
  --red-dark: #A9CE2A;
  --orange: #A97C94;
  --peach: #C9A3B5;
  --peach-soft: #D9BFCB;
  --surface: #1C1A1E;
  --shadow-soft: rgba(0, 0, 0, 0.45);
  --shadow-glow: rgba(198, 241, 53, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  padding: 6vh 24px 40px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  transition: background .2s ease, color .2s ease;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.theme-toggle {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: none;
  border: 2px solid var(--peach-soft);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .18s ease, transform .18s ease;
}
.theme-toggle:hover { background: var(--surface); transform: translateY(-2px); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: .01em;
  text-align: center;
}
h2#trackTitle {
  margin: 0;
  font-family: var(--font-display);
  /* ~4px below the h1 across the clamp range */
  font-size: clamp(18px, 4.3vw, 26px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: .01em;
  text-align: center;
}
.hint {
  margin: 0;
  font-family: var(--font-accent);
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  max-width: 340px;
  letter-spacing: .02em;
}

/* ── turntable: record + round start/stop button ───────────────────────── */
.turntable { width: min(80vw, 400px); position: relative; }

/* dark mode: soft green gradient glow radiating all around the record */
[data-theme="dark"] .turntable::after {
  content: "";
  position: absolute;
  inset: -7%;
  border-radius: 50%;
  background: radial-gradient(circle at center,
              rgba(198, 241, 53, 0) 42%,
              rgba(198, 241, 53, 0.6) 51%,
              rgba(198, 241, 53, 0.28) 60%,
              rgba(198, 241, 53, 0) 70%);
  filter: blur(14px);
  z-index: -1;
  pointer-events: none;
}

#record_svg {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
  user-select: none;
  touch-action: none;                 /* let us drag/scratch without page scroll */
  /* white ring in both themes so the record edge reads cleanly */
  box-sizing: content-box;
  border: 1px solid #F4F0E9;
  border-radius: 50%;
  filter: drop-shadow(0 20px 40px var(--shadow-soft));
}
#record_svg.grabbing { cursor: grabbing; }
#record_svg image { -webkit-user-drag: none; user-select: none; }

/* record label takes the theme accent: red in light, green in dark */
#labelDisc { fill: var(--red); }
#labelRing { stroke: var(--red-dark); }

.deck {
  width: min(80vw, 400px);
  margin-top: -10px;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
}

.deck-btn {
  width: clamp(58px, 15vw, 70px);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  border-radius: 10px;
  background: var(--red);
  color: var(--cream);
  box-shadow: 0 10px 24px var(--shadow-glow);
  font-family: var(--font-body);
  cursor: pointer;
  touch-action: manipulation;
  transition: background .18s ease, transform .18s ease;
}
.deck-btn:disabled { opacity: .55; cursor: default; box-shadow: none; }
.deck-btn.is-playing { background: var(--red-dark); }
.deck-btn:not(:disabled):hover { transform: translateY(-2px); }
.deck-btn .t {
  display: inline-flex;
  align-items: baseline;
  font-family: Arial, Helvetica, sans-serif;   /* real tabular digits — no wobble */
  font-weight: 700;
  font-size: clamp(12px, 3.1vw, 14px);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  line-height: 1;
}
.deck-btn .t-cs {
  font-size: 0.68em;      /* hundredths sit smaller than the M:SS */
  font-weight: 600;
  opacity: 0.6;
  margin-left: 0.5px;
}
.deck-btn .s {
  font-size: clamp(9px, 2.6vw, 11px);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .8;
  line-height: 1;
}

.deck-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  gap: 1px;
  line-height: 1.1;
}
.deck-name strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
}
.deck-name span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── link list + download ─────────────────────────────────────────────── */
.links {
  width: min(80vw, 400px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.link {
  display: block;
  width: 100%;
  padding: 12px 18px;
  border-radius: 8px;
  font-family: var(--font-accent);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--peach-soft);
  box-shadow: 0 2px 10px var(--shadow-soft);
  cursor: pointer;
  touch-action: manipulation;
  transition: background .18s ease, transform .18s ease, color .18s ease;
}
.link:hover { background: var(--cream-soft); transform: translateY(-2px); }
.link--download {
  margin-top: 6px;
  font-family: var(--font-body);
  color: var(--cream);
  background: var(--red);
  border: none;
  box-shadow: 0 10px 24px var(--shadow-glow);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.link--download:hover { background: var(--red-dark); color: var(--cream); }

/* ── passcode modal ───────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(42, 35, 32, 0.5);
  backdrop-filter: blur(3px);
}
.modal-backdrop[hidden], .toast[hidden] { display: none; }

.modal {
  width: 100%;
  max-width: 330px;
  text-align: center;
  background: var(--surface);
  color: var(--ink);
  border: 3px solid var(--peach-soft);
  border-radius: 18px;
  padding: 24px 22px;
  box-shadow: 0 14px 30px var(--shadow-glow);
}
.modal h2 {
  margin: 0 0 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  font-weight: 900;
}
.modal .sub { margin: 0 0 16px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: var(--ink-soft); }
.modal input {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
  letter-spacing: 2px;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--peach-soft);
  border-radius: 8px;
}
.modal input:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.modal-error {
  min-height: 16px;
  margin: 10px 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
}
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions button {
  flex: 1;
  padding: 12px 18px;
  border: none;
  border-radius: 4px;
  font: inherit;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--red);
  color: var(--cream);
  transition: background .18s ease, transform .18s ease;
}
.modal-actions button:hover { background: var(--red-dark); transform: translateY(-2px); }
.modal .ghost {
  background: transparent;
  color: var(--red);
  border: 2px solid var(--red);
}
.modal .ghost:hover { background: var(--red); color: var(--cream); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--red);
  color: var(--cream);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .02em;
  padding: 11px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 24px var(--shadow-glow);
}
