* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #08080a;
  --ink: #101014;
  --pill-bg: rgba(16, 16, 20, 0.78);
  --pill-border: rgba(255, 255, 255, 0.12);
  --accent: #ff3868;
  --accent-ink: #2a0410;
  --accent2: #ffc23c;
  --live: #ff3b30;
  --text: #f4f4f6;
  --text-dim: #a8a8b2;
  --font-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  font-family: var(--font-body);
}

html, body {
  height: 100%;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: #000;
  overflow: hidden;
}

#player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 26%, rgba(0,0,0,0) 60%, rgba(0,0,0,0.7) 100%);
}

.pill {
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 10px;
  color: var(--text);
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  cursor: default;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* --- Tek satırlık üst bar: sol = canlı+izleyici, sağ = ikon-only butonlar --- */
.topbar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-pill {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 10.5px;
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,59,48,0.55); }
  70% { box-shadow: 0 0 0 6px rgba(255,59,48,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); }
}

.viewers { color: var(--text-dim); font-weight: 700; }
.viewers svg { flex: 0 0 auto; color: var(--text-dim); }

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--text);
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn.wide {
  width: auto;
  padding: 0 12px;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
}
/* Durum gösterimi buton üzerindeki data-* attribute'una bağlı — [hidden]
   attribute'una güvenmek kırılgandı (kullanıcı geri bildirimi: ikon
   değişmiyor gibi görünüyordu), bu daha sağlam. */
.icon-btn[data-muted="true"] .ic-unmute { display: none; }
.icon-btn[data-muted="false"] .ic-mute { display: none; }
.icon-btn[data-open="true"] .ic-no { display: none; }
.icon-btn[data-open="false"] .ic-yes { display: none; }
.icon-btn svg { display: block; flex: 0 0 auto; }

/* --- Ticker: tam genişlik, üst barın hemen altında. Kredi rozeti art
   konumlanabilsin diye ayrı bir sarmalayıcı içinde. --- */
.ticker-wrap {
  position: absolute;
  top: 46px;
  left: 10px;
  right: 10px;
  z-index: 5;
}
.ticker {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 10px;
}
.ticker-line {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.3;
}
.ticker-now { color: var(--text); font-weight: 700; }
.ticker-next { color: var(--text-dim); font-weight: 600; font-size: 10.5px; }
.ticker-next b, .ticker-now b { color: var(--accent2); font-weight: 800; }

/* --- Kredi rozeti: ticker'dan bağımsız, hemen altında, sağa yaslı, kendi
   badge'i. fal = pembe (accent), @sezeriltekin = sarı (accent2). */
.credit-pill {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #9a9aa2;
  white-space: nowrap;
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.credit-pill a {
  color: var(--accent2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.credit-pill .fal-mark {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
}
.credit-pill .fal-mark svg { flex: 0 0 auto; display: block; }

.center-brand {
  position: absolute;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 4;
  color: white;
  width: 90%;
}
.center-brand h1 {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -1.5px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.55);
}
.center-brand h1 em {
  font-style: normal;
  color: var(--accent2);
}
.center-brand .tagline {
  margin-top: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: #eee;
  line-height: 1.55;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
.center-brand .powered-by {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--font-display);
  text-shadow: 0 2px 14px rgba(0,0,0,0.65);
}
.center-brand .powered-by svg { color: var(--accent); flex: 0 0 auto; }
.center-brand .powered-fal {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
}
.center-brand .powered-model {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent2);
}
.play-btn {
  margin-top: 22px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 16px 30px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 28px rgba(255,56,104,0.5);
}
.play-btn:active { transform: scale(0.95); }

/* İlk ziyaret nick modalı */
.nick-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(4, 4, 6, 0.86);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nick-modal[hidden] { display: none; }
.nick-card {
  width: 84%;
  max-width: 320px;
  background: var(--ink);
  border: 1px solid var(--pill-border);
  border-radius: 20px;
  padding: 26px 22px;
  text-align: center;
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.nick-card h2 { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.nick-card p { font-size: 13px; color: var(--text-dim); margin-bottom: 18px; line-height: 1.5; }
.nick-card input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 13px 16px;
  font-size: 16px; /* iOS Safari 16px altında input'a odaklanınca otomatik zoom yapıyor */
  font-weight: 600;
  background: rgba(255,255,255,0.95);
  color: #111;
  margin-bottom: 12px;
  text-align: center;
}
.nick-card input:focus { outline: none; border-color: var(--accent); }
.nick-card button {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 13px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 0.2px;
}
.nick-card button:active { transform: scale(0.98); }
.nick-error {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  margin: -10px 0 12px;
}
.nick-error[hidden] { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
.spinner[hidden] { display: none; }
#sendBtn { display: inline-flex; align-items: center; justify-content: center; min-width: 76px; }
#sendBtn[disabled] { opacity: 0.75; cursor: default; }

.overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  max-height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 40%, rgba(0,0,0,0) 100%);
  padding-top: 24px;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 0 12px 8px;
  justify-content: center;
}
.tab {
  flex: 0 0 auto;
  padding: 8px 24px;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: rgba(255,255,255,0.92);
  color: #16161a;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.3px;
  cursor: pointer;
}
.tab.active { background: var(--accent); color: white; border-color: var(--accent); }

.panel { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 12px; flex: 1; }
.panel.hidden { display: none; }

.feed { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }

.section-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin: 6px 2px 2px;
}

.msg {
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 14px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  align-self: flex-start;
  max-width: 92%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.msg .time { color: var(--text-dim); font-size: 11px; margin-right: 6px; font-weight: 600; }
.msg .nick { font-weight: 800; margin-right: 4px; }

.msg.c0 { background: rgba(255, 56, 104, 0.20); }
.msg.c1 { background: rgba(255, 194, 60, 0.16); }
.msg.c2 { background: rgba(52, 211, 153, 0.16); }
.msg.c3 { background: rgba(56, 189, 248, 0.18); }
.msg.c4 { background: rgba(192, 132, 252, 0.18); }

.queue-row { display: flex; align-items: center; gap: 8px; }
.vote-btn {
  flex: 0 0 auto;
  width: 34px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 10px;
  color: var(--text);
  padding: 5px 0;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.vote-btn:active { transform: scale(0.94); }

.input-bar {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.65);
}
.input-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 999px;
  padding: 13px 16px;
  font-size: 16px; /* iOS Safari 16px altında input'a odaklanınca otomatik zoom yapıyor */
  font-weight: 500;
  background: rgba(255,255,255,0.95);
  color: #111;
}
.input-bar input:focus { outline: 2px solid var(--accent); }
.input-bar button {
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  padding: 0 22px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
.input-bar button:active { transform: scale(0.96); }
#nickEditBtn {
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 481px) {
  #app { border-radius: 20px; margin-top: 2vh; height: 96vh; height: 96dvh; box-shadow: 0 30px 100px rgba(0,0,0,0.6); }
}
