/* TuneBridge — a Windows 95 aesthetic.
   Hand-rolled "Chicago" bevels: a double inset box-shadow gives the classic
   raised/sunken 3D look without any external CSS framework. */

:root {
  --silver: #c0c0c0;
  --silver-light: #dfdfdf;
  --gray: #808080;
  --navy: #000080;
  --teal: #008080;
  --black: #000;
  --white: #fff;
  --font: "Pixelated MS Sans Serif", "MS Sans Serif", "Segoe UI", Tahoma, sans-serif;

  /* Raised (button / window) and sunken (input / well) bevels. */
  --bevel-out: inset -1px -1px var(--black), inset 1px 1px var(--white),
    inset -2px -2px var(--gray), inset 2px 2px var(--silver-light);
  --bevel-in: inset -1px -1px var(--white), inset 1px 1px var(--gray),
    inset -2px -2px var(--silver-light), inset 2px 2px var(--black);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  color: var(--black);
  background: var(--teal);
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
}

a {
  color: inherit;
}

/* ---- Desktop layout ---------------------------------------------------- */

.desktop {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 28px 14px 52px; /* room for the taskbar */
}

/* ---- Windows ----------------------------------------------------------- */

.window {
  background: var(--silver);
  box-shadow: var(--bevel-out);
  padding: 3px;
  width: 100%;
}

.app-window {
  max-width: 520px;
}

.center-window {
  max-width: 420px;
  margin-top: 8vh;
}

.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 22px;
  padding: 0 3px 0 4px;
  background: linear-gradient(90deg, var(--navy), #1084d0);
  color: var(--white);
  user-select: none;
}

.title-bar-text {
  font-weight: bold;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-bar-controls {
  display: flex;
  gap: 2px;
}

.title-bar-controls button,
.title-close {
  width: 16px;
  height: 14px;
  padding: 0;
  display: block;
  background: var(--silver);
  box-shadow: var(--bevel-out);
  border: none;
  cursor: pointer;
}

.title-bar-controls button:active,
.title-close:active {
  box-shadow: var(--bevel-in);
}

.title-close::after {
  content: "\00d7";
  display: block;
  font-size: 11px;
  line-height: 12px;
  text-align: center;
  color: var(--black);
}

.window-body {
  padding: 12px;
}

/* ---- Buttons ----------------------------------------------------------- */

.btn {
  font-family: var(--font);
  font-size: 13px;
  min-width: 84px;
  padding: 5px 12px;
  background: var(--silver);
  color: var(--black);
  box-shadow: var(--bevel-out);
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn:active {
  box-shadow: var(--bevel-in);
  padding: 6px 11px 4px 13px;
}

.btn:focus-visible {
  outline: 1px dotted var(--black);
  outline-offset: -4px;
}

.btn[disabled] {
  color: var(--gray);
  text-shadow: 1px 1px var(--white);
  cursor: default;
}

/* ---- Inputs / fieldsets ------------------------------------------------ */

.field {
  font-family: var(--font);
  font-size: 13px;
  padding: 4px 5px;
  background: var(--white);
  color: var(--black);
  box-shadow: var(--bevel-in);
  border: none;
  width: 100%;
}

.field:focus {
  outline: none;
}

fieldset {
  margin: 14px 0 0;
  padding: 10px 10px 12px;
  border: 1px solid var(--gray);
  border-right-color: var(--white);
  border-bottom-color: var(--white);
}

legend {
  padding: 0 4px;
  font-weight: bold;
}

/* ---- Home page --------------------------------------------------------- */

.tagline {
  margin: 0 0 12px;
  line-height: 1.45;
}

.search-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.search-row .field {
  flex: 1;
}

.hint {
  margin: 10px 0 0;
  color: #404040;
  font-size: 12px;
}

.status {
  margin-top: 12px;
  min-height: 18px;
}

.status.error {
  color: #aa0000;
  font-weight: bold;
}

.spinner-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.platforms-blurb {
  margin: 16px 0 0;
}

.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  background: var(--silver);
  box-shadow: var(--bevel-out);
  font-size: 12px;
}

/* ---- Now playing (share page) ------------------------------------------ */

.now-playing {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.cover {
  width: 96px;
  height: 96px;
  object-fit: cover;
  box-shadow: var(--bevel-in);
  background: var(--white);
  flex: 0 0 auto;
}

.cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--gray);
}

.now-playing-meta {
  min-width: 0;
}

.track-title {
  margin: 2px 0 4px;
  font-size: 16px;
  line-height: 1.2;
}

.track-artist {
  margin: 0 0 6px;
  font-size: 13px;
}

.track-type {
  margin: 0;
  display: inline-block;
  text-transform: capitalize;
  font-size: 11px;
  padding: 1px 6px;
  background: var(--silver);
  box-shadow: var(--bevel-out);
  color: #303030;
}

/* ---- Platform links ---------------------------------------------------- */

.platform-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.platform-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--silver);
  box-shadow: var(--bevel-out);
  text-decoration: none;
  color: var(--black);
}

.platform-link:active {
  box-shadow: var(--bevel-in);
}

.platform-badge {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: bold;
  box-shadow: inset -1px -1px rgba(0, 0, 0, 0.4), inset 1px 1px rgba(255, 255, 255, 0.4);
}

.platform-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-tag {
  font-size: 10px;
  color: #404040;
  text-transform: uppercase;
}

.brand-spotify { background: #1db954; }
.brand-appleMusic { background: #fb243b; }
.brand-tidal { background: #000000; }
.brand-amazonMusic { background: #00a8e1; }
.brand-youtubeMusic { background: #ff0000; }
.brand-bandcamp { background: #629aa9; }

/* ---- Share box / actions ----------------------------------------------- */

.share-row {
  display: flex;
  gap: 8px;
}

.share-row .field {
  flex: 1;
}

.actions {
  margin-top: 14px;
}

.dialog-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
}

.bang-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffcc00;
  color: #000;
  font-weight: bold;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset -1px -1px rgba(0, 0, 0, 0.4), inset 1px 1px rgba(255, 255, 255, 0.6);
}

.dialog-buttons {
  text-align: center;
}

/* ---- Ad banner --------------------------------------------------------- */

.ad-banner {
  margin: 16px auto 2px;
  width: 100%;
  max-width: 468px;
  text-align: center;
}

.ad-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #2a2a2a;
  margin-bottom: 3px;
}

.ad-slot {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  box-shadow: var(--bevel-in);
  color: var(--gray);
  font-size: 12px;
}

/* ---- Taskbar ----------------------------------------------------------- */

.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  background: var(--silver);
  box-shadow: inset 0 1px var(--white), inset 0 2px var(--silver-light);
}

.start-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: bold;
  padding: 3px 9px 3px 5px;
  background: var(--silver);
  box-shadow: var(--bevel-out);
  text-decoration: none;
  color: var(--black);
}

.start-button:active {
  box-shadow: var(--bevel-in);
}

.start-flag {
  width: 16px;
  height: 14px;
  background: linear-gradient(135deg, #ff0000 0 50%, #00a300 0 50%);
  position: relative;
  display: inline-block;
}

.start-flag::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, #0066ff 0 50%, #ffcc00 0 50%);
  clip-path: polygon(0 0, 50% 0, 0 50%);
}

.taskbar-item {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  background: var(--silver);
  box-shadow: var(--bevel-in);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.tray {
  margin-left: auto;
  padding: 3px 8px;
  box-shadow: var(--bevel-in);
}

.tray-clock {
  font-size: 12px;
}

/* ---- Small screens ----------------------------------------------------- */

@media (max-width: 480px) {
  .platform-list {
    grid-template-columns: 1fr;
  }
  .search-row {
    flex-direction: column;
  }
}
