:root {
  --bg: #0c0d11;
  --panel: #14161d;
  --panel-2: #1b1e27;
  --line: #262a36;
  --text: #e8eaf0;
  --muted: #8f96a8;
  --accent: #ff7a59;
  --accent-2: #ffb46b;
  --ok: #4ade80;
  --radius: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button, input, textarea { font: inherit; color: inherit; }

button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  transition: background .15s, border-color .15s, transform .05s;
}
button:hover { background: #232734; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }

button.primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color: transparent;
  color: #251008;
  font-weight: 650;
}
button.primary:hover { filter: brightness(1.06); background: linear-gradient(180deg, var(--accent-2), var(--accent)); }

input[type="text"], input[type="url"], textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); }

/* ---------- Giris sayfasi ---------- */
.landing {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.card {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
}
.card h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; }
.card p.sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.card label { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 6px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.hint { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.5; }

/* ---------- Oda ---------- */
.room {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

header.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex-wrap: wrap;
}
.brand { font-weight: 700; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.pill {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.pill.live { color: var(--ok); border-color: #23412f; }
.bar .spacer { flex: 1; }
.bar button { padding: 7px 12px; font-size: 13px; }

main.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 0;
}
@media (max-width: 900px) {
  main.layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
}

/* Sahne */
.stage {
  position: relative;
  background: #000;
  display: grid;
  min-height: 0;
}
.stage video {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
@media (max-width: 900px) {
  .stage { aspect-ratio: 16 / 9; height: auto; }
  .stage video { aspect-ratio: 16 / 9; }
}

.gate {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  background: rgba(8, 9, 12, .82);
  backdrop-filter: blur(6px);
  padding: 20px;
  z-index: 5;
}
.gate h2 { margin: 0; font-size: 20px; }
.gate p { margin: 0; color: var(--muted); font-size: 14px; max-width: 320px; }
.gate button { justify-self: center; padding: 12px 26px; font-size: 15px; }
.gate.hidden { display: none; }

.reactions {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 4;
}
.reaction {
  position: absolute;
  bottom: 8%;
  font-size: 34px;
  animation: floatUp 2.4s ease-out forwards;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(.6); opacity: 0; }
  15%  { transform: translateY(-10px) scale(1.15); opacity: 1; }
  100% { transform: translateY(-220px) scale(1); opacity: 0; }
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  background: rgba(20, 22, 29, .94);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  z-index: 6;
  white-space: nowrap;
}
.toast.hidden { display: none; }

/* Kontroller */
.controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 14px 12px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .78));
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 3;
  font-size: 13px;
}
.controls .time { color: #dfe3ec; font-variant-numeric: tabular-nums; white-space: nowrap; }
.controls input[type="range"] { flex: 1; accent-color: var(--accent); min-width: 60px; }
.controls .sync { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.controls button { padding: 6px 11px; background: rgba(27, 30, 39, .85); }

/* Sohbet */
.chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  border-left: 1px solid var(--line);
  background: var(--panel);
  min-height: 0;
}
@media (max-width: 900px) {
  .chat { border-left: none; border-top: 1px solid var(--line); }
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.chat-head input { padding: 6px 10px; font-size: 13px; }
.chat-head .who { font-size: 12px; color: var(--muted); white-space: nowrap; }

.messages {
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}
.msg { display: grid; gap: 3px; }
.msg .meta { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: baseline; }
.msg .meta .nm { font-weight: 650; color: #c9cfdd; }
.msg.host .meta .nm { color: var(--accent-2); }
.msg .body {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px 12px 12px 12px;
  padding: 8px 11px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.msg.me .body { background: #2a1f1b; border-color: #3d2c24; }
.msg.system { text-align: center; }
.msg.system .body {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  padding: 2px;
}
.stamp {
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  border-bottom: 1px dotted #4a5164;
}
.stamp:hover { color: var(--accent); }

.emoji-row { display: flex; gap: 6px; padding: 8px 12px 0; flex-wrap: wrap; }
.emoji-row button { padding: 4px 9px; font-size: 17px; line-height: 1.2; }

.composer { display: flex; gap: 8px; padding: 10px 12px 12px; align-items: flex-end; }
.composer textarea { resize: none; height: 42px; max-height: 120px; padding: 10px 12px; }
.composer button { padding: 10px 16px; }

.typing { padding: 0 12px; height: 16px; font-size: 11px; color: var(--muted); }

.hidden { display: none !important; }
