/* Katılımcı ekranı — mobile-first, koyu tema, büyük ve uzaktan okunabilir yazılar */
:root {
  --bg: #05070c;
  --panel: #0e131d;
  --panel-2: #151c2a;
  --text: #f4f6fb;
  --muted: #9aa4b8;
  --accent: #1e90ff;
  --accent-2: #ffffff;
  --danger: #ff4d5e;
  --ok: #2ee59d;
  --warn: #ffc247;
  --stage-text: #ffffff;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 17px;
  line-height: 1.45;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.hidden { display: none !important; }

/* Tüm ekranı kaplayan ışık sahnesi */
.stage {
  position: fixed; inset: 0; z-index: 0;
  background: var(--bg);
  transition: background-color 160ms linear, filter 200ms linear;
}
.stage.dim { filter: brightness(0.55); transition: background-color 420ms ease-in-out, filter 200ms linear; }

#app { position: relative; z-index: 1; height: 100%; height: 100dvh; }

.screen {
  display: none;
  position: absolute; inset: 0;
  padding: calc(20px + var(--safe-top)) calc(20px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(20px + var(--safe-left));
}
.screen.active { display: flex; flex-direction: column; }
.screen.center { align-items: center; justify-content: center; text-align: center; gap: 14px; }
.screen.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Giriş ---------- */
.intro { width: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding-bottom: 24px; }
.logo { width: 96px; height: 96px; object-fit: contain; align-self: center; border-radius: 22px; }
.logo.small { width: 64px; height: 64px; border-radius: 16px; }
.system-name { margin: 0; text-align: center; color: var(--muted); font-size: 14px; letter-spacing: .08em; }
.event-title { margin: 0; text-align: center; font-size: clamp(30px, 8vw, 44px); line-height: 1.1; font-weight: 900; letter-spacing: -.01em; }
.lead { margin: 0; text-align: center; color: #d5dbea; font-size: 18px; }
.info-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; }
.info-list li { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border-radius: 14px; padding: 12px 14px; font-size: 15.5px; }
.info-list .ico { font-size: 20px; line-height: 1.2; }
.warning {
  background: rgba(255, 194, 71, .1); border: 1px solid rgba(255, 194, 71, .45); color: #ffe3a6;
  border-radius: 14px; padding: 12px 14px; font-size: 14.5px;
}
.small { font-size: 13.5px; color: var(--muted); margin: -6px 0 0; }
.center-text { text-align: center; }
.muted { color: var(--muted); margin: 0; }
.big-text { font-size: 24px; font-weight: 800; margin: 0; }
.big-emoji { font-size: 64px; }

/* ---------- Butonlar ---------- */
.btn {
  appearance: none; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 800; letter-spacing: .02em;
  min-height: 52px; padding: 12px 22px; color: var(--text); background: var(--panel-2);
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 30px -10px var(--accent); }
.btn-secondary { background: transparent; border: 2px solid #2c3648; color: #dfe5f2; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); font-weight: 700; min-height: 44px; padding: 8px 16px; font-size: 15px; }
.btn-ghost.on { background: rgba(255,255,255,.25); }
.btn-xl { min-height: 68px; font-size: 22px; letter-spacing: .04em; margin-top: 6px; }

.spinner { width: 54px; height: 54px; border-radius: 50%; border: 5px solid rgba(255,255,255,.12); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Canlı ekran ---------- */
.live { padding: 0; color: var(--stage-text); }
.topbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: calc(10px + var(--safe-top)) calc(14px + var(--safe-right)) 8px calc(14px + var(--safe-left));
  font-size: 14px; font-weight: 700;
}
.status { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px rgba(0,0,0,.25); }
.dot.ok { background: var(--ok); }
.dot.lost { background: var(--danger); animation: blink-slow 2s ease-in-out infinite; }
.dot.wait { background: var(--warn); }
@keyframes blink-slow { 50% { opacity: .35; } }
.chip { background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: 5px 11px; white-space: nowrap; color: #fff; }

.live-center {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 12px; padding: 8px calc(18px + var(--safe-right)) 8px calc(18px + var(--safe-left)); min-height: 0;
}
.event-name { font-size: 18px; font-weight: 800; opacity: .85; letter-spacing: .04em; text-transform: uppercase; }
.live.is-active .logo, .live.is-active .event-name { display: none; }

.headline {
  font-size: clamp(34px, 10.5vw, 76px); font-weight: 900; line-height: 1.05; letter-spacing: -.01em;
  text-wrap: balance; max-width: 16ch; color: var(--stage-text);
  text-shadow: 0 2px 18px rgba(0,0,0,.55);
}
body.on-light .headline { text-shadow: none; }
.subline { font-size: clamp(17px, 4.6vw, 24px); font-weight: 700; opacity: .9; max-width: 28ch; }

.countdown {
  font-size: clamp(130px, 46vw, 300px); font-weight: 900; line-height: .9; font-variant-numeric: tabular-nums;
  color: var(--accent-2); text-shadow: 0 0 40px var(--accent);
}
.countdown.tick { animation: pop .9s ease-out; }
@keyframes pop { 0% { transform: scale(1.25); opacity: .2; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(.94); opacity: .85; } }

/* Telefon animasyon ipuçları (yavaş, güvenli hareketler) */
.hint { height: 120px; display: flex; align-items: flex-end; justify-content: center; }
.phone { width: 52px; height: 92px; border-radius: 12px; border: 4px solid currentColor; position: relative; opacity: .95; }
.phone-light { position: absolute; top: 8px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 18px 6px rgba(255, 210, 90, .7); }
.hint[data-hint="raise"] .phone { animation: raise 2.4s ease-in-out infinite; }
.hint[data-hint="hold"] .phone { transform: translateY(-20px); }
.hint[data-hint="wave"] .phone { animation: wave 2.6s ease-in-out infinite; transform-origin: 50% 120%; }
.hint[data-hint="cheer"] .phone { animation: cheer 1.6s ease-in-out infinite; }
@keyframes raise { 0%, 100% { transform: translateY(18px); } 50% { transform: translateY(-22px); } }
@keyframes wave { 0%, 100% { transform: rotate(-16deg); } 50% { transform: rotate(16deg); } }
@keyframes cheer { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) {
  .hint .phone, .countdown.tick, .spinner { animation: none !important; }
  .stage { transition: none; }
}

/* Admin mesajı (flaştan bağımsız katman) */
.message {
  position: absolute; left: calc(14px + var(--safe-left)); right: calc(14px + var(--safe-right));
  top: calc(64px + var(--safe-top));
  border-radius: var(--radius); padding: 18px 20px; display: flex; gap: 14px; align-items: center; justify-content: center;
  font-size: clamp(24px, 7vw, 44px); font-weight: 900; line-height: 1.1; text-align: center;
  box-shadow: 0 20px 50px -10px rgba(0,0,0,.6); border: 2px solid rgba(255,255,255,.2);
  animation: msg-in .25s ease-out;
}
.message-icon:empty { display: none; }
.message-text { overflow-wrap: anywhere; }
@keyframes msg-in { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }

.notice {
  position: absolute; left: calc(14px + var(--safe-left)); right: calc(14px + var(--safe-right));
  bottom: calc(130px + var(--safe-bottom));
  background: rgba(14, 19, 29, .94); color: #fff; border: 1px solid #2c3648; border-radius: 14px;
  padding: 12px 14px; font-size: 15px; font-weight: 600; text-align: center;
}

.bottombar {
  display: flex; flex-direction: column; gap: 10px; align-items: stretch;
  padding: 10px calc(14px + var(--safe-right)) calc(14px + var(--safe-bottom)) calc(14px + var(--safe-left));
}
.bottombar .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.btn-leave { min-height: 56px; font-size: 18px; }

/* Aydınlık sahnede butonlar okunur kalsın */
body.on-light .btn-ghost { background: rgba(0,0,0,.12); border-color: rgba(0,0,0,.25); color: #000; }
body.on-light .chip { background: rgba(0,0,0,.6); }

/* Görünmez video (kamera görüntüsü gösterilmez) */
.torch-video { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: -10px; top: -10px; }

/* Yatay ekran */
@media (orientation: landscape) and (max-height: 520px) {
  .headline { font-size: clamp(28px, 7vh + 2vw, 56px); max-width: 24ch; }
  .countdown { font-size: clamp(90px, 42vh, 220px); }
  .hint { height: 80px; }
  .phone { transform: scale(.75); }
  .live-center { gap: 6px; }
  .bottombar { flex-direction: row; align-items: center; }
  .bottombar .row { flex: 1; justify-content: flex-start; }
  .btn-leave { min-height: 48px; font-size: 16px; }
  .notice { bottom: calc(80px + var(--safe-bottom)); }
  .message { top: calc(52px + var(--safe-top)); padding: 10px 16px; }
  .intro { max-width: 720px; }
}
