/* ── Fonts ─────────────────────────────────────────────── */
@font-face {
  font-family: 'Pixel Times';
  src: url('../assets/fonts/pixelated-times/pixelated-times-new-roman.otf') format('opentype');
  font-display: swap;
  /* This font is drawn small on its em square; scale it to match real Times. */
  size-adjust: 177%;
}
@font-face {
  /* Demo licence — personal use only. Not used anywhere yet. */
  font-family: 'Seratonin';
  src: url('../assets/fonts/seratonin/seratonin-regular.otf') format('opentype');
  font-display: swap;
}
@font-face {
  font-family: 'W95FA';
  src: url('../assets/fonts/w95fa/w95f.woff2') format('woff2'), url('../assets/fonts/w95fa/w95f.woff') format('woff');
  font-display: swap;
}

:root {
  --blue: #1803BB;
  --gray: #D9D9D9;
  --gray-lt: #EEEEEE;
  --gray-dk: #9C9C9C;
  --yellow: #F7D417;
  --yellow-lt: #FFE766;
  --yellow-dk: #7A5F00;
  --yellow-ink: #3B2F00;
  --red: #E52222;
  --black: #000;
  --ui: 'Pixelify Sans', 'W95FA', monospace;
  --serif: 'Pixel Times', 'Times New Roman', Times, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #6f8fb5;
  font-family: var(--ui);
  color: var(--black);
  overflow: hidden;
  -webkit-font-smoothing: none;
  font-smooth: never;
  cursor: url('../assets/icons/cursor.svg') 0 0, auto;
}
/* The pixel arrow everywhere, even over buttons and links (like an old OS). */
button, a, .mini, .mini .hit, .titlebar, .np-dots, .vol input { cursor: url('../assets/icons/cursor.svg') 0 0, pointer !important; }
input, textarea { cursor: text; }
button { font: inherit; color: inherit; }
img { image-rendering: pixelated; }
[hidden] { display: none !important; }

/* ── Desktop ───────────────────────────────────────────── */
.desktop {
  position: fixed;
  inset: 0;
  /* Portrait photo on a landscape screen: keep you and the harbour in frame. */
  background: #6f8fb5 url('../assets/images/desktop-bg.png') 30% 72% / cover no-repeat;
  image-rendering: pixelated;
}

.icons {
  position: absolute;
  top: 20px;
  left: 24px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap; /* overflow into a second column on shorter screens */
  align-content: flex-start;
  gap: 4px;
  max-height: calc(100vh - 40px);
  z-index: 2;
}
.icons-right { left: auto; right: 24px; }
.icon {
  width: 126px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  background: none;
  border: 0;
  text-decoration: none;
  color: var(--black);
}
.icon img { width: 80px; height: 80px; object-fit: contain; }
.icon span {
  width: 114px;
  padding: 1px 0;
  background: #fff;
  border: 1px solid var(--black);
  border-radius: 2px;
  box-shadow: 2px 2px 0 var(--black);
  font-size: 13px;
  letter-spacing: .04em;
  text-align: center;
}
.icon:hover span, .icon:focus-visible span { background: var(--blue); color: #fff; }
.icon:focus-visible { outline: none; }
.icon:active img { transform: translate(1px, 1px); }

/* ── Windows ───────────────────────────────────────────── */
.win {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--gray);
  border: 4px solid var(--blue);
  box-shadow: 10px 10px 0 var(--black);
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
}
.titlebar {
  display: flex;
  align-items: stretch;
  flex: none;
  height: 48px;
  border-bottom: 4px solid var(--blue);
  user-select: none;
  touch-action: none;
  cursor: grab;
}
.titlebar:active { cursor: grabbing; }
.titlebar h2 {
  flex: 1;
  margin: 0;
  padding: 0 14px;
  font-size: 28px;
  font-weight: 400;
  line-height: 44px;
  white-space: nowrap;
  overflow: hidden;
}
.tb-close, .tb-min {
  flex: none;
  width: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  border: 0;
}
.tb-close { border-right: 4px solid var(--blue); }
.tb-close img { width: 34px; height: 34px; }
.tb-close:active img { transform: translate(1px, 1px); }
.tb-min { border-left: 4px solid var(--blue); }
.tb-min i { width: 20px; height: 6px; margin-top: 14px; background: var(--blue); }
.win-body { overflow: auto; }

.px-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: #fff;
  border: 4px solid var(--blue);
  box-shadow: 6px 6px 0 #555;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--black);
  text-decoration: none;
}
.px-btn:hover { background: var(--yellow-lt); }
.px-btn:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 #555; }
.px-btn .glyph { width: 22px; height: 19px; color: var(--blue); }

/* ── About ─────────────────────────────────────────────── */
.win-about { width: 790px; }
.about {
  display: grid;
  grid-template-columns: 236px 1fr;
  gap: 20px 28px;
  padding: 0 18px 22px 0;
}
.about-photo {
  width: 236px;
  height: 236px;
  object-fit: cover;
  border-right: 4px solid #555;
  border-bottom: 4px solid #555;
}
.about-head { padding-top: 40px; text-align: center; }
.about-head h1 { margin: 0; font-size: 64px; font-weight: 400; line-height: 1; letter-spacing: .02em; }
.about-role { margin: 6px 0 12px; font-family: var(--serif); font-size: 25px; }
.stats {
  margin: 0;
  padding: 6px 12px 8px;
  border: 3px solid var(--blue);
  text-align: left;
}
.stats legend { padding: 0 6px; color: var(--blue); font-size: 14px; }
.stat { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 8px; font-size: 12px; line-height: 17px; }
.stat b { font-weight: 400; text-align: right; }
.bar {
  position: relative;
  height: 12px;
  background: repeating-linear-gradient(90deg, #C8C8C8 0 10px, transparent 10px 12px);
}
.bar::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--v) * 100%);
  background: repeating-linear-gradient(90deg, var(--blue) 0 10px, transparent 10px 12px);
}
.bar-low::before { background: repeating-linear-gradient(90deg, var(--red) 0 10px, transparent 10px 12px); }
.about-bio {
  grid-column: 1 / -1;
  margin: 0 0 0 20px;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.3;
}
.about .px-btn { grid-column: 1 / -1; justify-self: start; margin-left: 20px; }

/* ── Contact ───────────────────────────────────────────── */
.win-contact { width: 440px; }
.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 28px 28px;
  text-align: center;
}
.contact-icon { width: 96px; height: 96px; }
.contact-lead { margin: 10px 0 20px; font-family: var(--serif); font-size: 26px; line-height: 1.15; }
.contact-email {
  width: 100%;
  justify-content: center;
  padding: 14px 20px;
  background: var(--yellow);
  font-family: var(--ui);
  font-size: 26px;
  letter-spacing: .04em;
}
.contact-email:hover { background: var(--yellow-lt); }
.contact-email .glyph, .contact-ig .glyph { width: 28px; height: 24px; color: var(--blue); }
.contact-addr { margin: 12px 0 22px; color: #555; font-size: 14px; user-select: all; }
.socials {
  width: 100%;
  margin: 0;
  padding: 14px 12px 16px;
  border: 3px solid var(--blue);
}
.socials legend { padding: 0 6px; color: var(--blue); font-size: 14px; }
.contact-ig { font-family: var(--ui); font-size: 18px; padding: 8px 18px; }

/* ── Photos ────────────────────────────────────────────── */
.win-photos { width: 680px; }
.gal { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.gal-view { display: flex; align-items: center; gap: 12px; }
.gal-nav { flex: none; }
.gal-frame {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 10px 10px 8px;
  background: #fff;
  border: 4px solid var(--blue);
  box-shadow: 6px 6px 0 var(--black);
}
.gal-img { display: block; width: 100%; height: min(420px, 52vh); object-fit: contain; background: #222; }
.gal-caption { min-height: 1.3em; margin-top: 8px; font-family: var(--serif); font-size: 20px; text-align: center; }
.gal-empty { flex: 1; padding: 60px 0; text-align: center; }
.gal-strip {
  display: flex;
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  background: var(--gray-lt);
  border: 4px solid var(--blue);
  scrollbar-color: var(--blue) var(--gray-lt);
}
.gal-thumb { flex: none; width: 72px; height: 72px; padding: 0; background: #222; border: 3px solid var(--gray-dk); }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-thumb.is-current { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--blue); }

/* ── Junk folder ───────────────────────────────────────── */
.win-junk { width: 620px; height: min(560px, calc(100vh - 24px)); }
.junk { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; scrollbar-color: var(--blue) var(--gray-lt); }
.junk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 18px 10px;
  padding: 20px 16px;
  align-content: start;
}
.junk-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  background: none;
  border: 0;
  transform: rotate(var(--tilt));
}
.junk-thumb {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  background: var(--gray-lt);
  border: 3px solid var(--black);
  box-shadow: 4px 4px 0 var(--black);
  overflow: hidden;
}
.junk-thumb img, .junk-thumb video { width: 100%; height: 100%; object-fit: cover; }
.junk-badge { position: absolute; right: 4px; bottom: 4px; padding: 0 4px; background: var(--yellow); font-size: 12px; font-weight: 400; }
.junk-doc { font-size: 20px; color: var(--blue); }
.junk-audio { display: grid; place-items: center; width: 100%; height: 100%; background: var(--yellow); color: var(--yellow-ink); font-size: 40px; line-height: 1; }
.junk-audio small { font-size: 12px; }
.junk-player { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff; text-align: center; }
.junk-player svg { width: 160px; height: 160px; }
.junk-player p { margin: 0; font-size: 20px; }
.junk-player small { color: #bbb; font-size: 12px; }
.junk-player audio { width: min(360px, 70vw); margin-top: 6px; }
.junk-name {
  max-width: 112px;
  padding: 1px 4px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.junk-item:hover .junk-name, .junk-item:focus-visible .junk-name { background: var(--blue); color: #fff; }
.junk-item:hover { transform: rotate(0deg) translateY(-2px); }
.junk-item:focus-visible { outline: none; }
.junk-empty { padding: 60px 0; text-align: center; color: #777; }
.junk-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.junk-viewbar { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 3px solid var(--blue); background: var(--gray-lt); }
.junk-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.junk-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 14px; background: #222; overflow: auto; }
.junk-stage img, .junk-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.junk-note { width: 100%; height: 100%; margin: 0; padding: 16px; background: #FFFBD6; color: #222; font: 16px/1.5 var(--serif); white-space: pre-wrap; overflow: auto; }
.junk-status {
  display: flex;
  justify-content: space-between;
  flex: none;
  padding: 4px 12px;
  border-top: 4px solid var(--blue);
  color: #555;
  font-size: 12px;
}

/* ── Globe tracker ─────────────────────────────────────── */
.win-globe { width: 600px; }
.globe { display: flex; gap: 20px; padding: 18px; }
.globe-stage { position: relative; flex: none; width: 300px; text-align: center; }
.globe-canvas { display: block; width: 300px; height: 300px; image-rendering: pixelated; cursor: grab; touch-action: none; }
.globe-loading { position: absolute; inset: 0 0 auto; margin: 140px 0 0; color: var(--blue); font-size: 14px; }
.globe-hint { margin: 8px 0 0; color: #555; font-size: 12px; }
.globe-side { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.globe-side small { color: var(--blue); font-size: 14px; }
.globe-count { font-size: 96px; font-weight: 400; line-height: .95; letter-spacing: -.02em; }
.globe-of { font-size: 13px; color: #555; }
.globe-bar { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; margin: 10px 0 14px; }
.globe-bar i { height: 12px; background: #C8C8C8; }
.globe-bar i.on { background: var(--yellow); box-shadow: inset 0 -3px 0 var(--yellow-dk); }
.globe-list {
  flex: 1;
  max-height: 170px;
  margin: 0;
  padding: 8px 10px;
  overflow-y: auto;
  list-style: none;
  background: #fff;
  border: 4px solid var(--blue);
  font-family: var(--serif);
  font-size: 18px;
  scrollbar-color: var(--blue) var(--gray-lt);
}
.globe-list li { padding: 1px 0; }
.globe-list li::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; background: var(--yellow); box-shadow: 0 0 0 2px var(--black); vertical-align: 2px; }
.globe-list li small { display: block; margin: 0 0 4px 16px; font-family: var(--ui); font-size: 11px; line-height: 1.35; color: #666; }
.globe-list li.is-territory::before { background: #fff; }
.globe-list li[data-place] { cursor: pointer; }
.globe-list li[data-place]:hover span, .globe-list li[data-place]:focus-visible span { color: var(--blue); }
.globe-list li[data-place]:focus-visible { outline: 2px dashed var(--blue); outline-offset: 1px; }
.globe-list li.is-picked::before { background: #E52222; }
.globe-list li.is-picked span { color: #E52222; }
.globe-list .globe-list-head { margin-top: 8px; font-family: var(--ui); font-size: 12px; color: var(--blue); }
.globe-list .globe-list-head::before { display: none; }

/* ── Minesweeper ───────────────────────────────────────── */
.win-mines { width: auto; }
.ms { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; }
.ms-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border: 4px solid var(--blue);
  background: var(--gray-lt);
}
.ms-led {
  min-width: 58px;
  padding: 2px 6px;
  background: #000;
  color: #FF2A2A;
  font-family: 'W95FA', var(--ui);
  font-size: 28px;
  line-height: 1;
  letter-spacing: .08em;
  text-align: center;
}
.ms-face {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--gray);
  border: 3px solid;
  border-color: #fff #808080 #808080 #fff;
}
.ms-face svg { width: 28px; height: 28px; }
.ms-face:active { border-color: #808080 #fff #fff #808080; }
.ms-board { display: grid; grid-template-columns: repeat(9, 32px); border: 4px solid var(--blue); background: var(--gray-dk); }
.ms-cell {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--gray);
  border: 3px solid;
  border-color: #fff #808080 #808080 #fff;
  font-family: var(--ui);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.ms-cell.open { background: #CFCFCF; border: 1px solid #A6A6A6; }
.ms-cell.boom { background: var(--red); }
.ms-cell.wrong { background: #FFC2C2; }
.ms-cell svg, .ms-cell img { width: 18px; height: 18px; image-rendering: pixelated; }
.ms-flagmode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #fff;
  border: 3px solid var(--blue);
  font-size: 14px;
}
.ms-flagmode b { font-weight: 400; }
.ms-flagmode[aria-pressed="true"] { background: var(--yellow); }
.ms-flag-ico svg { display: block; width: 16px; height: 16px; }
.ms-help { margin: 0; color: #555; font-size: 12px; }

/* ── Resume ────────────────────────────────────────────── */
.win-resume { width: 690px; height: min(910px, calc(100vh - 24px)); }
.toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: none;
  height: 64px;
  padding: 0 14px;
  border-bottom: 4px solid var(--blue);
  font-size: 16px;
}
.toolbar .pg b { font-weight: 400; }
.zoom { display: flex; gap: 6px; margin: 0 auto 0 80px; }
.sq-btn, .zoom output {
  min-width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  background: #fff;
  border: 3px solid var(--blue);
  font-size: 18px;
}
.sq-btn:active { background: var(--yellow); }
.toolbar .dl { font-family: var(--ui); font-size: 18px; padding: 6px 18px; box-shadow: 5px 5px 0 #555; }
.viewer {
  flex: 1;
  overflow: auto;
  padding: 28px 24px;
  background: #A5A3AB;
  scrollbar-color: var(--blue) #EEE;
}
.viewer::-webkit-scrollbar { width: 18px; height: 18px; }
.viewer::-webkit-scrollbar-track { background: #EEE; border-left: 4px solid var(--blue); }
.viewer::-webkit-scrollbar-thumb { background: var(--blue); border: 3px solid #EEE; }
#pdf-pages-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; min-width: min-content; }
#pdf-pages-wrap canvas { display: block; background: #fff; box-shadow: 8px 8px 0 #666; }
.pdf-fallback { width: 100%; height: 760px; border: 0; background: #fff; }

/* ── Playlist ──────────────────────────────────────────── */
.win-playlist { width: 560px; }
.pl-body { display: flex; flex-direction: column; gap: 16px; padding: 16px 16px 18px; }
.px-box { position: relative; isolation: isolate; }
.px-bg { position: absolute; inset: 0; z-index: -1; line-height: 0; pointer-events: none; }
.np { display: flex; gap: 14px; padding: 14px 16px 14px 14px; color: var(--lcd-ink, var(--yellow-ink)); }
.np-cover {
  flex: none;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  background: #FFF4B8;
  border: 4px solid var(--lcd-dark, var(--yellow-dk));
}
.np-cover img { width: 100%; height: 100%; object-fit: cover; }
.np-cd { line-height: 0; }
.np-info { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-top: 2px; }
.np-info small { font-size: 13px; color: var(--lcd-sub, var(--yellow-dk)); }
.np-title { font-size: 30px; font-weight: 400; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 16px; color: var(--lcd-sub, var(--yellow-dk)); }
.np-time { color: var(--lcd-ink, var(--yellow-ink)); white-space: nowrap; }
.np-dots {
  display: grid;
  grid-template-columns: repeat(42, 1fr);
  gap: 3px 2px;
  margin-top: auto;
  padding: 6px 8px;
  background: var(--lcd-track, #EBC80C);
  cursor: pointer;
  touch-action: none;
}
.np-dots i { aspect-ratio: 1; background: var(--lcd-off, #D6B000); }
.np-dots i.on { background: var(--lcd-on, var(--yellow-dk)); }

.pl-controls { display: flex; align-items: center; gap: 12px; }
.pbtn {
  width: 56px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--gray-lt);
  border: 4px solid var(--blue);
  box-shadow: 4px 4px 0 var(--black);
  color: var(--blue);
}
.pbtn .glyph { width: 28px; height: 24px; display: block; }
.pbtn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--black); }
.pbtn-main { width: 72px; background: var(--yellow); color: var(--yellow-dk); }
.pbtn[aria-pressed="true"] { background: var(--yellow); }
.pbtn-repeat { position: relative; }
.pbtn-repeat[data-mode="one"]::after {
  content: '1';
  position: absolute;
  right: -2px;
  bottom: -4px;
  padding: 0 3px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  line-height: 14px;
}
.vol { flex: 1; display: flex; flex-direction: column; gap: 6px; color: var(--blue); font-size: 14px; }
.vol input {
  --v: .8;
  width: 100%;
  height: 28px;
  margin: 0;
  appearance: none;
  background: linear-gradient(var(--blue), var(--blue)) 0 50% / calc(var(--v) * 100%) 8px no-repeat,
              linear-gradient(var(--gray-dk), var(--gray-dk)) 0 50% / 100% 8px no-repeat;
  cursor: pointer;
}
.vol input::-webkit-slider-thumb { appearance: none; width: 16px; height: 28px; background: var(--gray-lt); border: 4px solid var(--blue); box-shadow: 2px 2px 0 var(--black); }
.vol input::-moz-range-thumb { width: 8px; height: 20px; background: var(--gray-lt); border: 4px solid var(--blue); border-radius: 0; box-shadow: 2px 2px 0 var(--black); }

.tracklist { background: #fff; border: 4px solid var(--blue); }
.tl-head, .tl-row {
  display: grid;
  grid-template-columns: 36px 1fr 150px 56px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}
.tl-head { height: 32px; background: var(--gray-lt); border-bottom: 4px solid var(--blue); color: var(--blue); font-size: 14px; }
.tl-head span:last-child, .tl-time { text-align: right; }
.tl-rows {
  position: relative;
  max-height: 180px; /* five songs, then it scrolls */
  scroll-behavior: smooth;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  scrollbar-color: var(--blue) var(--gray-lt);
}
.tl-rows::-webkit-scrollbar { width: 20px; }
.tl-rows::-webkit-scrollbar-track { background: var(--gray-lt); border-left: 4px solid var(--blue); }
.tl-rows::-webkit-scrollbar-thumb { background: var(--blue); border: 4px solid var(--gray-lt); }
.tl-row {
  width: 100%;
  height: 36px;
  background: none;
  border: 0;
  background-image: repeating-linear-gradient(90deg, #C8C8C8 0 4px, transparent 4px 8px);
  background-size: 100% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  text-align: left;
}
.tl-row:hover { background-color: #FFF7C2; }
.tl-row.is-current { background-color: var(--yellow); color: var(--yellow-ink); }
.tl-no { color: var(--gray-dk); font-size: 16px; }
.tl-no .glyph { display: block; width: 14px; height: 12px; color: var(--yellow-dk); }

/* Header equalizer (replaces "#"): bounces while music plays, rests when paused. */
.eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq i { width: 4px; height: var(--h); background: var(--blue); }
.eq i:nth-child(1) { --h: 6px; }
.eq i:nth-child(2) { --h: 12px; }
.eq i:nth-child(3) { --h: 8px; }
.eq i:nth-child(4) { --h: 4px; }
.win-playlist.is-playing .eq i { animation: eq .8s step-end infinite; }
.win-playlist.is-playing .eq i:nth-child(2) { animation-duration: .6s; animation-delay: -.2s; }
.win-playlist.is-playing .eq i:nth-child(3) { animation-duration: .7s; animation-delay: -.45s; }
.win-playlist.is-playing .eq i:nth-child(4) { animation-duration: .5s; animation-delay: -.1s; }
@keyframes eq {
  0%, 100% { height: 4px; }
  25% { height: 14px; }
  50% { height: 8px; }
  75% { height: 12px; }
}
@media (prefers-reduced-motion: reduce) { .win-playlist.is-playing .eq i { animation: none; } }
.tl-title { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-artist { font-size: 16px; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-row.is-current .tl-artist { color: var(--yellow-dk); }
.tl-time { font-size: 16px; }

/* ── Mini player ───────────────────────────────────────── */
.mini {
  position: fixed;
  right: 40px;
  bottom: 40px;
  width: 440px;
  height: 168px;
  z-index: 9; /* behind open windows; app.js raises it when clicked */
  user-select: none;
  touch-action: none;
  cursor: grab;
}
.mini:active { cursor: grabbing; }
.mini-art { display: block; overflow: visible; }
.mini .hit { cursor: pointer; }
.mini .hit[data-act="seek"] { cursor: col-resize; }
.mini-lcd {
  position: absolute;
  left: 156px;
  top: 54px;
  width: 240px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--yellow-ink);
  pointer-events: auto;
}
.mini-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 19px; }
.mini-title span { display: inline-block; }
.mini-title.scroll span { animation: marquee 9s steps(60) infinite; }
@keyframes marquee {
  0%, 15% { transform: translateX(0); }
  85%, 100% { transform: translateX(var(--over)); }
}
.mini-time { flex: none; font-size: 16px; }

/* Window title-bar path label (Photos, Junk) */
.tb-path {
  flex: none;
  padding: 0 20px;
  border-left: 4px solid var(--blue);
  color: #555;
  font-size: 18px;
  line-height: 44px;
}

/* ── Boot screen ───────────────────────────────────────── */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  background: #2596be;
  color: #fff;
  cursor: url('../assets/icons/cursor.svg') 0 0, progress;
  transition: opacity .45s ease-out;
}
.boot.done { opacity: 0; pointer-events: none; }
.skip-boot .boot { display: none; }
.boot-inner { width: min(460px, 86vw); text-align: center; }
.boot-text { margin: 0 0 18px; font-size: 26px; letter-spacing: .06em; }
.boot-dots::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.boot-bar {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 3px;
  padding: 4px;
  border: 4px solid #fff;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .35);
}
.boot-bar i { height: 20px; background: rgba(255, 255, 255, .18); }
.boot-bar i.on { background: #fff; }
.boot-start {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin: 34px 0 0;
  padding: 14px 28px;
  background: #fff;
  color: #2596be;
  border: 4px solid #fff;
  outline: 4px solid #fff;
  outline-offset: 6px;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .35);
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1;
  white-space: nowrap;
  animation: pulse 1.1s steps(2) infinite;
}
.boot-start img { width: 29px; height: 29px; image-rendering: pixelated; }
@keyframes pulse { 50% { outline-color: transparent; } }
.boot.needs-click { cursor: url('../assets/icons/cursor.svg') 0 0, pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.boot.needs-click .boot-text { opacity: .7; }

/* ── Welcome notice ────────────────────────────────────── */
.win-welcome { width: 360px; transition: opacity .25s; }
.win-welcome.leaving { opacity: 0; }
.welcome { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 24px 18px; text-align: center; }
.welcome img { width: 64px; height: 64px; }
.welcome p { margin: 0; font-family: var(--serif); font-size: 26px; }
.welcome b { font-family: var(--ui); font-weight: 400; color: var(--blue); }
.welcome .welcome-ok { margin-top: 4px; padding: 6px 22px; font-size: 20px; box-shadow: 4px 4px 0 #555; }
.welcome .welcome-ok:active { box-shadow: 2px 2px 0 #555; transform: translate(2px, 2px); }
.welcome-timer { display: block; width: 100%; height: 6px; margin-top: 8px; background: var(--blue); transform-origin: left; }
.win-welcome.counting .welcome-timer { animation: shrink 4.5s linear forwards; }
@keyframes shrink { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .boot-dots::after, .boot-start { animation: none; }
  .boot-start { outline-color: #fff; }
  .boot-dots::after { content: '...'; }
}

/* ── EN / ES + colourblind switches (js/i18n.js) ───────── */
.site-prefs {
  position: fixed;
  left: 24px;
  bottom: 20px;
  z-index: 9; /* like the mini player: open windows sit on top of it */
  display: flex;
  gap: 8px;
  font-family: var(--ui);
}
.lang-toggle, .cvd-toggle {
  display: flex;
  background: #fff;
  border: 2px solid var(--black);
  border-radius: 2px;
  box-shadow: 3px 3px 0 var(--black);
}
.lang-toggle button, .cvd-toggle {
  padding: 4px 10px 3px;
  background: #fff;
  border: 0;
  font-size: 13px;
  letter-spacing: .08em;
  line-height: 1.2;
}
.lang-toggle button + button { border-left: 2px solid var(--black); }
.cvd-toggle { align-items: center; justify-content: center; padding: 4px 8px 3px; border: 2px solid var(--black); }
.cvd-toggle svg { width: 13px; height: 13px; display: block; }
.cvd-toggle.is-on, .a11y-open .cvd-toggle { background: var(--blue); color: #fff; }
.lang-toggle button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.lang-toggle button[aria-pressed="false"]:hover, .site-prefs:not(.a11y-open) .cvd-toggle:not(.is-on):hover { background: var(--gray-lt); }
.lang-toggle button:focus-visible, .cvd-toggle:focus-visible { outline: 2px dashed var(--blue); outline-offset: 2px; }

/* Colourblind menu */
.cvd-wrap { position: relative; display: flex; }
.cvd-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: -1; /* tucked behind the icon while it slides */
  min-width: 210px;
  padding: 8px;
  background: #fff;
  border: 2px solid var(--black);
  box-shadow: 3px 3px 0 var(--black);
  /* Hidden: pushed down behind the buttons. Open: slides up into place. */
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  transition: transform .22s steps(4), opacity .22s steps(4), visibility 0s .22s;
}
.a11y-open .cvd-menu { opacity: 1; visibility: visible; transform: none; transition: transform .22s steps(4), opacity .22s steps(4); }
@media (prefers-reduced-motion: reduce) { .cvd-menu, .a11y-open .cvd-menu { transition: none; } }
.cvd-menu-head { margin: 0 0 6px; padding: 0 4px; font-size: 11px; letter-spacing: .08em; color: var(--blue); }
.cvd-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 4px;
  background: none;
  border: 0;
  font-size: 14px;
  text-align: left;
}
.cvd-menu button small { margin-left: auto; font-size: 10px; color: #666; }
.cvd-menu button i { width: 10px; height: 10px; flex: none; border: 2px solid var(--black); background: #fff; }
.cvd-menu button[aria-checked="true"] i { background: var(--blue); box-shadow: inset 0 0 0 2px #fff; }
.cvd-menu button:hover, .cvd-menu button:focus-visible { background: var(--gray-lt); outline: none; }
/* The whole page goes through the matching correction filter (filters live in js/i18n.js).
   Set on each top-level block, not on <html>: iOS Safari (and every iPhone browser) skips filters on the root. */
html[data-cvd="protan"] body > :not(.cvd-defs) { filter: url(#cvd-protan); }
html[data-cvd="deutan"] body > :not(.cvd-defs) { filter: url(#cvd-deutan); }
html[data-cvd="tritan"] body > :not(.cvd-defs) { filter: url(#cvd-tritan); }
/* Colourblind mode: no information carried by red alone. */
html[data-cvd] .globe-list li.is-picked::before { background: var(--black); box-shadow: 0 0 0 2px var(--black), 0 0 0 4px #fff; }
html[data-cvd] .globe-list li.is-picked span { color: var(--black); text-decoration: underline 2px; text-underline-offset: 3px; }
html[data-cvd] .globe-list li.is-picked span::before { content: '▶ '; }
html[data-cvd] .mw-info a, html[data-cvd] .contact-addr { text-decoration: underline; text-underline-offset: 3px; }

/* ── Small screens ─────────────────────────────────────── */
@media (max-width: 760px) {
  .boot-start { font-size: 26px; padding: 12px 18px; gap: 10px; }
  .boot-text { font-size: 20px; }
  /* Phone home screen: all nine icons in a 3×3 grid up top, the photo below. */
  .desktop {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-content: start;
    justify-items: center;
    row-gap: 10px;
    padding: max(18px, env(safe-area-inset-top)) 6px 0;
    /* Cropped so you sit in the open space between the icons and the player. */
    background-position: 24% 100%;
  }
  .icons, .icons-right { display: contents; }
  .icon { width: 100%; max-width: 118px; }
  .icon img { width: 58px; height: 58px; }
  .icon span { width: calc(100% - 10px); font-size: 11px; }
  .site-prefs { left: auto; right: 12px; bottom: 148px; flex-direction: column; align-items: flex-end; } /* clear of the photo, above the player */
  /* Open to the left of the icon, on top of EN/ES, so every option can be tapped. */
  .cvd-menu { left: auto; right: calc(100% + 10px); bottom: 0; z-index: 1; min-width: 0; width: min(230px, calc(100vw - 110px)); transform: translateX(24px); }
  .cvd-menu button { padding: 10px 4px; }
  .lang-toggle button, .cvd-toggle { padding: 5px 12px 4px; font-size: 14px; }
  .win { left: 8px !important; top: 8px !important; width: calc(100vw - 26px); }
  .about { grid-template-columns: 1fr; padding: 0 0 18px; }
  .about-photo { width: 100%; height: auto; aspect-ratio: 1; }
  .about-head { padding: 0 16px; }
  .about-head h1 { font-size: 40px; }
  .about-bio { margin: 0 16px; font-size: 20px; }
  .zoom { margin-left: 0; }
  /* Globe: stack the globe over the stats so the country list gets the full width. */
  .globe { flex-direction: column; gap: 14px; padding: 14px; }
  .globe-stage { width: 100%; }
  .globe-canvas { width: min(260px, 100%); height: auto; aspect-ratio: 1; margin: 0 auto; }
  .globe-loading { margin-top: 120px; }
  .globe-count { font-size: 64px; }
  .globe-list { flex: none; max-height: 220px; font-size: 17px; }
  .mini { right: auto; left: 50%; bottom: 12px; transform: translateX(-50%) scale(.72); transform-origin: bottom center; }
}
