/* ============================================================
   ZAPGOAL — mobil öncelikli arayüz
   ============================================================ */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #040b16;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
  color: #e8f7ff;
}

body { height: 100dvh; }

#game {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

button, input { font-family: inherit; }
button { -webkit-tap-highlight-color: transparent; }

/* ============================================================
   SKORBOARD
   ============================================================ */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: calc(58px + env(safe-area-inset-top)) 10px 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

body.in-match .hud { opacity: 1; }

.hud-actions {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.hud-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1.5px solid rgba(150, 220, 255, 0.5);
  background: linear-gradient(180deg, rgba(22, 56, 92, 0.94), rgba(4, 16, 34, 0.96));
  color: #d9f6ff;
  font-size: 19px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 16px rgba(45, 160, 255, 0.2);
  transition: transform 0.08s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hud-btn:hover {
  border-color: rgba(105, 230, 255, 0.9);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 22px rgba(55, 195, 255, 0.4);
}

.hud-btn:active { transform: scale(0.93); }
.hud-btn .gear { display: inline-block; animation: spinSlow 9s linear infinite; }

.scoreboard {
  position: relative;
  display: flex;
  align-items: center;
  width: min(94vw, 620px);
  background: rgba(4, 15, 28, 0.8);
  border: 1px solid rgba(150, 215, 255, 0.24);
  border-bottom-color: rgba(125, 220, 31, 0.45);
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.score-side {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: transparent;
  overflow: hidden;
}

.score-side.red {
  border-left: 3px solid rgba(255, 92, 76, 0.9);
}

.score-side.blue {
  border-right: 3px solid rgba(64, 176, 255, 0.9);
}

.score-side .team-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.score-side.red .team-dot {
  background: #ff5c4c;
  box-shadow: 0 0 8px rgba(255, 59, 47, 0.55);
}

.score-side.blue .team-dot {
  background: #40b0ff;
  box-shadow: 0 0 8px rgba(43, 139, 255, 0.55);
}

.score-side .score {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.score-side.red .score { color: #ff8a80; }

.score-side.blue .score { color: #7fc8ff; }

.score-side.pop .score { animation: scorePop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }

.clock {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 74px;
  height: 46px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
  border-left: 1px solid rgba(160, 220, 255, 0.16);
  border-right: 1px solid rgba(160, 220, 255, 0.16);
}

.clock span {
  color: #d7ffb4;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.net-badge {
  position: fixed;
  z-index: 11;
  top: calc(10px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  right: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(3, 14, 30, 0.82);
  border: 1px solid rgba(90, 210, 255, 0.38);
  color: #bfe9ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.net-badge.hidden { display: none; }

.net-badge .ping-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #8aa0b5;
  box-shadow: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.net-badge .ping-label {
  font-size: 9px;
  letter-spacing: 0.9px;
  opacity: 0.7;
}

.net-badge .ping-value {
  min-width: 18px;
  text-align: right;
  color: #eaffff;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.net-badge .ping-unit {
  font-size: 9px;
  opacity: 0.6;
}

.net-badge[data-state="good"] .ping-dot {
  background: #7dffb0;
  box-shadow: 0 0 9px rgba(80, 255, 160, 0.85);
}

.net-badge[data-state="good"] .ping-value { color: #9dffc4; }

.net-badge[data-state="ok"] .ping-dot {
  background: #ffe27a;
  box-shadow: 0 0 9px rgba(255, 210, 60, 0.8);
}

.net-badge[data-state="ok"] .ping-value { color: #ffe9a0; }

.net-badge[data-state="bad"] .ping-dot {
  background: #ff7a6e;
  box-shadow: 0 0 9px rgba(255, 80, 60, 0.85);
}

.net-badge[data-state="bad"] .ping-value { color: #ffb0a8; }

/* ============================================================
   JOYSTICK / ŞUT
   ============================================================ */
.joy-rest {
  position: fixed;
  z-index: 8;
  left: calc(20px + env(safe-area-inset-left));
  bottom: calc(26px + env(safe-area-inset-bottom));
  width: 118px;
  height: 118px;
  border-radius: 50%;
  border: 2px dashed rgba(120, 220, 255, 0.22);
  background: radial-gradient(circle at 50% 50%, rgba(80, 200, 255, 0.07), rgba(255, 255, 255, 0.015) 68%, transparent 72%);
  pointer-events: none;
  opacity: 0;
  display: none;
  transition: opacity 0.2s ease;
}

body.touch-ui .joy-rest { display: block; }
body.touch-ui.playing .joy-rest { opacity: 1; }

.joy-rest span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: rgba(150, 230, 255, 0.35);
  box-shadow: 0 0 10px rgba(120, 220, 255, 0.5);
}

.joy-rest.hidden { opacity: 0; }

.joy {
  position: fixed;
  z-index: 9;
  width: 132px;
  height: 132px;
  margin-left: -66px;
  margin-top: -66px;
  border-radius: 50%;
  border: 2px solid rgba(120, 220, 255, 0.28);
  background: radial-gradient(circle at 50% 50%, rgba(80, 200, 255, 0.1), rgba(255, 255, 255, 0.02) 70%);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.25), 0 0 24px rgba(40, 160, 255, 0.18);
  opacity: 0;
  display: none;
  transform: scale(0.85);
  transition: opacity 0.12s ease, transform 0.12s ease;
  pointer-events: none;
}

body.touch-ui .joy { display: block; }
.joy.active { opacity: 1; transform: scale(1); }

.joy .knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(210, 250, 255, 0.7), rgba(70, 180, 255, 0.3) 60%, rgba(255, 255, 255, 0.08));
  border: 2px solid rgba(150, 235, 255, 0.55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), 0 0 18px rgba(60, 180, 255, 0.35);
  transform: translate(-50%, -50%);
  will-change: transform;
}

.kick {
  position: fixed;
  z-index: 9;
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(28px + env(safe-area-inset-bottom));
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid rgba(255, 245, 180, 0.75);
  background: radial-gradient(circle at 35% 28%, #fff08a, #ffab1f 45%, #e35c00 100%);
  color: #071a33;
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 1.5px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45), 0 0 26px rgba(255, 150, 20, 0.45), inset 0 -6px 14px rgba(120, 40, 0, 0.35);
  transition: transform 0.06s ease, filter 0.06s ease;
  touch-action: none;
  cursor: pointer;
  opacity: 0;
  display: none;
  pointer-events: none;
}

body.touch-ui .kick { display: block; }
body.touch-ui.playing .kick { opacity: 1; pointer-events: auto; }

.kick span { position: relative; z-index: 1; }
.kick::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  animation: spinSlow 12s linear infinite;
}

.kick.active { transform: scale(0.92); filter: brightness(1.15); }

/* ============================================================
   OVERLAY / SAHNE
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
  touch-action: pan-y;
  background:
    radial-gradient(120% 85% at 50% 0%, rgba(6, 26, 48, 0.52), rgba(2, 7, 16, 0.9)),
    linear-gradient(180deg, rgba(3, 12, 24, 0.35), rgba(2, 8, 16, 0.82));
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
}

.overlay.hidden { display: none; }

.overlay::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    conic-gradient(from 0deg at 50% 50%,
      transparent 0deg 24deg, rgba(70, 190, 255, 0.055) 30deg, transparent 40deg,
      transparent 110deg, rgba(255, 150, 40, 0.05) 118deg, transparent 130deg,
      transparent 200deg, rgba(120, 255, 90, 0.04) 208deg, transparent 220deg,
      transparent 290deg, rgba(90, 160, 255, 0.05) 298deg, transparent 310deg);
  background-size: 140% 140%;
  background-position: center;
  animation: borderFlow 14s ease-in-out infinite;
}

.overlay::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(90% 70% at 50% 40%, transparent 40%, rgba(0, 0, 0, 0.45) 100%);
}

.screen-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 980px;
  min-height: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0 30px;
}

.screen-head {
  width: min(94vw, 760px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.brand-logo {
  display: block;
  width: min(88vw, 440px);
  height: auto;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 26px rgba(60, 170, 255, 0.18));
  animation: logoFloat 6s ease-in-out infinite;
}

.brand-logo.small {
  width: auto;
  height: 78px;
  animation: logoFloatSmall 6s ease-in-out infinite;
}

.head-spacer { width: 86px; flex: 0 0 auto; }

/* ============================================================
   BUTONLAR
   ============================================================ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 15px;
  padding: 15px 22px;
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 2px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.2s ease;
  isolation: isolate;
}

.btn:active { transform: scale(0.965); }
.btn > span:not(.btn-shine) { position: relative; z-index: 2; }
.btn > .btn-shine { position: absolute; z-index: 1; }

.btn-primary {
  color: #071a33;
  background: linear-gradient(180deg, #ffe766 0%, #ffb21f 42%, #ff6a00 100%);
  border: 2px solid #ffe98a;
  box-shadow: 0 0 0 2px rgba(8, 34, 70, 0.95), 0 0 26px rgba(255, 150, 20, 0.5), inset 0 -5px 0 rgba(140, 45, 0, 0.32), inset 0 2px 0 rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 0 0 2px rgba(8, 34, 70, 0.95), 0 0 38px rgba(255, 165, 30, 0.75), inset 0 -5px 0 rgba(140, 45, 0, 0.32); }

.btn-secondary {
  color: #b9f5ff;
  background: linear-gradient(180deg, rgba(20, 86, 158, 0.9), rgba(4, 24, 60, 0.96));
  border: 2px solid rgba(64, 205, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(3, 18, 40, 0.9), 0 0 24px rgba(35, 165, 255, 0.38), inset 0 0 18px rgba(60, 190, 255, 0.14);
  text-shadow: 0 0 12px rgba(90, 220, 255, 0.65);
}

.btn-secondary:hover { filter: brightness(1.12); box-shadow: 0 0 0 2px rgba(3, 18, 40, 0.9), 0 0 34px rgba(50, 190, 255, 0.6), inset 0 0 18px rgba(60, 190, 255, 0.2); }

.btn-ghost {
  color: #bcd6e6;
  background: rgba(10, 26, 46, 0.62);
  border: 1px solid rgba(160, 210, 240, 0.25);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.25);
  font-size: 14px;
  letter-spacing: 1.5px;
}

.btn-ghost:hover { border-color: rgba(160, 220, 255, 0.5); color: #e4f7ff; }

.btn-lg { width: 100%; min-height: 58px; margin-top: 12px; font-size: 20px; }
.btn-sm { padding: 10px 15px; font-size: 12px; letter-spacing: 1.2px; border-radius: 12px; min-height: 40px; }

.btn:disabled,
.seg button:disabled,
.mini-btn:disabled {
  opacity: 0.42;
  filter: grayscale(0.45);
  cursor: default;
  box-shadow: none;
  pointer-events: none;
}

.btn-shine {
  position: absolute;
  z-index: 1;
  top: -70%;
  left: -35%;
  width: 26%;
  height: 240%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: rotate(18deg);
  animation: btnSweep 3.4s ease-in-out infinite;
  pointer-events: none;
}

.btn-secondary .btn-shine { animation-delay: 1.1s; opacity: 0.45; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(150, 210, 245, 0.45);
  background: linear-gradient(180deg, rgba(26, 52, 82, 0.9), rgba(6, 20, 40, 0.94));
  color: #d8f2ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.4px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.08s ease;
}

.icon-btn:hover { border-color: rgba(100, 225, 255, 0.85); box-shadow: 0 0 18px rgba(60, 190, 255, 0.35); }
.icon-btn:active { transform: scale(0.96); }

.settings-top {
  position: absolute;
  z-index: 3;
  top: calc(14px + env(safe-area-inset-top));
  left: calc(14px + env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(38, 74, 112, 0.92), rgba(7, 24, 48, 0.95));
}

.settings-top .gear {
  font-size: 15px;
  animation: spinSlow 10s linear infinite;
}

/* ============================================================
   BAŞLAT EKRANI
   ============================================================ */
.start-screen {
  background: radial-gradient(120% 85% at 50% 8%, rgba(7, 32, 60, 0.4), rgba(2, 7, 16, 0.86));
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

.start-inner { justify-content: center; padding-bottom: 44px; }

.start-panel {
  width: min(90vw, 430px);
  margin-top: 2px;
  display: flex;
  flex-direction: column;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: #cfe9f8;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.name-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(12, 38, 70, 0.92), rgba(3, 14, 30, 0.96));
  border: 2px solid rgba(70, 190, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(3, 16, 34, 0.9), 0 0 24px rgba(40, 150, 255, 0.25), inset 0 0 18px rgba(50, 160, 255, 0.12);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.name-field:focus-within {
  border-color: #7de7ff;
  box-shadow: 0 0 0 2px rgba(3, 16, 34, 0.9), 0 0 32px rgba(60, 200, 255, 0.55), inset 0 0 22px rgba(70, 200, 255, 0.2);
}

.name-icon { font-size: 20px; filter: drop-shadow(0 0 6px rgba(90, 210, 255, 0.6)); }

.name-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #dff8ff;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.name-field input::placeholder { color: rgba(150, 195, 220, 0.45); }

.field-glow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #63dcff, transparent);
  opacity: 0.75;
  animation: glowSlide 3s ease-in-out infinite;
  pointer-events: none;
}

.start-panel .btn-primary { margin-top: 16px; }
.start-panel .btn-secondary { margin-top: 12px; }

/* ============================================================
   PANEL
   ============================================================ */
.panel {
  position: relative;
  width: min(94vw, 760px);
  padding: 30px 20px 20px;
  border-radius: 18px;
  border: 2px solid rgba(64, 190, 255, 0.55);
  background:
    linear-gradient(180deg, rgba(8, 30, 58, 0.96), rgba(3, 12, 27, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65), 0 0 34px rgba(25, 130, 230, 0.22), inset 0 0 30px rgba(20, 80, 150, 0.16);
}

.panel::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(120deg, rgba(90, 225, 255, 0.9), transparent 25%, transparent 70%, rgba(255, 160, 40, 0.65));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.65;
  animation: borderFlow 6s ease-in-out infinite;
}

.panel-title {
  position: relative;
  z-index: 2;
  width: max-content;
  max-width: 90%;
  margin: -48px auto 16px;
  padding: 7px 34px;
  background: linear-gradient(180deg, rgba(16, 48, 84, 0.98), rgba(4, 18, 38, 0.98));
  border: 1.5px solid rgba(90, 215, 255, 0.75);
  border-radius: 4px;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
  color: #dcf8ff;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 3px;
  text-align: center;
  text-shadow: 0 0 14px rgba(70, 200, 255, 0.65);
  box-shadow: 0 0 24px rgba(40, 160, 255, 0.3);
}

.sub {
  margin: 0 0 12px;
  text-align: center;
  color: #9fc0d4;
  font-size: 13px;
  line-height: 1.4;
}

.msg {
  min-height: 16px;
  margin: 8px 0 4px;
  text-align: center;
  color: #ffcf6a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.msg.error { color: #ff8a80; }

/* ============================================================
   ODALAR
   ============================================================ */
.rooms-panel { width: min(94vw, 760px); }

.rooms-head,
.room-row {
  display: grid;
  grid-template-columns: 1.55fr 0.7fr 0.55fr 0.55fr 0.72fr;
  align-items: center;
  gap: 6px;
}

.rooms-head {
  padding: 0 12px 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #7fa8c4;
  text-align: center;
}

.rooms-head span:first-child { text-align: left; }

.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: min(46vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(90, 200, 255, 0.45) transparent;
}

.rooms-list::-webkit-scrollbar { width: 6px; }
.rooms-list::-webkit-scrollbar-thumb { background: rgba(90, 200, 255, 0.4); border-radius: 99px; }

.room-row {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(60, 175, 255, 0.42);
  background: linear-gradient(90deg, rgba(12, 44, 84, 0.72), rgba(4, 16, 36, 0.72));
  box-shadow: inset 0 0 16px rgba(20, 90, 160, 0.16);
  animation: rowIn 0.32s ease both;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

.room-row:hover {
  border-color: rgba(110, 225, 255, 0.85);
  box-shadow: 0 0 18px rgba(40, 170, 255, 0.3), inset 0 0 20px rgba(30, 110, 190, 0.22);
}

.room-row .rname {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #e8f8ff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-row .rname .lock { font-size: 11px; opacity: 0.8; }
.room-row .rname .rcode { font-size: 9px; color: #6f9bb8; letter-spacing: 1px; flex: 0 0 auto; }
.room-row .rname .rlabel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-row .rplayers,
.room-row .rping,
.room-row .rmode {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #b9d9ea;
  font-variant-numeric: tabular-nums;
}

.room-row .rmode {
  color: #8be6ff;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.room-row .rjoin {
  justify-self: end;
  border: 1.5px solid #ffd25e;
  border-radius: 8px;
  padding: 5px 13px;
  background: linear-gradient(180deg, #ffcf4a, #ff8a00);
  color: #0a1e36;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(255, 160, 30, 0.45);
  transition: filter 0.15s ease, transform 0.08s ease;
}

.room-row .rjoin:hover { filter: brightness(1.12); }
.room-row .rjoin:active { transform: scale(0.94); }
.room-row .rjoin:disabled { filter: grayscale(0.8); opacity: 0.5; cursor: default; }

.rooms-empty {
  padding: 26px 16px 24px;
  border-radius: 12px;
  border: 1.5px dashed rgba(80, 190, 255, 0.3);
  background: rgba(5, 20, 40, 0.45);
  text-align: center;
}

.rooms-empty.hidden { display: none; }

.empty-bolt {
  font-size: 34px;
  line-height: 1;
  color: #ffe45c;
  text-shadow: 0 0 18px rgba(255, 210, 40, 0.85);
  animation: boltPulse 2.2s ease-in-out infinite;
}

.rooms-empty b {
  display: block;
  margin-top: 8px;
  color: #cfeafa;
  font-size: 14px;
  letter-spacing: 2px;
}

.rooms-empty p {
  margin: 7px auto 0;
  max-width: 330px;
  color: #7fa4bb;
  font-size: 12px;
  line-height: 1.45;
}

.code-join {
  margin: 0 2px 12px;
  padding: 8px 10px 10px;
  border-radius: 12px;
  border: 1.5px solid rgba(70, 185, 255, 0.28);
  background: linear-gradient(180deg, rgba(8, 30, 58, 0.72), rgba(3, 14, 30, 0.62));
}

.code-join-label {
  display: block;
  margin: 0 0 6px 2px;
  color: #7fb2cd;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.4px;
}

.code-join-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.code-input { flex: 1; }

.code-input input {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 5px;
  font-variant-numeric: tabular-nums;
}

#joinCodeBtn {
  flex: 0 0 auto;
  min-width: 96px;
  min-height: 40px;
}

.refresh-btn {
  position: absolute;
  right: 16px;
  bottom: -22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(90, 210, 255, 0.65);
  background: radial-gradient(circle at 35% 30%, #1d5f96, #071c38);
  color: #a9ecff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(40, 160, 255, 0.4);
  transition: transform 0.2s ease;
}

.refresh-btn:hover { transform: rotate(90deg); }
.refresh-btn:active { transform: rotate(180deg) scale(0.92); }

/* ============================================================
   ODA KUR
   ============================================================ */
.create-panel { width: min(94vw, 640px); }

.form-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.form-row > label {
  color: #d9eef9;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.1px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1.5px solid rgba(70, 180, 255, 0.5);
  background: linear-gradient(180deg, rgba(9, 32, 62, 0.95), rgba(3, 14, 30, 0.95));
  box-shadow: inset 0 0 14px rgba(20, 90, 160, 0.18);
}

.input-wrap:focus-within {
  border-color: #67ddff;
  box-shadow: 0 0 18px rgba(50, 190, 255, 0.35), inset 0 0 14px rgba(30, 110, 190, 0.2);
}

.input-icon { font-size: 13px; opacity: 0.8; flex: 0 0 auto; }

.input-wrap input {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e6f9ff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.input-wrap input::placeholder { color: rgba(140, 180, 205, 0.4); }

.mini-btn {
  flex: 0 0 auto;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(110, 210, 255, 0.45);
  border-radius: 6px;
  padding: 4px 9px;
  background: rgba(16, 54, 92, 0.8);
  color: #a8e4ff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.8px;
  cursor: pointer;
}

.mini-btn.active {
  background: linear-gradient(180deg, #ffcf4a, #ff8a00);
  border-color: #ffe07a;
  color: #0a1e36;
}

.seg {
  display: flex;
  gap: 5px;
  min-width: 0;
}

.seg button {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  padding: 5px 3px;
  border-radius: 7px;
  border: 1px solid rgba(70, 175, 255, 0.38);
  background: linear-gradient(180deg, rgba(13, 42, 76, 0.9), rgba(4, 16, 34, 0.92));
  color: #9dc4db;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.seg button small { font-size: 8px; opacity: 0.8; }

.seg button:hover { border-color: rgba(110, 225, 255, 0.75); color: #d8f6ff; }

.seg button.active {
  border-color: #ffe07a;
  background: linear-gradient(180deg, #ffd75c, #ff8a00);
  color: #081b32;
  box-shadow: 0 0 14px rgba(255, 165, 30, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.seg.small button { font-size: 10px; min-height: 30px; }

.create-panel .btn-lg { margin-top: 14px; min-height: 52px; font-size: 18px; }

/* ============================================================
   ODA BEKLEME
   ============================================================ */
.wait-panel { width: min(94vw, 560px); }

.room-code-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 2px 0 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #8fb6cc;
}

.room-code-line b {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 8px;
  color: #ffe45c;
  text-shadow: 0 0 18px rgba(255, 210, 40, 0.7);
  font-variant-numeric: tabular-nums;
}

.wait-players {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.wait-player {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid rgba(70, 175, 255, 0.32);
  background: linear-gradient(90deg, rgba(10, 38, 72, 0.65), rgba(4, 16, 34, 0.65));
  animation: rowIn 0.25s ease both;
}

.wait-player.red { border-left: 3px solid #ff5a4a; }
.wait-player.blue { border-left: 3px solid #3b9dff; }

.wait-player .wp-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.wait-player.red .wp-dot { background: #ff5a4a; box-shadow: 0 0 10px #ff5a4a; }
.wait-player.blue .wp-dot { background: #3b9dff; box-shadow: 0 0 10px #3b9dff; }

.wait-player .wp-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e8f8ff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.wait-player .wp-tag {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(255, 210, 70, 0.14);
  border: 1px solid rgba(255, 210, 70, 0.4);
  color: #ffe45c;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.8px;
}

.wait-player .wp-tag.you {
  background: rgba(80, 200, 255, 0.12);
  border-color: rgba(80, 200, 255, 0.45);
  color: #8fe8ff;
}

.wait-player.empty {
  border-style: dashed;
  opacity: 0.45;
  background: rgba(4, 16, 34, 0.35);
}

.wait-player.empty .wp-name { color: #6c8ea3; font-weight: 600; }

.wait-panel .btn-lg { min-height: 52px; margin-top: 12px; font-size: 18px; }
.wait-panel .btn-ghost { width: 100%; margin-top: 8px; }

/* ============================================================
   AYARLAR
   ============================================================ */
.settings-panel { width: min(94vw, 640px); }

.setting-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(80, 170, 230, 0.14);
}

.setting-row:last-of-type { border-bottom: 0; }

.setting-row > label {
  color: #dceffb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.1px;
}

.quality-control { min-width: 0; }

.setting-hint {
  margin: 5px 1px 0;
  color: #7fa4ba;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.25px;
  line-height: 1.35;
}

.slider-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.slider-icon { font-size: 14px; opacity: 0.85; flex: 0 0 auto; }

.slider-wrap input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 14px;
  margin: 0;
  border-radius: 99px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg, #ffb21f 0 var(--p, 70%), rgba(16, 46, 80, 0.95) var(--p, 70%) 100%);
  border: 1px solid rgba(90, 180, 240, 0.35);
  outline: 0;
  cursor: pointer;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.4);
}

.slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7c2, #ffb21f 60%, #e06a00);
  border: 1.5px solid #ffe98a;
  box-shadow: 0 0 12px rgba(255, 170, 30, 0.7);
  cursor: pointer;
}

.slider-wrap input[type="range"]::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7c2, #ffb21f 60%, #e06a00);
  border: 1.5px solid #ffe98a;
  box-shadow: 0 0 12px rgba(255, 170, 30, 0.7);
  cursor: pointer;
}

.slider-wrap output {
  flex: 0 0 42px;
  text-align: right;
  color: #ffe08a;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(255, 180, 40, 0.45);
}

.toggle {
  justify-self: start;
  min-width: 86px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(120, 255, 170, 0.45);
  background: rgba(46, 220, 120, 0.18);
  color: #8dffb4;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle.off {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #8fa99a;
}

.settings-panel .btn-lg { margin-top: 16px; min-height: 52px; font-size: 18px; }

/* ============================================================
   ŞİFRE / MAÇ SONU
   ============================================================ */
.modal-overlay { align-items: center; }

.pass-panel {
  width: min(92vw, 380px);
  margin: auto;
  padding-top: 34px;
}

.pass-panel .input-wrap { margin-top: 6px; }
.pass-panel .btn { width: 100%; margin-top: 10px; }

.exit-panel { text-align: center; }
.exit-panel .sub { margin: 4px 2px 10px; font-size: 13px; }
.exit-panel .btn-lg { min-height: 52px; margin-top: 6px; font-size: 17px; }

.over-panel {
  width: min(92vw, 440px);
  text-align: center;
  padding-top: 38px;
}

.over-badge {
  width: 76px;
  height: 76px;
  margin: -70px auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 220, 80, 0.7);
  background: radial-gradient(circle at 40% 30%, #3a7ac0, #061a36);
  box-shadow: 0 0 30px rgba(255, 190, 40, 0.5);
  animation: badgeFloat 3.2s ease-in-out infinite;
}

.over-panel h2 {
  margin: 4px 0 6px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffe45c;
  text-shadow: 0 0 18px rgba(255, 200, 40, 0.5);
}

.over-panel .sub { font-size: 15px; color: #c3e3f4; }
.over-panel .btn-lg { min-height: 52px; margin-top: 14px; font-size: 18px; }
.over-panel .btn-secondary { margin-top: 9px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  max-width: min(90vw, 440px);
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid rgba(90, 210, 255, 0.55);
  background: rgba(4, 20, 40, 0.96);
  color: #d9f6ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 22px rgba(40, 160, 255, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255, 110, 90, 0.65); color: #ffd3cc; }

/* ============================================================
   ANİMASYONLAR
   ============================================================ */
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes logoFloat { 0%, 100% { transform: translateY(0) rotate(-0.4deg); } 50% { transform: translateY(-9px) rotate(0.4deg); } }
@keyframes logoFloatSmall { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes scorePop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes btnSweep { 0% { left: -45%; opacity: 0; } 18% { opacity: 1; } 55% { opacity: 1; } 100% { left: 130%; opacity: 0; } }
@keyframes glowSlide { 0%, 100% { opacity: 0.35; transform: scaleX(0.6); } 50% { opacity: 0.95; transform: scaleX(1); } }
@keyframes borderFlow { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.95; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes boltPulse { 0%, 100% { transform: scale(1); opacity: 0.75; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes badgeFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 520px) {
  .start-inner { padding: 10px 0 28px; }
  .brand-logo { width: auto; height: clamp(120px, 26vh, 180px); max-width: 74vw; }
  .start-panel { width: min(82vw, 340px); }
  .field-label { margin-bottom: 6px; font-size: 10px; }
  .name-field { height: 52px; padding: 0 14px; border-radius: 15px; }
  .name-field input { font-size: 18px; }
  .start-panel .btn-lg { min-height: 52px; padding: 12px 20px; font-size: 17px; }
  .start-panel .btn-primary { margin-top: 12px; }
  .start-panel .btn-secondary { margin-top: 9px; }

  .rooms-head,
  .room-row {
    grid-template-columns: minmax(0, 1.2fr) 0.5fr 0.52fr 0.48fr 0.58fr;
    gap: 4px;
  }
  .rooms-head { padding: 0 8px 7px; font-size: 9px; letter-spacing: 0.5px; }
  .room-row { padding: 8px; }
  .room-row .rname { font-size: 11px; gap: 4px; }
  .room-row .rname .rcode { display: none; }
  .room-row .rplayers,
  .room-row .rping,
  .room-row .rmode { font-size: 10px; }
  .room-row .rjoin { padding: 5px 7px; font-size: 9px; letter-spacing: 0.5px; }
  .hud-actions { top: calc(6px + env(safe-area-inset-top)); right: calc(8px + env(safe-area-inset-right)); gap: 6px; }
  .hud-btn { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }
  .code-join { padding: 6px 8px 8px; margin-bottom: 10px; }
  .code-join-label { font-size: 8px; letter-spacing: 1px; }
  .code-input input { font-size: 14px; letter-spacing: 4px; }
  #joinCodeBtn { min-width: 80px; min-height: 36px; padding: 7px 10px; font-size: 10px; }
  .score-side { padding: 0 12px; height: 44px; }
  .score-side .score { font-size: 27px; }
  .clock { width: 68px; height: 44px; }
  .clock span { font-size: 17px; }
  .hud { padding-top: calc(52px + env(safe-area-inset-top)); }
  .net-badge { top: calc(9px + env(safe-area-inset-top)); left: calc(9px + env(safe-area-inset-left)); padding: 5px 8px; }
  .form-row { grid-template-columns: 104px minmax(0, 1fr); gap: 7px; }
  .setting-row { grid-template-columns: 112px minmax(0, 1fr); gap: 7px; }
  .seg button { font-size: 10px; }
  .seg.small button { font-size: 9px; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .overlay { padding: 10px 16px; }
  .screen-inner { padding-bottom: 8px; }
  .screen-head { margin-bottom: 8px; }
  .brand-logo { width: auto; height: 128px; animation: none; }
  .brand-logo.small { height: 58px; }
  .start-inner { padding-bottom: 6px; }
  .start-panel { width: min(70vw, 400px); }
  .field-label { margin-bottom: 5px; font-size: 10px; }
  .name-field { height: 44px; border-radius: 13px; }
  .name-field input { font-size: 17px; }
  .btn-lg { min-height: 46px; margin-top: 8px; font-size: 16px; border-radius: 12px; }
  .start-panel .btn-primary { margin-top: 10px; }
  .start-panel .btn-secondary { margin-top: 8px; }
  .settings-top { top: calc(8px + env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left)); min-height: 34px; padding: 6px 12px; font-size: 10px; }

  .panel { padding: 22px 16px 12px; }
  .panel-title { margin-top: -38px; margin-bottom: 10px; font-size: 15px; padding: 5px 26px; }
  .rooms-list { max-height: calc(100dvh - 278px); }
  .code-join { margin-bottom: 7px; padding: 5px 8px 7px; }
  .code-join-label { margin-bottom: 4px; font-size: 8px; }
  .code-input input { height: 28px; font-size: 13px; letter-spacing: 4px; }
  #joinCodeBtn { min-height: 32px; padding: 5px 9px; font-size: 9px; }
  .hud-actions { top: calc(6px + env(safe-area-inset-top)); }
  .hud-btn { width: 34px; height: 34px; font-size: 15px; }
  .room-row { padding: 6px 10px; }
  .room-row .rname { font-size: 11px; }
  .room-row .rplayers, .room-row .rping, .room-row .rmode { font-size: 10px; }
  .rooms-empty { padding: 12px 12px; }
  .empty-bolt { font-size: 24px; }
  .rooms-empty b { font-size: 12px; margin-top: 3px; }
  .rooms-empty p { font-size: 10px; margin-top: 3px; }
  .refresh-btn { width: 38px; height: 38px; bottom: -16px; font-size: 18px; }

  .form-row { grid-template-columns: 108px minmax(0, 1fr); margin-bottom: 5px; }
  .form-row > label { font-size: 9px; }
  .input-wrap { min-height: 32px; }
  .input-wrap input { height: 30px; font-size: 11px; }
  .seg button { min-height: 28px; font-size: 9px; }
  .create-panel .btn-lg { min-height: 42px; margin-top: 8px; font-size: 15px; }

  .setting-row { grid-template-columns: 122px minmax(0, 1fr); padding: 5px 2px; }
  .setting-row > label { font-size: 9px; }
  .slider-wrap input[type="range"] { height: 12px; }
  .seg.small button { min-height: 26px; }
  .toggle { padding: 6px 12px; min-width: 72px; font-size: 9px; }
  .settings-panel .btn-lg { min-height: 42px; margin-top: 8px; font-size: 15px; }

  .room-code-line { margin: 0 0 8px; }
  .room-code-line b { font-size: 26px; }
  .wait-player { padding: 6px 10px; }
  .wait-panel .btn-lg { min-height: 42px; margin-top: 8px; font-size: 15px; }
  .wait-panel .btn-ghost { margin-top: 5px; padding: 9px 16px; }

  .over-panel { padding-top: 26px; }
  .over-badge { width: 56px; height: 56px; margin-top: -54px; font-size: 26px; }
  .over-panel h2 { font-size: 22px; }
  .over-panel .btn-lg { min-height: 42px; font-size: 15px; }
  .over-panel .btn-secondary { margin-top: 6px; }
}

@media (max-height: 430px) and (orientation: landscape) {
  .brand-logo { height: 100px; }
  .brand-logo.small { height: 46px; }
  .screen-head { margin-bottom: 5px; }
  .panel { padding-top: 18px; }
  .panel-title { margin-top: -32px; font-size: 13px; padding: 4px 22px; }
  .rooms-list { max-height: calc(100dvh - 190px); }
  .create-panel .btn-lg, .settings-panel .btn-lg { min-height: 38px; }
  .start-panel .btn-lg { min-height: 40px; font-size: 14px; }
  .name-field { height: 40px; }
  .start-panel { width: min(68vw, 380px); }
}

/* Yatay telefonda skorboardı üst kenara sabitle; sahaya daha fazla yer kalsın. */
@media (max-height: 560px) and (orientation: landscape) {
  .hud {
    padding-top: calc(8px + env(safe-area-inset-top));
    padding-left: calc(10px + env(safe-area-inset-left));
    padding-right: calc(10px + env(safe-area-inset-right));
  }
  .scoreboard {
    width: min(calc(100vw - 220px - env(safe-area-inset-left) - env(safe-area-inset-right)), 620px);
    border-radius: 10px;
  }
  .score-side { height: 38px; padding: 0 14px; }
  .score-side .score { font-size: 24px; }
  .score-side .team-dot { width: 11px; height: 11px; }
  .clock { width: 60px; height: 38px; margin: 0; }
  .clock span { font-size: 15px; }
  .hud-actions {
    top: calc(6px + env(safe-area-inset-top));
    right: calc(8px + env(safe-area-inset-right));
    gap: 6px;
  }
  .hud-btn { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
  .net-badge {
    top: calc(9px + env(safe-area-inset-top));
    left: calc(9px + env(safe-area-inset-left));
    right: auto;
    gap: 4px;
    padding: 4px 7px;
    font-size: 9px;
    letter-spacing: 0.5px;
  }
  .net-badge .ping-label { font-size: 8px; }
  .net-badge .ping-value { min-width: 16px; font-size: 11px; }
  .net-badge .ping-unit { font-size: 8px; }
  .setting-hint { display: none; }

  /* Dokunmatik kontroller sahanın yanındaki boşlukta kalacak kadar küçülür. */
  .joy-rest {
    left: calc(10px + env(safe-area-inset-left));
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: 92px;
    height: 92px;
  }
  .joy {
    width: 112px;
    height: 112px;
    margin-left: -56px;
    margin-top: -56px;
  }
  .joy .knob { width: 48px; height: 48px; }
  .kick {
    right: calc(10px + env(safe-area-inset-right));
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: 80px;
    height: 80px;
    font-size: 15px;
    letter-spacing: 1.2px;
  }
}

/* Tarayıcı çubukları açıkken kalan çok kısa yatay alanlar için daha kompakt düzen. */
@media (max-height: 300px) and (orientation: landscape) {
  .hud { padding-top: calc(4px + env(safe-area-inset-top)); }
  .score-side { height: 32px; padding: 0 10px; }
  .score-side .score { font-size: 20px; }
  .score-side .team-dot { width: 9px; height: 9px; }
  .clock { width: 52px; height: 32px; }
  .clock span { font-size: 13px; }
  .hud-actions { top: calc(4px + env(safe-area-inset-top)); }
  .hud-btn { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
  .net-badge {
    top: calc(5px + env(safe-area-inset-top));
    left: calc(7px + env(safe-area-inset-left));
    gap: 3px;
    padding: 3px 6px;
    font-size: 8px;
  }
  .net-badge .ping-label { display: none; }
  .net-badge .ping-value { min-width: 14px; font-size: 10px; }
  .net-badge .ping-unit { font-size: 8px; }
  .joy-rest {
    left: calc(8px + env(safe-area-inset-left));
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: 76px;
    height: 76px;
  }
  .joy {
    width: 96px;
    height: 96px;
    margin-left: -48px;
    margin-top: -48px;
  }
  .joy .knob { width: 42px; height: 42px; }
  .kick {
    right: calc(8px + env(safe-area-inset-right));
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: 66px;
    height: 66px;
    font-size: 13px;
    letter-spacing: 1px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
