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

:root {
  --bg:       #0f0f1a;
  --surface:  #1a1a2e;
  --border:   #2a2a4a;
  --primary:  #4f8ef7;
  --danger:   #e05252;
  --success:  #4caf7d;
  --warn:     #f0a030;
  --text:     #e8e8f0;
  --muted:    #8888aa;
  --speak:    #4caf7d;
  --radius:   14px;
  --gap:      20px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  -webkit-tap-highlight-color: transparent;
}

/* ── Layouts ── */
.page-home, .page-room {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  gap: var(--gap);
  max-width: 480px;
  margin: 0 auto;
}

/* ── Brand ── */
.brand { text-align: center; }
.brand__icon { font-size: 56px; margin-bottom: 8px; }
.brand__title { font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; }
.brand__sub { color: var(--muted); margin-top: 4px; }

/* ── Card ── */
.card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.divider {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  width: 100%;
}

/* ── Buttons ── */
.btn {
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 24px;
  transition: opacity .15s, transform .1s;
  width: 100%;
}
.btn:active { transform: scale(0.97); opacity: 0.85; }

.btn--primary { background: var(--primary);  color: #fff; }
.btn--secondary { background: var(--border); color: var(--text); }
.btn--danger  { background: var(--danger);   color: #fff; }
.btn--copy    { background: var(--border);   color: var(--text); width: auto; padding: 12px 16px; flex-shrink: 0; }
.btn--large   { font-size: 1.15rem; padding: 18px 24px; min-height: 60px; }
.btn--muted   { background: var(--danger); }

/* ── Input label ── */
.input-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

/* ── Input ── */
.input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.1rem;
  padding: 14px 16px;
  width: 100%;
  outline: none;
  letter-spacing: 0.05em;
}
.input:focus { border-color: var(--primary); }
.input--share { font-size: 0.8rem; letter-spacing: 0; flex: 1; }

/* ── Room header ── */
.room-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.room-info { display: flex; align-items: center; gap: 10px; }
.label { color: var(--muted); font-size: 0.8rem; }
.room-code { font-size: 1.5rem; font-weight: 800; letter-spacing: 0.15em; }

/* ── Connection state ── */
.conn-state { font-size: 0.8rem; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.conn--ok   { background: #1e3a2f; color: var(--success); }
.conn--warn { background: #3a2e1a; color: var(--warn); }
.conn--err  { background: #3a1a1a; color: var(--danger); }

/* ── Status ── */
.status { font-size: 0.85rem; text-align: center; color: var(--muted); }
.status--ok   { color: var(--success); }
.status--warn { color: var(--warn); }
.status--error { color: var(--danger); }

/* ── Speaking indicator ── */
.speak-indicator {
  width: 100%;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--muted);
  transition: all .2s;
}
.speak-indicator.speaking {
  border-color: var(--speak);
  color: var(--speak);
  background: #1a2e24;
}

/* ── Participants ── */
.participants-box {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.participants-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.participants-title {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.participants-count {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--border);
  padding: 2px 9px;
  border-radius: 12px;
}

.participants-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.participant-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all .2s;
}

.participant-item--speaking {
  border-color: var(--speak);
  background: #162a1f;
}

.participant-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.participant-avatar--speaking {
  background: var(--speak);
  color: #fff;
}

.participant-name {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text);
}

.participant-me {
  font-size: 0.7rem;
  color: var(--muted);
}

.participant-badge {
  font-size: 0.68rem;
  color: var(--speak);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: #1a3824;
  border: 1px solid var(--speak);
  white-space: nowrap;
}

/* ── Controls ── */
.controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Room header sağ ── */
.room-header-right { display: flex; align-items: center; gap: 8px; }
.data-usage { font-size: 0.75rem; color: var(--muted); min-width: 44px; text-align: right; }

/* ── Settings box ── */
.settings-box {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-row  { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.settings-label { font-size: 0.85rem; color: var(--text); }
.settings-value { font-size: 0.85rem; color: var(--primary); font-weight: 700; min-width: 24px; text-align: right; }
.settings-note  { font-size: 0.72rem; color: var(--muted); }
.slider-hint    { font-size: 0.7rem; color: var(--muted); flex-shrink: 0; }

.slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
}

/* ── Level meters ── */
.level-box {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.level-row   { display: flex; align-items: center; gap: 10px; }
.level-label { font-size: 0.75rem; color: var(--muted); width: 36px; flex-shrink: 0; }
.level-bar   { flex: 1; height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.level-fill  { height: 100%; width: 0%; border-radius: 5px; transition: width 0.1s ease; }
.level-fill--local  { background: var(--primary); }
.level-fill--remote { background: var(--success); }

/* ── Share box ── */
.share-box {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.share-box__label { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }
.share-row { display: flex; gap: 8px; }

/* ── Başlangıç izin overlay ── */
.perm-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  transition: opacity 0.35s ease;
}
.perm-overlay--hidden {
  opacity: 0;
  pointer-events: none;
}
.perm-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 340px;
  width: 100%;
  text-align: center;
}
.perm-icon  { font-size: 72px; line-height: 1; }
.perm-title { font-size: 1.8rem; font-weight: 700; }
.perm-desc  { color: var(--muted); font-size: 0.95rem; line-height: 1.6; }

/* ── Telefon çağrısında katılımcı ── */
.participant-item--oncall {
  border-color: var(--warn);
  background: #2a1f0a;
  opacity: 0.75;
}
.participant-avatar--oncall {
  background: var(--warn);
  color: #fff;
}
.participant-badge--oncall {
  color: var(--warn);
  background: #2a1f0a;
  border-color: var(--warn);
}
