:root { color-scheme: dark; --bg: #111; --panel: #1b1b1b; --line: #262626; --text: #eee; --muted: #8a8a8a; --accent: #3a6df0; --danger: #e5484d; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; padding-bottom: 110px; }
[hidden] { display: none !important; }
h1 { font-size: 20px; margin: 0; flex: 1; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.screen { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 64px 24px; text-align: center; }

.topbar { display: flex; align-items: center; gap: 8px; padding: 16px 16px 8px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
/* Toolbar: short fixed-width search, language globe, then play / shuffle / repeat icons. */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; }
.toolbar .spacer { flex: 1; }
/* 16px font stops iPhone Safari zooming into the field. */
#search { flex: 0 0 160px; width: 160px; padding: 9px 12px; border-radius: 10px; border: 0; background: #222; color: var(--text); font-size: 16px; }
.lang { position: relative; }
.badge-code { position: absolute; right: -4px; bottom: -4px; padding: 1px 4px; border-radius: 6px; background: #fff; color: #111; font-size: 10px; font-weight: 700; pointer-events: none; }
.lang-panel { position: absolute; top: 46px; left: 0; z-index: 5; display: flex; gap: 6px; padding: 8px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.chip { min-width: 44px; height: 36px; padding: 0 10px; border: 0; border-radius: 999px; background: #2a2a2a; color: var(--text); font-size: 14px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; }
.banner { margin: 0 16px 8px; padding: 8px 12px; border-radius: 8px; background: #222; color: var(--muted); font-size: 13px; }

.tabs { display: flex; gap: 6px; padding: 4px 16px 8px; overflow-x: auto; }
.tabs button { flex: 1 0 auto; padding: 8px 10px; border: 0; border-radius: 999px; background: #222; color: var(--muted); font-size: 14px; }
.tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }

.detail-header { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.detail-header span { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.list li:active { background: #1e1e1e; }
.list .info { flex: 1; min-width: 0; }
.list .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 12px; color: #6ee7a0; }
.empty { padding: 40px 16px; text-align: center; }

button { font: inherit; cursor: pointer; }
button.ghost { background: #222; color: var(--text); border: 0; border-radius: 8px; padding: 8px 10px; min-height: 36px; }
button.primary { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 10px 16px; min-height: 40px; }
/* Round player buttons (issue #4). Icons are SVG so iPhone doesn't swap in emoji. */
button.round {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: #2a2a2a; color: var(--text); -webkit-tap-highlight-color: transparent;
}
button.round svg { width: 20px; height: 20px; fill: currentColor; }
button.round.play { width: 48px; height: 48px; background: var(--accent); color: #fff; }
button.round.play svg { width: 24px; height: 24px; }
button.round.on { background: var(--accent); color: #fff; }
button.round:active { transform: scale(.94); }
button.round:disabled { opacity: .4; }
button:disabled { opacity: .5; }

#player { position: fixed; left: 0; right: 0; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
#player .now { display: flex; align-items: center; gap: 8px; }
#player img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }
#player .meta { flex: 1; min-width: 0; }
#player .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
#player .artist { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#player audio { width: 100%; margin-top: 6px; }

#googleButton { min-height: 44px; }
