/* ===========================================================================
   333AUDIO - Retro OS Portfolio  ·  styles.css
   ===========================================================================
   THEME EVERYTHING FROM HERE:
     The :root block below holds every color + font. Change a value once and it
     updates across the whole site. --accent is reserved if you want a single
     pop color; the retro palette mostly uses the cream/pink/mint vars.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   FONTS (loaded from local files in /fonts)
   Download the .ttf files and drop them in a "fonts" folder next to
   index.html. Filenames must match the url() paths below (or edit the paths).
   --------------------------------------------------------------------------- */
/* ChiKareGo2 - UI / body text. Loaded from the onlinewebfonts CDN (needs an
   internet connection). To self-host instead, download the files and point
   these url()s at a local /fonts path. */
@font-face {
  font-family: "ChiKareGo2";
  src: url("https://db.onlinewebfonts.com/t/20879f289f178c7c99a7623b1bcda06f.woff2") format("woff2"),
       url("https://db.onlinewebfonts.com/t/20879f289f178c7c99a7623b1bcda06f.woff") format("woff"),
       url("https://db.onlinewebfonts.com/t/20879f289f178c7c99a7623b1bcda06f.ttf") format("truetype");
  font-display: swap;
}

/* Ishmeria - wordmarks / window titles (local files). */
@font-face {
  font-family: "Ishmeria";
  src: url("../fonts/ishmeria/Ishmeria.woff") format("woff"),
       url("../fonts/ishmeria/Ishmeria.ttf") format("truetype");
  font-display: swap;
}

/* Pixolde - optional pixel text (local file). */
@font-face {
  font-family: "Pixolde";
  src: url("../fonts/pixolde/Pixolde.ttf") format("truetype");
  font-display: swap;
}

:root {
  /* ---- COLORS (warm retro palette) -------------------------------------- */
  --bg:          #F4D3D4;   /* dusty pink desktop background (solid)       */
  --chrome:      rgba(249, 241, 233, 0.82);  /* window / dock / box face (slightly see-through) */
  --chrome-2:    rgba(222, 215, 196, 0.82);  /* slightly darker face for buttons */
  --ink:         #161616;   /* near-black text + outlines                  */
  --ink-soft:    #5a5a52;   /* dimmed text                                 */
  --line:        #000000;   /* hard outlines (the retro 1px black borders) */
  --hover:       rgba(255, 255, 255, 0.85);  /* button hover fill          */

  --mint:        rgba(185, 220, 207, 0.85);  /* play button face           */
  --pink:        rgba(232, 199, 199, 0.85);  /* shuffle button face        */
  --black-box:   #141414;   /* black tabs / corner box                     */
  --black-text:  #efe9da;   /* text on the black boxes                     */
  --screen:      #ccc7b8;   /* placeholder "video screen" background       */
  --live:        #d23b3b;   /* ON AIR / live red                           */

  --accent:      #d23b3b;   /* EDIT: one pop color (used sparingly)        */

  /* ---- TYPOGRAPHY (matches Poolsuite's font roles) ----------------------- */
  --font-display: "Ishmeria", Georgia, serif;             /* wordmarks/titles */
  --font-ui:      "ChiKareGo2", "Courier New", monospace; /* body + UI text   */
  --font-label:   system-ui, -apple-system, sans-serif;   /* dock labels      */

  /* ---- METRICS ---------------------------------------------------------- */
  --bar-h: 26px;            /* window title-bar height                     */
  --taskbar-h: 40px;        /* bottom taskbar height                       */
}

/* ---------------------------------------------------------------------------
   DARK THEME
   Applied when <html> has data-theme="dark" (toggled by the top-right switch).
   Light is the default. Only the colors change; layout stays identical.
   --------------------------------------------------------------------------- */
:root[data-theme="dark"] {
  --bg:          #211d29;   /* dark desktop background                     */
  --chrome:      rgba(56, 50, 63, 0.82);   /* window / box face (slightly see-through) */
  --chrome-2:    rgba(47, 41, 53, 0.82);   /* darker face for buttons       */
  --ink:         #ece7df;   /* light text + outlines                       */
  --ink-soft:    #9d978f;   /* dimmed text                                 */
  --line:        #d7d1c7;   /* light hairline outlines on dark chrome      */
  --hover:       #4a4450;   /* button hover fill                           */
  --black-box:   #efe9da;   /* corner tab inverts to stay high-contrast    */
  --black-text:  #141414;
  --screen:      #423c4a;   /* dark "video screen" placeholder             */
  --live:        #ff5b5b;   /* brighter red for dark background            */
}

/* ---------------------------------------------------------------------------
   RESET & BASE
   --------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--ink);
  background-color: var(--bg);   /* fallback behind the background video */
  overflow: hidden;
}

/* Looping desktop background video (covers the screen, sits behind everything). */
.desktop-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  pointer-events: none;
}

/* Darkening layer over the video. Increase the alpha for a darker desktop. */
.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

img { image-rendering: pixelated; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Reusable "beveled chrome" look: hard black outline + soft 3D inner edges. */
.bevel {
  border: 1px solid var(--line);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.65),
    inset -1px -1px 0 rgba(0, 0, 0, 0.18);
}


/* ===========================================================================
   BOOT / LOADING SCREEN
   =========================================================================== */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background-color: var(--bg);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.boot-hidden { opacity: 0; visibility: hidden; }

.boot-box {
  background: var(--chrome);
  padding: 34px 48px;
  text-align: center;
}

.boot-logo {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 1px;
}

.boot-tagline {
  margin: 10px 0 16px;
  color: var(--ink-soft);
  letter-spacing: 1px;
}

.boot-bar {
  width: 220px;
  height: 14px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
}

.boot-bar-fill {
  height: 100%;
  width: 0%;
  /* Blocky striped fill, like an old install progress bar. */
  background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 10px);
  animation: boot-fill 1.8s steps(20) forwards;
}

@keyframes boot-fill { from { width: 0%; } to { width: 100%; } }


/* ===========================================================================
   TOP BARS
   =========================================================================== */
.topbar-left,
.topbar-right {
  position: fixed;
  top: 10px;
  z-index: 800;
  display: flex;
  align-items: stretch;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 16px;            /* ChiKareGo2 is a pixel font: render at its
                                native 16px so it stays chunky + crisp, not
                                thin/blurry like it was at 12px */
  letter-spacing: 0;
}

.topbar-left  { left: 0; top: 0; gap: 0; }
.topbar-right { right: 14px; top: 12px; gap: 16px; }

/* Little black square in the very corner. */
.corner-tab {
  display: grid;
  place-items: center;
  width: 30px;
  background: var(--black-box);
  color: var(--black-text);
  border-left: none;
  border-top: none;
}

.member-box {
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 30px;
  background: var(--chrome);
  color: var(--ink);
  border-top: none;
}

.member-box:hover { background: #fff; }

.date-box,
.clock-box {
  display: flex;
  align-items: center;
  gap: 6px;
  /* borderless, no background - just the text/icons */
}

.clock-glyph { color: var(--live); }   /* red ring like the reference */

/* Dark / light toggle button (borderless, no background). */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ink);
}

.theme-toggle:hover { opacity: 0.6; }

/* Show the sun in light mode, the moon in dark mode. */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }


/* ===========================================================================
   DESKTOP
   =========================================================================== */
.desktop {
  position: fixed;
  inset: 0;
  bottom: var(--taskbar-h);     /* leave room for the taskbar */
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;              /* icons wrap into a new column if needed */
  align-content: flex-start;
  gap: 4px;
  padding: 14px;
}

/* Loose desktop icons (icon over label), light so they read on the video. */
.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 84px;
  padding: 8px 4px;
  background: transparent;
  color: #f4f0ea;
  cursor: pointer;
  border-radius: 4px;
}

.desk-icon:hover  { background: rgba(255, 255, 255, 0.14); }
.desk-link { text-decoration: none; }
.desk-icon:active { background: rgba(255, 255, 255, 0.22); }

.desk-glyph svg {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.desk-label {
  font-family: var(--font-ui);
  font-size: 15px;
  text-align: center;
  line-height: 1.1;
  color: #f4f0ea;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}


/* ===========================================================================
   TASKBAR  (Start button | open windows | tray)
   =========================================================================== */
.taskbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 900;
  height: var(--taskbar-h);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: var(--chrome);
  border-top: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 15px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.start-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 14px;
  font-weight: bold;
  color: var(--ink);
  background: var(--chrome-2);
  cursor: pointer;
}
.start-btn .start-glyph svg { width: 18px; height: 18px; display: block; }
.start-btn.open { box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.2); }   /* pressed */

/* Open-window buttons. */
.task-windows {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}

.task-win-btn {
  max-width: 180px;
  height: 30px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--ink);
  background: var(--chrome-2);
  border: 1px solid var(--line);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.6), inset -1px -1px 0 rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.task-win-btn:hover { background: var(--hover); }

.tray {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 30px;
  padding: 0 12px;
  background: var(--chrome);
}

/* ----- Start menu ---------------------------------------------------------- */
.start-menu {
  position: fixed;
  left: 6px;
  bottom: calc(var(--taskbar-h) + 4px);
  z-index: 950;
  width: 200px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  background: var(--chrome);
  border: 1px solid var(--line);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.start-menu[hidden] { display: none; }

.start-menu-head {
  font-family: var(--font-display);
  font-size: 16px;
  padding: 6px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.start-item {
  text-align: left;
  padding: 9px 12px;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}
.start-item:hover { background: var(--accent); color: #fff; }


/* ===========================================================================
   WINDOWS (shared chrome)
   =========================================================================== */
.window {
  position: fixed;
  top: 120px;
  left: 120px;
  display: none;                 /* hidden until opened */
  flex-direction: column;
  background: var(--chrome);
  border: 1px solid var(--line);
  border-radius: 10px;           /* rounded corners like the reference */
  overflow: hidden;              /* clip inner content to the rounded edge */
  /* Blur the video showing through the translucent chrome so text stays readable. */
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.window.open { display: flex; }

/* Title bar: controls left, wordmark right. Also the drag handle. */
.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--bar-h);
  padding: 0 8px;
  cursor: grab;
  user-select: none;
}

.title-bar:active { cursor: grabbing; }

.title-controls { display: flex; align-items: center; gap: 8px; }

.tb-btn {
  display: grid;
  place-items: center;
  width: 18px;
  height: 16px;
  font-size: 15px;
  line-height: 1;
  color: var(--ink);
}

.tb-btn[data-window-close]:hover { background: var(--ink); color: var(--chrome); }

.wordmark {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.5px;
}


/* ----- MEDIA PLAYER -------------------------------------------------------- */
.win-player { width: 700px; }

/* The big screen / video area. EDIT: put a <video> or <img> inside it. */
.player-screen {
  position: relative;
  aspect-ratio: 4 / 3;       /* classic 4:3 screen */
  margin: 6px;
  background: var(--screen);
  /* faint scanline + dither texture so the empty screen still reads "retro" */
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.06) 0 1px, transparent 1px 3px),
    radial-gradient(rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: auto, 3px 3px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.screen-logo {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: rgba(0, 0, 0, 0.22);
  letter-spacing: 3px;
  text-align: center;
  padding: 0 16px;
}

/* While playing, hide the "333" logo and show the visualizers instead. */
.player-screen.playing .screen-logo { display: none; }

/* Visualizer panel: top half = waveform, bottom half = two quarter meters.
   Sits above the screen texture and clears the filename bar at the bottom. */
.viz {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 30px;            /* clear the screen-bar */
  display: none;
  flex-direction: column;
  background: transparent;   /* see-through so the video shows underneath */
}

.player-screen.playing .viz { display: flex; }

/* While playing, clear the screen's fill/texture so the (translucent) window
   reveals the background video behind the visualizers. */
.player-screen.playing {
  background-color: transparent;
  background-image: none;
}

.viz-wave {
  width: 100%;
  height: 50%;
  display: block;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);   /* divider */
}

.viz-row { flex: 1; display: flex; min-height: 0; }

.viz-scope,
.viz-disc {
  width: 50%;
  height: 100%;
}

.viz-scope { display: block; border-right: 1px solid rgba(0, 0, 0, 0.18); }

/* Static / noise overlays the ENTIRE visualizer area. */
.viz .viz-static {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  opacity: 0.4;
  pointer-events: none;
}

/* Spinning record (bottom-right quarter). */
.viz-disc {
  display: grid;
  place-items: center;
  opacity: 0.5;
}

.disc-svg {
  width: 84%;
  height: 84%;
  transform-origin: 50% 50%;
  animation: disc-spin 4s linear infinite;
}

/* Freeze the record when paused, in sync with the other meters. */
.player-screen.paused .disc-svg { animation-play-state: paused; }

@keyframes disc-spin { to { transform: rotate(360deg); } }

.disc-line  { fill: none; stroke: var(--ink); stroke-width: 0.8; }
.disc-label { fill: rgba(0, 0, 0, 0.05); stroke: var(--ink); stroke-width: 0.8; }
.disc-hole  { fill: var(--ink); }
.disc-text  { fill: var(--ink); font-family: var(--font-display); font-size: 6px; letter-spacing: 0.4px; text-anchor: middle; }

.viz canvas { image-rendering: pixelated; opacity: 0.5; }   /* 50% see-through */

.viz { transition: opacity 0.2s ease; }

/* Clickable screen + paused state. */
.player-screen.playing { cursor: pointer; }

/* When paused, fade the frozen visualizer right down... */
.player-screen.paused .viz { opacity: 0.25; }

/* ...and show a big "||" pause badge centered on the screen. */
.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
}

.player-screen.paused .pause-overlay { display: flex; }

.pause-bar {
  width: 16px;
  height: 60px;
  background: var(--ink);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.55);   /* halo so it reads on any video */
}

/* ----- Attract / tune-in intro --------------------------------------------- */
/* In attract mode the screen shows the (idle) visualizers behind a gray scrim. */
.player-screen.attract { background-color: transparent; background-image: none; cursor: pointer; }
.player-screen.attract .screen-logo { display: none; }

.tune-in {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(120, 116, 110, 0.55);   /* gray-out scrim */
  cursor: pointer;
  text-align: center;
}

.player-screen.attract .tune-in { display: flex; }

.tune-in-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.tune-in-sub {
  display: block;
  margin-top: 8px;
  font-family: var(--font-ui);
  font-size: 1rem;
  letter-spacing: 0.5px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Pulsing red "live" dot. */
.tune-in-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--live);
  vertical-align: middle;
  animation: live-pulse 1.1s ease-in-out infinite;
}

@keyframes live-pulse { 50% { opacity: 0.25; } }

/* Filename / scrub strip along the bottom of the screen. */
.screen-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px;
  background: var(--chrome);
  border-top: 1px solid var(--line);
  font-size: 16px;
}

.screen-file { flex: 1; }
.screen-res  { color: var(--ink-soft); }

/* Now-playing strip. */
.now-playing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  margin: 0 6px;
  border-bottom: 1px solid var(--line);
}

.np-status { margin: 0; font-weight: bold; font-size: 18px; }
.np-track  { margin: 2px 0 0; color: var(--ink-soft); font-size: 17px; }
.dot-live  { color: var(--live); font-size: 12px; vertical-align: middle; }
.np-actions { display: flex; gap: 12px; color: var(--ink-soft); }

/* Transport row: status box (left) + button cluster (right). */
.transport {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px 6px;
}

.status-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--chrome-2);
  border: 1px solid var(--line);
  font-weight: bold;
  font-size: 18px;
}

.status-caret { color: var(--ink-soft); }

.controls {
  display: flex;
  align-items: stretch;
  background: var(--chrome-2);
}

.ctrl {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 42px;
  font-size: 16px;
  color: var(--ink);
  border-right: 1px solid var(--line);
}

.ctrl:last-child { border-right: none; }
.ctrl:hover  { background: var(--hover); }
.ctrl:active { box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.2); }

.ctrl-play    { min-width: 56px; background: var(--mint); }
.ctrl-shuffle { background: var(--pink); }

/* Channel + volume row. */
.channel-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 0 6px 8px;
}

.channel-box {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  background: var(--chrome);
  font-size: 16px;
}

.channel-live { font-weight: bold; }

.volume-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--chrome);
  width: 150px;
}

.volume-track {
  position: relative;
  flex: 1;
  height: 8px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

/* The filled (lit) portion of the volume bar; width set by JS. */
.volume-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px);
}

.drag-grip {
  width: 30px;
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,0.35) 0 2px, transparent 2px 4px),
    var(--chrome);
}


/* ----- FOLDER WINDOWS (Beats / Loops / Gallery) ---------------------------- */
.win-folder { width: 420px; }

.folder-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 14px;
}

.tile { margin: 0; text-align: center; }

.tile-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--screen);
  border: 1px solid var(--line);
}

.tile figcaption { margin-top: 6px; font-size: 17px; }

/* ----- Gallery polaroids --------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

/* Polaroid proportions: ~3.5in x 4.2in card, square 62mm photo, thick bottom
   strip for the date. */
.polaroid {
  margin: 0;
  background: #fbfbf6;
  padding: 8% 8% 0;                 /* even white border on top + sides */
  box-shadow: 1px 2px 7px rgba(0, 0, 0, 0.35);
}

.polaroid-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;             /* square photo */
  object-fit: cover;
  background: #e6e6e0;             /* shown while loading / if no image */
}

.polaroid-date {
  padding: 12px 4px 18px;          /* the thicker bottom strip */
  text-align: center;
  font-family: "Caveat", cursive;  /* handwritten date */
  font-size: 19px;
  color: #2a2a2a;
}


/* ----- Beats cassette player ----------------------------------------------- */
/* All colors are scoped here so the whole deck is easy to recolor / reskin. */
.win-cassette { width: 380px; }

.cassette {
  --cass-body:   #d6d6d6;     /* silver shell                              */
  --cass-body-2: #b8b8b8;
  --cass-edge:   #141414;     /* hard pixel outline                        */
  --cass-tape:   #1b1b1b;     /* dark tape window                          */
  --cass-lcd:    #c7ccbe;     /* greyish-green LCD                         */
  --cass-lcd-ink:#1a1f18;
  --cass-rec:    #8e2a25;     /* REC red                                   */
  --cass-btn:    #3a3a3a;     /* dark buttons                              */
  --cass-btn-2:  #242424;

  position: relative;
  padding: 14px;
}

/* Flame skin lives on a layer at the same opacity as the window chrome (0.82),
   so the deck is slightly see-through like the title bar. "contain" shows the
   whole flame artwork small + detailed. Swap the file to reskin the deck. */
.cassette::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0a0a0a url("../media/imgs/cassette-player-skins/cassette-flames-skin.png") bottom center / contain no-repeat;
  opacity: 0.82;
  image-rendering: pixelated;
  /* chunky Y2K bevel */
  box-shadow: inset 2px 2px 0 rgba(255,255,255,0.6), inset -2px -2px 0 rgba(0,0,0,0.35);
}

/* keep the deck contents above the translucent flame layer */
.cassette > * { position: relative; z-index: 1; }

/* --- cassette shell (LCD + tape window) --- */
.cass-shell {
  background: linear-gradient(#eee, #cfcfcf);
  border: 2px solid var(--cass-edge);
  padding: 8px;
}

.cass-lcd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  margin-bottom: 8px;
  background: var(--cass-lcd);
  border: 2px solid var(--cass-edge);
  color: var(--cass-lcd-ink);
  font-family: var(--font-ui);
  font-size: 15px;
}

.cass-side {
  flex: none;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: #e7eadf;
  border: 2px solid var(--cass-lcd-ink);
  font-weight: bold;
}

.cass-file {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.cass-elapsed { flex: none; font-variant-numeric: tabular-nums; }

/* tape window with the two reels */
.cass-tape {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  height: 96px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0 2px, transparent 2px 5px),
    var(--cass-tape);
  border: 2px solid var(--cass-edge);
  color: #cfcfcf;
  overflow: hidden;
}

/* Scope visualizer fills the tape window, behind the reels. */
.cass-scope {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.cass-tape .reel,
.cass-tape .cass-arrow { position: relative; z-index: 1; }

.reel {
  position: relative;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #555 0 26%, #2a2a2a 27% 100%);
  border: 2px solid #0c0c0c;
  /* spokes */
  box-shadow: inset 0 0 0 6px rgba(0,0,0,0.4);
}
.reel i {
  position: absolute; inset: 0;
  margin: auto;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #cdcdcd;
  border: 2px solid #0c0c0c;
}
/* simple spoke marks so rotation is visible */
.reel::before {
  content: "";
  position: absolute; inset: 6px;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, transparent 0 18deg, rgba(255,255,255,0.5) 18deg 22deg,
      transparent 22deg 108deg, rgba(255,255,255,0.5) 108deg 112deg,
      transparent 112deg 198deg, rgba(255,255,255,0.5) 198deg 202deg,
      transparent 202deg 288deg, rgba(255,255,255,0.5) 288deg 292deg, transparent 292deg 360deg);
}
.cassette.playing .reel { animation: reel-spin 1.4s linear infinite; }
@keyframes reel-spin { to { transform: rotate(360deg); } }

.cass-arrow { color: #9a9a9a; }

/* --- duration readout --- */
.cass-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 2px 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: #f4f4f4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}
.cass-dur {
  padding: 3px 8px;
  background: #161616;
  color: #6cff8a;                  /* little green DUR display */
  border: 2px solid var(--cass-edge);
  font-variant-numeric: tabular-nums;
}

/* --- buttons --- */
.cass-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.cass-key { display: flex; flex-direction: column; align-items: center; gap: 5px; }

.cass-key-label {
  font-family: var(--font-ui);
  font-size: 13px;
  color: #f4f4f4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.cass-btn {
  width: 100%;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 7px 4px 7px;
  background: linear-gradient(var(--cass-btn), var(--cass-btn-2));
  border: 2px solid var(--cass-edge);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.18);
  cursor: pointer;
}
.cass-btn:active,
.cass-btn.on {
  background: linear-gradient(var(--cass-btn-2), #111);
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.5);
}
.cass-btn-rec { background: linear-gradient(var(--cass-rec), #5e1c19); }
.cass-btn-rec:active,
.cass-btn-rec.on { background: linear-gradient(#5e1c19, #3a110f); }

/* PLAY blinks green when nothing is playing, to prompt the user to press it. */
.cass-btn.hint { animation: play-blink 1.1s ease-in-out infinite; }
.cass-btn.hint:hover { animation: none; }   /* stop nagging once they're on it */
@keyframes play-blink {
  0%, 100% {
    background: linear-gradient(var(--cass-btn), var(--cass-btn-2));
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.18);
  }
  50% {
    background: linear-gradient(#33d35a, #1c9e36);
    box-shadow: 0 0 10px rgba(70, 220, 100, 0.85), inset 1px 1px 0 rgba(255, 255, 255, 0.3);
  }
}

/* the 3 ridge dots at the bottom of each key */
.cass-ridges {
  width: 26px; height: 5px;
  background:
    radial-gradient(circle, rgba(255,255,255,0.5) 0 40%, transparent 45%) 0 0 / 9px 5px repeat-x;
}

/* --- beats layout: shelf of cassettes above the deck --- */
.beats-body { display: flex; flex-direction: column; }

.beats-shelf {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  max-height: 46vh;
  overflow-y: auto;
}

.tape-row { display: flex; align-items: stretch; gap: 8px; }

/* A cassette in the shelf (click to play). */
.tape {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  background: linear-gradient(#3a3631, #211f1c);
  border: 2px solid #141414;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
}
.tape:hover { filter: brightness(1.12); }
.tape.selected { box-shadow: 0 0 0 2px var(--accent), inset 1px 1px 0 rgba(255,255,255,0.12); }

/* two reel windows */
.tape-reels { display: flex; gap: 6px; flex: none; }
.tape-reels i {
  display: block;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #cfc9bb;
  border: 2px solid #0c0c0c;
}

/* white tape label with the handwritten beat name */
.tape-label {
  flex: 1;
  min-width: 0;
  padding: 3px 10px;
  background: #f4efe2;
  border: 1px solid #111;
  color: #1a1a1a;
  font-family: "Caveat", cursive;
  font-size: 22px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* buy-now button -> BeatStars */
.tape-buy {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: var(--accent);
  color: #fff;
  border: 2px solid #141414;
  font-family: var(--font-ui);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.tape-buy:hover { filter: brightness(1.12); }


/* ----- TEXT WINDOW (loopMachine) ------------------------------------------- */
.win-text { width: 380px; }

.text-body { padding: 16px; font-size: 18px; line-height: 1.5; }
.text-body p { margin: 0 0 10px; }
.text-body p:first-child { font-family: var(--font-display); font-size: 16px; }

/* ----- Journal ------------------------------------------------------------- */
#window-journal { width: 420px; }
#window-journal .text-body { max-height: 60vh; overflow: auto; }

.journal-entry {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
.journal-entry:last-child { border-bottom: none; margin-bottom: 0; }

.journal-date { margin: 0 0 4px; font-size: 14px; color: var(--ink-soft); }
.journal-title { margin: 0 0 6px; font-family: var(--font-display); font-weight: normal; font-size: 18px; }
.journal-body { margin: 0; font-size: 17px; line-height: 1.55; }

/* ----- System Settings / Appearance ---------------------------------------- */
#window-settings { width: 470px; }
.settings-body { max-height: 64vh; overflow: auto; }

.settings-head { margin: 0 0 8px; font-family: var(--font-display); font-size: 20px; }
.settings-sub  { margin: 16px 0 8px; font-family: var(--font-ui); font-size: 16px; color: var(--ink-soft); }
.settings-note { margin: 18px 0 0; font-family: var(--font-ui); font-size: 14px; color: var(--ink-soft); line-height: 1.5; }

.swatch-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }

.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}
.swatch:hover { background: var(--hover); }
.swatch.selected { border-color: var(--accent); background: var(--hover); }

.swatch-prev {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 46px;
  height: 30px;
  padding: 4px;
  border: 1px solid var(--line);
}
.swatch-prev i { display: block; width: 9px; height: 16px; }

.swatch-name { font-family: var(--font-ui); font-size: 12px; text-align: center; color: var(--ink); }


/* ===========================================================================
   DOCK
   =========================================================================== */
.dock {
  position: fixed;
  bottom: 0;                     /* sits flush against the bottom edge */
  left: 50%;
  transform: translateX(-50%);
  z-index: 700;
  display: flex;
  align-items: stretch;
  background: var(--chrome);
  border: 1px solid var(--line);
  border-bottom: none;           /* no line along the screen edge */
  border-radius: 10px 10px 0 0;  /* round only the top corners */
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  overflow: hidden;              /* clip cell dividers to the rounded corners */
}

/* Each icon is a cell, separated from the next by a full-height divider. */
.dock-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 86px;
  height: 86px;            /* 1:1 square cells */
  color: var(--ink);
  border-right: 1px solid var(--line);
}

.dock-icon:last-child { border-right: none; }
.dock-icon:hover { background: rgba(0, 0, 0, 0.04); }
.dock-icon:active { background: rgba(0, 0, 0, 0.08); }

/* Icons sit directly on the panel (no tile / bevel). */
.dock-glyph {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--ink);
}

.dock-label {
  font-family: var(--font-ui);   /* retro ChiKareGo2 to match the rest */
  font-size: 16px;
}


/* ===========================================================================
   RESPONSIVE / MOBILE
   Windows shrink to fit and the dock wraps so nothing breaks on a phone.
   =========================================================================== */
@media (max-width: 760px) {
  /* On mobile, drop the background video + overlay and use a static image. */
  .desktop-bg { display: none; }
  .bg-overlay { display: none; }
  body {
    background: #0a0a0a url("../media/imgs/bg/collage.png") center / cover no-repeat;
  }

  .win-player { width: calc(100vw - 24px); }

  .window {
    left: 12px !important;
    right: 12px;
    top: 80px !important;
    max-width: calc(100vw - 24px);
  }

  .win-folder, .win-text, .win-cassette { width: calc(100vw - 24px); }

  /* On mobile, hide the desktop icons to save space - users open apps from
     the Start menu instead. */
  .desk-icon { display: none; }

  /* ...except the BeatStars link, pinned bottom-center (below the player). */
  #beatstars-icon {
    display: flex;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18px;
  }

  .dock {
    flex-wrap: wrap;
    justify-content: center;
    max-width: calc(100vw - 24px);
    gap: 10px;
  }

  .topbar-left .member-box { font-size: 8px; padding: 0 8px; }
}
