/* Yaygara — ortak stil. Tasarım: krem zemin, terracotta aksan, soft pastel kartlar. */
:root {
  --bg: #faf9f5;
  --panel: #ffffff;
  --ink: #1f1e1b;
  --muted: #6f6c66;
  --faint: #9b978f;
  --line: rgba(31, 30, 27, 0.09);
  --line-strong: rgba(31, 30, 27, 0.16);
  --accent: #c96442;
  --accent-deep: #b14e2e;
  --accent-soft: #f8ece6;
  --green: #2f7d46;
  --green-soft: #e4f2e8;
  --amber: #9a6b15;
  --amber-soft: #fbf0d9;
  --danger: #b91c1c;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(31, 30, 27, 0.05), 0 1px 1px rgba(31, 30, 27, 0.03);
  --shadow-md: 0 6px 24px rgba(31, 30, 27, 0.09);
  --shadow-lg: 0 16px 48px rgba(31, 30, 27, 0.14);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

.icon { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; flex: 0 0 auto; }
.icon-14 { width: 14px; height: 14px; }
.icon-22 { width: 22px; height: 22px; }

/* ---------- genel bileşenler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  border-radius: calc(var(--radius) - 2px);
  padding: 12px 18px;
  font-size: 15px; font-weight: 600;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: var(--shadow-sm);
  user-select: none;
}
.btn:hover { box-shadow: var(--shadow-md); }
.btn:active { transform: scale(0.985); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: rgba(31, 30, 27, 0.05); box-shadow: none; }
.btn-lg { padding: 16px 26px; font-size: 17px; border-radius: var(--radius); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }
.dot.on { background: var(--green); }
.dot.warn { background: #d9a528; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: #26241f; color: #f6f4ef;
  border-radius: 12px; padding: 12px 18px;
  font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 90; max-width: 88vw; text-align: center;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; color: #fff; box-shadow: var(--shadow-sm); }
.brand-name { font-size: 19px; }
.brand-tag { font-size: 12px; font-weight: 600; color: var(--faint); margin-left: 2px; }

/* ---------- landing ---------- */
.landing { max-width: 720px; margin: 0 auto; padding: 64px 22px 80px; }
.landing-hero { text-align: center; margin-bottom: 44px; }
.landing-hero .brand-mark { width: 58px; height: 58px; border-radius: 17px; margin-bottom: 20px; }
.landing-hero h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.12; letter-spacing: -0.025em; margin: 14px 0 12px; }
.landing-hero p.sub { color: var(--muted); font-size: 17px; line-height: 1.55; margin: 0 auto; max-width: 480px; }
.landing-actions { display: grid; gap: 14px; max-width: 420px; margin: 0 auto; }
.join-row { display: flex; gap: 10px; }
.join-row input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 14px 16px; font-size: 19px; font-weight: 700; letter-spacing: 0.28em;
  background: var(--panel); color: var(--ink); text-align: center;
  box-shadow: var(--shadow-sm); outline: none;
}
.join-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.join-row input::placeholder { letter-spacing: 0.28em; color: var(--faint); font-weight: 600; }
.how { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.how-step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; box-shadow: var(--shadow-sm); }
.how-num { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-deep); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.how-step h3 { font-size: 14.5px; margin: 0 0 4px; letter-spacing: -0.01em; }
.how-step p { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0; }
.landing-foot { text-align: center; color: var(--faint); font-size: 13px; margin-top: 52px; }
@media (max-width: 620px) { .how { grid-template-columns: 1fr; } }

/* ---------- sound grid (ortak) ---------- */
.sound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.sound-card {
  border: 1px solid rgba(31, 30, 27, 0.08);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  gap: 14px; min-height: 108px;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.sound-card:hover { box-shadow: var(--shadow-md); }
.sound-card:active { transform: scale(0.97); }
.sound-card .sc-name { font-size: 16.5px; font-weight: 750; letter-spacing: -0.01em; line-height: 1.15; overflow-wrap: anywhere; }
.sound-card .sc-dur { font-size: 12px; font-weight: 600; opacity: 0.72; font-family: var(--mono); }
.sound-card .sc-wave { display: flex; align-items: flex-end; gap: 2.5px; height: 16px; opacity: 0.6; }
.sound-card .sc-wave i { width: 3px; border-radius: 2px; background: currentColor; display: block; }
.sound-card.playing { outline: 2px solid currentColor; outline-offset: 2px; }

/* ---------- host ---------- */
.host-top {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250, 249, 245, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.host-top-in { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.host-code-pill {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 7px 8px 7px 16px; box-shadow: var(--shadow-sm);
}
.host-code-pill .code { font-family: var(--mono); font-size: 21px; font-weight: 700; letter-spacing: 0.16em; cursor: pointer; }
.host-code-pill button { border: none; background: var(--accent-soft); color: var(--accent-deep); border-radius: 999px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; }
.host-code-pill button:hover { background: #f2ddd3; }
.host-top .spacer { flex: 1; }
.host-main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 90px; }
.host-sec-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-size: 15px; font-weight: 750; letter-spacing: -0.01em; }
.host-sec-title .hint { font-weight: 600; color: var(--faint); font-size: 13px; }

.host-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.host-bar-in { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.vol-wrap { display: flex; align-items: center; gap: 10px; min-width: 240px; flex: 1; max-width: 420px; }
.vol-wrap input[type="range"] { flex: 1; accent-color: var(--accent); height: 26px; }
.vol-val { font-family: var(--mono); font-size: 13px; color: var(--muted); width: 42px; text-align: right; }
.host-feed { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; flex: 1 1 200px; min-width: 0; }
.host-feed strong { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.host-feed .flash { animation: feedin 0.35s ease; }
@keyframes feedin { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* hoparlör başlat overlay */
.start-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(250, 249, 245, 0.97);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.start-card { max-width: 460px; width: 100%; text-align: center; }
.start-card h2 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 8px; }
.start-card p { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0 0 22px; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; display: inline-flex; margin: 4px 0 18px; box-shadow: var(--shadow-sm); }
.qr-box img, .qr-box canvas { display: block; }
.start-code { font-family: var(--mono); font-size: 44px; font-weight: 800; letter-spacing: 0.18em; margin: 2px 0 6px; }
.start-sub { color: var(--faint); font-size: 13.5px; margin-bottom: 14px; }
.start-link { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 0 0 20px; flex-wrap: wrap; }
.start-link .link-text { font-family: var(--mono); font-size: 12.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.start-link .btn { padding: 8px 14px; font-size: 13.5px; }
.invite-btn { padding: 7px 13px; font-size: 13px; border-radius: 999px; }

/* ---------- room (controller) ---------- */
.room-wrap { max-width: 640px; margin: 0 auto; padding: 18px 16px 84px; }
.room-top { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.room-top .spacer { flex: 1; }
.room-status { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; color: var(--muted); }
.room-code { font-family: var(--mono); font-weight: 700; letter-spacing: 0.14em; font-size: 15px; }
.host-flag { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; border-radius: 999px; padding: 7px 13px; border: 1px solid var(--line); background: var(--panel); }
.host-flag.on { background: var(--green-soft); border-color: transparent; color: var(--green); }
.host-flag.off { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.room-name-row { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.room-name-row label { font-size: 13px; color: var(--faint); font-weight: 650; white-space: nowrap; }
.room-name-row input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font-size: 14px; background: var(--panel); color: var(--ink); outline: none;
}
.room-name-row input:focus { border-color: var(--accent); }
.ctrl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.ctrl-btn {
  position: relative;
  border: none; border-radius: 16px; padding: 18px 14px;
  min-height: 96px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  font-weight: 750; font-size: 17px; letter-spacing: -0.01em;
  transition: transform 0.07s ease, box-shadow 0.15s ease, filter 0.12s ease;
  box-shadow: var(--shadow-sm); text-align: left;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ctrl-btn:active { transform: scale(0.94); filter: brightness(0.97); }
.ctrl-btn .dur { font-size: 11.5px; font-weight: 650; opacity: 0.66; font-family: var(--mono); }
.ctrl-btn.pulse { animation: ctrlpulse 0.34s ease; }
@keyframes ctrlpulse { 0% { transform: scale(0.94); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
.ctrl-btn .sc-name { padding-right: 32px; }
.ctrl-prev {
  position: absolute; top: 9px; right: 9px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.78); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(31, 30, 27, 0.14); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ctrl-prev:hover { background: #fff; }
.ctrl-prev svg { width: 13px; height: 13px; display: block; }
.ctrl-prev .ic-stop { display: none; }
.ctrl-prev.playing { background: currentColor; }
.ctrl-prev.playing svg { fill: #fff; }
.ctrl-prev.playing .ic-play { display: none; }
.ctrl-prev.playing .ic-stop { display: block; }
.room-bottom { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.room-bottom-in { max-width: 640px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.room-bottom .last { flex: 1; color: var(--muted); font-size: 13.5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dead { max-width: 440px; margin: 18vh auto 0; text-align: center; padding: 0 22px; }
.dead h1 { font-size: 24px; letter-spacing: -0.02em; margin: 14px 0 8px; }
.dead p { color: var(--muted); line-height: 1.5; }

@media (min-width: 780px) {
  .room-wrap { max-width: 780px; }
  .ctrl-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 380px) {
  .ctrl-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .ctrl-btn { min-height: 88px; font-size: 15.5px; padding: 14px 12px; }
  .start-code { font-size: 36px; }
}
