/* SteamLink-Tesla v0.7.0 Temel Akış, İpucu Çubuğu, Kaydırıcı ve Yayın İçi CControllerOverlay Stilleri */
:root {
  --bg-top: #1f354e;
  --bg-mid: #142233;
  --bg-bot: #0c131c;
  --panel: rgba(22, 35, 51, 0.88);
  --panel-border: rgba(102, 192, 244, 0.25);
  --steam-blue: #1a9fff;
  --steam-cyan: #66c0f4;
  --steam-green: #59BF40;
  --steam-amber: #f5b942;
  --text: #ffffff;
  --muted: #bbc5cd;
}

* { box-sizing: border-box; user-select: none; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Noto Sans", "Motiva Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
  background: #071e44;
  overflow: hidden;
  overscroll-behavior: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Alt Kontrolcü İpucu Çubuğu */
.hintbar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(14px, 2.4vw, 28px);
  padding: 10px 20px;
  background: rgba(7, 11, 17, 0.72);
  border-top: 1px solid rgba(80, 160, 179, 0.35);
  font-size: clamp(12px, 1.4vw, 15px);
  color: var(--muted);
  flex-shrink: 0;
}
.hintbar[hidden] { display: none; }

.hint {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  color: #0b1118;
}
.badge.a { background: #74d14c; }
.badge.b { background: #e85d5d; }
.badge.x { background: #4ea8f5; }
.badge.y { background: #f2c94c; }
.badge.badge-glyph {
  background: transparent;
  padding: 0;
}
.badge-glyph-img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}
.badge.bumper {
  border-radius: 999px;
  background: rgba(143, 163, 184, 0.26);
  color: var(--text);
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

/* QSS Uyumlu Range Slider (sub-page: #dadbdb, add-page: #163f56) */
input[type="range"] {
  --slider-track-size: 0.45rem;
  --slider-thumb-size: 1.2rem;
  --slider-track-radius: 999px;
  --slider-thumb-radius: 50%;
  --slider-track-color: #163f56;
  --slider-fill-color: #dadbdb;
  --slider-thumb-color: #ffffff;
  --slider-direction: to right;
  --attr-min: 0;
  --attr-max: 100;
  --control-value: 50;
  --slider-progress: calc(
    (var(--control-value) - var(--attr-min)) /
    max(1, (var(--attr-max) - var(--attr-min))) * 100%
  );
  appearance: none;
  inline-size: 100%;
  block-size: 2.2rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  block-size: var(--slider-track-size);
  border-radius: var(--slider-track-radius);
  background: linear-gradient(
    var(--slider-direction),
    var(--slider-fill-color) var(--slider-progress),
    var(--slider-track-color) var(--slider-progress)
  );
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  inline-size: var(--slider-thumb-size);
  block-size: var(--slider-thumb-size);
  margin-block-start: calc((var(--slider-track-size) - var(--slider-thumb-size)) / 2);
  border: 2px solid #0099E6;
  border-radius: var(--slider-thumb-radius);
  background: var(--slider-thumb-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
input[type="range"]::-moz-range-track {
  block-size: var(--slider-track-size);
  border-radius: var(--slider-track-radius);
  background: var(--slider-track-color);
}
input[type="range"]::-moz-range-progress {
  block-size: var(--slider-track-size);
  border-radius: var(--slider-track-radius);
  background: var(--slider-fill-color);
}
input[type="range"]::-moz-range-thumb {
  inline-size: var(--slider-thumb-size);
  block-size: var(--slider-thumb-size);
  border: 2px solid #0099E6;
  border-radius: var(--slider-thumb-radius);
  background: var(--slider-thumb-color);
}

/* Tam Ekran Oyun Akışı Görünümü */
.stream-view {
  position: fixed;
  inset: 0;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: #000000;
  display: none;
  z-index: 30;
}
.stream-view.active { display: block; }
.stream-view video,
.stream-view canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.stream-view audio {
  display: none;
}

.audio-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(5, 9, 14, 0.72);
  z-index: 15;
  padding: 20px;
}
.audio-overlay[hidden] { display: none; }

.btn-unmute-overlay {
  min-width: 260px;
  min-height: 64px;
  padding: 18px 32px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 0;
  background: #0099E6;
  color: #ffffff;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
}
.btn-unmute-overlay:hover { background: #1AB2FF; }

.audio-overlay-sub {
  font-size: 16px;
  color: var(--text);
  text-align: center;
}

.moved-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: rgba(6, 10, 16, 0.9);
  text-align: center;
}
.moved-overlay[hidden] { display: none; }
.moved-overlay h2 { margin: 0; font-size: 32px; }
.moved-overlay p { margin: 0; font-size: 18px; color: var(--muted); max-width: 540px; }

/* Yayın İçi CControllerOverlay Üst HUD Çubuğu */
.stream-hud {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(10, 18, 30, 0.78);
  border: 1px solid rgba(80, 160, 179, 0.45);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
}
.stream-stats {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 4px 10px;
}
.btn-hud-mute,
.btn-hud-icon {
  min-width: 44px;
  min-height: 44px;
  background: rgba(7, 141, 219, 0.45);
  color: #ffffff;
  border: 0;
  border-radius: 50%;
  padding: 6px;
  cursor: pointer;
  font-size: 16px;
  display: grid;
  place-items: center;
}
.btn-hud-icon[hidden],
.btn-hud-mute[hidden],
.btn-hud-disconnect[hidden] {
  display: none;
}
.btn-hud-icon[aria-pressed="true"],
.btn-hud-mute[aria-pressed="true"] {
  background: #0099E6;
  box-shadow: 0 0 0 2px #ffffff;
}
.btn-hud-disconnect {
  min-height: 44px;
  background: #c93c37;
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.perf-hud {
  position: fixed;
  top: 12px;
  left: 14px;
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(5, auto);
  gap: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(11, 20, 34, 0.8);
  border: 1px solid rgba(80, 160, 179, 0.45);
  color: #dbeafe;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.perf-hud[hidden] { display: none; }
.perf-hud[data-mode="icons"] .perf-hud-row:nth-child(n+4) { display: none; }
.perf-hud-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.perf-hud-row span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8fa3bf;
}
.perf-hud-row strong {
  font-size: 13px;
  color: #ffffff;
}

/* CControllerOverlay Yarı Saydam Çoklu Dokunmatik Sanal Kontrolcü */
.touch-controller {
  --touch-opacity: 0.65;
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 76px 22px 22px;
  pointer-events: none;
  opacity: var(--touch-opacity);
  transition: opacity 0.15s ease;
}
.touch-controller[hidden] { display: none; }

.touch-controller button,
.touch-controller .tc-stick-base,
.touch-controller .tc-dpad {
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.tc-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tc-shoulder-group,
.tc-system-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tc-pill {
  min-width: 68px;
  height: 42px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  background: rgba(12, 22, 34, 0.72);
  color: #eef4fa;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.tc-trigger {
  min-width: 78px;
  border-color: rgba(102, 192, 244, 0.55);
}
.tc-pill.active {
  background: rgba(0, 153, 230, 0.82);
  border-color: #ffffff;
  transform: scale(0.96);
}

.tc-sys-btn {
  width: 44px;
  height: 36px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: rgba(12, 22, 34, 0.72);
  color: #eef4fa;
  font-size: 15px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.tc-sys-btn.tc-guide {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border-color: rgba(102, 192, 244, 0.7);
  background: rgba(14, 24, 38, 0.85);
}
.tc-sys-btn.active {
  background: rgba(0, 153, 230, 0.85);
  border-color: #ffffff;
}

.tc-bottom-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.tc-cluster {
  display: flex;
  align-items: flex-end;
  gap: 18px;
}

.tc-stick-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.tc-stick-base {
  position: relative;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.38);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(12, 20, 30, 0.65) 75%);
  display: grid;
  place-items: center;
}
.tc-stick-nub {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: radial-gradient(circle at 35% 30%, rgba(26, 178, 255, 0.75), rgba(20, 42, 66, 0.92));
  pointer-events: none;
  transform: translate(0px, 0px);
  transition: transform 0.06s ease-out;
}
.tc-stick-base.dragging .tc-stick-nub {
  transition: none;
  border-color: #ffffff;
}

.tc-l3r3 {
  min-width: 48px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(16, 26, 38, 0.72);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}
.tc-l3r3.active {
  background: rgba(0, 153, 230, 0.85);
  border-color: #ffffff;
}

.tc-dpad {
  display: grid;
  grid-template-columns: repeat(3, 42px);
  grid-template-rows: repeat(3, 42px);
  gap: 2px;
  padding: 6px;
  border-radius: 50%;
  background: rgba(12, 20, 30, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
}
.tc-dpad-btn {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(28, 44, 62, 0.8);
  color: #eef4fa;
  font-size: 14px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.tc-up { grid-column: 2; grid-row: 1; }
.tc-left { grid-column: 1; grid-row: 2; }
.tc-dpad-center { grid-column: 2; grid-row: 2; border-radius: 50%; background: rgba(20, 32, 46, 0.85); }
.tc-right { grid-column: 3; grid-row: 2; }
.tc-down { grid-column: 2; grid-row: 3; }
.tc-dpad-btn.active { background: rgba(0, 153, 230, 0.88); border-color: #ffffff; }

.tc-abxy {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(3, 48px);
  gap: 4px;
  align-items: center;
  justify-items: center;
}
.tc-face {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  color: #0b1118;
  font-size: 17px;
  font-weight: 900;
  display: grid;
  place-items: center;
}
.tc-face.tc-face-glyph {
  background: rgba(12, 22, 34, 0.65);
  border-color: rgba(255, 255, 255, 0.35);
}
.tc-glyph-img {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
}
.tc-y { grid-column: 2; grid-row: 1; background: rgba(242, 201, 76, 0.86); }
.tc-x { grid-column: 1; grid-row: 2; background: rgba(78, 168, 245, 0.86); }
.tc-b { grid-column: 3; grid-row: 2; background: rgba(232, 93, 93, 0.86); }
.tc-a { grid-column: 2; grid-row: 3; background: rgba(116, 209, 76, 0.86); }
.tc-face.active {
  transform: scale(0.92);
  filter: brightness(1.25);
  border-color: #ffffff;
}

.gp-focus,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #66c0f4;
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .stream-hud {
    top: 8px;
    right: 8px;
    left: 8px;
    justify-content: space-between;
    flex-wrap: wrap;
    border-radius: 12px;
    font-size: 12px;
  }
  .perf-hud {
    top: 126px;
    left: 50%;
    transform: translateX(-50%);
  }
  .stream-stats { white-space: normal; }
  .touch-controller { padding: 84px 10px 12px; }
  .tc-cluster { gap: 8px; }
  .tc-stick-base { width: 96px; height: 96px; }
  .tc-stick-nub { width: 42px; height: 42px; }
  .tc-dpad {
    grid-template-columns: repeat(3, 34px);
    grid-template-rows: repeat(3, 34px);
  }
  .tc-abxy {
    grid-template-columns: repeat(3, 40px);
    grid-template-rows: repeat(3, 40px);
  }
  .tc-face { width: 40px; height: 40px; font-size: 15px; }
  .tc-pill { min-width: 54px; height: 36px; font-size: 12px; }
}
