/* Faded artwork wallpaper: the lavender tint layer sets how faded it looks (its alpha byte,
   dc ≈ 86%), with the faint grid on top. dev/ascii.py can make an ASCII-art version instead. */
.desktop {
  background-color: #7c809b;
  background-image:
    linear-gradient(#e8e6ff14 1px, transparent 1px),
    linear-gradient(90deg, #e8e6ff14 1px, transparent 1px),
    linear-gradient(#7c809bdc, #7c809bdc),
    url('../assets/wallpaper.jpg');
  background-size: 32px 32px, 32px 32px, cover, cover;
  background-position: center, center, center, center 30%;
}
.desktop::before {
  background: linear-gradient(135deg, #d8cbed1a, transparent 55%, #454c681a);
}

/* A directory tree drawn directly onto the wallpaper, rather than another window. */
.desktop-sitemap {
  position: absolute;
  top: 53px;
  right: 24px;
  width: 206px;
  z-index: 2;
  color: #fffbea;
  font-size: 13px;
}
.sitemap-node {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 9px 7px;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  text-shadow: 1px 1px 2px #303251b3;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
}
.sitemap-node img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: .88;
  filter: saturate(.7) drop-shadow(1px 2px 0 #32345345);
  transition: filter .15s, opacity .15s, transform .15s;
}
.sitemap-node:hover {
  background: #e4ddff12;
  border-color: #f0e6ff3b;
}
.sitemap-node:hover img,
.sitemap-node:focus-visible img {
  opacity: 1;
  filter: saturate(1) drop-shadow(1px 2px 0 #32345345);
  transform: translateY(-2px);
}
.sitemap-node:focus-visible { outline-color: #fff0b8; }
.sitemap-node small { font: 11px var(--desktop-font); margin-left: auto; opacity: .45; }
.sitemap-node:hover small { opacity: 1; }
.sitemap-home { gap: 15px; width: 100%; font-weight: 700; }
.sitemap-home img { width: 40px; height: 40px; image-rendering: pixelated; }
.sitemap-branches { list-style: none; position: relative; margin: 0 0 0 27px; padding: 5px 0 0 29px; }
.sitemap-branches::before { content: ''; position: absolute; left: 0; top: -10px; bottom: 43px; border-left: 1px solid #ece8ff70; }
.sitemap-branches li { position: relative; padding: 8px 0; }
.sitemap-branches li::before { content: ''; position: absolute; left: -29px; top: 43px; width: 29px; border-top: 1px solid #ece8ff70; }
.sitemap-branches li:last-child img { image-rendering: pixelated; }

@media (min-width: 1101px) {
  .welcome-window { left: calc(100px + 2vw); width: calc((100% - 365px) * .57); }
  .favorites-window { left: calc(100px + 2vw + (100% - 365px) * .59); width: calc((100% - 365px) * .39); }
  .postcards-window { left: 14%; width: calc((100% - 365px) * .45); }
  .goblin-window { left: calc(14% + (100% - 365px) * .47); width: calc((100% - 365px) * .26); }
  .desktop-mascot { right: 265px; bottom: 90px; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .desktop { min-height: 1000px; }
  .desktop-sitemap { right: 14px; top: 55px; width: 166px; font-size: 11px; }
  .sitemap-node { gap: 8px; padding: 7px 4px; min-height: 62px; }
  .sitemap-node img { width: 29px; height: 29px; }
  .sitemap-home img { width: 36px; height: 36px; }
  .sitemap-branches { margin-left: 22px; padding-left: 20px; }
  .sitemap-branches::before { bottom: 39px; }
  .sitemap-branches li::before { left: -20px; width: 20px; top: 39px; }
  .welcome-window { left: 11%; width: calc(100% - 320px); }
  .favorites-window { left: 44%; top: 51%; width: calc(56% - 200px); }
  .postcards-window { left: 11%; top: 51%; width: 29%; }
  .goblin-window { left: 11%; top: 78%; width: 29%; }
  .goblin-photo img { height: 130px; }
  .desktop-mascot { left: auto; right: 35px; bottom: 95px; }
}

@media (max-width: 760px) {
  .desktop-sitemap { position: relative; top: auto; right: auto; width: 100%; order: 5; padding: 10px 13px 0; }
  .sitemap-home { min-height: 55px; }
  .sitemap-home img { width: 34px; height: 34px; }
  .sitemap-branches { padding-top: 0; padding-left: 29px; margin-left: 24px; }
  .sitemap-branches li { padding: 0; }
  .sitemap-branches::before { bottom: 30px; }
  .sitemap-branches li::before { top: 30px; }
  .sitemap-node { min-height: 60px; gap: 14px; padding: 8px; }
  .sitemap-node img { width: 30px; height: 30px; }
  .sitemap-node small { margin-left: 8px; }
}

/* Preserve the desktop composition on a laptop-sized screen. */
.welcome-content { grid-template-columns: 60% 40%; }
.welcome-copy h1 { font-size: 48px; }

/* The original transparent logo remains the roomy welcome mark. */
.welcome-copy .welcome-logo { margin: 18px -12px 20px; line-height: 0; }
.welcome-logo img { display: block; width: 100%; max-width: 560px; height: auto; }
.logo-welcome .welcome-copy { display: flex; flex-direction: column; justify-content: center; }
.logo-welcome .classic-button { align-self: flex-start; }

@media (min-width: 1101px) and (max-height: 850px) {
  .desktop { min-height: 600px; }
  .welcome-content { min-height: 300px; }
  .welcome-copy { padding: 18px 22px; }
  .welcome-copy h1 { font-size: 44px; line-height: 1; margin: 16px 0 12px; }
  .welcome-copy p { font-size: 12px; line-height: 1.5; margin-bottom: 10px; }
  .welcome-copy .intro-text { font-size: 12px; line-height: 1.6; margin-bottom: 12px; }
  .tiny-label { font-size: 9px; letter-spacing: .7px; }
  .favorites-window { top: 7%; }
  .favorite-library { height: 295px; }
  .postcards-window { top: 69%; }
  .postcard img { height: 100px; }
  .goblin-window { top: 73%; width: 19%; }
  .goblin-photo img { height: 95px; }
  .desktop-mascot { right: 265px; bottom: 38px; }
  .desktop-mascot img { width: 88px; }
}

@media (max-width: 760px) {
  .welcome-content { grid-template-columns: 59% 41%; }
  .welcome-copy h1 { font-size: 44px; }
  .logo-welcome .welcome-content { grid-template-columns: 1fr; min-height: 0; }
  .logo-welcome .welcome-art { display: none; }
  .logo-welcome .welcome-copy { padding: 24px 22px; }
  .welcome-copy .welcome-logo { margin: 18px 0 22px; }
  .logo-welcome .intro-text { max-width: 100%; }
}

/* Larger, individually resizable applications; the wallpaper stays clear on boot. */
.interactive-desktop .pc-window {
  display: flex;
  flex-direction: column;
  min-width: 360px;
  min-height: 240px;
  max-width: calc(100% - 16px);
  max-height: calc(100% - 16px);
  overflow: hidden;
}
.interactive-desktop .pc-window[hidden] { display: none; }
.interactive-desktop .title-bar,
.interactive-desktop .status-bar,
.interactive-desktop .favorites-footer,
.interactive-desktop .goblin-note { flex-shrink: 0; }
.interactive-desktop .pc-window .welcome-content { flex: 1; min-height: 0; overflow: auto; }
.interactive-desktop .logo-welcome .welcome-copy { min-height: min-content; justify-content: flex-start; padding: 28px; }
.interactive-desktop .tiny-label[lang=ja] { font-size: 15px; letter-spacing: 3px; }
.interactive-desktop .welcome-copy .intro-text { font-size: 14px; line-height: 1.8; max-width: 420px; }
.interactive-desktop .favorites-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.interactive-desktop .classic-tabs { flex-shrink: 0; }
.interactive-desktop .pc-window .favorite-library { height: auto; min-height: 0; flex: 1; grid-template-columns: repeat(auto-fill,minmax(130px,1fr)); }
.interactive-desktop .cover-card span { font-size: 12px; }
.interactive-desktop .cover-card small { font-size: 10px; }
.interactive-desktop .postcard { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.interactive-desktop .postcard .photo-open { flex: 1; min-height: 0; overflow: hidden; background: #343550; }
.interactive-desktop .pc-window .postcard img { height: 100%; width: 100%; object-fit: contain; }
.interactive-desktop .postcard figcaption { flex-shrink: 0; }
.interactive-desktop .goblin-photo { flex: 1; min-height: 0; overflow: hidden; background: #343550; }
.interactive-desktop .pc-window .goblin-photo img { height: 100%; width: 100%; object-fit: contain; }
.interactive-desktop .text-document { flex: 1; min-height: 0; max-height: none; overflow: auto; font-size: 14px; }
.interactive-desktop .profile-photo { height: 240px; }
.interactive-desktop .links-document { flex: 1; min-height: 0; overflow: auto; }
.interactive-desktop .status-bar,
.interactive-desktop .favorites-footer,
.interactive-desktop .goblin-note { padding-right: 26px; }
.window-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: repeating-linear-gradient(135deg,transparent 0 3px,#59618d 3px 4px,transparent 4px 6px) bottom right/13px 13px no-repeat;
  cursor: nwse-resize;
  touch-action: none;
  z-index: 3;
}
.window-resize-handle:hover { background-color: #fff0b86b; }
.interactive-desktop .pc-window.maximized .window-resize-handle { display: none; }
.interactive-desktop .pc-window.maximized { height: calc(100% - 24px)!important; }

.clock-area { position: relative; flex-shrink: 0; margin-left: auto; }
.interactive-desktop .task-buttons { scrollbar-width: none; }
.interactive-desktop .task-buttons::-webkit-scrollbar { display: none; }
.interactive-desktop .desktop-mascot {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 100%;
  width: 110px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  z-index: 5;
}
.interactive-desktop .desktop-mascot:active { cursor: grabbing; }
.interactive-desktop .desktop-mascot img { width: 100%; height: auto; pointer-events: none; }
.interactive-desktop .desktop-mascot span { margin-bottom: 4px; font-size: 10px; }

@media (min-width: 761px) {
  .interactive-desktop .desktop { height: calc(100svh - 114px); min-height: 600px; }
  .interactive-desktop .welcome-window { left: 9%; top: 28px; width: min(1080px,calc(100% - 390px)); height: min(520px,calc(100% - 72px)); min-height: 340px; }
  .interactive-desktop .favorites-window { left: 12%; top: 55px; width: min(980px,calc(100% - 420px)); height: min(650px,calc(100% - 94px)); }
  .interactive-desktop .postcards-window { left: 15%; top: 65px; width: min(720px,calc(100% - 420px)); height: min(520px,calc(100% - 100px)); }
  .interactive-desktop .goblin-window { left: 18%; top: 80px; width: min(520px,calc(100% - 430px)); height: min(540px,calc(100% - 115px)); }
  .interactive-desktop .about-window { left: 12%; top: 45px; width: min(660px,calc(100% - 390px)); height: min(650px,calc(100% - 85px)); }
  .interactive-desktop .links-window { left: 18%; top: 75px; width: min(560px,calc(100% - 420px)); height: min(480px,calc(100% - 110px)); }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .interactive-desktop .welcome-window,
  .interactive-desktop .favorites-window,
  .interactive-desktop .postcards-window,
  .interactive-desktop .about-window { left: 11%; width: calc(100% - 310px); }
  .interactive-desktop .goblin-window,
  .interactive-desktop .links-window { left: 12%; width: calc(100% - 320px); }
}
@media (max-width: 760px) {
  .interactive-desktop .pc-window { height: auto!important; min-width: 0; min-height: 0; max-height: none; max-width: none; }
  .interactive-desktop .window-resize-handle { display: none; }
  .interactive-desktop .pc-window .favorite-library { height: 430px; flex: auto; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .interactive-desktop .pc-window .postcard img { height: 260px; }
  .interactive-desktop .pc-window .goblin-photo img { height: 320px; }
  .interactive-desktop .logo-welcome .welcome-copy { padding: 24px 22px; }
  .interactive-desktop .tray { display: flex; font-size: 10px; padding: 6px; height: 32px; }
  .interactive-desktop .tray>span { display: none; }
  .interactive-desktop .desktop-mascot { width: 78px; }
  .interactive-desktop .desktop-mascot span { font-size: 9px; padding: 3px 5px; }
}

/* A little more room for Sumika's original illustrated branding. */
.interactive-desktop .menu-bar { height: 64px; padding: 0 20px; }
.interactive-desktop .sumika-brand { display: flex; align-items: center; height: 60px; flex-shrink: 0; }
.interactive-desktop .sumika-brand img { display: block; width: auto; height: 58px; max-width: none; }
.interactive-desktop .sumika-brand:focus-visible { outline-offset: 1px; }
@media (max-width: 760px) {
  .interactive-desktop .menu-bar { padding: 0 12px; gap: 8px; }
  .interactive-desktop .sumika-brand img { height: clamp(36px,12vw,48px); }
  .interactive-desktop .desktop { min-height: calc(100svh - 110px); }
}

/* A photo-browser application with albums and adjustable thumbnail density. */
.gallery-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid #a5a2bd; font-size: 11px; flex-shrink: 0; }
.gallery-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-views { display: flex; gap: 3px; flex-shrink: 0; }
.gallery-views button { border: 1px solid #9295b8; padding: 4px 7px; font-size: 10px; background: #d9dbef; }
.gallery-views button[aria-pressed=true] { background: var(--paper); box-shadow: inset 1px 1px #9a97b4; }
.gallery-body { display: grid; grid-template-columns: 148px minmax(0,1fr); flex: 1; min-height: 0; background: var(--paper); }
.gallery-albums { padding: 18px 8px; background: #eae7f2; border-right: 1px solid #c5bed4; overflow: auto; }
.gallery-folder-label { display: block; font-size: 9px; letter-spacing: 1px; color: #77718d; margin: 0 9px 14px; }
.gallery-albums button { display: flex; align-items: center; text-align: left; gap: 8px; width: 100%; border: 1px solid transparent; padding: 10px 7px; margin-bottom: 4px; font-size: 11px; background: transparent; }
.gallery-albums button[aria-pressed=true] { background: #fff5ce; border-color: #c8bfa5; box-shadow: inset 1px 1px #fffdf1; }
.gallery-albums button:hover { border-color: #b9accd; }
.gallery-albums button>span:first-child { width: 18px; text-align: center; }
.gallery-albums small { margin-left: auto; color: #8b829c; font-size: 9px; }
.gallery-panel { min-width: 0; overflow: auto; padding: 18px; }
.gallery-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 0 0 20px; }
.gallery-heading h3 { font-size: 20px; font-weight: 400; margin: 0 0 7px; }
.gallery-heading p { font-size: 10px; line-height: 1.6; color: #777089; margin: 0; }
#gallery-count { font-size: 9px; white-space: nowrap; color: #8c8299; padding-top: 7px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(145px,1fr)); gap: 19px 14px; align-content: start; }
.photo-grid.small-thumbnails { grid-template-columns: repeat(auto-fill,minmax(105px,1fr)); gap: 16px 10px; }
.gallery-card { display: block; min-width: 0; text-align: left; background: transparent; border: 0; padding: 0; }
.gallery-card img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; border: 1px solid #a8a0b8; padding: 4px; background: white; box-shadow: 2px 2px #c9c1d34d; }
.gallery-card strong { display: block; font-size: 11px; font-weight: 400; line-height: 1.5; margin-top: 9px; overflow-wrap: anywhere; }
.gallery-card small { display: block; font-size: 9px; line-height: 1.5; color: #8c8299; margin-top: 3px; }
button.gallery-card:hover img { border-color: #8e6ea9; background: #f0e9fa; }
button.gallery-card:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.collection-placeholder-art { display: grid; place-items: center; width: 100%; aspect-ratio: 4/3; border: 1px dashed #b7a7c6; background: repeating-linear-gradient(135deg,#f1ecf6 0 6px,#f7f3fa 6px 12px); color: #b29dc3; font-size: 36px; }
.collection-placeholder:nth-child(2) .collection-placeholder-art { color: #a5af9a; background: #eef1e8; border-color: #b2bba6; }
.collection-placeholder:nth-child(3) .collection-placeholder-art { color: #c79bac; background: #f7eaf0; border-color: #d4b3c2; }
.interactive-desktop .photo-dialog { width: min(1060px,92vw); }
.interactive-desktop .photo-dialog img { max-height: 72svh; max-width: 100%; }
.photo-viewer-bar { display: flex; align-items: center; gap: 14px; padding: 12px 5px 3px; }
.photo-viewer-bar>div { flex: 1; min-width: 0; }
.photo-viewer-bar p { margin: 0 0 5px; }
.photo-viewer-bar small { font-size: 10px; color: #84768e; line-height: 1.5; }
.photo-viewer-bar>button { width: 32px; height: 32px; flex-shrink: 0; border: 1px solid #aaa1b8; background: #e4def1; font-size: 24px; }
.photo-viewer-bar>button:disabled { opacity: .35; cursor: default; }
#viewer-position { font-size: 10px; white-space: nowrap; }
@media (min-width: 761px) {
  .interactive-desktop .gallery-window { left: 9%; top: 28px; width: min(980px,calc(100% - 390px)); height: min(600px,calc(100% - 76px)); }
  .interactive-desktop .desktop-sitemap { top: 25px; width: 220px; }
  .interactive-desktop .sitemap-node { min-height: 54px; padding: 7px; }
  .interactive-desktop .sitemap-branches li { padding: 3px 0; }
  .interactive-desktop .sitemap-branches li::before { top: 30px; }
  .interactive-desktop .sitemap-branches::before { bottom: 30px; }
  .interactive-desktop .sitemap-branches li:last-child img { image-rendering: auto; }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .interactive-desktop .gallery-window { width: calc(100% - 330px); left: 11%; }
  .interactive-desktop .gallery-body { grid-template-columns: 116px minmax(0,1fr); }
  .interactive-desktop .gallery-albums button { font-size: 10px; gap: 4px; padding: 10px 3px; }
  .interactive-desktop .gallery-albums small { display: none; }
  .interactive-desktop .desktop-sitemap { width: 184px; }
  .interactive-desktop .sitemap-node { font-size: 11px; gap: 8px; padding: 7px 4px; }
}
@media (max-width: 760px) {
  .gallery-body { display: flex; flex-direction: column; }
  .gallery-albums { display: flex; gap: 4px; padding: 9px; border-right: 0; border-bottom: 1px solid #c5bed4; overflow-x: auto; }
  .gallery-albums .gallery-folder-label,.gallery-albums small { display: none; }
  .gallery-albums button { width: auto; flex-shrink: 0; margin: 0; gap: 4px; padding: 9px 6px; font-size: 10px; }
  .gallery-albums button>span:first-child { width: auto; }
  .gallery-panel { padding: 18px 12px; max-height: 590px; }
  .gallery-heading { gap: 8px; }
  .gallery-heading h3 { font-size: 18px; }
  .photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 10px; }
  .photo-grid.small-thumbnails { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .gallery-card strong { font-size: 10px; }
  .gallery-toolbar { padding: 9px; gap: 7px; font-size: 10px; }
  .gallery-views button { font-size: 9px; padding: 5px; }
  .gallery-views button span { display: none; }
  .gallery-window .status-bar { font-size: 9px; line-height: 1.5; }
  .gallery-window .status-bar>span:last-child { display: none; }
  .photo-viewer-bar { gap: 8px; }
  .photo-viewer-bar small { font-size: 9px; }
}
@media (max-width: 380px) {
  .gallery-albums { flex-wrap: wrap; overflow: visible; }
  .gallery-albums button { flex: 1 0 calc(50% - 4px); }
}

/* A tiny curated radio, styled like an old desktop media player. */
.radio-body { display: flex; flex-direction: column; gap: 11px; flex: 1; min-height: 0; margin-top: 3px; padding: 13px; background: var(--paper); border: 1px solid #868bae; }
.radio-deck { display: grid; grid-template-columns: 124px minmax(0,1fr); gap: 13px; flex-shrink: 0; }
.radio-cover { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; padding: 4px; background: white; border: 1px solid #a8a0b8; box-shadow: 2px 2px #c9c1d34d; }
.radio-display { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-width: 0; padding: 9px 12px; background: #2c2f57; color: var(--butter); border: 1px solid #1f2142; box-shadow: inset 2px 2px #1a1c3a, inset -1px -1px #5a6093; font-family: 'VT323', var(--desktop-font); }
.radio-display-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; font-size: 15px; letter-spacing: 1px; color: #c4c6eb; }
.radio-now { display: flex; flex-direction: column; min-width: 0; }
.radio-now strong, .radio-now span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-now strong { font-weight: 400; font-size: 29px; line-height: 1; }
.radio-now span { font-size: 18px; color: #d9cdf5; }
.radio-eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.radio-eq i { width: 4px; height: 100%; background: var(--butter); transform: scaleY(.2); transform-origin: bottom; }
.is-playing .radio-eq i { animation: radio-eq .8s ease-in-out infinite alternate; }
.radio-eq i:nth-child(2) { animation-delay: -.5s; animation-duration: .7s; }
.radio-eq i:nth-child(3) { animation-delay: -.2s; animation-duration: .95s; }
.radio-eq i:nth-child(4) { animation-delay: -.65s; }
.radio-eq i:nth-child(5) { animation-delay: -.35s; animation-duration: .65s; }
.radio-eq i:nth-child(6) { animation-delay: -.8s; animation-duration: .9s; }
.radio-eq i:nth-child(7) { animation-delay: -.1s; animation-duration: .75s; }
@keyframes radio-eq { from { transform: scaleY(.2); } to { transform: scaleY(1); } }
.radio-slider { margin: 0; accent-color: var(--lilac); cursor: pointer; }
.radio-seek { width: 100%; flex-shrink: 0; }
.radio-controls { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.radio-controls button, .radio-widget-controls button { width: 40px; height: 32px; padding: 0; font-size: 14px; background: var(--chrome); border: 1px solid var(--line); box-shadow: inset 1px 1px #faffff, inset -1px -1px #818ab3; }
.radio-controls button:hover, .radio-widget-controls button:hover { background: #d8d9f2; }
.radio-controls button:active, .radio-widget-controls button:active { box-shadow: inset 1px 1px #818ab3; }
.radio-controls .radio-play { width: 54px; }
.radio-controls .radio-play, .radio-widget-controls .radio-play { background: var(--butter); }
.radio-controls .radio-play:hover, .radio-widget-controls .radio-play:hover { background: #fff6d2; }
.radio-volume { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 11px; color: #626284; }
.radio-volume input { width: 110px; }
.radio-tracklist { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow: auto; background: white; border: 1px solid #8b92b7; box-shadow: inset 1px 1px #767da1; }
.radio-tracklist button { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; text-align: left; font-size: 12px; background: transparent; border: 0; border-bottom: 1px dashed #c2bbd0; }
.radio-tracklist li:last-child button { border-bottom: 0; }
.radio-tracklist button:hover { background: #eae5f4; }
.radio-tracklist button[aria-current=true] { background: #fff5ce; }
.radio-tracklist small { display: block; margin-top: 2px; font-size: 10px; color: #77738c; }
.radio-track-meta { font-size: 10px; color: #77738c; }
.radio-window.is-playing .radio-tracklist [aria-current=true] .radio-track-meta:first-child { color: transparent; position: relative; }
.radio-window.is-playing .radio-tracklist [aria-current=true] .radio-track-meta:first-child::after { content: '♪'; position: absolute; left: 0; color: var(--ink); font-size: 13px; }
@media (min-width: 761px) {
  .interactive-desktop .radio-window { left: 24%; top: 50px; width: min(540px,calc(100% - 420px)); height: min(590px,calc(100% - 90px)); min-height: 420px; }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .interactive-desktop .radio-window { left: 12%; width: calc(100% - 320px); }
}
@media (max-width: 760px) {
  .radio-window { order: 0; }
  .radio-body { padding: 11px; }
  .radio-deck { grid-template-columns: 92px minmax(0,1fr); gap: 10px; }
  .radio-display { padding: 7px 9px; }
  .radio-now strong { font-size: 24px; }
  .radio-now span { font-size: 16px; }
  .radio-volume input { width: 80px; }
  .radio-tracklist { flex: none; }
}

/* The always-on radio gadget that sits on the wallpaper; radio.exe is the full player. */
.radio-widget { position: absolute; left: 128px; bottom: 22px; z-index: 2; display: grid; grid-template-columns: 86px minmax(0,1fr); gap: 9px; width: 330px; padding: 6px; background: var(--chrome); border: 1px solid #313b6a; box-shadow: inset 1px 1px #f0f2ff, inset -1px -1px #6b74a4, 3px 4px 0 #20264166; }
.radio-widget-grip { display: block; padding: 0; border: 0; background: transparent; cursor: inherit; }
.radio-widget-cover { display: block; width: 86px; height: 86px; object-fit: cover; border: 1px solid #59618d; }
@media (min-width: 761px) {
  .radio-widget { cursor: grab; touch-action: none; user-select: none; }
  .radio-widget.dragging { cursor: grabbing; box-shadow: inset 1px 1px #fff, inset -1px -1px #626893, 5px 6px 0 #20264177; }
}
.radio-widget-main { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-width: 0; }
.radio-widget-screen { padding: 5px 8px 6px; background: #2c2f57; color: var(--butter); border: 1px solid #1f2142; box-shadow: inset 2px 2px #1a1c3a, inset -1px -1px #5a6093; font-family: 'VT323', var(--desktop-font); }
.radio-widget-top { display: flex; justify-content: space-between; align-items: flex-end; font-size: 13px; line-height: 1; letter-spacing: 1px; color: #c4c6eb; }
.radio-widget .radio-now { margin-top: 3px; }
.radio-widget .radio-now strong { font-size: 21px; line-height: 1.05; }
.radio-widget .radio-now span { font-size: 15px; line-height: 1; }
.radio-widget .radio-eq { height: 11px; }
.radio-widget .radio-eq i { width: 3px; }
.radio-widget-controls { display: flex; align-items: center; gap: 4px; }
.radio-widget-controls button { width: 28px; height: 24px; font-size: 11px; flex-shrink: 0; }
.radio-widget-controls .radio-play { width: 36px; }
.radio-widget-controls input { flex: 1; min-width: 0; margin: 0 4px; }
@media (prefers-reduced-motion: reduce) {
  .is-playing .radio-eq i { animation: none; transform: scaleY(.6); }
}

/* For S: a tiny password prompt that unlocks a private folder and a notepad. */
.interactive-desktop .for-s-lock-window { width: 330px; height: auto; min-width: 0; min-height: 0; }
.for-s-lock-window .window-resize-handle { display: none; }
.for-s-lock { display: flex; flex-direction: column; gap: 10px; margin: 3px 0 0; padding: 18px 16px 12px; background: var(--paper); border: 1px solid #868bae; }
.for-s-lock label { font-size: 13px; }
.for-s-row { display: flex; gap: 6px; }
.for-s-row input { flex: 1; min-width: 0; padding: 6px 8px; font: inherit; color: var(--ink); background: white; border: 1px solid var(--line); box-shadow: inset 1px 1px #818ab3; }
.for-s-row .classic-button { padding: 6px 14px; }
.for-s-error { min-height: 1.5em; margin: 0; font-size: 11px; color: #8a4a6b; }
.for-s-lock-window.shake { animation: for-s-shake .35s; }
@keyframes for-s-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.for-s-files { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill,96px); align-content: start; gap: 12px; padding: 18px; background: var(--paper); }
.for-s-file { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 9px 4px; font-size: 11px; overflow-wrap: anywhere; background: transparent; border: 1px solid transparent; }
.for-s-file span:first-child { font-size: 36px; line-height: 1; }
.for-s-file:hover { background: #fff5ce; border: 1px dotted #b9accd; }
.for-s-note { flex: 1; min-height: 0; overflow: auto; margin-top: 3px; padding: 22px 26px; font-size: 13px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--paper); border: 1px solid #868bae; }
@media (min-width: 761px) {
  .interactive-desktop .for-s-lock-window { left: calc(50% - 165px); top: 26%; }
  .interactive-desktop .for-s-files-window { left: 20%; top: 70px; width: min(540px,calc(100% - 420px)); height: min(360px,calc(100% - 110px)); }
  .interactive-desktop .for-s-note-window { left: 27%; top: 45px; width: min(620px,calc(100% - 420px)); height: min(580px,calc(100% - 85px)); }
}
@media (max-width: 760px) {
  .for-s-lock-window, .for-s-files-window, .for-s-note-window { order: 0; }
  .interactive-desktop .pc-window .for-s-files { min-height: 200px; }
  .interactive-desktop .pc-window .for-s-note { max-height: 520px; }
}
@media (prefers-reduced-motion: reduce) {
  .for-s-lock-window.shake { animation: none; }
}
@media (min-width: 761px) and (max-height: 850px) {
  .desktop-icons { gap: 8px; }
}
@media (max-width: 760px) {
  .desktop-icons { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px 3px; }
}
@media (max-width: 760px) {
  /* Centred over the clock, Gigi poked 3px past the edge of narrow phones. */
  .interactive-desktop .desktop-mascot { left: auto; right: 0; transform: none; }
}

/* Goblin, the desk cat (goblin.js). Lives behind the radio widget and every window. */
.goblin-pet { position: absolute; bottom: 6px; z-index: 1; padding: 0; border: 0; background: transparent; cursor: pointer; line-height: 0; }
.goblin-pet canvas { display: block; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 #20264155); }
.goblin-pet:focus-visible { outline-offset: 2px; }
.goblin-bubble { position: absolute; left: 50%; bottom: 100%; margin-bottom: 4px; padding: 3px 7px; transform: translateX(-50%); font-size: 10px; line-height: 1.4; white-space: nowrap; background: var(--butter); border: 1px solid #73728b; opacity: 0; transition: opacity .2s; pointer-events: none; }
.goblin-bubble.show { opacity: 1; }
@media (max-width: 760px) {
  .goblin-pet { bottom: 100%; margin-bottom: -2px; }
}

/* Slim welcome note, open on load: logo, a line of text, one button. */
.logo-welcome .welcome-content { grid-template-columns: 1fr; min-height: 0; }
.interactive-desktop .logo-welcome .welcome-copy { padding: 22px 26px 24px; }
.interactive-desktop .logo-welcome .welcome-logo { margin: 0 -8px 16px; }
@media (min-width: 761px) {
  .interactive-desktop .welcome-window { left: calc(50% - 240px); top: 12%; width: min(480px,calc(100% - 390px)); height: auto; min-height: 0; }
  .interactive-desktop .about-window { left: calc(50% - 220px); top: 30px; width: min(440px,calc(100% - 390px)); height: auto; min-height: 0; }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .interactive-desktop .welcome-window { left: 120px; width: min(480px,calc(100% - 320px)); }
  .interactive-desktop .about-window { left: 120px; width: min(440px,calc(100% - 320px)); }
}

/* About: a tall photo cropped to the top, then the blurb. */
.interactive-desktop .profile-photo { height: 360px; object-position: center 12%; }

/* Phones: no taskbar (phones and browsers already have bars down there), so windows can't be
   minimised, and the radio becomes a thin player pinned to the bottom of the screen. Closing it
   pauses the music and puts a ♪ in the menu bar to bring it back. */
.radio-widget-close, .menu-bar .radio-reopen { display: none; }
@media (max-width: 760px) {
  .interactive-desktop .taskbar { display: none; }
  .interactive-desktop .window-actions [data-action=minimize] { display: none; }
  .interactive-desktop .desktop { min-height: calc(100svh - 64px); padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .radio-closed .desktop { padding-bottom: 35px; }
  .interactive-desktop .profile-photo { height: 320px; }

  .radio-widget { position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; width: auto; grid-template-columns: 44px minmax(0,1fr); align-items: center; gap: 8px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-width: 1px 0 0; box-shadow: inset 0 1px #f0f2ff, 0 -2px 0 #20264133; }
  .radio-closed .radio-widget { display: none; }
  .radio-widget-cover { width: 44px; height: 44px; }
  .radio-widget-main { flex-direction: row; align-items: center; gap: 6px; }
  .radio-widget-screen { flex: 1; min-width: 0; padding: 3px 8px 4px; }
  .radio-widget-top { display: none; }
  .radio-widget .radio-now { margin-top: 0; }
  .radio-widget .radio-now strong { font-size: 18px; }
  .radio-widget .radio-now span { font-size: 14px; }
  .radio-widget .radio-now strong, .radio-widget .radio-now span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .radio-widget-controls [data-radio=prev], .radio-widget-controls input { display: none; }
  .radio-widget-controls button { width: 34px; height: 34px; font-size: 13px; }
  .radio-widget-controls .radio-play { width: 40px; }
  .radio-widget-close { display: block; font-size: 17px; }
  .radio-closed .menu-bar .radio-reopen { display: flex; font-size: 17px; }

  /* The welcome note leads the page, above the icons. */
  .welcome-window { order: -1; }
  .desktop-icons { grid-template-columns: repeat(5,minmax(0,1fr)); }
  /* Homelab links only as wide as they look, so the empty space beside them isn't a tap target. */
  .sitemap-home, .sitemap-node { width: fit-content; max-width: 100%; }
}

/* Phones: pin the wallpaper to the screen. The page grows and shrinks as windows open and close,
   and a cover-sized background on the page itself re-zooms (and seems to jump) every time. */
@media (max-width: 760px) {
  .desktop { background: #7c809b; }
  .desktop::before {
    position: fixed; top: 0; right: 0; bottom: auto; left: 0; height: 100vh; height: 100lvh;
    background-color: #7c809b;
    background-image:
      linear-gradient(135deg, #d8cbed1a, transparent 55%, #454c681a),
      linear-gradient(#e8e6ff14 1px, transparent 1px),
      linear-gradient(90deg, #e8e6ff14 1px, transparent 1px),
      linear-gradient(#7c809bdc, #7c809bdc),
      url('../assets/wallpaper.jpg');
    background-size: auto, 32px 32px, 32px 32px, cover, cover;
    background-position: center, center, center, center, center 30%;
  }
}
