/*
 * Same look as the main Songblox site: the design tokens below are copied from app/globals.css, and
 * inter-latin.woff2 is the exact Inter file the main site serves. Dark mode is the .dark class on <html>,
 * like the main site's theme toggle (see theme.js).
 */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --background: oklch(0.9842 0.0034 247.8575);
  --foreground: oklch(0.2795 0.0368 260.031);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.2795 0.0368 260.031);
  --primary: oklch(0 0 0);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.9276 0.0058 264.5313);
  --secondary-foreground: oklch(0.3729 0.0306 259.7328);
  --muted: oklch(0.967 0.0029 264.5419);
  --muted-foreground: oklch(0.551 0.0234 264.3637);
  --accent: oklch(0.9299 0.0334 272.7879);
  --accent-foreground: oklch(0.3729 0.0306 259.7328);
  --destructive: oklch(0.6368 0.2078 25.3313);
  --border: oklch(0.8717 0.0093 258.3382);
  --input: oklch(0.8717 0.0093 258.3382);
  --ring: oklch(0.5854 0.2041 277.1173);
  --ok: oklch(0.62 0.17 150);
  --warn: oklch(0.75 0.16 75);
  --radius: 0rem;
  --shadow-sm: 0px 4px 12px -1px hsl(0 0% 10.1961% / 0.34), 0px 1px 2px -2px hsl(0 0% 10.1961% / 0.34);
  --font-sans: Inter, sans-serif;
}

.dark {
  --background: oklch(0.1448 0 0);
  --foreground: oklch(0.9288 0.0126 255.5078);
  --card: oklch(0.1496 0 0);
  --card-foreground: oklch(0.9288 0.0126 255.5078);
  --primary: oklch(1 0 0);
  --primary-foreground: oklch(0.1543 0 0);
  --secondary: oklch(0.2768 0 0);
  --secondary-foreground: oklch(0.8027 0.0143 258.3509);
  --muted: oklch(0.1684 0 0);
  --muted-foreground: oklch(0.7137 0.0192 261.3246);
  --accent: oklch(0.9796 0.0158 73.6841);
  --accent-foreground: oklch(0.1536 0.0027 248.0045);
  --border: oklch(0.4461 0.0263 256.8018);
  --input: oklch(0.4461 0.0263 256.8018);
  --ring: oklch(0.6801 0.1583 276.9349);
  --shadow-sm: 0px 4px 12px -1px hsl(0 0% 10.1961% / 0.85), 0px 1px 2px -2px hsl(0 0% 10.1961% / 0.85);
}

* {
  box-sizing: border-box;
  border-color: var(--border);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans), system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

/* top bar */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.brand {
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.theme {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme svg {
  width: 1rem;
  height: 1rem;
}

/* same switch as the main site's ThemeToggle */
.switch {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 9999px;
  background: var(--input);
  cursor: pointer;
  transition: background-color 0.15s;
}

.switch[aria-checked="true"] {
  background: var(--primary);
}

.switch .thumb {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: var(--background);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}

.switch[aria-checked="true"] .thumb {
  transform: translateX(1.25rem);
}

/* page */
.container {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: 4rem 1rem;
}

.intro {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  margin: 0 0 1rem;
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 700;
}

p {
  margin: 0;
}

.muted {
  color: var(--muted-foreground);
}

.small {
  font-size: 0.875rem;
}

.center {
  text-align: center;
}

.stack > * + * {
  margin-top: 1rem;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* shadcn Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: max(calc(var(--radius) - 2px), 0px);
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s;
}

.btn:hover {
  background: color-mix(in oklab, var(--primary) 90%, transparent);
}

.btn:focus-visible,
.switch:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.btn svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  pointer-events: none;
}

.btn-lg {
  height: 2.75rem;
  padding: 0 2rem;
}

.btn-block {
  width: 100%;
}

.btn-outline {
  border: 1px solid var(--input);
  background: var(--background);
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

/* shadcn card */
.card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-sm);
}

.notice {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: max(calc(var(--radius) - 2px), 0px);
  font-size: 0.875rem;
}

.notice.destructive {
  border-color: color-mix(in oklab, var(--destructive) 20%, transparent);
  background: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  background: var(--muted-foreground);
  flex: none;
}

.dot[data-state="ok"] {
  background: var(--ok);
}

.dot[data-state="warn"] {
  background: var(--warn);
}

.dot[data-state="bad"] {
  background: var(--destructive);
}

/* now playing */
.now {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cover {
  width: 5rem;
  height: 5rem;
  flex: none;
  object-fit: cover;
  background: var(--secondary);
}

.now-text {
  min-width: 0;
}

.now-text strong {
  display: block;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.progress {
  height: 0.25rem;
  background: var(--secondary);
}

.progress > div {
  height: 100%;
  width: 0;
  background: var(--primary);
}

.controls {
  display: flex;
  gap: 0.5rem;
}

.controls .btn {
  flex: 1;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* shadcn Input; the code field is centred and spaced out so it is easy to read and check */
.input {
  display: block;
  width: 100%;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: max(calc(var(--radius) - 2px), 0px);
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 0.875rem;
}

.input::placeholder {
  color: var(--muted-foreground);
}

.input:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.input.code {
  height: 3rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}
