/* Layer 2: XP.css fixes (from comparing against real XP screenshots) and the 2004 homepage parts. Colours, type, borders. */

/* ---------- base ---------- */
/* the desk: disco photo, fixed, under a flat white wash (no blur) */
html { background: linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)) fixed, #FFFFFF url("../../assets/img/disco.jpg") center / cover fixed; }
html:has(dialog.splash[open]) { overflow: hidden; }
body { margin: 0; color: var(--ink); font: var(--size)/1.6 var(--font-page); }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
h2, h3 { font-size: 12px; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; }
a { color: #0000FF; }
a:visited { color: #800080; }
[hidden] { display: none !important; }
.hint { color: var(--ink-2); }
.red, .new { color: var(--red); }
.new { font-size: 10px; font-weight: bold; }
.tag { display: inline-block; padding: 0 4px; background: var(--red); color: var(--paper); font: bold 10px/15px var(--font-page); white-space: nowrap; }
.skip, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { z-index: 100; top: 8px; left: 8px; width: auto; height: auto; clip: auto; padding: 4px 8px; background: var(--paper); border: 1px solid var(--ink); }

/* ---------- XP controls ---------- */
/* XP.css ships the 98-era pixel font; XP itself drew controls in Tahoma 11px and title bars in Trebuchet MS. */
.window, button, input, label, select, textarea, legend, fieldset, menu[role=tablist] button, [role=tabpanel], .listview table {
  font-family: var(--font-ui); font-size: var(--size); color: #000000;
}
.title-bar-text { font: bold 13px var(--font-title); color: #FFFFFF; }
button:disabled { background: var(--xp-disabled-face); border-color: var(--xp-disabled-border); color: var(--xp-gray-text); } /* XP.css leaves disabled buttons looking live */
button.default { box-shadow: inset -1px 1px #CEE7FF, inset 1px 2px #98B8EA, inset -2px 2px #BCD4F6, inset 1px -1px #89ADE4, inset 2px -2px #89ADE4; } /* XP's default-button ring: dialogs only */
fieldset { background: transparent; } /* XP group boxes are see-through; XP.css paints them white */
input:disabled + label, input:disabled + label .hint { color: var(--xp-gray-text); }
.field-row label .hint { margin-left: 4px; } /* XP.css labels are inline-flex, which eats the space */
input:not([type]), input[type=url], input[type=number] { height: 23px; padding: 3px 4px; border: 1px solid var(--xp-field); background: var(--paper); box-sizing: border-box; }
textarea { border: 1px solid var(--xp-field); resize: none; }
menu[role=tablist] button { min-height: 21px; padding: 0 6px 1px; } /* XP's real tab size */
[role=tabpanel] { margin: 0; padding: var(--gap); }
.field { position: relative; display: flex; flex-direction: column; gap: 3px; }
.field input, .field select, .field textarea { width: 100%; }
.btns { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.btns.center { justify-content: center; gap: var(--gap); }

/* XP balloon tip on the first bad field */
.balloon { position: absolute; top: 100%; left: 8px; z-index: 10; max-width: 260px; margin-top: 8px; padding: 6px 10px; background: var(--xp-tooltip); border: 1px solid #000000; border-radius: 6px; font: var(--size)/1.4 var(--font-ui); }
.balloon::before, .balloon::after { content: ""; position: absolute; left: 14px; border: 8px solid transparent; border-top: 0; }
.balloon::before { top: -9px; border-bottom-color: #000000; }
.balloon::after { top: -7px; left: 15px; border-width: 7px; border-top: 0; border-bottom-color: var(--xp-tooltip); }

/* list view ("Details") with XP's column header */
.listview { overflow-x: auto; background: var(--paper); border: 1px solid var(--xp-field); }
.listview table { width: 100%; border-collapse: collapse; line-height: 1.35; }
.listview th {
  position: relative; padding: 2px 6px 4px; background: var(--xp-header); font-weight: normal; text-align: left; white-space: nowrap;
  box-shadow: inset 0 -1px var(--xp-header-3), inset 0 -2px var(--xp-header-2), inset 0 -3px var(--xp-header-1);
}
.listview th + th::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 6px; border-left: 1px solid var(--xp-gray-text); border-right: 1px solid var(--paper); }
.listview td { padding: 1px 6px; vertical-align: top; }
.listview tfoot th { background: none; box-shadow: none; border-top: 1px solid var(--xp-gray-text); font-weight: bold; }
.listview tfoot th::before { content: none; }
.listview tr.off td { color: var(--xp-gray-text); }
.num, .listview .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; }

/* playlist: single-line rows, selection in XP blue, the playing row bold */
.playlist { cursor: default; }
.playlist td { white-space: nowrap; }
.playlist td:nth-child(2) { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; }
.playlist:focus-visible { outline: 1px dotted #000000; outline-offset: -2px; }
.playlist tr.is-playing td { font-weight: bold; }
.playlist tr[aria-selected=true] td, .playlist tr[aria-selected=true] .red { background: var(--xp-select); color: var(--paper); }

/* dialogs: XP never dimmed the screen */
dialog.window { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 0 0 3px; border: 0; }
dialog::backdrop { background: transparent; }
dialog.window > .window-body { margin: var(--gap); }
dialog.window > .window-body > * + * { margin-top: var(--gap); }
#cart { width: 400px; }
#cart-rows input { width: 48px; }
dialog.viewer { width: min(760px, calc(100vw - 24px)); }
#pv-img { display: block; max-height: calc(100dvh - 140px); margin: 0 auto; border: 1px solid var(--xp-field); }

/* ticket wizard (Wizard97): fixed size so the buttons never move */
dialog.wizard[open] { display: flex; flex-direction: column; width: min(500px, calc(100vw - 24px)); height: min(360px, calc(100dvh - 24px)); }
.wiz { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0 3px; }
.wiz-head { display: flex; flex-direction: column; padding: 10px var(--gap); background: var(--paper); border-bottom: 1px solid var(--xp-gray-text); }
.wiz-body { flex: 1; overflow: auto; padding: var(--gap); }
.step > * + * { margin-top: var(--gap); }
.wiz-foot { display: flex; justify-content: flex-end; gap: 6px; padding: 10px var(--gap); border-top: 1px solid var(--xp-gray-text); box-shadow: inset 0 1px var(--paper); }
#tix-tiers .field-row + .field-row { margin-top: 4px; }
#tix-tiers label { flex: 1; }
.total { display: flex; justify-content: space-between; font-weight: bold; }
.props th { padding: 2px var(--gap) 2px 0; color: var(--ink-2); font-weight: normal; text-align: left; vertical-align: top; }

/* the sidebar player: a silver WMP-era skin made of XP parts */
.player { border: 1px solid var(--silver-edge); border-radius: 4px; background: linear-gradient(var(--silver-1), var(--silver-2) 55%, var(--silver-3)); font: var(--size)/1.3 var(--font-ui); }
.pl-strip { display: flex; align-items: center; justify-content: space-between; padding: 2px 3px 2px 8px; border-bottom: 1px solid var(--silver-edge); font-weight: bold; }
button.pl-min { min-width: 0; min-height: 0; width: 18px; height: 16px; padding: 0 0 6px; border-color: var(--silver-edge); line-height: 1; }
.player.is-min .pl-body { display: none; }
.player.is-min .pl-strip { border-bottom: 0; }
.pl-body { display: grid; gap: 6px; padding: 8px; }
.pl-lcd { display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; align-items: center; padding: 4px 6px; overflow: hidden; background: var(--lcd); border: 1px solid var(--silver-edge); box-shadow: inset 1px 1px var(--silver-2); }
.pl-time { font: bold 12px/1 var(--font-lcd); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-title { grid-column: 1 / -1; overflow: hidden; white-space: nowrap; font-family: var(--font-lcd); }
.pl-title span { display: inline-block; }
.player.is-playing .pl-title span { animation: lcd 18s linear infinite; }
@keyframes lcd { to { transform: translateX(-50%); } }
.pl-row { display: flex; align-items: center; gap: 2px; }
.pl-row button { min-width: 0; width: 24px; padding: 0; }
.pl-row img { display: block; margin: auto; }
.pl-row button:disabled img { opacity: 0.4; }
#pl-prev, #pl-mute { margin-left: 6px; }
.pl-row input { flex: 1; min-width: 0; margin-left: 2px; }
.player.is-playing .i-play, .player:not(.is-playing) .i-pause, #pl-mute[aria-pressed=true] .i-vol, #pl-mute[aria-pressed=false] .i-mute { display: none; }
/* the seek bar fills its elapsed part (--p) in XP blue */
#pl-seek::-webkit-slider-runnable-track { height: 5px; background: linear-gradient(90deg, var(--xp-select) var(--p, 0%), #ECEBE4 0); }
#pl-seek::-moz-range-track { height: 5px; background: linear-gradient(90deg, var(--xp-select) var(--p, 0%), #ECEBE4 0); }
#pl-seek:disabled { opacity: 0.4; }
#pl-seek, #pl-vol { padding: 10px 0; margin-block: -10px; } /* a bigger hit area, same look */
#pl-pick { width: 100%; }
/* outside .pl-body, so minimizing never hides it: the SoundCloud credit or "listen on" link */
.pl-credit { margin: 0 8px 8px; }
/* Mixcloud's 60px strip only shows its logo at about full page width, so it docks, framed, at the bottom of the
   window (no jump under the pointer), and the page gets room for it so it never covers anything */
.pl-embed:has(iframe:not([aria-hidden])) { position: fixed; z-index: 10; bottom: 0; left: 50%; transform: translateX(-50%); box-sizing: border-box; width: min(var(--column), 100%); padding: 6px; background: var(--paper); border: 1px solid var(--silver-edge); border-bottom: 0; }
body:has(.pl-embed iframe:not([aria-hidden])) { padding-bottom: 74px; }

/* ---------- the 2004 homepage ---------- */
.page { background: var(--paper); border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.box { background: var(--paper); border: 1px solid var(--rule); }
.box-h { display: flex; align-items: center; gap: 6px; padding: 3px 8px; background: var(--paper-2); border-bottom: 1px dotted var(--dots); letter-spacing: 0.04em; }
.box-h::before { content: url("../img/peace.svg"); line-height: 0; }
.side .box-h::before { content: url("../img/flower.svg"); }
.box-h span, .nav span, .sub-h span { color: var(--ink-2); font: normal 10px var(--font-jp); letter-spacing: 0; }
.box-body { padding: 8px var(--gap) var(--gap); }
.box-body > * + *, .info > * + *, .post > * + * { margin-top: 8px; }
.box-body > [role=tabpanel] { margin-top: 0; }
form.join > * + * { margin-top: var(--gap); }
.done { padding: 6px 8px; background: var(--paper); border: 1px solid var(--xp-gray-text); }

.nav { display: flex; align-items: center; gap: 8px; padding: 4px 8px; color: var(--dots); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.nav-links { flex: 1; }
.nav a { color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav a:hover, .nav a:focus-visible { color: #0000FF; text-decoration: underline; }
#cart-btn { min-width: 0; }
.ticker { display: block; padding: 2px 0; background: var(--paper-2); border-bottom: 1px solid var(--rule); }

/* hero: forest ↔ disco crossfade with a slow drift (CSS only, 55s loop), glare behind the logo, the three.js globe */
.hero-photo { position: relative; overflow: hidden; background: var(--paper); }
.hero-photo::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse 50% 72% at 34% 52%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82) 45%, rgba(255, 255, 255, 0)); }
.slide { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; animation: drift-a 55s linear infinite; }
.slide-b { opacity: 0; animation-name: drift-b; }
@keyframes drift-a { 0% { transform: scale(1.005); } 50% { transform: scale(1.06); } 50.01%, 95.45% { transform: scale(1); } 100% { transform: scale(1.005); } }
@keyframes drift-b { 0%, 45.45% { opacity: 0; transform: scale(1); } 50%, 95.45% { opacity: 1; } 100% { opacity: 0; transform: scale(1.06); } }
.tab-hidden .slide { animation-play-state: paused; }
.hero-logo, .globe { position: relative; z-index: 2; }
.hero-logo img { display: block; width: min(400px, 100%); height: auto; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.6)) drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.2)); } /* a PS7-style stroke keeps the pastel logo legible on both photos */
.hero-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px var(--gap); border-top: 1px solid var(--rule); }
.hero-bar .status { flex: 1; min-width: 200px; }

/* ENTER splash */
dialog.splash { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--paper); }
dialog.splash::backdrop { background: var(--paper); }
.splash-in { display: grid; place-items: center; align-content: center; gap: var(--gap); min-height: 100%; padding: var(--gap); text-align: center; }
.splash-in > img:first-child { width: min(420px, 80vw); height: auto; }
button.enter { all: unset; color: #0000FF; text-decoration: underline; font: 14px var(--font-page); letter-spacing: 0.3em; cursor: pointer; }
button.enter:focus-visible { outline: 1px dotted var(--ink); }
.loader { animation: turn 6s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }

/* pictures: 1px rule, white mat */
.art, .pal img, .thumbs img, .merch img, [data-md] img { display: block; width: 100%; height: auto; padding: 2px; background: var(--paper); border: 1px solid var(--rule); box-sizing: border-box; }
.art, .pal img, .merch img { aspect-ratio: 1; object-fit: cover; }
.pal img { width: 96px; margin: 0 auto 2px; image-rendering: pixelated; } /* small, low-res placeholder look */
.thumbs img { aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 2px; }
.art-wrap { position: relative; }
.stamp { position: absolute; top: 6px; right: 6px; }
.event + .event, .post + .post { padding-top: var(--gap); border-top: 1px dotted var(--dots); }
[data-md] > * + * { margin-top: 6px; }
[data-md] { overflow-wrap: anywhere; } /* long URLs wrap instead of bleeding out */
[data-md] :is(h1, h2, h3, h4, h5, h6) { margin: 0; font-size: 12px; } /* not XP.css's 5rem */
[data-md] :is(ul, ol) { padding-left: 16px; }
[data-md] ul { list-style: square; }
[data-md] img { width: auto; }
.foot [data-md] :is(ul, ol) { padding: 0; list-style-position: inside; }

/* Top 8: each friend is a details element; an open one takes a full row, profile beside the photo */
.pal summary { display: block; list-style: none; text-align: center; overflow-wrap: anywhere; cursor: pointer; }
.pal summary::-webkit-details-marker { display: none; }
.pal summary:hover img, .pal[open] img { border-color: var(--xp-select); }
.pal summary:focus-visible { outline: 1px dotted var(--ink); }
.pal[open] { grid-column: 1 / -1; }
.pal[open] summary { float: left; width: 110px; margin-right: var(--gap); }
.prof { display: grid; overflow: hidden; grid-template-columns: max-content 1fr; gap: 2px var(--gap); padding: 8px var(--gap); background: var(--paper-2); border: 1px solid var(--rule); }
.prof dt { color: var(--ink-2); }
.you, .you:visited { display: block; color: var(--ink); text-align: center; text-decoration: none; }
.you span { display: grid; place-items: center; width: 96px; aspect-ratio: 1; margin-inline: auto; margin-bottom: 2px; border: 1px solid var(--rule); color: var(--ink-2); font-size: 28px; }

.merch article { display: flex; flex-direction: column; gap: 4px; }
.soon { display: flex; align-items: center; gap: 8px; }
.merch:not(:empty) + .soon { display: none; } /* "under construction" only while there's no merch */
.buy { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; padding-top: 4px; }
.buy button { width: 92px; min-width: 0; } /* "Added" keeps the width */
.thumbs li { text-align: center; } /* caption and its "sample" mark */
.thumbs a { display: block; color: var(--ink); }

.log li { padding: 3px 0; border-bottom: 1px dotted var(--paper-3); }
.ticker:empty, .box:has(.log:empty, .box-body:empty), .info > :empty { display: none; } /* no events, posts or blurb */
.log time { display: block; color: var(--ink-2); }
.odo { display: inline-flex; gap: 1px; }
.odo b { width: 11px; background: var(--ink); color: var(--paper); font: bold 12px/16px var(--font-lcd); text-align: center; }

/* 200×40 and 88×31 banners */
.banners { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.b200, .b88 { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--silver-edge); background: linear-gradient(var(--silver-1), var(--silver-3) 60%, var(--silver-2)); color: var(--ink); font: bold 9px/1.1 var(--font-page); text-align: center; text-decoration: none; }
.b200 { flex-direction: row; gap: 6px; width: 200px; height: 40px; background: var(--paper); }
.b88 { width: 88px; height: 31px; }
.b88 small { font: normal 8px/1 var(--font-jp); }
a.b88:visited, a.b200:visited { color: var(--ink); }
a.b88:hover, a.b200:hover { border-color: var(--xp-select); }
.ring { display: inline-flex; }
.ring a { display: grid; place-items: center; width: 14px; background: var(--paper-3); border: 1px solid var(--silver-edge); color: var(--ink); text-decoration: none; }
#link-code { font: 11px var(--font-lcd); }

.foot { text-align: center; }
.foot > * + * { margin-top: 8px; }
.divider { display: flex; align-items: center; gap: 8px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px dotted var(--dots); }

/* touch: bigger targets */
@media (pointer: coarse) {
  button:not([aria-label=Close]):not(.pl-min) { min-height: 34px; }
  .pl-row { flex-wrap: wrap; }
  .pl-row button { width: 40px; }
  .pl-row input { min-width: 96px; } /* wraps under the buttons in the narrow sidebar */
  select { height: 30px; }
  menu[role=tablist] button { min-height: 30px; }
  .playlist td { padding: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .slide, .loader, .player.is-playing .pl-title span { animation: none; }
  .slide-b { display: none; }
}
.sb button { margin: 0 0 4px; }
