/* KusCam - mobil oncelikli, muhabbet kusu temali arayuz */

:root {
  --bg: #0d1a16;
  --bg-2: #132a22;
  --card: rgba(255, 255, 255, 0.06);
  --card-solid: #172b24;
  --line: rgba(255, 255, 255, 0.13);
  --text: #eef6f1;
  --muted: #9ab3a8;
  --lime: #a8e063;
  --leaf: #4fc27b;
  --sun: #ffd75e;
  --sky: #5bc8f5;
  --coral: #ff7a6b;
  --radius: 18px;
  --tap: 52px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* display tanimlayan siniflar hidden niteligini ezmesin */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system,
    "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 12% -12%, #1f4a37 0%, transparent 62%),
    radial-gradient(880px 520px at 92% 6%, #1a3d55 0%, transparent 58%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  overscroll-behavior-y: none;
}

/* Arka planda usulca suzulen tuyler */
.feathers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.feathers span {
  position: absolute;
  top: -8vh;
  font-size: 20px;
  opacity: 0.16;
  animation: drift linear infinite;
}
@keyframes drift {
  0% {
    transform: translateY(-10vh) rotate(0deg);
  }
  100% {
    transform: translateY(115vh) rotate(320deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .feathers {
    display: none;
  }
}

/* ---------- Giris ekrani ---------- */

.gate {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 20px;
}

.gate-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 30px 24px 26px;
  text-align: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

.mascot {
  width: 116px;
  height: 116px;
  margin: 0 auto 6px;
  display: block;
  animation: bob 3.4s ease-in-out infinite;
  transform-origin: 50% 85%;
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-7px) rotate(2deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .mascot {
    animation: none;
  }
}

h1 {
  margin: 6px 0 4px;
  font-size: 30px;
  letter-spacing: -0.5px;
}
h1 .accent {
  color: var(--sun);
}

.tagline {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

label {
  font-size: 13px;
  color: var(--muted);
  padding-left: 4px;
}

input[type="password"] {
  width: 100%;
  height: var(--tap);
  padding: 0 16px;
  font-size: 16px; /* 16px alti iOS'ta sayfayi zoomlar */
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
input[type="password"]:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 4px rgba(79, 194, 123, 0.16);
}

.btn-primary {
  width: 100%;
  height: var(--tap);
  margin-top: 16px;
  font: inherit;
  font-size: 16.5px;
  font-weight: 700;
  color: #0d2018;
  background: linear-gradient(135deg, var(--lime), var(--leaf));
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s, filter 0.18s;
}
.btn-primary:active {
  transform: scale(0.975);
}
.btn-primary:disabled {
  filter: grayscale(0.55) brightness(0.75);
  cursor: progress;
}

.error {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--coral);
}

.gate-foot {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.8;
}

/* ---------- Yayin ekrani ---------- */

.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 14px 20px;
  max-width: 900px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.3px;
}
.brand svg {
  width: 30px;
  height: 30px;
}

.spacer {
  flex: 1;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--card);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.pill.live {
  color: #0d2018;
  background: linear-gradient(135deg, var(--lime), var(--leaf));
  border-color: transparent;
}
.pill.live .dot {
  background: #0d2018;
  animation: blink 1.4s ease-in-out infinite;
}
.pill.starting .dot {
  background: var(--sun);
  animation: blink 0.9s ease-in-out infinite;
}
.pill.offline .dot {
  background: var(--coral);
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

.battery,
.temp {
  font-variant-numeric: tabular-nums;
}
.temp.warm {
  color: #2a1f05;
  background: linear-gradient(135deg, var(--sun), #ffb648);
  border-color: transparent;
}
.temp.hot {
  color: #2a0b08;
  background: linear-gradient(135deg, #ff9a6b, var(--coral));
  border-color: transparent;
}

/* Video */

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  /* Dikey videoda bile kontroller ekranda kalsin */
  max-height: 62dvh;
  background: #050b09;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #050b09;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  background: rgba(5, 11, 9, 0.82);
  backdrop-filter: blur(3px);
  transition: opacity 0.28s;
}
.overlay[hidden] {
  display: none;
}
.overlay .emoji {
  font-size: 46px;
  line-height: 1;
}
.overlay .headline {
  font-size: 17px;
  font-weight: 700;
}
.overlay .sub {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 30ch;
  line-height: 1.5;
}

/* Tunekte sallanan bekleme animasyonu */
.perch {
  width: 88px;
  height: 54px;
  position: relative;
}
.perch .bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 4px;
  border-radius: 4px;
  background: #6b4a2f;
}
.perch .bird {
  position: absolute;
  left: 50%;
  bottom: 10px;
  font-size: 26px;
  transform-origin: 50% 100%;
  animation: swing 1.6s ease-in-out infinite;
}
@keyframes swing {
  0%,
  100% {
    transform: translateX(-50%) rotate(-11deg);
  }
  50% {
    transform: translateX(-50%) rotate(11deg);
  }
}

/* Kontroller */

.controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ctrl {
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s, background 0.18s, border-color 0.18s;
  user-select: none;
}
.ctrl .ico {
  font-size: 21px;
  line-height: 1;
}
.ctrl:active {
  transform: scale(0.96);
}
.ctrl:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.ctrl.on {
  color: #0d2018;
  background: linear-gradient(135deg, var(--sun), #ffb648);
  border-color: transparent;
}

/* Ottur: satirin tamamini kaplar, basildiginda kisa sure parlar */
.ctrl.chirp {
  grid-column: 1 / -1;
  min-height: 60px;
  font-size: 13.5px;
  background: linear-gradient(135deg, rgba(255, 215, 94, 0.16), rgba(168, 224, 99, 0.16));
  border-color: rgba(255, 215, 94, 0.38);
}
.ctrl.chirp.on {
  color: #2a1f05;
  background: linear-gradient(135deg, var(--sun), var(--lime));
  border-color: transparent;
  transform: scale(1.015);
  box-shadow: 0 0 0 6px rgba(255, 215, 94, 0.16);
}

/* Bas-konus: satirin tamamini kaplar, basiliyken kirmizi */
.ctrl.talk {
  grid-column: 1 / -1;
  min-height: 76px;
  font-size: 14px;
  background: linear-gradient(135deg, rgba(91, 200, 245, 0.18), rgba(79, 194, 123, 0.18));
  border-color: rgba(91, 200, 245, 0.4);
}
.ctrl.talk.active {
  color: #2a0b08;
  background: linear-gradient(135deg, #ff9a6b, var(--coral));
  border-color: transparent;
  transform: scale(1.015);
  box-shadow: 0 0 0 6px rgba(255, 122, 107, 0.16);
}

.note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.85;
  line-height: 1.6;
}
.note a {
  color: var(--muted);
}
.note.credits {
  margin-top: -6px;
  font-size: 10.5px;
  opacity: 0.55;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(14px);
  z-index: 20;
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: #0d2018;
  background: var(--sun);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s, transform 0.24s;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Yatay telefonda video ekrani doldursun */
@media (max-height: 500px) and (orientation: landscape) {
  .app {
    padding: 8px;
    gap: 8px;
  }
  .topbar,
  .note {
    display: none;
  }
  .stage {
    aspect-ratio: auto;
    height: calc(100dvh - 108px);
  }
  .controls {
    gap: 8px;
  }
  .ctrl {
    min-height: 48px;
  }
  .ctrl.talk {
    min-height: 48px;
  }
}

@media (min-width: 620px) {
  .controls {
    grid-template-columns: repeat(4, 1fr);
  }
}
