:root {
  --bg: #0b1f2a;
  --bg2: #103040;
  --card: #15384a;
  --accent: #2ec4b6;
  --accent2: #ff9f1c;
  --text: #eaf6f6;
  --muted: #8fb3bd;
  --danger: #ff5d5d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(160deg, var(--bg), var(--bg2));
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); }

.wrap { max-width: 680px; margin: 0 auto; padding: 16px; }

header.app {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  position: sticky; top: 0;
  background: rgba(11,31,42,0.92);
  backdrop-filter: blur(6px);
  z-index: 5;
}
header.app h1 { font-size: 1.2rem; margin: 0; }
header.app .logo { font-size: 1.6rem; }

input[type="search"], input[type="text"] {
  width: 100%; padding: 14px 16px; font-size: 1rem;
  border-radius: 12px; border: 1px solid #245; background: #0e2a38;
  color: var(--text);
}
input::placeholder { color: var(--muted); }

/* search box with clear button */
.search-wrap { position: relative; }
.search-wrap input { padding-right: 46px; }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; padding: 0; border-radius: 50%;
  background: #0e2a38; color: var(--muted); font-size: 1.2rem; line-height: 1;
  align-items: center; justify-content: center;
}
.search-clear:hover { color: var(--text); }
/* hide the browser's native search clear so we only show ours */
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

button {
  cursor: pointer; border: none; border-radius: 10px;
  padding: 10px 14px; font-size: 0.95rem; font-weight: 600;
  background: var(--accent); color: #042; transition: transform .05s ease;
}
button:active { transform: scale(0.97); }
button.ghost { background: transparent; color: var(--text); border: 1px solid #356; }
button.danger { background: var(--danger); color: #300; }
button:disabled { opacity: .5; cursor: default; }

.muted { color: var(--muted); font-size: .85rem; }

/* result + queue cards */
.card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 12px; padding: 10px; margin: 8px 0;
}
.card img.art { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: #07202b; flex: none; }
.card .meta { flex: 1; min-width: 0; }
.card .meta .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta .sub { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .added { font-size: .75rem; color: var(--accent2); }

.section-title { margin: 18px 0 6px; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* request history cards */
.hist-stats { display: flex; align-items: center; gap: 12px; flex: none; }
.hist-stats .stat { display: flex; flex-direction: column; align-items: center; line-height: 1.05; min-width: 34px; }
.hist-stats .stat b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.hist-stats .stat small { font-size: .6rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pill { font-size: .7rem; padding: 4px 10px; border-radius: 999px; white-space: nowrap; flex: none; }
.pill.ready { background: rgba(46, 196, 182, .18); color: var(--accent); }
.pill.cooling { background: rgba(255, 159, 28, .16); color: var(--accent2); }

/* expandable history cards + host-only actions */
.hist-item { margin: 6px 0; }
.hist-card { margin: 0; cursor: pointer; }
.hist-card .chev { color: var(--muted); font-size: .8rem; width: 14px; text-align: center; }
.hist-actions { display: flex; gap: 8px; padding: 8px 4px 2px; }
.hist-actions button { padding: 6px 12px; font-size: .85rem; }
button.ghost.danger-btn { color: var(--danger); border-color: var(--danger); }

/* name gate */
.overlay {
  position: fixed; inset: 0; background: rgba(4,15,20,.96);
  display: flex; align-items: center; justify-content: center; z-index: 20; padding: 24px;
}
.overlay .box { background: var(--card); padding: 24px; border-radius: 16px; width: 100%; max-width: 360px; text-align: center; }
.overlay .box h2 { margin-top: 0; }

/* toast — full-width banner centered on screen */
.toast {
  position: fixed; left: 0; right: 0; top: 50%;
  transform: translateY(-50%) scale(.98);
  background: #04313a; color: var(--text); padding: 22px 18px;
  border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent);
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
  pointer-events: none; z-index: 30; cursor: pointer; text-align: center;
  font-size: 1.1rem; font-weight: 600;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
}
.toast.show { opacity: 1; transform: translateY(-50%) scale(1); pointer-events: auto; }

/* host display */
.host-now {
  display: flex; gap: 20px; align-items: center;
  background: var(--card); border-radius: 18px; padding: 22px; margin-bottom: 18px;
}
.host-now img { width: 140px; height: 140px; border-radius: 14px; object-fit: cover; background: #07202b; flex: none; }
.host-now .big-title { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.host-now .big-sub { color: var(--muted); font-size: 1.1rem; margin-top: 6px; }
.host-now .by { color: var(--accent2); margin-top: 10px; }

.pbar { height: 6px; background: #0e2a38; border-radius: 999px; overflow: hidden; }
.pbar-fill { height: 100%; width: 0%; background: var(--accent); transition: width .5s linear; }
.ptimes { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; margin-top: 5px; }

.host-grid { display: grid; grid-template-columns: 1fr 220px; gap: 20px; align-items: start; }
/* Up next + Top Requests side by side under Now Playing, to use the wide display. */
.host-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; margin-top: 4px; }
.cta { color: var(--accent); font-weight: 600; font-size: 1.05rem; }
.qr-panel { background: var(--card); border-radius: 16px; padding: 18px; text-align: center; }
.qr-panel img { width: 180px; height: 180px; background: #fff; border-radius: 10px; padding: 6px; }
.qr-panel .url { font-size: .85rem; color: var(--accent); word-break: break-all; margin-top: 8px; }

@media (max-width: 720px) {
  .host-grid { grid-template-columns: 1fr; }
  .host-lists { grid-template-columns: 1fr; }
  .host-now img { width: 90px; height: 90px; }
  .host-now .big-title { font-size: 1.3rem; }
}
