/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body { background: #06080e; color: #e4e6f0; font-family: 'Outfit', sans-serif; font-weight: 400; min-height: 100dvh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
input  { font-family: inherit; }
.hidden { display: none !important; }

:root {
  --bg:       #06080e;
  --surface:  #0d1018;
  --surface2: #131720;
  --border:   rgba(255,255,255,0.08);
  --border2:  rgba(255,255,255,0.13);
  --text:     #e4e6f0;
  --dim:      rgba(228,230,240,0.4);
  --gold:     #d4a843;
  --gold2:    #b8902e;
  --gold-glow:rgba(212,168,67,0.15);
  --red:      #e05555;
  --red-bg:   rgba(224,85,85,0.1);
  --radius:   16px;
  --safe-b:   env(safe-area-inset-bottom, 0px);
  --safe-t:   env(safe-area-inset-top, 0px);
}

/* ── Home Screen ── */
#home-screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.site-header {
  padding: calc(var(--safe-t) + 18px) 22px 14px;
  display: flex;
  align-items: center;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
}

.logo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  flex-shrink: 0;
}

.logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ── Hero ── */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 32px;
  position: relative;
}

.hero-glow {
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,67,0.07) 0%, transparent 65%);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
}

.hero-body {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, var(--gold) 55%, #fff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 5s ease-in-out infinite;
  text-align: center;
}

@keyframes shimmer {
  0%,100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.hero-sub {
  font-size: 14px;
  color: var(--dim);
  text-align: center;
  line-height: 1.6;
}

/* ── Input Card ── */
.input-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.input-row {
  display: flex;
  align-items: center;
  padding: 4px 6px 4px 16px;
  border-bottom: 1px solid var(--border);
}

.input-icon { color: var(--dim); flex-shrink: 0; margin-right: 10px; }

#url-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  padding: 14px 8px 14px 0;
  caret-color: var(--gold);
  min-width: 0;
}
#url-input::placeholder { color: var(--dim); }

.url-clear {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--dim);
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.url-clear.show  { opacity: 1; }
.url-clear:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.card-actions {
  display: flex;
  gap: 10px;
  padding: 12px;
}

.btn-play {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 100%);
  color: #1a0e00;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(212,168,67,0.3);
}
.btn-play:hover  { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(212,168,67,0.45); }
.btn-play:active { transform: scale(0.97); }
.btn-play-icon   { font-size: 13px; }

.btn-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dim);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn-sub:hover { border-color: var(--gold); color: var(--gold); }

.sub-loaded-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--gold);
}
.sub-loaded-badge svg { flex-shrink: 0; }
.sub-loaded-badge span { flex: 1; }
#sub-remove { font-size: 13px; opacity: 0.6; padding: 2px 5px; border-radius: 4px; }
#sub-remove:hover { opacity: 1; background: rgba(255,255,255,0.07); }

.home-error {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  background: var(--red-bg);
  border: 1px solid rgba(224,85,85,0.2);
  border-radius: 10px;
  color: var(--red);
  font-size: 13px;
  line-height: 1.5;
  animation: fadein 0.2s ease;
}
@keyframes fadein { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }

.format-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}
.ftag {
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--dim);
  text-transform: uppercase;
}

/* ── Footer ── */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px calc(var(--safe-b) + 14px);
  border-top: 1px solid var(--border);
}
.footer-brand { font-size: 12px; font-weight: 600; color: rgba(212,168,67,0.45); letter-spacing: 0.04em; }
.footer-note  { font-size: 11px; color: var(--dim); opacity: 0.5; }

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
