:root {
  --bg: #0c0a1d;
  --panel: rgba(22, 18, 46, .72);
  --solid: #171332;
  --card: rgba(255, 255, 255, .05);
  --card2: rgba(255, 255, 255, .09);
  --line: rgba(160, 140, 255, .16);
  --text: #f2efff;
  --dim: #9d96c4;
  --accent: #9b7bff;
  --accent2: #e46bd0;
  --green: #4ee6a8;
  --red: #ff6482;
  --yellow: #ffc85c;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; height: 100dvh; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
body {
  display: flex; flex-direction: column; overflow: hidden; user-select: none;
  color: var(--text); font: 14px/1.4 "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(900px 600px at 50% 18%, rgba(128, 84, 255, .30), transparent 70%),
    radial-gradient(700px 500px at 0% 100%, rgba(52, 96, 220, .22), transparent 70%),
    radial-gradient(600px 500px at 100% 90%, rgba(214, 70, 180, .16), transparent 70%),
    var(--bg);
}
#root { flex: 1; min-height: 0; }
.hidden { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { background: var(--card2); border: 1px solid transparent; border-radius: 12px; padding: 9px 14px; cursor: pointer; font-weight: 600; transition: filter .15s, background .15s, border-color .15s; }
button:hover { filter: brightness(1.2); border-color: var(--line); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
button.danger { background: rgba(255, 80, 115, .18); color: #ff9db0; }
button.on { background: var(--red); color: #fff; }
button.small { padding: 5px 10px; font-size: 12px; border-radius: 9px; }
input, select { width: 100%; background: rgba(8, 6, 22, .6); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; user-select: text; }
select option { background: var(--solid); }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="range"] { padding: 0; border: 0; background: transparent; accent-color: var(--accent); }
label { display: block; color: var(--dim); font-size: 12px; margin: 12px 0 5px; }
h1 { font-size: 28px; letter-spacing: -.5px; }
h2 { font-size: 19px; }
h3 { font-size: 11px; letter-spacing: 1px; color: var(--dim); text-transform: uppercase; margin: 4px 0 10px; }
.dim { color: var(--dim); }
.error { color: var(--red); min-height: 20px; margin-top: 10px; font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: rgba(160, 140, 255, .22); border-radius: 4px; }

.center { height: 100%; display: grid; place-items: center; text-align: center; }
.auth { width: 370px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 32px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 60px rgba(140, 100, 255, .18); }
.auth button.primary { width: 100%; margin-top: 16px; }
.hero { font-size: 54px; margin-bottom: 10px; filter: drop-shadow(0 0 24px rgba(155, 123, 255, .8)); }

.layout { height: 100%; display: grid; grid-template-columns: 250px minmax(0, 1fr) 240px; grid-template-rows: minmax(0, 1fr); }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side.right { border: 0; border-left: 1px solid var(--line); }
.side-head { padding: 16px; border-bottom: 1px solid var(--line); }
.scroll { overflow-y: auto; padding: 14px; flex: 1; min-height: 0; }
.mebar { padding: 12px; border-top: 1px solid var(--line); }

.room-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 10px; width: 100%; text-align: left; display: block; }
.room-card.active { border-color: var(--accent); background: linear-gradient(135deg, rgba(155, 123, 255, .22), rgba(228, 107, 208, .10)); box-shadow: 0 0 22px rgba(155, 123, 255, .25); }
.stack { display: flex; margin-top: 8px; min-height: 26px; align-items: center; }
.stack .avatar { margin-right: -7px; border: 2px solid var(--solid); }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #6a57d9, #3b2f8a); display: grid; place-items: center; font-weight: 700; object-fit: cover; flex: none; }
.avatar.av1 { background: linear-gradient(135deg, #e46bd0, #7b2f86); }
.avatar.av2 { background: linear-gradient(135deg, #4aa8ff, #28429c); }
.avatar.av3 { background: linear-gradient(135deg, #36d6b5, #1c6670); }
.avatar.av4 { background: linear-gradient(135deg, #ff9a62, #9c3d55); }
.avatar.av5 { background: linear-gradient(135deg, #b98cff, #4b4fb0); }
.avatar.xs { width: 26px; height: 26px; font-size: 11px; }
.avatar.big { width: 76px; height: 76px; font-size: 28px; }

.member { display: flex; align-items: center; gap: 10px; padding: 6px; width: 100%; background: transparent; text-align: left; font-weight: 400; }
.member.off { opacity: .5; }
.nick { color: #b9a4ff; font-size: 12px; max-width: 100%; }
.lock { font-size: 11px; color: var(--yellow); white-space: nowrap; }
.picklist { display: grid; gap: 8px; margin-top: 14px; }
input.check { width: auto; accent-color: var(--accent); }
.section label.grow { margin: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); flex: none; }
.badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--card2); color: var(--yellow); margin-left: 5px; }
.badge.founder { color: var(--green); background: rgba(78, 230, 168, .14); box-shadow: 0 0 8px rgba(78, 230, 168, .25); }
.notice { font-size: 11px; line-height: 1.4; margin: 12px 0 0; }

.main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.room-head { padding: 14px 20px; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: var(--card2); white-space: nowrap; }
.pill.live { background: rgba(255, 80, 115, .2); color: #ff8ea3; }
.banner { background: rgba(255, 80, 115, .2); color: #ffb8c4; text-align: center; padding: 8px; font-weight: 600; }
.banner.warn { background: rgba(255, 200, 92, .16); color: var(--yellow); }

/* sahne: oda yöneticisi ortada büyük, diğerleri altında halka halinde */
.grid { flex: 1; min-height: 120px; overflow-y: auto; display: flex; padding: 10px 16px; position: relative; }
.stage { margin: auto; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; max-width: 640px; }
.person { background: transparent; padding: 8px 4px; width: 112px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.person:hover { background: var(--card); }
.ring { padding: 3px; border-radius: 50%; position: relative; background: linear-gradient(135deg, rgba(155, 123, 255, .75), rgba(74, 168, 255, .35)); box-shadow: 0 0 20px rgba(140, 100, 255, .30); margin-bottom: 2px; }
.ring .avatar { border: 3px solid var(--solid); }
.person.speaking .ring { background: linear-gradient(135deg, var(--green), #35c9e6); animation: pulse 1.1s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(78, 230, 168, .65), 0 0 22px rgba(78, 230, 168, .5); } 100% { box-shadow: 0 0 0 13px rgba(78, 230, 168, 0), 0 0 22px rgba(78, 230, 168, .5); } }
.wave { display: flex; gap: 3px; align-items: center; height: 12px; opacity: .25; }
.wave i { width: 3px; height: 4px; border-radius: 2px; background: var(--accent); }
.person.speaking .wave { opacity: 1; }
.person.speaking .wave i { background: var(--green); animation: eq .7s ease-in-out infinite alternate; }
.person.speaking .wave i:nth-child(2) { animation-delay: .15s; }
.person.speaking .wave i:nth-child(3) { animation-delay: .35s; }
.person.speaking .wave i:nth-child(4) { animation-delay: .05s; }
.person.speaking .wave i:nth-child(5) { animation-delay: .25s; }
@keyframes eq { from { height: 3px; } to { height: 12px; } }
.person .name { max-width: 100%; font-size: 13px; }
.person.host { width: 200px; }
.person.host .avatar { width: 128px; height: 128px; font-size: 48px; }
.person.host .ring { padding: 4px; background: linear-gradient(135deg, var(--accent2), var(--accent), #4aa8ff); box-shadow: 0 0 46px rgba(185, 110, 255, .55); }
.person.host.speaking .ring { background: linear-gradient(135deg, var(--green), #35c9e6); }
.person.host .name { font-size: 16px; }
.host-tag { font-size: 11px; font-weight: 700; padding: 2px 12px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent2)); margin-bottom: 4px; }
.stage.crowded .person { width: 94px; }
.stage.crowded .seats .avatar { width: 56px; height: 56px; font-size: 21px; }
.stage.crowded .person.host .avatar { width: 92px; height: 92px; font-size: 34px; }
.stage.crowded .person.host { width: 170px; }
.flags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; min-height: 18px; }
.flag { font-size: 10px; font-weight: 700; border-radius: 6px; padding: 1px 6px; background: rgba(255, 80, 115, .22); color: #ff9db0; }
.flag.gray { background: var(--card2); color: var(--dim); }

.controls { display: flex; gap: 6px; padding: 12px 8px; justify-content: center; flex-wrap: wrap; border-top: 1px solid var(--line); background: var(--panel); }
.controls button { border-radius: 24px; padding: 9px 11px; font-size: 12.5px; white-space: nowrap; }

.toggle { display: flex; align-items: center; gap: 5px; margin: 0; cursor: pointer; }

.modal-back { position: fixed; inset: 0; background: rgba(6, 4, 18, .78); display: grid; place-items: center; z-index: 5; }
.modal { background: var(--solid); border: 1px solid var(--line); border-radius: 20px; padding: 22px; width: 440px; max-height: 88vh; overflow-y: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 50px rgba(140, 100, 255, .18); }
.modal.wide { width: 780px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.section { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.admin-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.admin-card { padding: 10px 0; border-bottom: 1px solid var(--line); }
.admin-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.founder-info { display: flex; flex-wrap: wrap; gap: 3px 14px; margin-top: 7px; font-size: 12px; color: var(--dim); user-select: text; }
.founder-info b { color: var(--green); font-weight: 600; }
.log { max-height: 260px; overflow-y: auto; font-size: 12px; user-select: text; }
.log-row { display: grid; grid-template-columns: 105px 110px 170px 1fr; gap: 8px; padding: 4px 0; }
.tabs, .ico { display: none; }
.log-row.warn > span:nth-child(3) { color: var(--yellow); font-weight: 600; }
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); border-radius: 12px; padding: 10px 16px; font-weight: 600; z-index: 9; max-width: 80vw; }

.voices { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 0 14px 8px; padding: 8px 10px; background: var(--solid); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 0 30px rgba(140, 100, 255, .22); flex: none; }
.voice-split { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.micbar { display: flex; align-items: center; gap: 12px; padding: 6px 20px; font-size: 12px; }
progress { width: 110px; height: 8px; flex: none; appearance: none; border: 0; border-radius: 5px; overflow: hidden; background: var(--card2); }
progress.wide { width: 100%; display: block; margin: 8px 0 4px; }
progress::-webkit-progress-bar { background: var(--card2); }
progress::-webkit-progress-value { background: var(--green); }
.mic-status.bad { color: var(--yellow); font-weight: 600; }
.mictest { font-size: 12px; margin-bottom: 8px; }
.update { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 7px 14px; background: linear-gradient(90deg, #3b2a86, #6b2a70); font-weight: 600; flex: none; }
.room-head { flex-wrap: wrap; gap: 8px; }
.room-head > .grow { min-width: 260px; }
@media (max-width: 1100px) { .controls .key { display: none; } .controls button { padding: 9px 8px; font-size: 12px; } .voice-split { display: none; } }
@media (max-height: 690px) {
  .room-head { padding: 8px 14px; }
  .grid { padding: 4px 12px; }
  .stage { gap: 0; }
  .person { padding: 2px 4px; gap: 2px; }
  .wave { height: 8px; }
  .person.host { width: 160px; }
  .person.host .avatar { width: 72px; height: 72px; font-size: 28px; }
  .person .avatar.big, .stage.crowded .seats .avatar { width: 48px; height: 48px; font-size: 20px; }
  .controls { padding: 8px; }
}

/* ---------- telefon / dar ekran ---------- */
@media (max-width: 820px) {
  body { font-size: 15px; }
  input, select { font-size: 16px; } /* iPhone odaklanınca yakınlaştırmasın */
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .layout > .side, .layout > .main { grid-row: 1; grid-column: 1; display: none; border: 0; }
  .layout[data-tab="rooms"] > .side:not(.right) { display: flex; }
  .layout[data-tab="room"] > .main { display: flex; }
  .layout[data-tab="people"] > .side.right { display: flex; }
  .tabs { display: flex; grid-row: 2; background: var(--panel); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 6px; }
  .tabs button { flex: 1; background: transparent; padding: 8px 4px; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 12px; }
  .tabs button .ico { display: block; font-size: 19px; line-height: 1; }
  .tabs button.active { background: var(--card2); color: var(--accent); }
  .center .auth, .auth { width: min(370px, 92vw); padding: 24px; }
  .modal-back { place-items: end center; }
  .modal, .modal.wide { width: 100vw; max-width: 100vw; max-height: 92dvh; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .toast { bottom: 90px; }
  .room-head { padding: 10px 14px; }
  .room-head > .grow { min-width: 0; flex-basis: 100%; }
  .grid { padding: 6px 8px; }
  .person { width: 96px; }
  .person.host { width: 150px; }
  .person.host .avatar { width: 96px; height: 96px; font-size: 36px; }
  .controls { gap: 8px; padding: 10px 8px calc(10px + env(safe-area-inset-bottom)); }
  .controls button { flex: 1; max-width: 64px; min-height: 50px; padding: 8px 0; border-radius: 18px; display: flex; align-items: center; justify-content: center; }
  .controls .ico { display: block; font-size: 22px; line-height: 1; }
  .controls .lbl, .controls .key { display: none; }
  .voices { margin: 0 8px 8px; }
  .voices button.small { padding: 8px 10px; }
  .admin-row { flex-wrap: wrap; }
  .log-row { grid-template-columns: 1fr 1fr; }
  .log-row > span:nth-child(4) { grid-column: 1 / -1; }
  .founder-info { gap: 3px 10px; }
  .update { display: none; }
}
