/* VGMix Archive 3.0: VGMix 2 (2003-2008) look, rebuilt in CSS. Colours sampled from the original title-bar GIFs. */
:root {
  --bar: #425d7b;        /* header bar (titlebar_*.gif background) */
  --bar-dark: #344960;
  --tab: #668a9e;        /* window title tab (main_window_*_title.gif) */
  --tab-light: #8eaabb;
  --page: #afc5d2;       /* page background */
  --panel: #e5f1f7;      /* window body */
  --panel-edge: #586f9b;
  --row: #f9fdff;
  --ink: #1d2b3a;
  --link: #405d7e;
  --nav-text: #d8e1ea;
}
* { box-sizing: border-box; }
html { background: var(--page); }
body { margin: 0; font: 13px/1.45 Verdana, Arial, Helvetica, sans-serif; color: var(--ink);
       background: url(../img/bg.jpg) var(--page) 0 0 repeat-x; }  /* VGMix's own header strip: dark bar at 38-78px */
a { color: var(--link); }
a:hover { color: #1f3550; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 12px; }

/* ---------- header: logo overlapping the full-width bar from bg.jpg, like VGMix 2 ---------- */
.site-header { position: relative; height: 132px; }
.site-header .logo { position: absolute; left: 0; top: 4px; z-index: 2; display: block; }
.site-header .logo img { width: 420px; height: auto; display: block; }
.titlebar { position: absolute; left: 0; right: 0; top: 38px; height: 40px; }  /* sits on bg.jpg's dark band */
.titlebar > ul { list-style: none; margin: 0; padding: 0 8px 0 430px; height: 40px; display: flex; align-items: center;
               justify-content: flex-end; gap: 2px; }
.titlebar > ul > li { position: relative; display: flex; align-items: center; }
.titlebar > ul > li + li.text::before { content: "/"; color: #9fb3c7; font: 15px Arial, sans-serif; margin: 0 6px 0 2px; }
button.tb { all: unset; cursor: pointer; }  /* ThaSauce menu button: same look as the links (kept less specific than .titlebar .tb) */
.titlebar .tb { display: block; height: 40px; padding: 0 9px; line-height: 40px; text-decoration: none;
                 font: bold 15px/40px "Arial Black", "Arial Bold", Gadget, Arial, sans-serif; letter-spacing: .3px;
                 color: var(--nav-text); text-shadow: 1px 1px 0 #1a2836, 2px 2px 3px rgba(0,0,0,.7); }
.titlebar .tb:hover, .titlebar .tb:focus-visible, .titlebar li.on .tb, .titlebar .drop.open .tb { color: #fff; }
.titlebar a.icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-left: 4px;
                   border-radius: 4px; color: var(--nav-text); filter: drop-shadow(1px 1px 1px rgba(0,0,0,.6)); }
.titlebar a.icon:hover, .titlebar a.icon:focus { color: #fff; background: rgba(255,255,255,.12); }
.titlebar a.icon svg { width: 20px; height: 20px; fill: currentColor; }
/* ThaSauce dropdown */
.titlebar .drop > .tb::after { content: " \25BE"; font-size: 11px; }
.titlebar .menu { display: none; position: absolute; right: 0; top: 100%; min-width: 190px; z-index: 5; list-style: none; margin: 0; padding: 4px 0;
                  background: var(--panel); border: 1px solid var(--panel-edge); box-shadow: 2px 3px 6px rgba(0,0,0,.35); }
.titlebar .drop:hover .menu, .titlebar .drop.open .menu { display: block; }
.titlebar .menu a { display: block; padding: 5px 12px; text-decoration: none; font-weight: bold; }
.titlebar .menu a:hover, .titlebar .menu a:focus { background: #d3e4ee; }

/* ---------- windows: title tab image (img/vg2/main_window_*_title.gif) + light panel ---------- */
.window { margin: 0 0 22px; }
/* the tab's dark lower band runs on to the right edge, like VGMix 2 */
/* margin-right: the 6px corner gif is all shadow, so it hangs past the panel edge */
.window-title { margin: 0 -6px 0 0; height: 37px; line-height: 0;
                background: url(../img/vg2/main_window_top_right.gif) right top no-repeat, linear-gradient(transparent 17px, #405d7e 17px); }
/* VGMix 2 window icons: a framed 46x37 box flush with the panel's right edge, in place of the shadow corner */
.window-title[class*=icon-] { margin-right: 0; background: var(--icon) right top no-repeat, linear-gradient(transparent 17px, #405d7e 17px); }
.icon-song_list { --icon: url(../img/vg2/main_window_song_list_icon.gif); }
.icon-library { --icon: url(../img/vg2/main_window_library_icon.gif); }
.window-title img { display: block; }
/* fallback when a window has no title image yet */
.window-title .text { position: relative; display: inline-block; min-width: 260px; height: 37px; padding: 0 70px 0 14px;
                font: 21px/37px "Trebuchet MS", "Lucida Grande", Verdana, sans-serif; color: #f2f7fa;
                text-shadow: 1px 1px 1px rgba(0,0,0,.35); margin: 0;
                background:
                  repeating-linear-gradient(115deg, transparent 0 9px, rgba(255,255,255,.35) 9px 12px, transparent 12px 18px) right / 64px 100% no-repeat,
                  linear-gradient(var(--tab-light), var(--tab) 45%, #5b7f94);
                border: 1px solid #4f6f84; border-bottom: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }
.window-body { background: var(--panel); border: 1px solid var(--panel-edge); border-bottom: 12px solid #66879e;
               box-shadow: 2px 3px 5px rgba(0,0,0,.4); padding: 14px var(--pad); --pad: 18px; }
.window-body h2 { margin: 0 0 8px; font: bold 22px Verdana, sans-serif; color: #24384d; }
.window-body h3 { margin: 18px 0 6px; font: bold 15px Verdana, sans-serif; color: #2d4560; border-bottom: 1px solid #bcd0dc; padding-bottom: 2px; }

/* buttons */
.btn { display: inline-block; padding: 6px 14px; border: 1px solid #3c566f; border-radius: 3px; text-decoration: none; font-weight: bold;
       color: #fff; background: linear-gradient(#6f93ab, #4d6d86); box-shadow: inset 0 1px 0 rgba(255,255,255,.3); cursor: pointer; font-size: 13px; }
.btn:hover, .btn:focus { background: linear-gradient(#7fa3bb, #567a94); color: #fff; }
.btn.discord { background: linear-gradient(#7984f5, #5865f2); border-color: #3b45b8; }
.btn svg { width: 16px; height: 16px; fill: currentColor; vertical-align: -3px; margin-right: 6px; }
.callout { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 12px 0 2px; }

/* ---------- song tables ---------- */
/* .find (search + count, pinned on small screens) and .tools (filters) melt into one row on desktop */
[data-table] { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.find, .tools { display: contents; }
[data-table] .count { order: 1; }
table.songs { order: 2; flex: 0 0 100%; }
.find input[type=search] { width: 280px; max-width: 100%; padding: 5px 8px; border: 1px solid #7f98ad; border-radius: 3px; font: inherit; }
.tools select { padding: 4px; border: 1px solid #7f98ad; font: inherit; }
.count { color: #4b6278; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid #7f98ad; background: var(--row); border-radius: 12px; padding: 2px 10px; cursor: pointer; font: inherit; }
.chip[aria-pressed=true] { background: var(--bar); color: #fff; border-color: var(--bar-dark); }
/* song tables: same look as the VGMix Archive 2.0 / VGMix 2 lists (slate header, borderless rows, light-blue stripes) */
table.songs { width: 100%; border-collapse: collapse; margin: 10px 0; background: #f9fdff; border: 1px solid #66879e; }
table.songs th { background: #66879e; color: #fff; text-align: left; padding: 2px 5px; white-space: nowrap; font-weight: bold; }
table.songs th button { all: unset; cursor: pointer; font-weight: bold; color: #fff; }
table.songs th button:focus-visible { outline: 1px dotted #fff; }
table.songs th button::after { content: " \2195"; color: #c6d5df; font-weight: normal; }
table.songs th[aria-sort=ascending] button::after { content: " \25B2"; color: #fff; }
table.songs th[aria-sort=descending] button::after { content: " \25BC"; color: #fff; }
table.songs td.nw, table.songs td[data-sort^="20"] { white-space: nowrap; }
table.songs td { padding: 2px 5px; vertical-align: top; }
table.songs tbody tr.alt { background: #d1edf9; }   /* set by archive3.js on visible rows, so stripes survive search/sort */
table.songs tbody tr:hover { background: #fff8d6; }
/* site badge: colour per site */
.tag { display: inline-block; padding: 0 6px; border-radius: 3px; font-size: 11px; font-weight: bold; white-space: nowrap; color: #fff; }
.tag.vg1 { background: #7d6aa8; } .tag.vg2 { background: #4d7898; } .tag.vgx { background: #8a5a3c; }
/* play button, styled like the 2.0 site's small "download" button image */
.play { cursor: pointer; padding: 1px 7px; border: 1px solid #5b7389; border-radius: 3px; font: bold 10px/14px Verdana, sans-serif;
        color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.6); background: linear-gradient(#96aabb, #708ba2 50%, #4c5f6f); }
.play:hover, .play:focus-visible { background: linear-gradient(#a8bccc, #7f9ab1 50%, #5a6f81); }
.st { font-weight: bold; white-space: nowrap; }
.st.archived { color: #2f7a3a; } .st.missing { color: #a3402b; } .st.elsewhere { color: #2a62a8; }
.tier { white-space: nowrap; font-size: 12px; }
.tier.sol { color: #8a5a00; font-weight: bold; }

/* player modal (native <dialog>) */
dialog.player { border: 1px solid var(--panel-edge); padding: 0; max-width: 560px; width: 92vw; background: var(--panel);
                box-shadow: 4px 6px 16px rgba(0,0,0,.5); }
dialog.player::backdrop { background: rgba(20,32,45,.55); }
dialog.player header { background: var(--bar); color: #fff; padding: 8px 12px; font-weight: bold; display: flex; justify-content: space-between; gap: 8px; }
dialog.player header button { all: unset; cursor: pointer; font-size: 18px; line-height: 1; }
dialog.player .body { padding: 12px; }
dialog.player audio { width: 100%; margin: 8px 0; }
dialog.player .note { font-size: 12px; color: #3d5266; }

/* changelog */
.release { margin: 0 0 18px; }
.release h3 small { font-weight: normal; color: #4b6278; }
.release ul { margin: 6px 0 0 20px; padding: 0; }

footer.site { margin: 10px 0 30px; padding-top: 10px; border-top: 1px solid #8ea8bb; font-size: 12px; color: #2f465c;
              display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
footer.site a { font-weight: bold; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- small screens: Menu button + drawer (hidden on desktop) ---------- */
button.menu-btn { all: unset; display: none; }
dialog.drawer { margin: 0 0 0 auto; padding: 0; border: 0; border-left: 1px solid var(--bar-dark); width: min(300px, 85vw);
                height: 100%; max-height: none; background: var(--bar); color: var(--nav-text); box-shadow: -4px 0 12px rgba(0,0,0,.5); }
dialog.drawer[open] { animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(100%); } }
dialog.drawer::backdrop { background: rgba(20,32,45,.55); }
.drawer-in { min-height: 100%; padding: 4px 0 20px; }  /* fills the dialog, so only backdrop clicks hit <dialog> */
.drawer .close { all: unset; display: block; width: 44px; height: 44px; margin: 0 4px 0 auto; text-align: center; font: 28px/44px Arial, sans-serif;
                 cursor: pointer; color: var(--nav-text); }
.drawer ul { list-style: none; margin: 0; padding: 0; }
.drawer a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; text-decoration: none; color: var(--nav-text); }
.drawer .main a { min-height: 48px; font: bold 17px "Arial Black", "Arial Bold", Gadget, Arial, sans-serif; letter-spacing: .3px;
                  text-shadow: 1px 1px 0 #1a2836, 2px 2px 3px rgba(0,0,0,.7); border-left: 4px solid transparent; }
.drawer .main a[aria-current] { color: #fff; border-left-color: var(--tab-light); background: rgba(255,255,255,.08); }
.drawer a:hover, .drawer a:focus-visible, .drawer .close:hover { color: #fff; background: rgba(255,255,255,.12); }
.drawer :focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.drawer hr { border: 0; border-top: 1px solid rgba(255,255,255,.2); margin: 10px 18px 6px; }
.drawer .label { margin: 0; padding: 4px 18px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #9fb3c7; }
.drawer .more a { font-weight: bold; }
.drawer svg { width: 20px; height: 20px; fill: currentColor; }
@media (prefers-reduced-motion: reduce) { dialog.drawer[open] { animation: none; } }

/* phones + tablets: one header bar, drawer menu, pinned search */
@media (max-width: 860px) {
  .site-header { height: 84px; }
  .site-header .logo { left: 6px; }
  .site-header .logo img { width: 220px; }  /* shortcut: scaled desktop logo until a mobile logo exists */
  .titlebar { display: none; }
  button.menu-btn { position: absolute; right: 6px; top: 36px; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px;
                    cursor: pointer; color: var(--nav-text); font: bold 15px "Arial Black", "Arial Bold", Gadget, Arial, sans-serif;
                    text-shadow: 1px 1px 0 #1a2836, 2px 2px 3px rgba(0,0,0,.7); }  /* sits on bg.jpg's dark band, like the desktop links */
  button.menu-btn svg { width: 20px; height: 20px; fill: currentColor; filter: drop-shadow(1px 1px 1px rgba(0,0,0,.6)); }
  button.menu-btn:hover, button.menu-btn:focus-visible { color: #fff; }
  button.menu-btn:focus-visible { outline: 2px solid #fff; }
  table.songs .hide-sm { display: none; }
  [data-table] { display: block; }
  .find { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; height: 60px;
          margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); background: var(--panel); }
  .find input[type=search] { flex: 1; min-width: 0; width: auto; height: 44px; font-size: 16px; }  /* 16px stops iOS zooming in on focus */
  .find .count { white-space: nowrap; font-size: 12px; }
  .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 0; }
  .tools select { font-size: 16px; min-height: 32px; }
  .chip { padding: 4px 12px; }
  table.songs th { position: sticky; top: 60px; z-index: 2; }  /* sort bar stays under the pinned search */
}

/* phones: About buttons stack; each song row is two columns (title + details | Play/status) */
@media (max-width: 640px) {
  .wrap { padding: 0 6px; }
  .window-body { --pad: 10px; }
  .window-body h2 { font-size: 18px; }
  .callout .btn { flex: 1 1 100%; display: flex; align-items: center; justify-content: center; min-height: 44px; text-align: center; }
  table.songs, table.songs tbody { display: block; }
  table.songs thead { display: block; position: sticky; top: 60px; z-index: 2; }
  table.songs thead tr { display: flex; flex-wrap: wrap; gap: 0 4px; background: #66879e; }  /* header becomes a sort bar */
  table.songs th { position: static; display: block; padding: 0; }
  table.songs th button { display: block; padding: 4px 8px; }  /* 27px tall: over the 24px AA minimum */
  table.songs th:not([data-col]) { display: none; }
  /* details go in columns 1-3 of line 2 and shrink with an ellipsis; column 4 soaks up spare room; column 5 is the action */
  table.songs tbody tr { display: grid; grid-template-columns: auto auto auto 1fr auto; gap: 2px 8px; align-items: center; padding: 6px; }
  table.songs tbody tr[hidden] { display: none; }
  table.songs td { padding: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #3d5266; }
  table.songs td:empty { display: none; }
  table.songs td.t { grid-column: 1 / 5; grid-row: 1; white-space: normal; overflow: visible; font-size: 13px; font-weight: bold; color: var(--ink); }
  table.songs td:last-child { grid-column: 5; grid-row: 1 / 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
                              gap: 2px 6px; max-width: 150px; overflow: visible; white-space: normal; text-align: right; font-size: 13px; }
  .play { min-width: 56px; min-height: 44px; font-size: 12px; }  /* 44px tap target */
}
