* { box-sizing: border-box; margin: 0; padding: 0; }

#mobile-block {
  display: none;
  position: fixed; inset: 0; z-index: 99999;
  background: #060e08;
  align-items: center; justify-content: center;
}
.mobile-block-card {
  text-align: center; padding: 40px 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px; max-width: 320px;
}
.mobile-block-icon { font-size: 56px; margin-bottom: 16px; }
.mobile-block-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 10px; color: #fff; }
.mobile-block-card p { font-size: 14px; color: #94a3b8; line-height: 1.6; }

@media (max-width: 768px), (pointer: coarse) {
  #mobile-block { display: flex; }
}

body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: #060e08;
  min-height: 100vh;
  color: #eee;
}

#screen-home {
  background: #060e08;
  overflow: hidden;
}

#screen-home::before,
#screen-home::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

#screen-home::before {
  width: 600px; height: 500px;
  background: radial-gradient(ellipse, rgba(22,163,74,0.22) 0%, transparent 70%);
  top: -100px; left: -100px;
  animation: homGlow1 14s ease-in-out infinite alternate;
}

#screen-home::after {
  width: 500px; height: 400px;
  background: radial-gradient(ellipse, rgba(16,100,45,0.2) 0%, transparent 70%);
  bottom: -80px; right: -80px;
  animation: homGlow2 11s ease-in-out infinite alternate;
}

@keyframes homGlow1 {
  0%   { transform: translate(0px, 0px); }
  33%  { transform: translate(340px, 180px); }
  66%  { transform: translate(160px, 360px); }
  100% { transform: translate(480px, 80px); }
}

@keyframes homGlow2 {
  0%   { transform: translate(0px, 0px); }
  33%  { transform: translate(-280px, -140px); }
  66%  { transform: translate(-80px, -300px); }
  100% { transform: translate(-380px, -60px); }
}

/* ===== SCREENS ===== */
.screen { display: none; }
.screen.active { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; }

/* ===== LOGO ===== */
.futeka-logo { display: flex; align-items: center; gap: 10px; line-height: 1; }
.futeka-img { max-height: 200px; max-width: 420px; object-fit: contain; }
.futeka-fallback { display: flex; align-items: center; gap: 10px; }
.futeka-ball { font-size: 42px; }
.futeka-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 58px;
  letter-spacing: 6px;
  color: #fff;
  text-shadow: 0 0 30px rgba(74,222,128,0.4), 0 2px 0 rgba(0,0,0,0.5);
  line-height: 1;
}
.futeka-name-sm { font-size: 28px; letter-spacing: 4px; }
.small-logo { max-height: 36px; }
.home-sub { font-size: 11px; color: rgba(255,255,255,0.35); letter-spacing: 2.5px; text-transform: uppercase; margin-top: -4px; }

/* ===== HOME BG CANVAS ===== */
#home-bg {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  opacity: 0.45;
  filter: blur(1.5px);
  pointer-events: none;
}
#screen-home .home-card { position: relative; z-index: 1; }

/* ===== HOME CARD ===== */
.home-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 20px; padding: 48px 44px; min-width: 340px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

#name {
  width: 100%; background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 10px;
  color: #fff; padding: 10px 16px; font-size: 15px; outline: none;
  transition: border-color 0.2s, background 0.2s; margin-top: 6px; text-align: center;
}
#name:focus { border-color: #4ade80; background: rgba(74,222,128,0.08); }
#name::placeholder { color: rgba(255,255,255,0.3); }

.home-buttons { display: flex; flex-direction: column; gap: 10px; width: 100%; }
#room-name-input {
  width: 100%; background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 10px;
  color: #fff; padding: 10px 16px; font-size: 14px; outline: none;
  transition: border-color 0.2s, background 0.2s; text-align: center;
}
#room-name-input:focus { border-color: #4ade80; background: rgba(74,222,128,0.08); }
#room-name-input::placeholder { color: rgba(255,255,255,0.25); }
.join-row { display: flex; gap: 8px; width: 100%; }
#room-code-input, #browse-code-input {
  flex: 1; background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 10px;
  color: #fff; padding: 10px 14px; font-size: 15px;
  font-family: 'Courier New', monospace; letter-spacing: 3px;
  text-transform: uppercase; outline: none; transition: border-color 0.2s;
}
#room-code-input:focus, #browse-code-input:focus { border-color: #60a5fa; background: rgba(96,165,250,0.08); }
#room-code-input::placeholder, #browse-code-input::placeholder { color: rgba(255,255,255,0.25); letter-spacing: 1px; font-family: inherit; }
.home-error { font-size: 13px; color: #f87171; text-align: center; min-height: 18px; }
.home-footer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; }
.home-footer a { font-size: 12px; color: rgba(255,255,255,0.25); text-decoration: none; transition: color 0.2s; }
.home-footer a:hover { color: rgba(255,255,255,0.6); }
.home-footer span { font-size: 12px; color: rgba(255,255,255,0.15); }

/* ===== MODAL ===== */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; }
.modal-box {
  background: #111d14;
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 20px;
  width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.22,1,0.36,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.modal-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: 3px;
  color: #4ade80;
}
.modal-close {
  background: none; border: none; color: rgba(255,255,255,0.35);
  font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.modal-close:hover { color: #fff; background: rgba(255,255,255,0.08); }
.modal-body { display: flex; flex-direction: column; gap: 20px; padding: 24px; }
.modal-field { display: flex; flex-direction: column; gap: 8px; }
.modal-label {
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 1.5px;
}
.modal-label-hint { font-weight: 400; color: rgba(255,255,255,0.2); text-transform: none; letter-spacing: 0; }
#modal-room-name, #modal-room-password {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; color: #fff; padding: 10px 14px; font-size: 15px;
  outline: none; transition: border-color 0.2s, background 0.2s; width: 100%;
}
#modal-room-name:focus, #modal-room-password:focus { border-color: #4ade80; background: rgba(74,222,128,0.08); }
#modal-room-name::placeholder, #modal-room-password::placeholder { color: rgba(255,255,255,0.25); }
.modal-footer { padding: 0 24px 24px; }
.modal-footer .btn { width: 100%; }

.modal-legal { max-width: 560px; width: 90%; }
.modal-legal-body {
  padding: 0 24px 24px; max-height: 60vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.modal-legal-body h3 { font-size: 13px; font-weight: 700; color: #fff; margin: 20px 0 6px; }
.modal-legal-body h3:first-child { margin-top: 4px; }
.modal-legal-body p { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.6; margin-bottom: 4px; }
.modal-legal-body a { color: #4ade80; text-decoration: none; }
.modal-legal-body strong { color: rgba(255,255,255,0.75); }

/* modal edit inputs reutiliza #modal-room-name */
#modal-edit-name, #modal-edit-password, #modal-password-input {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; color: #fff; padding: 10px 14px; font-size: 15px;
  outline: none; transition: border-color 0.2s, background 0.2s; width: 100%;
}
#modal-edit-name:focus, #modal-edit-password:focus, #modal-password-input:focus {
  border-color: #4ade80; background: rgba(74,222,128,0.08);
}
#modal-edit-name::placeholder, #modal-edit-password::placeholder, #modal-password-input::placeholder {
  color: rgba(255,255,255,0.25);
}

/* lobby room info */
.lobby-room-info {
  display: flex; flex-direction: column; gap: 2px;
}
.lobby-room-name-wrap { display: flex; align-items: center; gap: 6px; }
.lobby-room-name {
  font-size: 15px; font-weight: 700; color: #fff;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lobby-room-name.unnamed { color: rgba(255,255,255,0.25); font-style: italic; font-weight: 400; }
.btn-icon-edit {
  background: none; border: none; cursor: pointer; font-size: 13px;
  opacity: 0.5; padding: 2px 4px; border-radius: 4px; transition: opacity 0.2s;
  line-height: 1;
}
.btn-icon-edit:hover { opacity: 1; }
.lobby-room-badges { display: flex; gap: 6px; }
.lobby-badge-lock {
  font-size: 10px; font-weight: 700; color: #fbbf24;
  background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.25);
  border-radius: 6px; padding: 1px 7px; letter-spacing: 0.5px;
}

/* ===== BROWSE ROOMS ===== */
.btn-browse {
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 10px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-browse:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25); }

.btn-quickmatch {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff; border: none; border-radius: 10px;
  padding: 10px 18px; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  box-shadow: 0 4px 18px rgba(22,163,74,0.35);
}
.btn-quickmatch:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-quickmatch:active { transform: translateY(1px); }

/* ── Tela de fila ──────────────────────────────────────── */
#screen-queue.active {
  display: flex; align-items: center; justify-content: center;
  background: #060e08; position: relative; overflow: hidden;
}
.queue-bg-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(22,163,74,0.12) 0%, transparent 70%);
  animation: queueGlowPulse 2.4s ease-in-out infinite;
}
@keyframes queueGlowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.08); }
}
.queue-card {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 32px;
  padding: 52px 72px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  backdrop-filter: blur(8px);
}
.queue-vs-row {
  display: flex; align-items: center; gap: 40px;
}
.queue-player-slot {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.queue-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900; color: #fff;
}
.queue-avatar-a {
  background: radial-gradient(circle at 35% 35%, #f87171, #e63946);
  box-shadow: 0 0 24px rgba(230,57,70,0.5), 0 0 0 3px rgba(230,57,70,0.2);
}
.queue-avatar-b {
  background: rgba(255,255,255,0.06);
  border: 2px dashed rgba(255,255,255,0.2);
  box-shadow: none;
}
.queue-avatar-b.queue-avatar-found {
  background: radial-gradient(circle at 35% 35%, #60a5fa, #1d6fa5);
  box-shadow: 0 0 24px rgba(29,111,165,0.5), 0 0 0 3px rgba(29,111,165,0.2);
  border: none;
  animation: avatarPop 0.4s cubic-bezier(0.22,1,0.36,1);
}
@keyframes avatarPop {
  0%   { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
.queue-dots {
  display: flex; gap: 5px; align-items: center;
}
.queue-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.35);
  animation: dotBlink 1.2s ease-in-out infinite;
}
.queue-dots span:nth-child(2) { animation-delay: 0.2s; }
.queue-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBlink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40%           { opacity: 1;   transform: scale(1.1); }
}
.queue-player-name {
  font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.8);
  max-width: 90px; text-align: center; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.queue-opp-name { color: rgba(255,255,255,0.35); font-style: italic; }
.queue-vs-center {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.queue-ball-pulse {
  font-size: 32px;
  animation: ballBounce 1s ease-in-out infinite;
}
@keyframes ballBounce {
  0%, 100% { transform: translateY(0);   }
  50%       { transform: translateY(-8px); }
}
.queue-vs-text {
  font-family: 'Bebas Neue', sans-serif; font-size: 28px;
  color: rgba(255,255,255,0.25); letter-spacing: 4px;
}
.queue-status-row {
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%;
}
.queue-pulse-bar {
  width: 220px; height: 4px; background: rgba(255,255,255,0.08);
  border-radius: 99px; overflow: hidden;
}
.queue-pulse-fill {
  height: 100%; width: 40%; border-radius: 99px;
  background: linear-gradient(90deg, #16a34a, #4ade80);
  animation: queueScan 1.6s ease-in-out infinite;
}
@keyframes queueScan {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(600%); }
}
.queue-time-label {
  font-size: 13px; color: rgba(255,255,255,0.35); margin: 0; letter-spacing: 1px;
}

.browse-card {
  display: flex; flex-direction: column;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 20px; padding: 0;
  width: 100%; max-width: 560px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  overflow: hidden;
}
.browse-header {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 24px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.browse-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: 3px;
  color: rgba(255,255,255,0.8); margin-right: auto;
}
.browse-list {
  display: flex; flex-direction: column; gap: 0;
  max-height: 420px; overflow-y: auto; padding: 12px 16px;
}
.browse-list::-webkit-scrollbar { width: 4px; }
.browse-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.browse-empty { color: rgba(255,255,255,0.3); font-size: 14px; text-align: center; padding: 32px 0; }
.browse-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.browse-row:last-child { border-bottom: none; }
.browse-row:hover { background: rgba(255,255,255,0.05); }
.browse-code {
  font-family: 'Bebas Neue', monospace; font-size: 20px; letter-spacing: 4px;
  color: #4ade80; min-width: 80px;
}
.browse-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.browse-mode { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.8); }
.browse-room-name { color: #fff; font-weight: 800; }
.browse-lock { font-size: 11px; color: #fbbf24; margin-left: 4px; }
.browse-detail { font-size: 11px; color: rgba(255,255,255,0.35); letter-spacing: 0.5px; }
.browse-players {
  font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,0.5); min-width: 48px; text-align: center;
}
.browse-players.full { color: #f87171; }
.browse-join-btn {
  background: rgba(74,222,128,0.12); color: #4ade80;
  border: 1px solid rgba(74,222,128,0.25); border-radius: 8px;
  padding: 7px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.browse-join-btn:hover { background: rgba(74,222,128,0.22); transform: scale(1.04); }
.browse-join-btn:disabled { opacity: 0.25; cursor: default; pointer-events: none; }
.browse-join-spec { border-color: rgba(148,163,184,0.4) !important; color: #94a3b8 !important; background: rgba(148,163,184,0.08) !important; }
.browse-join-spec:hover { background: rgba(148,163,184,0.15) !important; }
.browse-search-wrap {
  padding: 12px 16px 0;
}
.browse-search-wrap input {
  width: 100%; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 10px;
  color: #fff; padding: 9px 14px; font-size: 14px; outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.browse-search-wrap input:focus { border-color: #4ade80; background: rgba(74,222,128,0.06); }
.browse-search-wrap input::placeholder { color: rgba(255,255,255,0.25); }
.browse-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; flex-direction: column; gap: 6px;
}

/* ===== LOBBY ===== */
#screen-waiting {
  justify-content: flex-start; padding: 0;
  background:
    radial-gradient(ellipse 50% 60% at 0% 50%, rgba(200,40,40,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 100% 50%, rgba(20,90,200,0.12) 0%, transparent 60%),
    #07090f;
}

.lobby-layout {
  display: flex; flex-direction: column;
  width: 100%; max-width: 900px;
  min-height: 100vh; padding: 0 0 28px;
}

/* header */
.lobby-header {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px;
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(12px);
}
.lobby-logo { flex-shrink: 0; }
.lobby-code-wrap { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.lobby-code-label { font-size: 10px; color: rgba(255,255,255,0.25); letter-spacing: 2px; text-transform: uppercase; }
.lobby-code {
  font-family: 'Bebas Neue', monospace; font-size: 26px; letter-spacing: 7px;
  color: #4ade80;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 10px; padding: 5px 16px;
  box-shadow: 0 0 16px rgba(74,222,128,0.08);
}

/* teams area */
.lobby-teams {
  display: flex; flex: 1; gap: 16px;
  padding: 24px 24px 0;
}

.team-panel {
  flex: 1; display: flex; flex-direction: column; gap: 10px;
  border-radius: 18px; padding: 22px 20px;
  min-height: 260px;
  position: relative; overflow: hidden;
}
.team-panel::before {
  content: ''; position: absolute; inset: 0; border-radius: 18px;
  pointer-events: none; z-index: 0;
}
.team-panel > * { position: relative; z-index: 1; }

.team-panel-a {
  background: rgba(200,40,40,0.07);
  border: 1px solid rgba(230,57,70,0.25);
  box-shadow: inset 0 1px 0 rgba(255,100,100,0.08), 0 4px 24px rgba(200,40,40,0.08);
}
.team-panel-a::before {
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(230,57,70,0.1) 0%, transparent 70%);
}
.team-panel-b {
  background: rgba(20,80,180,0.07);
  border: 1px solid rgba(29,111,165,0.25);
  box-shadow: inset 0 1px 0 rgba(100,160,255,0.08), 0 4px 24px rgba(20,80,180,0.08);
}
.team-panel-b::before {
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(29,111,165,0.1) 0%, transparent 70%);
}
.team-panel-mid {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  align-items: center; justify-content: center;
  flex: 0.6;
}

.team-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.team-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px; letter-spacing: 3px;
  color: rgba(255,255,255,0.7);
}
.mid-title { color: rgba(255,255,255,0.25); font-size: 16px; letter-spacing: 2px; }
.team-badge {
  width: 32px; height: 32px; border-radius: 10px;
  font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.badge-a { background: rgba(230,57,70,0.2); color: #f87171; border: 1px solid rgba(230,57,70,0.4); box-shadow: 0 0 12px rgba(230,57,70,0.15); }
.badge-b { background: rgba(29,111,165,0.2); color: #60a5fa; border: 1px solid rgba(29,111,165,0.4); box-shadow: 0 0 12px rgba(29,111,165,0.15); }

.team-slots { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 7px; }
.team-slots li {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 10px 14px;
  font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.9);
  transition: background 0.15s;
}
.team-slots li .slot-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-a { background: #e63946; box-shadow: 0 0 6px rgba(230,57,70,0.6); }
.dot-b { background: #1d6fa5; box-shadow: 0 0 6px rgba(29,111,165,0.6); }
.dot-none { background: rgba(255,255,255,0.2); }
.slot-you { font-size: 10px; color: #ffd60a; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; margin-left: auto; }
.slot-bot {
  font-size: 10px; font-weight: 800; color: #22d3ee;
  background: rgba(34,211,238,0.1); border: 1px solid rgba(34,211,238,0.2);
  border-radius: 6px; padding: 2px 7px; margin-left: auto; letter-spacing: 1px;
}
.slot-empty { opacity: 0.2; font-style: italic; font-size: 13px; }
.slot-crown { font-size: 12px; margin-right: 2px; filter: drop-shadow(0 0 4px rgba(255,214,10,0.6)); }
.slot-spec { font-size: 13px; margin-left: auto; opacity: 0.6; }
.slot-owner-actions { display: flex; gap: 4px; margin-left: auto; }
.slot-action-btn {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5); border-radius: 6px; padding: 2px 7px;
  font-size: 11px; cursor: pointer; transition: all 0.15s; line-height: 1.4;
}
.slot-action-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.slot-action-kick:hover { background: rgba(230,57,70,0.25); border-color: rgba(230,57,70,0.5); color: #f87171; }

.slot-ping { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; margin-left: 6px; opacity: 0.85; }
.ping-good { color: #4ade80; }
.ping-ok   { color: #fbbf24; }
.ping-bad  { color: #f87171; }

.btn-spectate {
  margin-top: 8px; width: 100%;
  background: rgba(148,163,184,0.08); border: 1px solid rgba(148,163,184,0.2);
  color: rgba(148,163,184,0.8); border-radius: 10px;
  font-size: 12px; font-weight: 700; padding: 8px; cursor: pointer;
  transition: all 0.15s; letter-spacing: 0.5px;
}
.btn-spectate:hover { background: rgba(148,163,184,0.15); color: #cbd5e1; }

.mid-hint { font-size: 11px; color: rgba(255,255,255,0.2); text-align: center; margin-top: 8px; letter-spacing: 0.5px; }

.gnav-spec-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  color: #94a3b8; background: rgba(148,163,184,0.12);
  border: 1px solid rgba(148,163,184,0.25); border-radius: 6px;
  padding: 2px 8px; text-transform: uppercase;
}

.btn-join {
  border: none; border-radius: 12px; font-size: 13px; font-weight: 700;
  cursor: pointer; padding: 11px 16px;
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
  letter-spacing: 0.5px; margin-top: auto;
}
.btn-join:hover { transform: translateY(-2px); }
.btn-join:active { transform: translateY(1px); }
.btn-join-a {
  background: linear-gradient(135deg, rgba(230,57,70,0.25), rgba(230,57,70,0.12));
  color: #f87171; border: 1px solid rgba(230,57,70,0.35);
}
.btn-join-a:hover { background: linear-gradient(135deg, rgba(230,57,70,0.38), rgba(230,57,70,0.22)); box-shadow: 0 4px 20px rgba(230,57,70,0.25); }
.btn-join-b {
  background: linear-gradient(135deg, rgba(29,111,165,0.25), rgba(29,111,165,0.12));
  color: #60a5fa; border: 1px solid rgba(29,111,165,0.35);
}
.btn-join-b:hover { background: linear-gradient(135deg, rgba(29,111,165,0.38), rgba(29,111,165,0.22)); box-shadow: 0 4px 20px rgba(29,111,165,0.25); }
.btn-join:disabled { opacity: 0.2; cursor: default; pointer-events: none; }

/* footer */
.lobby-footer {
  padding: 20px 24px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 20px;
}
.room-config-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.config-group-inline { display: flex; align-items: center; gap: 10px; }
.config-label { font-size: 10px; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 2px; white-space: nowrap; }
.toggle-group { display: flex; gap: 5px; }
.toggle {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; color: rgba(255,255,255,0.4);
  padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.toggle:hover { background: rgba(255,255,255,0.1); color: #fff; }
.toggle.active { background: rgba(74,222,128,0.12); border-color: rgba(74,222,128,0.5); color: #4ade80; box-shadow: 0 0 10px rgba(74,222,128,0.1); }
.toggle:disabled { opacity: 0.3; cursor: default; pointer-events: none; }
.btn-start-big { margin-left: auto; padding: 12px 32px; font-size: 15px; white-space: nowrap; }
.btn-add-bot { padding: 11px 18px; white-space: nowrap; }

.config-display-row { display: flex; align-items: center; gap: 16px; }
.config-readonly { font-size: 13px; color: rgba(255,255,255,0.4); }
.waiting-owner-hint {
  font-size: 13px; color: rgba(255,255,255,0.35);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ===== BUTTONS ===== */
.btn {
  border: none; border-radius: 10px; font-size: 15px; font-weight: 600;
  cursor: pointer; padding: 11px 24px;
  transition: transform 0.1s, box-shadow 0.2s, background 0.2s; letter-spacing: 0.4px;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, #22c55e, #15803d); color: #fff; box-shadow: 0 2px 14px rgba(34,197,94,0.4); }
.btn-primary:hover { box-shadow: 0 4px 22px rgba(34,197,94,0.6); }
.btn-secondary { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.75); border: 1px solid rgba(255,255,255,0.12); white-space: nowrap; }
.btn-secondary:hover { background: rgba(255,255,255,0.13); color: #fff; }
.btn-ghost { background: transparent; color: rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.12); }
.btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* ===== GAME SCREEN ===== */
#screen-game {
  position: relative;
  background:
    radial-gradient(ellipse 55% 90% at 0% 50%,   rgba(200,40,40,0.32) 0%, transparent 65%),
    radial-gradient(ellipse 55% 90% at 100% 50%,  rgba(20,90,220,0.32) 0%, transparent 65%),
    radial-gradient(ellipse 90% 35% at 50% 0%,    rgba(255,210,60,0.08) 0%, transparent 55%),
    radial-gradient(ellipse 90% 35% at 50% 100%,  rgba(255,210,60,0.06) 0%, transparent 55%),
    #06080e;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0;
  padding: 0;
}

/* navbar */
#game-nav {
  display: flex; align-items: center;
  padding: 0 24px;
  height: 52px; flex-shrink: 0;
  background: rgba(0,0,0,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(8px);
  gap: 16px;
}
.gnav-logo { display: flex; align-items: center; }
.gnav-logo-img { height: 28px; width: auto; object-fit: contain; }
.gnav-logo-text { font-size: 22px; letter-spacing: 3px; }
.gnav-info {
  flex: 1; display: flex; align-items: center; gap: 20px;
  padding-left: 20px;
  border-left: 1px solid rgba(255,255,255,0.08);
}
.gnav-player { display: flex; align-items: center; gap: 7px; }
.gnav-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
#gnav-name { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.85); }
.gnav-room { font-size: 12px; color: rgba(255,255,255,0.3); letter-spacing: 1px; }
.gnav-room span { color: rgba(255,255,255,0.55); font-family: 'Bebas Neue', sans-serif; letter-spacing: 3px; font-size: 14px; }
.gnav-exit { margin-left: auto; flex-shrink: 0; }

#game-wrap {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 72px 0 16px;
}

/* --- stadium wrap --- */
#stadium-wrap {
  position: relative;
  display: inline-block;
  border-radius: 10px;
  overflow: visible;
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.07),
    0 0 60px rgba(0,0,0,0.95),
    -60px 0 80px rgba(200,40,40,0.2),
    60px 0 80px rgba(20,90,220,0.2);
}
#game { display: block; outline: none; border-radius: 8px; }

/* ===== GAME HUD ===== */
#game-hud {
  position: absolute;
  top: -58px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0;
  background: rgba(8,12,22,0.82);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.07);
  overflow: hidden;
  z-index: 10;
  min-width: 320px;
}

.hud-team {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 22px;
  flex: 1;
}
.hud-team-a {
  background: linear-gradient(90deg, rgba(230,57,70,0.12) 0%, transparent 100%);
  border-right: 1px solid rgba(255,255,255,0.07);
  justify-content: flex-start;
}
.hud-team-b {
  background: linear-gradient(270deg, rgba(29,111,165,0.12) 0%, transparent 100%);
  border-left: 1px solid rgba(255,255,255,0.07);
  justify-content: flex-end;
}

.hud-team-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px; letter-spacing: 2.5px;
  color: rgba(255,255,255,0.3);
}
.hud-team-a .hud-team-name { color: rgba(248,113,113,0.6); }
.hud-team-b .hud-team-name { color: rgba(96,165,250,0.6); }

.hud-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 42px; line-height: 1; letter-spacing: 1px;
}
.hud-team-a .hud-score { color: #f87171; text-shadow: 0 0 16px rgba(230,57,70,0.5); }
.hud-team-b .hud-score { color: #60a5fa; text-shadow: 0 0 16px rgba(29,111,165,0.5); }

.hud-center {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 24px;
  gap: 1px;
}
.hud-timer {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px; letter-spacing: 4px; line-height: 1;
  color: rgba(255,255,255,0.9);
  transition: color 0.3s;
}
.hud-timer.hud-timer-urgent {
  color: #f87171;
  animation: timerUrgent 1s ease-in-out infinite;
}
@keyframes timerUrgent {
  0%, 100% { text-shadow: 0 0 8px rgba(248,113,113,0.4); }
  50%       { text-shadow: 0 0 20px rgba(248,113,113,0.9); }
}
.hud-timer-label {
  font-size: 9px; letter-spacing: 3px; color: rgba(255,255,255,0.2);
  font-weight: 700; text-transform: uppercase;
}

.score-bump {
  animation: scoreBump 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes scoreBump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.55); filter: brightness(1.6); }
  65%  { transform: scale(0.9); }
  100% { transform: scale(1); filter: brightness(1); }
}


#boost-bar-wrap {
  display: flex; align-items: center; gap: 10px;
  width: 800px; padding: 8px 0 4px;
}
.boost-bar-label {
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.4);
  letter-spacing: 1.5px; flex-shrink: 0;
}
#boost-bar-track {
  flex: 1; height: 8px; background: rgba(255,255,255,0.08);
  border-radius: 99px; overflow: hidden;
}
#boost-bar-fill {
  height: 100%; width: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #4ade80, #22d3ee);
  transition: width 0.1s linear, background 0.3s;
}

#emote-bar {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 8px 0 2px;
  width: 800px;
}
.emote-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.25); text-transform: uppercase;
}
.emote-grid {
  display: flex; gap: 6px; justify-content: center; flex-wrap: nowrap;
}
.emote-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  width: 68px; height: 58px;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
  padding: 0;
  --c: 255,255,255;
}
.emote-btn:hover {
  background: rgba(var(--c), 0.14);
  border-color: rgba(var(--c), 0.35);
  box-shadow: 0 0 12px rgba(var(--c), 0.18);
  transform: translateY(-3px) scale(1.06);
}
.emote-btn:active { transform: scale(0.93); }
.emote-btn.emote-sent {
  background: rgba(var(--c), 0.2);
  border-color: rgba(var(--c), 0.5);
  box-shadow: 0 0 16px rgba(var(--c), 0.25);
  transform: scale(0.92);
}
.emote-icon { font-size: 22px; line-height: 1; }
.emote-text {
  font-size: 9px; font-weight: 700; letter-spacing: 0.3px;
  color: rgba(255,255,255,0.55); text-transform: uppercase;
  font-family: 'Inter', sans-serif; line-height: 1;
}

#controls-hint {
  font-size: 11px; color: rgba(255,255,255,0.15); letter-spacing: 0.5px;
  margin-top: 4px; text-align: center;
}

#goal-banner {
  --gc: #fbbf24;
  --gs: rgba(251,191,36,0.7);
  position: fixed; top: 42%; left: 50%;
  transform: translate(-50%, -50%) scale(0.05) rotate(-12deg);
  background: linear-gradient(135deg, var(--gc), color-mix(in srgb, var(--gc) 60%, #000));
  color: #fff; font-size: 96px; font-weight: 900;
  font-family: 'Bebas Neue', sans-serif;
  padding: 18px 64px 14px; border-radius: 24px; letter-spacing: 10px;
  box-shadow: 0 0 0 0 var(--gs), 0 8px 40px rgba(0,0,0,0.5);
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  pointer-events: none; opacity: 0; z-index: 100;
  border: 2px solid rgba(255,255,255,0.25);
}
#goal-banner.show {
  animation: goalPop 2.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes goalPop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.05) rotate(-12deg); box-shadow: 0 0 0px var(--gs), 0 0 0 rgba(0,0,0,0); }
  12%  { opacity: 1; transform: translate(-50%, -50%) scale(1.22) rotate(3deg); box-shadow: 0 0 120px var(--gs), 0 8px 40px rgba(0,0,0,0.5); }
  22%  { transform: translate(-50%, -50%) scale(0.92) rotate(-2deg); }
  32%  { transform: translate(-50%, -50%) scale(1.06) rotate(1deg); }
  42%  { transform: translate(-50%, -50%) scale(0.98) rotate(0deg); }
  50%  { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
  72%  { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; box-shadow: 0 0 80px var(--gs), 0 8px 40px rgba(0,0,0,0.5); }
  88%  { transform: translate(-50%, -50%) scale(1.05) rotate(-1deg); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(0.3) rotate(6deg) translateY(-60px); opacity: 0; box-shadow: 0 0 0px var(--gs); }
}
#controls-hint { font-size: 11px; color: rgba(255,255,255,0.2); letter-spacing: 0.5px; }

/* ===== COUNTDOWN ===== */
.countdown-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55);
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.countdown-overlay.open {
  opacity: 1;
}
.countdown-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 72px;
  color: #fff;
  letter-spacing: 8px;
  text-shadow: 0 0 40px rgba(74,222,128,0.8), 0 3px 0 rgba(0,0,0,0.6);
  animation: none;
  line-height: 1;
}
.countdown-num.pop {
  animation: countPop 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.countdown-num.vai {
  font-size: 130px;
  color: #4ade80;
  text-shadow: 0 0 80px rgba(74,222,128,0.9), 0 4px 0 rgba(0,0,0,0.5);
  animation: vaiPop 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes countPop {
  0%   { transform: scale(2.2); opacity: 0; }
  20%  { transform: scale(0.9); opacity: 1; }
  55%  { transform: scale(1.05); opacity: 1; }
  80%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.4); opacity: 0; }
}
@keyframes vaiPop {
  0%   { transform: scale(0.3); opacity: 0; }
  30%  { transform: scale(1.15); opacity: 1; }
  60%  { transform: scale(0.95); opacity: 1; }
  85%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.1); opacity: 0; }
}

/* ===== END SCREEN ===== */
#screen-end { background: #06090f; justify-content: center; align-items: center; }

#end-confetti {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
}

#end-card {
  --ec: #fbbf24;
  --eg: rgba(251,191,36,0.15);
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 28px; padding: 48px 56px 40px;
  box-shadow: 0 0 80px var(--eg), 0 24px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
  animation: endCardIn 0.7s cubic-bezier(0.22,1,0.36,1) both;
  min-width: 340px;
}
@keyframes endCardIn {
  0%   { opacity: 0; transform: scale(0.7) translateY(40px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.end-trophy {
  font-size: 72px;
  filter: drop-shadow(0 0 24px rgba(255,214,10,0.6));
  animation: trophyBounce 0.9s cubic-bezier(0.22,1,0.36,1) 0.15s both;
}
@keyframes trophyBounce {
  0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
  70%  { transform: scale(1.2) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.end-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px; letter-spacing: 5px;
  color: var(--ec);
  text-shadow: 0 0 30px var(--ec);
  animation: endLabelIn 0.5s ease 0.3s both;
}
@keyframes endLabelIn {
  0%   { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

.end-score-wrap {
  display: flex; align-items: center; gap: 16px;
  animation: endScoreIn 0.5s ease 0.45s both;
}
@keyframes endScoreIn {
  0%   { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

.end-score-col {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.end-score-name {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; opacity: 0.55;
  max-width: 130px; text-align: center; line-height: 1.2;
}
.end-score-name-a { color: #f87171; }
.end-score-name-b { color: #60a5fa; }

.end-score-team {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 80px; letter-spacing: 2px; line-height: 1;
}
.end-score-a { color: #f87171; text-shadow: 0 0 20px rgba(230,57,70,0.5); }
.end-score-b { color: #60a5fa; text-shadow: 0 0 20px rgba(29,111,165,0.5); }
.end-score-sep {
  font-family: 'Bebas Neue', sans-serif; font-size: 48px;
  color: rgba(255,255,255,0.3); letter-spacing: 0;
}

.end-sub {
  font-size: 12px; color: rgba(255,255,255,0.35);
  letter-spacing: 1px; text-transform: uppercase; min-height: 16px;
}

.end-actions {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: 100%; margin-top: 8px;
  animation: endActionsIn 0.4s ease 0.6s both;
}
@keyframes endActionsIn {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
.end-actions .btn-primary { width: 100%; }
