/* =====================================================================
   PLAYGROUND — Jacob's desk. Draggable objects you can also click.
   The computer monitor opens a little Windows-XP (2004) desktop.
   Art style switches via [data-desk]: "lineart" | "marker" | "color".
   Shares @font-face (JacobMarker) + tokens from styles.css.
   ===================================================================== */

/* ---- resize handles (browser-window feel) on playground panels ---- */

.pg-body {
  margin: 0; min-height: 100vh; overflow: hidden;
  font-family: var(--font-body, system-ui, sans-serif);
  color: #1b1a16;
  background: #cdb38b;
  user-select: none;
}

/* ---- the desk surface (changes per art style) ---- */
.desk {
  position: fixed; inset: 0; overflow: hidden;
}
.pg-body[data-desk="lineart"] .desk { background: #f7f5ef; }
.pg-body[data-desk="lineart"] .desk::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(#1b1a160c 1px, transparent 1px), linear-gradient(90deg, #1b1a160c 1px, transparent 1px);
  background-size: 30px 30px;
}
.pg-body[data-desk="marker"] .desk { background: #efe7d4; }
.pg-body[data-desk="marker"] .desk::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(#b9a98044 1px, transparent 1.4px);
  background-size: 22px 22px;
}
.pg-body[data-desk="color"] .desk {
  background: #b07c4f;
  background-image: repeating-linear-gradient(90deg, #00000010 0 2px, transparent 2px 26px);
}

/* ---- header strip ---- */

/* =====================================================================
   DRAGGABLE OBJECTS
   ===================================================================== */

/* 8 resize zones (4 corners + 4 edges) on a desk object — proportional
   scaling. INVISIBLE: no markers/guides, only the resize cursor shows on hover */

/* line-art SVG styling */

/* marker / hand-drawn */

/* filled color / sticker */

/* =====================================================================
   RADIO PLAYER BAR (bottom)
   ===================================================================== */

@keyframes barUp { from { transform: translateX(-50%) translateY(20px); opacity: 0; } }

  
@keyframes eq { 0%,100%{ height: 4px; } 50%{ height: 16px; } }

/* winamp skin override */

/* =====================================================================
   SCENE PANELS (notebook / guestbook / photos) — centered modals
   ===================================================================== */
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(20,16,10,.45); display: grid; place-items: center; padding: 20px; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.panel {
  position: relative; width: min(560px, 94vw); max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column; animation: pop .3s cubic-bezier(.22,.61,.36,1);
}
@keyframes pop { from { transform: translateY(14px) scale(.97); opacity: 0; } }

/* notebook */

/* guestbook — cork board with sticky notes */

/* photo pile viewer */
.photos { background: transparent; box-shadow: none; align-items: center; }

/* ---- merged photo frame (ornate gold) on the desk ---- */

/* ---- gallery viewer: scrollable visual directory, dark + editorial ---- */

@keyframes gvfade { from { opacity: 0; } to { opacity: 1; } }

@keyframes gvzoom {
  from { transform: translate(var(--fx), var(--fy)) scale(var(--fs)); opacity: .4; }
  to { transform: translate(0, 0) scale(1); opacity: 1; }
}

@keyframes gvrowfade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@keyframes gvbig { from { opacity: 0; transform: translate(var(--ox), var(--oy)) scale(var(--os)); } to { opacity: 1; transform: translate(0, 0) scale(1); } }

 

/* =====================================================================
   WINDOWS-XP DESKTOP (opens from the monitor) — full overlay
   ===================================================================== */
.xp { position: fixed; inset: 0; z-index: 90; overflow: hidden; animation: xpin .4s cubic-bezier(.22,.61,.36,1); display: flex; flex-direction: column; }

@keyframes xpin { from { opacity: 0; transform: scale(.96); } }

/* uploaded wallpaper photo — sits ABOVE the painted bliss hills/clouds */

/* desktop icons */
.xp button, .xfolder button, .xp-trash button { -webkit-appearance: none; appearance: none; }

/* xp window */

/* xp file list / folder */

/* letter writer */

/* taskbar */

/* ---- computer window (windowed XP desktop, ~half-screen by default) ---- */

/* ---- real photo cutouts on desk objects (#8) ---- */

/* ---- headphones mixed-media collage (Tweak: hpArt) ---- */

/* min-height keeps the collage box from collapsing when the cutout photo is
   missing or fails to load — otherwise the whole .obj shrinks to label height
   and the tag/word overprint the art in a ~30px band. */

/* torn-paper scrap behind the media */

/* washi tape corners */

/* hand-drawn marker scribbles (marker collage only) */

/* paper variant: lean on the scrap + tape, drop the marker doodles */

/* ---- live desk panels: notebook + guestbook (#9) ---- */

/* notebook variant */

/* guestbook variant */

/* ---- radio (mixes) panel + playlists panel (driven by the shared player) ---- */

/* ---- the font story panel (#4) ---- */
.fontcard {
  position: absolute; width: min(1100px, 94vw); height: 620px;
  border: 2px solid #1b1a16; border-radius: 4px; box-shadow: 6px 6px 0 #1b1a16;
  overflow: hidden; touch-action: none; background: #1b1a16;
  display: flex; flex-direction: column;
}
.fontcard.grab { box-shadow: 9px 9px 0 #1b1a16; }

.fc-body { position: relative; flex: 1; min-height: 0; }
/* blurred dad photo behind the content — two layers: a mostly-sharp base,
   and a more-blurred copy masked to fade in top→bottom (via --fc-grad-start),
   so the top of the panel stays clearer and the bottom gets softer for text.
   All four knobs are Tweak-controlled (also editable via the ⚙ mini panel). */
.fc-bg { position: absolute; inset: 0; overflow: hidden; }
.fc-bg-sharp, .fc-bg-blur { position: absolute; inset: 0; overflow: hidden; }
.fc-bg-sharp .cropimg, .fc-bg-blur .cropimg { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); }
.fc-bg-sharp .cropimg { filter: blur(var(--fc-blur-top, 2px)) saturate(1.05); }
.fc-bg-blur { -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black var(--fc-grad-start, 35%)); mask-image: linear-gradient(to bottom, transparent 0%, black var(--fc-grad-start, 35%)); }
.fc-bg-blur .cropimg { filter: blur(var(--fc-blur-bottom, 13px)) saturate(1.05); transform: scale(1.14); }
.fc-bg-fallback { position: absolute; inset: 0; background: linear-gradient(150deg, #4a4036, #1b1a16); }
.fc-bg-scrim { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(12,10,8, calc(var(--fc-dim, .45) * 0.55)), rgba(12,10,8, calc(var(--fc-dim, .45) * 1.35))); }
.fontcard[data-text-style="glow"] .fc-scroll { text-shadow: 0 2px 3px rgba(0,0,0,.85), 0 1px 14px rgba(0,0,0,.7); }
.fontcard[data-text-style="glow"] .fc-bg-scrim { opacity: .7; }

.fc-scroll { position: absolute; inset: 0; z-index: 2; overflow-y: auto; padding: 22px 22px 26px; color: #fff; }
.fc-title { font-family: "JacobMarker", serif; font-size: clamp(34px, 6vw, 50px); line-height: .95; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.fc-maker { font-family: var(--font-mono, monospace); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #ffe27a; margin-top: 8px; }
.fc-story { margin-top: 14px; font-size: 14.5px; line-height: 1.6; color: rgba(255,255,255,.95); text-wrap: pretty; white-space: pre-wrap; }
.fc-sample { margin-top: 18px; padding: 14px 16px; background: rgba(255,255,255,.08); border-radius: 6px; font-family: "JacobMarker", serif; font-size: 24px; line-height: 1.5; white-space: pre-wrap; color: #fff; }
.fc-preview { margin-top: 16px; }
.fc-label { font-family: var(--font-mono, monospace); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.6); margin-bottom: 7px; }
.fc-type { width: 100%; min-height: 56px; display: block; text-align: left; border: 1.5px dashed rgba(255,255,255,.4); border-radius: 6px; background: rgba(0,0,0,.25); padding: 12px 14px; font-family: "JacobMarker", serif; font-size: 26px; line-height: 1.35; color: #fff; resize: vertical; }
.fc-type-ghost { cursor: text; color: rgba(255,255,255,.55); }
.fc-type-ghost:hover { border-color: #ffe27a; color: rgba(255,255,255,.8); }
.fc-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.fc-compare figure { margin: 0; }
.fc-compare figcaption { font-family: var(--font-mono, monospace); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.6); margin-top: 6px; text-align: center; }
.fc-scan { aspect-ratio: 3/2; border-radius: 5px; overflow: hidden; background: rgba(255,255,255,.1); }
.fc-scan .cropimg { width: 100%; height: 100%; }
.fc-digi { aspect-ratio: 3/2; border-radius: 5px; background: rgba(255,255,255,.08); display: grid; place-items: center; font-family: "JacobMarker", serif; font-size: 30px; color: #fff; text-align: center; padding: 6px; }
.fc-download {
  display: block; margin-top: 22px; text-align: center; padding: 13px; border-radius: 6px;
  background: #ffe27a; color: #1b1a16; border: 2px solid #1b1a16; box-shadow: 3px 3px 0 #1b1a16;
  font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.fc-download { width: 50%; min-width: 190px; }
.fc-download:hover { background: #fff; }
.fc-download:active { transform: translate(3px,3px); box-shadow: none; }

@media (prefers-reduced-motion: reduce){
  * { animation-duration: .001ms !important; }
}

/* =====================================================================
   DESIGN SYSTEM - added after a craft audit found 9 radius values, 13 type
   sizes (42 controls sitting at the browser's unstyled 13.33px default) and
   5 font families including Arial and Trebuchet leaking through. Everything
   below is scoped to .pg-body and deliberately does NOT touch the bottom
   player bar, which stays as-is.
   ===================================================================== */
.pg-body {
  --ink: #1b1a16;
  /* two-tier radius: sharp on retro chrome, soft on the hand-drawn panels */
  --r-chrome: 3px; --r-chrome-sm: 2px;
  --r-panel: 10px; --r-panel-sm: 6px;
  /* type scale for panel chrome (mono), replacing the unset defaults */
  --t-meta: 11px; --t-body: 13px; --t-ui: 15px;
  --btn: 24px;
}

/* ---- one button family: same ring, same 16px icon grid, same weight ---- */

/* the "reset size" pill becomes a round icon button like the rest */

/* object size-reset: bottom-left of the object, clear of the drag corners */

/* ---- forgiving hit areas WITHOUT changing any visual size ---- */

/* mix-panel sliders keep their 4px line but gain a 16px grab zone: the visual
   moves to the track pseudo-element so the input itself can be taller. */

/* ---- period-piece icons opt OUT of the desk art style ----
   The marker/lineart/color rules target '.obj .art svg *', which beats the
   inline style INHERITED from a parent <g> - so 33 of the radio's 40 elements
   were getting a uniform 2.4px marker stroke stamped over their authored
   weights, and its 3.4px EQ bars were nearly all outline. Restoring
   inheritance hands them back to the group's own inline style. */

/* ---- two-tier radius applied ---- */

.pg-body .desk-card, .pg-body .fontcard { border-radius: var(--r-panel); }

/* ---- chrome typography: mono, explicit sizes, no browser defaults ---- */
.pg-body .desk-card button, .pg-body .desk-card input, .pg-body .desk-card select,
.pg-body .fontcard button, .pg-body .comp-win button, .pg-body .gv-panel button {
  font-family: var(--font-mono, monospace); font-size: var(--t-body);
}

/* ---- gallery: it scrolls on short screens, so SAY so ---- */

/* the scrollbar above is the cue; it is always visible while the panel
   overflows, and data-more on the panel records the state for anything else */

/* ---- filmstrip thumbnails: image content, so big enough to tell apart ---- */

/* ---- font panel never taller than the window ---- */
.pg-body .fontcard { max-height: calc(100vh - 110px); }

/* =====================================================================
   XP windows inside the computer: a single bottom-right resize corner
   (authentic to the era) plus containment so a window cannot be dragged
   out of the computer's screen and lost behind its overflow.
   ===================================================================== */

/* XP window control marks (SVG, same grid as the desk icon set) */

/* the computer must be able to shrink onto a small screen, so its floor is
   lower than the old 480x360 — that minimum fought the viewport clamp and
   forced the window off-screen on short laptops. */

/* ---- font-story copy editor (pencil in the panel's title bar) ---- */

/* ---- title-bar controls group at the right ----
   .dc-min carries margin-left:auto, which was written when a bar had exactly
   one trailing button. The font panel now has three (edit / background /
   close), and in a flex row EVERY child with auto margins takes a share of the
   free space — so the buttons spread out across the bar with ~150px between
   them instead of sitting together. Only the FIRST control pushes right; the
   rest sit flush against it, so any bar can gain controls without scattering. */

/* =====================================================================
   VIEWPORT SCALING — panels grow with BOTH width and height.
   --pgu is a "scaled pixel": it tracks whichever axis is tighter, so a
   taller window makes content bigger, not just a wider one. It has a
   floor (content stops shrinking, then the panel scrolls) and a hard
   ceiling (stops growing on huge monitors). The floor is 1x on purpose:
   nothing is ever smaller than it was, it only grows.
   ===================================================================== */
.pg-body { --pgu: clamp(1px, min(100vw / 1420, 100vh / 880), 1.32px); }

/* ---- gallery viewer ---- */

/* ---- notebook / guestbook / mix / playlist panels ---- */

/* ---- the font panel ---- */
.pg-body .fontcard { width: min(calc(1100 * var(--pgu)), 94vw); height: min(calc(640 * var(--pgu)), calc(100vh - 110px)); }
.pg-body .fc-story { font-size: calc(14.5 * var(--pgu)); }
.pg-body .fc-sample { font-size: calc(24 * var(--pgu)); }
.pg-body .fc-type { font-size: calc(26 * var(--pgu)); }

/* ---- full-size photo: TRUE pixel size, uncapped. Drag or scroll to pan. ---- */

 

/* ---- uniform lowercase: OPT-IN, toggled from the playground's start menu.
   Typed input is left alone, and so is the marker face — that font is
   hand-drawn all-caps by design, so forcing it changes nothing but intent. ---- */
.pg-body.pg-lower, .pg-body.pg-lower *:not(input):not(textarea) { text-transform: lowercase !important; }
/* mix names stay in caps even with lowercase on */
.pg-body.pg-lower .pbar-title, .pg-body.pg-lower .dkm-list button, .pg-body.pg-lower .dkm-scroll em { text-transform: uppercase !important; }
.pg-body.pg-lower .dk-ic[data-app="font"] span,
.pg-body.pg-lower .dk-ic[data-app="guestbook"] span,
.pg-body.pg-lower .dk-ic[data-app="letter"] span,
.pg-body.pg-lower .dk-menu-head b,
.pg-body.pg-lower .dk-back,
.pg-body.pg-lower .dk-tray .name,
.pg-body.pg-lower .dk-mi-home { text-transform: none !important; }

/* =====================================================================
   KRINKY — the playground assistant. He replaces the hover tooltip.
   Everything is stepped: no easing, whole frames only.
   ===================================================================== */
.kr{position:absolute;z-index:9998;cursor:grab;touch-action:none;filter:drop-shadow(2px 3px 0 rgba(0,0,0,.22))}
.kr.behind{z-index:5}
.kr.pinned{cursor:default}
.kr.gone{opacity:0;pointer-events:none;filter:none}
.kr .kr-svg{display:block;pointer-events:none}
.kr-zzz{position:absolute;top:-6px;right:-10px;font-family:Tahoma,sans-serif;font-size:11px;color:#123f8a;animation:kr-zzz 1.2s steps(3) infinite}
.kr-zzz i{font-size:13px;font-style:normal;margin-left:1px}
.kr-zzz b{font-size:15px;margin-left:1px}
@keyframes kr-zzz{0%{opacity:.3;transform:translateY(0)}100%{opacity:1;transform:translateY(-8px)}}
.kr-loose{position:absolute;z-index:9997;width:18px;height:18px;border-radius:50%;background:#dfe8f2;border:1.5px solid #123f8a;box-shadow:inset 0 0 0 4px #f4f7fb}

/* two dots then the balloon — staged from JS (krinky.jsx), never a delayed
   CSS animation: the 12fps re-render would restart the delay forever.
   One flex stack holds both bubbles so they are spaced by real height. */
.kr-stack{position:absolute;z-index:9999;pointer-events:none;display:flex;gap:9px;align-items:flex-start}
.kr-stack.flip{align-items:flex-end}
.kr-bubble{position:relative;display:flex;justify-content:flex-start;max-width:100%}
.kr-stack.flip .kr-bubble{justify-content:flex-end}
.kr-dot{position:absolute;border-radius:50%;background:#fff;border:1.5px solid #123f8a}
.kr-dot.a{width:7px;height:7px;left:-2px;bottom:-14px}
.kr-dot.b{width:12px;height:12px;left:6px;bottom:-4px}
.kr-stack.flip .kr-dot.a{left:auto;right:-2px}
.kr-stack.flip .kr-dot.b{left:auto;right:6px}
.kr-bal{position:relative;max-width:260px;flex:0 1 auto;background:#fff;border:2px solid #123f8a;border-radius:16px;padding:9px 14px;font-family:Tahoma,"Trebuchet MS",sans-serif;font-size:12.5px;line-height:1.35;color:#12233f;box-shadow:2px 3px 0 rgba(18,63,138,.25)}
.kr-bubble.second .kr-bal{background:#f4f8ff}
.kr-bal:has(a){pointer-events:auto}
.kr-bal a{color:#0a4fd6;font-weight:bold;text-decoration:underline;text-underline-offset:2px}.kr-bal a:hover{color:#123f8a;background:#e3ecff}
/* Krinky sent away: the line still lands, as one big balloon in his corner */
.kr-stack.solo .kr-bal{max-width:312px;font-size:14px;padding:12px 17px;border-radius:19px}
.kr-stack.solo .kr-dot{display:none}
@media (prefers-reduced-motion:reduce){.kr-zzz{animation:none}}
