/* ==========================================================================
   RammWiki Flashcards — preservation desktop
   Dark Citizen-inspired chrome with the RammWiki olive accent
   (original CSS artwork, no third-party UI assets).
   Sections:
     1. Base + wallpaper
     2. Desktop icons
     3. Windows (title bar, buttons, resize)
     4. Explorer catalog
     5. Dialogs + shared controls
     6. Taskbar, Start menu, tray
     7. Player page (iframe document)
     8. Responsive + reduced motion
     9. Screensaver preview page (artifact window iframe)
    10. Mutter Enhanced CD preview page (artifact window iframe)
   ========================================================================== */

:root {
  --taskbar-height: 40px;
  --rw-surface-0: #161613;
  --rw-surface-1: #1c1c19;
  --rw-border: #3b3b34;
  --rw-border-soft: #2a2a25;
  --rw-text: #eae7df;
  --rw-text-muted: #b7b2a6;
  --rw-text-subtle: #8f8b80;
  --rw-text-disabled: #6b685f;
  --rw-accent: #ae9d75;
  --rw-accent-bright: #cfbd92;
  --rw-accent-soft: #8d7f5d;
  --rw-accent-deep: #6f6448;
  --rw-accent-ink: #17150f;
  --rw-accent-tint: rgba(174, 157, 117, 0.14);
  --rw-accent-tint-strong: rgba(174, 157, 117, 0.3);
  --rw-shadow: rgba(0, 0, 0, 0.7);
  --rw-danger: #d4645a;
  --rw-success: #7fb37f;
  --rw-warning: #d3a94f;
  --rw-info: #9db4d4;
  --rw-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.desktop-page {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #0d0d0b;
  color: var(--rw-text);
  font-family: var(--rw-font);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 2px dashed var(--rw-accent-bright);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   1. Base + wallpaper
   -------------------------------------------------------------------------- */

.wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1100px 640px at 82% 6%, rgba(174, 157, 117, 0.14) 0%, rgba(174, 157, 117, 0) 62%),
    radial-gradient(900px 620px at 8% 96%, rgba(174, 157, 117, 0.1) 0%, rgba(174, 157, 117, 0) 60%),
    linear-gradient(160deg, #1b1b17 0%, #141412 45%, #0d0d0b 100%);
}

.wallpaper-glow {
  position: absolute;
  top: -22%;
  left: 50%;
  width: 120%;
  height: 78%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 0%, rgba(207, 189, 146, 0.1) 0%, rgba(207, 189, 146, 0) 68%);
}

.wallpaper-rings {
  position: absolute;
  right: -14%;
  bottom: -30%;
  width: 68vmax;
  height: 68vmax;
  border-radius: 50%;
  border: 1px solid rgba(174, 157, 117, 0.1);
  box-shadow:
    0 0 0 60px rgba(174, 157, 117, 0.035),
    0 0 0 150px rgba(174, 157, 117, 0.02);
}

.wallpaper-mark {
  position: absolute;
  right: clamp(18px, 6vw, 96px);
  bottom: clamp(58px, 12vh, 132px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  text-align: right;
}

.wallpaper-wordmark {
  width: clamp(200px, 26vw, 330px);
  height: auto;
  opacity: 0.92;
}

.wallpaper-tagline {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(174, 157, 117, 0.35);
  color: var(--rw-text-subtle);
  font-size: 10.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.wallpaper-texture {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.014) 0 1px, rgba(255, 255, 255, 0) 1px 4px);
  mix-blend-mode: overlay;
}

.desktop {
  position: fixed;
  inset: 0 0 var(--taskbar-height) 0;
  z-index: 1;
  overflow: hidden;
}

.desktop-icons {
  position: absolute;
  inset: 14px auto auto 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 96px;
  z-index: 2;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 96px;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #f2efe7;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.desktop-icon:hover,
.desktop-icon:focus-visible {
  background: var(--rw-accent-tint);
  border-color: rgba(207, 189, 146, 0.55);
}

.desktop-icon-label {
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
}

.desktop-icon-image,
.quick-icon,
.start-item-icon,
.address-icon {
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.desktop-icon-image {
  width: 40px;
  height: 40px;
}

.icon-catalog {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect x='3' y='9' width='26' height='24' rx='3' fill='%23242420' stroke='%237c6e50'/%3E%3Crect x='8' y='4' width='27' height='25' rx='3' fill='%231c1c19' stroke='%23ae9d75'/%3E%3Cpath d='M12 10h18M12 15h18M12 20h12' stroke='%238d7f5d' stroke-width='2'/%3E%3Cpath d='M23 23l9 5-4 1 2 4-2 1-2-4-3 3z' fill='%23cfbd92' stroke='%236f6448'/%3E%3C/svg%3E");
}

.icon-help {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect x='4' y='6' width='32' height='27' rx='4' fill='%231c1c19' stroke='%23ae9d75'/%3E%3Crect x='4' y='6' width='32' height='7' rx='4' fill='%23ae9d75'/%3E%3Ctext x='20' y='28' font-family='Verdana, sans-serif' font-size='16' font-weight='bold' text-anchor='middle' fill='%23cfbd92'%3E%3F%3C/text%3E%3C/svg%3E");
}

.icon-search {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='10' r='6' fill='none' stroke='%23cfbd92' stroke-width='2.5'/%3E%3Cpath d='M15 15l6 6' stroke='%23cfbd92' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}

.icon-play {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23ae9d75'/%3E%3Cpath d='M9 7l9 5-9 5z' fill='%2317150f'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   2. Windows
   -------------------------------------------------------------------------- */

.window-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 280px;
  min-height: 180px;
  pointer-events: auto;
  background: var(--rw-surface-0);
  border: 1px solid var(--rw-border);
  border-top-width: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 12px 32px var(--rw-shadow);
  overflow: hidden;
}

.window:not(.window--active) {
  border-color: var(--rw-border-soft);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.window--maximized {
  border-radius: 0;
  box-shadow: none;
}

.window--minimized {
  display: none;
}

.window--dialog {
  border-radius: 8px 8px 0 0;
}

.window-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 4px 0 6px;
  flex: none;
  background: linear-gradient(180deg, #33332c 0%, #282823 45%, #1e1e1a 100%);
  border-bottom: 1px solid rgba(174, 157, 117, 0.55);
  color: #f2efe7;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.window:not(.window--active) .window-titlebar {
  background: linear-gradient(180deg, #232320 0%, #1b1b18 100%);
  border-bottom-color: rgba(174, 157, 117, 0.18);
  color: var(--rw-text-subtle);
}

.window-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 12.5px;
  font-weight: bold;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.65);
}

.window-title-icon {
  width: 16px;
  height: 16px;
  flex: none;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.window-buttons {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

.window-button {
  width: 21px;
  height: 21px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  color: #f2efe7;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 2px rgba(0, 0, 0, 0.5);
}

.window-button.minimize,
.window-button.maximize {
  background: linear-gradient(180deg, #45453c 0%, #2b2b26 55%, #1d1d19 100%);
}

.window-button.close {
  background: linear-gradient(180deg, #b35a4e 0%, #8a3a30 48%, #5f2620 100%);
}

.window-button.minimize:hover,
.window-button.maximize:hover {
  background: linear-gradient(180deg, #5a5a4e 0%, #34342d 55%, #222220 100%);
}

.window-button.close:hover {
  background: linear-gradient(180deg, #cf6f60 0%, #a3483c 48%, #74302a 100%);
}

.window-button:active {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55);
}

.window-button .glyph {
  display: block;
  pointer-events: none;
}

.glyph-minimize {
  width: 9px;
  height: 8px;
  border-bottom: 2px solid #f2efe7;
  margin-top: 4px;
}

.glyph-maximize {
  width: 10px;
  height: 9px;
  border: 2px solid #f2efe7;
  border-top-width: 3px;
}

.glyph-restore {
  width: 9px;
  height: 7px;
  border: 2px solid #f2efe7;
  box-shadow: 2px -2px 0 0 #f2efe7;
  transform: translate(-1px, 2px);
}

.glyph-close {
  position: relative;
  width: 11px;
  height: 11px;
}

.glyph-close::before,
.glyph-close::after {
  content: "";
  position: absolute;
  left: 4px;
  top: -1px;
  width: 2px;
  height: 13px;
  background: #f2efe7;
}

.glyph-close::before { transform: rotate(45deg); }
.glyph-close::after { transform: rotate(-45deg); }

.window-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.resize-handle {
  position: absolute;
  z-index: 5;
  touch-action: none;
}

.resize-handle[data-dir="n"] { top: -3px; left: 8px; right: 8px; height: 6px; cursor: ns-resize; }
.resize-handle[data-dir="s"] { bottom: -3px; left: 8px; right: 8px; height: 6px; cursor: ns-resize; }
.resize-handle[data-dir="w"] { left: -3px; top: 8px; bottom: 8px; width: 6px; cursor: ew-resize; }
.resize-handle[data-dir="e"] { right: -3px; top: 8px; bottom: 8px; width: 6px; cursor: ew-resize; }
.resize-handle[data-dir="nw"] { top: -3px; left: -3px; width: 12px; height: 12px; cursor: nwse-resize; }
.resize-handle[data-dir="ne"] { top: -3px; right: -3px; width: 12px; height: 12px; cursor: nesw-resize; }
.resize-handle[data-dir="sw"] { bottom: -3px; left: -3px; width: 12px; height: 12px; cursor: nesw-resize; }
.resize-handle[data-dir="se"] { bottom: -3px; right: -3px; width: 14px; height: 14px; cursor: nwse-resize; }

.window--maximized .resize-handle,
.window--compact .resize-handle {
  display: none;
}

/* --------------------------------------------------------------------------
   3. Explorer catalog
   -------------------------------------------------------------------------- */

.explorer {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--rw-surface-0);
}

.explorer-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 4px 6px;
  background: linear-gradient(180deg, #232320 0%, #1c1c19 55%, #171714 100%);
  border-bottom: 1px solid #2f2f29;
}

.toolbar-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--rw-text);
  font-size: 12px;
  cursor: pointer;
}

.toolbar-button:hover:not(:disabled),
.toolbar-button:focus-visible {
  border-color: rgba(174, 157, 117, 0.55);
  background: linear-gradient(180deg, #33332c 0%, #26261f 50%, #1f1f1a 100%);
}

.toolbar-button:disabled {
  color: var(--rw-text-disabled);
  cursor: default;
}

.toolbar-button .toolbar-glyph {
  font-size: 14px;
  line-height: 1;
}

.address-bar {
  flex: 1;
  min-width: 110px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 4px 0 7px;
  border: 1px solid var(--rw-border);
  border-radius: 3px;
  background: #0f0f0d;
}

.address-label {
  color: var(--rw-text-subtle);
  font-size: 11.5px;
  flex: none;
}

.address-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--rw-text);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-icon {
  width: 16px;
  height: 16px;
  flex: none;
}

.search-box {
  position: relative;
  flex: none;
  width: min(220px, 32vw);
}

.search-box input {
  width: 100%;
  height: 26px;
  padding: 0 26px 0 8px;
  border: 1px solid var(--rw-border);
  border-radius: 3px;
  background: #0f0f0d;
  color: var(--rw-text);
  font: inherit;
  font-size: 12px;
}

.search-box input::placeholder {
  color: var(--rw-text-disabled);
}

.search-box .search-glyph {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.75;
}

.explorer-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  background: var(--rw-surface-0);
}

.task-pane {
  min-width: 0;
  padding: 10px 10px 14px;
  overflow: auto;
  background: linear-gradient(180deg, #1e1e1a 0%, #191916 100%);
  border-right: 1px solid var(--rw-border-soft);
}

.task-pane h3 {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--rw-accent-bright);
  letter-spacing: 0.02em;
}

.task-pane .task-separator {
  height: 1px;
  margin: 12px 0;
  background: var(--rw-border-soft);
}

.task-list {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.task-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--rw-accent-bright);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.task-link:hover,
.task-link:focus-visible {
  border-color: rgba(174, 157, 117, 0.55);
  background: rgba(174, 157, 117, 0.12);
}

.task-link[aria-pressed="true"] {
  border-color: var(--rw-accent-soft);
  background: var(--rw-accent-tint-strong);
  font-weight: bold;
}

.task-link .task-count {
  flex: none;
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 8px;
  background: #22221e;
  border: 1px solid var(--rw-border);
  color: var(--rw-accent-bright);
  font-size: 10.5px;
  text-align: center;
}

.task-pane .hint {
  margin: 8px 2px 0;
  color: var(--rw-text-subtle);
  font-size: 11px;
  line-height: 1.45;
}

.pane-launch {
  width: 100%;
  margin-top: 6px;
}

.explorer-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--rw-surface-0);
}

.cards-grid {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  align-content: start;
  background: var(--rw-surface-0);
}

.cards-grid:focus {
  outline: none;
}

.card-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid #34342d;
  border-radius: 3px;
  background: #1b1b18;
  padding: 0;
  color: var(--rw-text);
  text-align: left;
  cursor: default;
  overflow: hidden;
  min-height: 132px;
}

.card-tile:hover {
  border-color: var(--rw-accent);
  background: #22221e;
}

.card-tile[aria-selected="true"] {
  border-color: var(--rw-accent);
  background: rgba(174, 157, 117, 0.16);
}

.card-tile:focus-visible {
  outline: 2px solid var(--rw-accent-bright);
  outline-offset: -3px;
}

.tile-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, #262620 0%, #1b1b18 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(135deg, #232320 0 10px, #1b1b18 10px 20px);
  color: var(--rw-text-subtle);
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 0.08em;
}

.status-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  max-width: calc(100% - 10px);
  padding: 1px 6px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.02em;
  color: #fff;
  background: #4c4a42;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge[data-tone="playable"] { background: #3f7d4a; }
.status-badge[data-tone="partial"] { background: #8a6320; }
.status-badge[data-tone="unverified"] { background: #44597a; }
.status-badge[data-tone="unsupported"] { background: #8a3a30; }
.status-badge[data-tone="unknown"] { background: #4c4a42; }

.tile-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 8px 8px;
}

.tile-title {
  font-size: 12px;
  font-weight: bold;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tile-meta {
  color: var(--rw-text-subtle);
  font-size: 11px;
}

.tile-launch {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--rw-accent-deep);
  border-radius: 4px;
  background: linear-gradient(180deg, #d3c195 0%, #a4905f 55%, #7c6e50 100%);
  color: var(--rw-accent-ink);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.tile-launch:hover {
  background: linear-gradient(180deg, #e2d2a8 0%, #b6a26e 55%, #8b7c5a 100%);
}

.explorer-status {
  flex: none;
  padding: 5px 10px;
  border-top: 1px solid var(--rw-border-soft);
  background: #1b1b18;
  color: var(--rw-text-muted);
  font-size: 11.5px;
}

.explorer-status[data-tone="error"] {
  background: #2a1a18;
  color: #e0a29a;
}

.explorer-status[data-tone="info"] {
  background: #1f1e16;
  color: #d6c9a8;
}

.details-pane {
  min-width: 0;
  overflow: auto;
  border-left: 1px solid #2f2f29;
  background: linear-gradient(180deg, #1b1b18 0%, #151512 100%);
}

.details-header {
  padding: 6px 10px;
  background: linear-gradient(180deg, #b7a67e 0%, #8d7f5d 100%);
  color: #191710;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.03em;
}

.details-content {
  padding: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--rw-text);
}

.details-empty {
  color: var(--rw-text-subtle);
  font-size: 12px;
  line-height: 1.6;
}

.details-title {
  margin: 0 0 8px;
  font-size: 14px;
  color: #f2efe7;
  line-height: 1.3;
}

.details-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--rw-border);
  background: #101010;
  object-fit: cover;
  display: block;
  margin-bottom: 8px;
}

.details-status {
  display: inline-block;
  margin-bottom: 8px;
  padding: 1px 8px;
  border-radius: 8px;
  color: #fff;
  font-size: 10.5px;
  font-weight: bold;
}

.details-status[data-tone="playable"] { background: #3f7d4a; }
.details-status[data-tone="partial"] { background: #8a6320; }
.details-status[data-tone="unverified"] { background: #44597a; }
.details-status[data-tone="unsupported"] { background: #8a3a30; }
.details-status[data-tone="unknown"] { background: #4c4a42; }

.details-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: 0 0 9px;
  font-size: 11.5px;
}

.details-meta dt {
  color: var(--rw-text-subtle);
  font-weight: bold;
}

.details-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.details-section {
  margin: 0 0 9px;
}

.details-section h4 {
  margin: 0 0 3px;
  font-size: 11.5px;
  color: var(--rw-accent-bright);
}

.details-section p {
  margin: 0;
  white-space: pre-line;
}

.details-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.control-chip {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--rw-border);
  border-radius: 9px;
  background: #22221e;
  font-size: 10.5px;
  color: var(--rw-text);
}

.details-warning {
  margin: 0 0 9px;
  padding: 6px 8px;
  border: 1px solid #6e5c28;
  border-radius: 3px;
  background: #2a2415;
  color: #e6cd8d;
  font-size: 11.5px;
}

.details-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.details-actions .hint {
  margin: 0;
  color: var(--rw-text-subtle);
  font-size: 10.5px;
  line-height: 1.45;
}

/* Artifact cards: downloads and the extracted-sprite gallery. */

.download-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.download-item {
  display: flex;
  flex-direction: column;
}

.download-link {
  color: var(--rw-accent-bright);
  font-weight: bold;
  text-decoration: underline;
}

.download-link:hover,
.download-link:focus-visible {
  color: #efe3c6;
}

.download-meta {
  color: var(--rw-text-subtle);
  font-size: 10.5px;
}

.artifact-content {
  height: 100%;
  overflow: auto;
  padding: 10px;
  background: #0d0d0b;
  color: #e2ddd2;
  font-size: 12px;
}

.artifact-preview {
  border: 1px solid var(--rw-border);
  background: #000;
  margin-bottom: 12px;
}

.artifact-frame {
  display: block;
  width: 100%;
  height: min(64vh, 620px);
  border: 0;
  background: #000;
}

.artifact-section {
  margin: 0 0 14px;
}

.artifact-heading {
  margin: 0 0 2px;
  font-size: 13px;
  color: var(--rw-accent-bright);
}

.artifact-hint {
  margin: 0 0 8px;
  color: var(--rw-text-subtle);
  font-size: 11px;
}

.artifact-content .download-link {
  color: var(--rw-accent-bright);
}

.artifact-content .download-link:hover,
.artifact-content .download-link:focus-visible {
  color: #f2e9d2;
}

.artifact-content .download-meta {
  color: var(--rw-text-subtle);
}

.artifact-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.gallery-item {
  margin: 0;
  border: 1px solid var(--rw-border);
  background: #000;
}

.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #000;
}

.gallery-item figcaption {
  padding: 5px 6px;
  color: #9c978a;
  font-size: 10.5px;
  line-height: 1.35;
}

.window[data-window-id="artifact"] .window-body {
  padding: 0;
  background: #0d0d0b;
}

/* Browser-game embed window (Asche zu Asche) */
.window[data-window-id="embed"] .window-body {
  padding: 0;
  background: #0d0d0b;
}

.embed-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #0d0d0b;
}

.embed-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 0;
  display: block;
  background: #000;
}

.embed-note {
  flex: none;
  margin: 0;
  padding: 5px 9px;
  background: linear-gradient(180deg, #232320 0%, #1b1b18 100%);
  border-top: 1px solid #2f2f29;
  color: var(--rw-text-subtle);
  font-size: 10.5px;
  line-height: 1.4;
}

.explorer-statusbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  min-height: 24px;
  padding: 2px 10px;
  background: linear-gradient(180deg, #1f1f1b 0%, #191916 100%);
  border-top: 1px solid #2f2f29;
  color: var(--rw-text-muted);
  font-size: 11px;
}

.explorer-statusbar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#status-selection {
  flex: 1;
  color: var(--rw-accent-bright);
}

#status-player {
  color: var(--rw-success);
}

/* --------------------------------------------------------------------------
   4. Shared controls, player status, dialogs
   -------------------------------------------------------------------------- */

.rw-button {
  position: relative;
  min-height: 26px;
  padding: 3px 13px;
  border: 1px solid var(--rw-border);
  border-radius: 4px;
  background: linear-gradient(180deg, #2c2c27 0%, #232320 55%, #1b1b18 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--rw-text);
  font-size: 12px;
  cursor: pointer;
}

.rw-button:hover:not(:disabled) {
  border-color: var(--rw-accent);
  box-shadow: inset 0 0 0 1px rgba(174, 157, 117, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.rw-button:active:not(:disabled) {
  background: linear-gradient(180deg, #1b1b18 0%, #232320 45%, #2c2c27 100%);
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.rw-button:disabled {
  color: var(--rw-text-disabled);
  border-color: #34342d;
  cursor: not-allowed;
}

.rw-button.primary {
  font-weight: bold;
  border-color: var(--rw-accent-deep);
  background: linear-gradient(180deg, #d3c195 0%, #a4905f 52%, #7c6e50 100%);
  color: var(--rw-accent-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.rw-button.primary:hover:not(:disabled) {
  border-color: var(--rw-accent-bright);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.rw-button:focus-visible {
  outline: 2px solid var(--rw-accent-bright);
  outline-offset: 2px;
}

.help-content {
  padding: 14px 16px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--rw-text);
}

.help-content h3 {
  margin: 14px 0 6px;
  font-size: 13px;
  color: var(--rw-accent-bright);
}

.help-content h3:first-child {
  margin-top: 0;
}

.help-content p {
  margin: 0 0 8px;
}

.help-content ul {
  margin: 0 0 8px;
  padding-left: 20px;
}

.help-content li {
  margin-bottom: 4px;
}

.help-content kbd {
  display: inline-block;
  min-width: 16px;
  padding: 1px 4px;
  border: 1px solid var(--rw-border);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: #22221e;
  font-family: inherit;
  font-size: 11px;
  text-align: center;
}

.player-window-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #0d0d0b;
}

.player-statusbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 4px 9px;
  background: linear-gradient(180deg, #232320 0%, #1b1b18 100%);
  border-bottom: 1px solid #2f2f29;
  font-size: 11.5px;
  color: var(--rw-text-muted);
}

.player-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: #6b685f;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
}

.player-status-dot[data-state="loading"] { background: var(--rw-warning); }
.player-status-dot[data-state="ready"],
.player-status-dot[data-state="playing"] { background: var(--rw-success); }
.player-status-dot[data-state="paused"] { background: var(--rw-info); }
.player-status-dot[data-state="error"],
.player-status-dot[data-state="unsupported"] { background: var(--rw-danger); }

#player-window-status {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#player-window-card {
  color: var(--rw-text-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-stage-holder {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
}

.player-stage-holder iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.player-switch-note {
  flex: none;
  margin: 0;
  padding: 3px 9px;
  background: #2a2415;
  color: #e6cd8d;
  font-size: 10.5px;
  line-height: 1.4;
}

.shutdown {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 4, 3, 0.72);
}

.shutdown-box {
  width: min(420px, calc(100vw - 32px));
  padding: 18px 20px 16px;
  border: 1px solid var(--rw-border);
  border-radius: 8px 8px 4px 4px;
  background: var(--rw-surface-1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
}

.shutdown-box h2 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #f2efe7;
}

.shutdown-box p {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.55;
}

.shutdown-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.noscript {
  position: fixed;
  inset: auto 16px 56px 16px;
  z-index: 4000;
  padding: 12px 14px;
  border: 1px solid #6e3a32;
  border-radius: 4px;
  background: #221614;
  color: #e0a29a;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   5. Taskbar, Start menu, tray
   -------------------------------------------------------------------------- */

.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  height: var(--taskbar-height);
  display: flex;
  align-items: stretch;
  background: linear-gradient(180deg, #232320 0%, #1a1a17 45%, #111110 100%);
  border-top: 1px solid rgba(174, 157, 117, 0.45);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.6);
  color: var(--rw-text);
}

.start-button {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 0 18px 2px 10px;
  border: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(180deg, #cdbb90 0%, #a4905f 48%, #7c6e50 100%);
  color: var(--rw-accent-ink);
  font-size: 15px;
  font-weight: bold;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.start-button:hover,
.start-button[aria-expanded="true"] {
  background: linear-gradient(180deg, #e0cfa4 0%, #b6a26e 48%, #8b7c5a 100%);
}

.start-logo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 19px;
  height: 19px;
  flex: none;
  transform: perspective(40px) rotateY(-14deg);
}

.start-logo i {
  display: block;
  border-radius: 2px;
}

.start-logo i:nth-child(1) { background: #e6d9b4; }
.start-logo i:nth-child(2) { background: #cdbb90; }
.start-logo i:nth-child(3) { background: #a4905f; }
.start-logo i:nth-child(4) { background: #7c6e50; }

.quick-launch {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  padding: 0 6px;
}

.quick-button {
  width: 27px;
  height: 27px;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
}

.quick-button:hover,
.quick-button:focus-visible {
  border-color: rgba(207, 189, 146, 0.5);
  background: var(--rw-accent-tint);
}

.quick-icon {
  display: block;
  width: 100%;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.quick-divider {
  width: 1px;
  height: 26px;
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.35);
}

.task-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  padding: 0 4px;
  overflow: hidden;
}

.task-button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 90px;
  max-width: 180px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--rw-border);
  border-radius: 3px;
  background: linear-gradient(180deg, #2b2b26 0%, #1f1f1b 55%, #181815 100%);
  color: var(--rw-text);
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  white-space: nowrap;
  overflow: hidden;
}

.task-button:hover {
  background: linear-gradient(180deg, #3a3a32 0%, #262622 55%, #1c1c19 100%);
}

.task-button[aria-pressed="true"] {
  background: linear-gradient(180deg, #141412 0%, #1d1d19 55%, #262621 100%);
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(174, 157, 117, 0.28);
}

.task-button .task-button-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tray {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 0 12px 0 10px;
  background: linear-gradient(180deg, #1e1e1a 0%, #161614 100%);
  border-left: 1px solid #33332c;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.06);
}

.tray-icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.tray-volume {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z' fill='%23cfbd92'/%3E%3Cpath d='M15 8a6 6 0 010 8M17.5 5.5a10 10 0 010 13' stroke='%23cfbd92' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

.clock {
  border: 0;
  background: transparent;
  color: var(--rw-text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 2px;
}

.clock:hover {
  text-decoration: underline;
}

/* Start menu */

.start-menu {
  position: fixed;
  left: 4px;
  bottom: calc(var(--taskbar-height) + 2px);
  z-index: 1100;
  width: min(400px, calc(100vw - 8px));
  border: 1px solid var(--rw-border);
  border-radius: 8px 8px 0 0;
  background: #171714;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.start-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  background: linear-gradient(180deg, #33332c 0%, #262621 55%, #1c1c19 100%);
  border-bottom: 1px solid rgba(174, 157, 117, 0.45);
  color: #f2efe7;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
}

.start-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 2px solid rgba(207, 189, 146, 0.8);
  border-radius: 5px;
  background: linear-gradient(135deg, #cdbb90 0%, #8d7f5d 60%, #4c4a3c 100%);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35);
  color: var(--rw-accent-ink);
  font-size: 15px;
  font-weight: bold;
}

.start-avatar::after {
  content: "R";
}

.start-body {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
}

.start-column {
  display: flex;
  flex-direction: column;
  padding: 6px;
  gap: 2px;
}

.start-left {
  background: #1b1b18;
}

.start-right {
  background: #141412;
  border-left: 1px solid var(--rw-border-soft);
}

.start-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.start-item:hover,
.start-item:focus-visible {
  border-color: rgba(174, 157, 117, 0.6);
  background: linear-gradient(180deg, rgba(174, 157, 117, 0.18) 0%, rgba(174, 157, 117, 0.1) 100%);
}

.start-item-icon {
  width: 26px;
  height: 26px;
  flex: none;
}

.start-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.start-item-text strong {
  font-size: 12.5px;
  color: var(--rw-text);
}

.start-item-text small {
  color: var(--rw-text-subtle);
  font-size: 10.5px;
}

.start-link {
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--rw-accent-bright);
  font-size: 12px;
  font-weight: bold;
  text-align: left;
  cursor: pointer;
}

.start-link:hover,
.start-link:focus-visible {
  border-color: rgba(174, 157, 117, 0.5);
  background: var(--rw-accent-tint);
}

.start-separator {
  height: 1px;
  margin: 4px 6px;
  background: #33332c;
}

/* --------------------------------------------------------------------------
   6. Player page (loaded inside the player window iframe)
   -------------------------------------------------------------------------- */

body.player-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0d0d0b;
  color: #e6e2d8;
  font-family: var(--rw-font);
  font-size: 13px;
  overflow: hidden;
}

.player-page .player-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 7px 12px;
  background: linear-gradient(180deg, #2e2e28 0%, #22221e 60%, #1a1a17 100%);
  border-bottom: 1px solid rgba(174, 157, 117, 0.5);
  color: #f2efe7;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
}

.player-page .player-header h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-page .player-year {
  flex: none;
  font-size: 11.5px;
  opacity: 0.9;
}

.player-page .player-stage-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
}

.player-page .player-stage {
  position: absolute;
  inset: 0;
}

.player-page .player-stage ruffle-player {
  display: block;
  width: 100%;
  height: 100%;
}

.player-page .player-stage > * {
  display: block;
  width: 100%;
  height: 100%;
}

.player-page .player-stage > *:focus,
.player-page .player-stage > *:focus-visible {
  outline: none;
}

.player-page .player-stage-wrap:focus-within {
  box-shadow: inset 0 0 0 2px rgba(174, 157, 117, 0.55);
}

.player-page .player-panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at 50% 30%, #24221b 0%, #0c0c0a 70%);
  color: #e4dfd4;
  overflow: auto;
}

.player-page .player-panel h2 {
  margin: 0;
  font-size: 16px;
  color: #f2efe7;
}

.player-page .player-panel p {
  max-width: 46ch;
  margin: 0;
  color: #b3aea2;
  font-size: 12px;
  line-height: 1.6;
}

.player-page .player-panel[data-tone="error"] h2 { color: #f0a99e; }
.player-page .player-panel[data-tone="unsupported"] h2 { color: #e6cd8d; }

.player-page .player-panel .player-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.player-page .spinner {
  width: 34px;
  height: 34px;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--rw-accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.player-page .player-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  flex: none;
  padding: 8px 12px;
  background: linear-gradient(180deg, #1f1f1b 0%, #171714 100%);
  border-top: 1px solid #33332c;
  color: var(--rw-text);
}

.player-page .player-toolbar .volume-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-page .player-toolbar label {
  font-size: 12px;
}

.player-page .player-toolbar input[type="range"] {
  width: 120px;
  accent-color: var(--rw-accent);
}

.player-page .player-toolbar output {
  min-width: 38px;
  font-size: 11.5px;
  color: var(--rw-text-muted);
}

.player-page .player-toolbar .toolbar-status {
  flex: 1;
  min-width: 120px;
  color: var(--rw-text-muted);
  font-size: 11.5px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-page .touch-controls {
  display: flex;
  gap: 8px;
  flex: none;
  padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: #121210;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.player-page .touch-controls[hidden] {
  display: none;
}

.player-page .touch-controls button {
  flex: 1;
  min-width: 0;
  min-height: 54px;
  padding: 8px 4px;
  border: 1px solid #4a4a42;
  border-radius: 5px;
  background: linear-gradient(180deg, #2e2e28 0%, #1d1d19 100%);
  color: var(--rw-text);
  font: bold 14px var(--rw-font);
  touch-action: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}

.player-page .touch-controls button.held {
  border-color: var(--rw-accent-bright);
  background: linear-gradient(180deg, #6f6448 0%, #4a4232 100%);
}

.player-page .touch-toggle[aria-pressed="true"] {
  border-color: var(--rw-accent-bright);
  box-shadow: inset 0 0 0 1px rgba(207, 189, 146, 0.6);
}

.player-page .player-notes {
  flex: none;
  margin: 0;
  padding: 6px 12px 5px;
  background: #121210;
  color: #d8d2c4;
  font-size: 11.5px;
  line-height: 1.45;
  max-height: 5.2em;
  overflow: auto;
}

.player-page .player-notes p {
  margin: 0 0 2px;
}

.player-page .player-notes .player-controls-line {
  color: #9c978a;
}

.player-page .player-notes:empty {
  display: none;
}

.player-page .player-details {
  flex: none;
  background: #101010;
  border-top: 1px solid var(--rw-border-soft);
  color: #9c978a;
  font-size: 11px;
}

.player-page .player-details summary {
  padding: 6px 12px;
  color: var(--rw-accent-bright);
  cursor: pointer;
  user-select: none;
}

.player-page .player-details summary:hover,
.player-page .player-details summary:focus-visible {
  background: #1a1a17;
}

.player-page .player-details-body {
  padding: 0 12px 8px;
  max-height: 12em;
  overflow: auto;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   7. Responsive + reduced motion
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .explorer-main {
    grid-template-columns: minmax(0, 1fr) 264px;
  }

  .task-pane {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --taskbar-height: 42px;
  }

  .wallpaper-mark {
    right: 16px;
    bottom: 64px;
    opacity: 0.55;
  }

  .wallpaper-wordmark {
    width: clamp(160px, 38vw, 230px);
  }

  .desktop-icons {
    inset: 10px auto auto 8px;
    gap: 12px;
    width: 84px;
  }

  .desktop-icon {
    width: 84px;
  }

  .explorer-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1.35fr) minmax(0, 1fr);
    overflow: auto;
  }

  .explorer-content {
    min-height: 240px;
  }

  .details-pane {
    border-left: 0;
    border-top: 1px solid #2f2f29;
  }

  .details-thumb {
    max-width: 220px;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    padding: 8px;
    gap: 8px;
  }

  .window-titlebar {
    cursor: default;
  }

  .quick-launch {
    display: none;
  }

  .task-button {
    max-width: 130px;
    min-width: 64px;
  }

  .tray {
    padding: 0 8px;
  }

  .start-menu {
    width: calc(100vw - 8px);
  }

  .start-body {
    grid-template-columns: 1fr;
  }

  .start-right {
    border-left: 0;
    border-top: 1px solid var(--rw-border-soft);
    flex-direction: row;
    flex-wrap: wrap;
  }

  .start-right .start-link {
    flex: 1 1 45%;
  }
}

@media (max-width: 620px) {
  .explorer-toolbar {
    flex-wrap: wrap;
    row-gap: 5px;
  }

  .toolbar-button .toolbar-label {
    display: none;
  }

  .toolbar-button {
    padding: 0 7px;
  }

  .address-bar {
    flex: 1 1 150px;
  }

  .search-box {
    flex: 1 1 100%;
    width: auto;
  }
}

@media (pointer: coarse) {
  .window-titlebar {
    height: 48px;
  }

  .window-button {
    width: 40px;
    height: 40px;
  }

  .tile-launch {
    width: 44px;
    height: 44px;
    font-size: 15px;
  }

  .toolbar-button {
    min-height: 40px;
  }

  .player-toolbar .rw-button {
    min-height: 40px;
  }

  .player-toolbar input[type="range"] {
    min-height: 36px;
  }

  .task-link {
    padding: 8px 8px;
  }

  .start-item {
    padding: 9px 8px;
  }
}

@media (max-width: 480px) {
  .tray-volume {
    display: none;
  }

  .window {
    min-width: 0;
    min-height: 0;
  }

  .player-page .player-toolbar {
    gap: 6px 8px;
  }

  .player-page .player-notes {
    max-height: 4.2em;
  }

  .player-page .player-toolbar input[type="range"] {
    width: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .player-page .spinner {
    animation-duration: 2.4s;
  }

  * {
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   8. Screensaver preview page (loaded inside the artifact window iframe)
   -------------------------------------------------------------------------- */

body.screensaver-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0d0d0b;
  color: #d8d2c4;
  font-family: var(--rw-font);
  font-size: 13px;
}

.screensaver-page .screensaver-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 7px 12px;
  background: linear-gradient(180deg, #2e2e28 0%, #22221e 60%, #1a1a17 100%);
  border-bottom: 1px solid rgba(174, 157, 117, 0.5);
  color: #f2efe7;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
}

.screensaver-page .screensaver-header h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screensaver-page .screensaver-year {
  flex: none;
  font-size: 11.5px;
  opacity: 0.9;
}

.screensaver-page .screensaver-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px;
  overflow: auto;
}

.screensaver-page .screensaver-stage-wrap {
  width: 100%;
  max-width: 960px;
}

.screensaver-page .screensaver-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  border: 1px solid var(--rw-border);
  overflow: hidden;
}

.screensaver-page .screensaver-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.screensaver-page .screensaver-sprites {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.screensaver-page .screensaver-sprite {
  position: absolute;
  image-rendering: pixelated;
  will-change: left, top;
}

.screensaver-page .screensaver-plate {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 62%;
  max-height: 46%;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 3;
  pointer-events: none;
}

.screensaver-page .screensaver-plate.is-visible {
  opacity: 1;
}

.screensaver-page .screensaver-stage.is-paused .screensaver-sprite,
.screensaver-page .screensaver-stage.is-paused .screensaver-plate {
  filter: saturate(0.6) brightness(0.85);
}

.screensaver-page .screensaver-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 18px;
  color: #9c978a;
  text-align: center;
  z-index: 4;
}

.screensaver-page .screensaver-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 960px;
}

.screensaver-page .screensaver-credit {
  color: var(--rw-text-subtle);
  font-size: 11px;
}

.screensaver-page .screensaver-note {
  max-width: 960px;
  margin: 0;
  color: #9c978a;
  font-size: 11.5px;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   10. Mutter Enhanced CD preview page (artifact window iframe)
   -------------------------------------------------------------------------- */

body.mutter-ecd-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0d0d0b;
  color: #d8d2c4;
  font-family: var(--rw-font);
  font-size: 13px;
}

.mutter-ecd-page .mutter-ecd-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 7px 12px;
  background: linear-gradient(180deg, #2e2e28 0%, #22221e 60%, #1a1a17 100%);
  border-bottom: 1px solid rgba(174, 157, 117, 0.5);
  color: #f2efe7;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
}

.mutter-ecd-page .mutter-ecd-header h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mutter-ecd-page .mutter-ecd-year {
  flex: none;
  font-size: 11.5px;
  opacity: 0.9;
}

.mutter-ecd-page .mutter-ecd-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px;
  overflow: auto;
}

.mutter-ecd-page code {
  color: var(--rw-accent-bright);
  font-size: 0.95em;
}

.mutter-ecd-page .ump-window {
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  background: #1a1a17;
  border: 1px solid var(--rw-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.mutter-ecd-page .ump-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(180deg, #302f29 0%, #26261f 100%);
  border-bottom: 1px solid rgba(174, 157, 117, 0.45);
}

.mutter-ecd-page .ump-titlebar-icon {
  flex: none;
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.mutter-ecd-page .ump-titlebar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #f2efe7;
}

.mutter-ecd-page .ump-titlebar-disc {
  flex: none;
  margin-left: auto;
  color: var(--rw-text-subtle);
  font-size: 11.5px;
}

.mutter-ecd-page .ump-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 2px;
  padding: 6px 8px;
  background: #20201c;
  border-bottom: 1px solid var(--rw-border-soft);
}

.mutter-ecd-page .ump-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 58px;
  padding: 4px 6px 3px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--rw-text-muted);
  cursor: pointer;
}

.mutter-ecd-page .ump-tool:hover {
  background: rgba(174, 157, 117, 0.08);
  border-color: rgba(174, 157, 117, 0.3);
}

.mutter-ecd-page .ump-tool.is-active {
  background: var(--rw-accent-tint);
  border-color: var(--rw-accent);
  color: var(--rw-text);
}

.mutter-ecd-page .ump-tool-icon {
  width: 32px;
  height: 16px;
  background-image: url("assets/cards/2001-mutter-enhanced-cd/ump-icons.png");
  background-repeat: no-repeat;
  background-size: 224px 16px;
  image-rendering: pixelated;
}

.mutter-ecd-page .ump-tool-icon--audio { background-position: 0 0; }
.mutter-ecd-page .ump-tool-icon--video { background-position: -32px 0; }
.mutter-ecd-page .ump-tool-icon--connect { background-position: -64px 0; }
.mutter-ecd-page .ump-tool-icon--media { background-position: -96px 0; }
.mutter-ecd-page .ump-tool-icon--help { background-position: -128px 0; }
.mutter-ecd-page .ump-tool-icon--prev { background-position: -160px 0; }
.mutter-ecd-page .ump-tool-icon--next { background-position: -192px 0; }

.mutter-ecd-page .ump-tool-label {
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.mutter-ecd-page .ump-toolbar-separator {
  width: 1px;
  margin: 4px 6px;
  background: var(--rw-border);
}

.mutter-ecd-page .ump-body {
  min-height: 300px;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.mutter-ecd-page .ump-panel {
  flex: 1;
  min-height: 0;
}

.mutter-ecd-page .ump-panel[hidden] {
  display: none;
}

.mutter-ecd-page .ump-panel-title {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--rw-accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.mutter-ecd-page .ump-panel-intro {
  max-width: 74ch;
  margin: 0 0 10px;
  color: var(--rw-text-muted);
  line-height: 1.55;
}

.mutter-ecd-page .ump-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mutter-ecd-page .ump-image-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  background: #000;
  border: 1px solid var(--rw-border);
}

.mutter-ecd-page .ump-image {
  display: block;
  max-width: 100%;
  max-height: 420px;
}

.mutter-ecd-page .ump-figure-caption {
  max-width: 74ch;
  color: var(--rw-text-subtle);
  font-size: 11.5px;
  line-height: 1.55;
}

.mutter-ecd-page .ump-tracks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mutter-ecd-page .ump-tracks li {
  display: flex;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px dotted var(--rw-border-soft);
}

.mutter-ecd-page .ump-track-number {
  width: 2ch;
  color: var(--rw-accent);
  font-variant-numeric: tabular-nums;
}

.mutter-ecd-page .ump-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mutter-ecd-page .ump-links li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 5px 0;
  border-bottom: 1px dotted var(--rw-border-soft);
}

.mutter-ecd-page .ump-link-name {
  min-width: 12ch;
  color: var(--rw-text);
}

.mutter-ecd-page .ump-link-url {
  color: var(--rw-warning);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  word-break: break-all;
}

.mutter-ecd-page .ump-video {
  width: 100%;
  max-width: 520px;
  background: #000;
  border: 1px solid var(--rw-border);
}

.mutter-ecd-page .ump-help {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.mutter-ecd-page .ump-help-about {
  width: min(489px, 100%);
  border: 1px solid var(--rw-border);
}

.mutter-ecd-page .ump-help-text {
  flex: 1;
  min-width: 240px;
}

.mutter-ecd-page .ump-help-text p {
  margin: 0;
  max-width: 60ch;
  line-height: 1.55;
  color: var(--rw-text-muted);
}

.mutter-ecd-page .ump-manual {
  max-height: 260px;
  overflow: auto;
  padding: 10px 12px;
  background: #141411;
  border: 1px solid var(--rw-border);
  color: var(--rw-text-muted);
  font-family: var(--rw-font);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.mutter-ecd-page .ump-statusbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px;
  background: #20201c;
  border-top: 1px solid var(--rw-border-soft);
  color: var(--rw-text-subtle);
  font-size: 11.5px;
}

.mutter-ecd-page .ump-statusbar-disc {
  flex: none;
}

.mutter-ecd-page .mutter-ecd-note {
  max-width: 980px;
  margin: 0;
  color: #9c978a;
  font-size: 11.5px;
  line-height: 1.55;
}

@media (max-width: 520px) {
  .mutter-ecd-page .ump-titlebar-disc {
    display: none;
  }

  .mutter-ecd-page .ump-tool {
    min-width: 48px;
  }

  .mutter-ecd-page .ump-image {
    max-height: 260px;
  }
}
