/* =============================================
   MANKEKES TTT — LOADING SCREEN
   assets/css/style.css
   ============================================= */

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:        #cc1111;
  --red-dark:   #880a0a;
  --red-glow:   rgba(204,17,17,0.35);
  --red-dim:    rgba(204,17,17,0.12);
  --gold:       #ddbb33;
  --blue:       #5599ee;
  --bg:         #08090d;
  --bg2:        #0e1018;
  --surface:    #12151c;
  --border:     rgba(204,17,17,0.22);
  --border2:    rgba(255,255,255,0.06);
  --text:       #dde0e8;
  --text-muted: #556070;
  --text-dim:   #3a4454;
  --font-hud:   'Share Tech Mono', monospace;
  --font-main:  'Rajdhani', sans-serif;
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  overflow: hidden;
}

/* --- BACKGROUND LAYERS --- */
.scanlines {
  position: fixed; inset: 0; z-index: 200; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 2px,
    rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 4px
  );
}

.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(180,20,20,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180,20,20,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
}

.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at center,
    transparent 40%,
    rgba(0,0,0,0.55) 100%
  );
}

.blood-layer {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  width: 100%; height: 100%;
}

/* --- HUD CORNERS --- */
.corner {
  position: fixed; z-index: 300; width: 28px; height: 28px;
}
.corner-tl { top: 14px; left: 14px;  border-top:    2px solid var(--red); border-left:  2px solid var(--red); }
.corner-tr { top: 14px; right: 14px; border-top:    2px solid var(--red); border-right: 2px solid var(--red); }
.corner-bl { bottom: 14px; left: 14px;  border-bottom: 2px solid var(--red); border-left:  2px solid var(--red); }
.corner-br { bottom: 14px; right: 14px; border-bottom: 2px solid var(--red); border-right: 2px solid var(--red); }

/* --- TOP HUD BAR --- */
.hud-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 250;
  height: 38px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 54px;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  font-family: var(--font-hud);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(204,17,17,0.08);
}

.hud-top::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  animation: topbar-pulse 3s ease-in-out infinite;
}

@keyframes topbar-pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

.hud-tag {
  display: inline-block; background: var(--red);
  color: #fff; font-size: 9px; font-weight: 700;
  padding: 1px 6px; margin-right: 8px; letter-spacing: 2px;
}

.ping-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: #33aa33;
  margin-right: 6px; vertical-align: middle;
  animation: ping-pulse 2.4s ease-in-out infinite;
}

@keyframes ping-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px #33aa33; }
  50%       { opacity: 0.45; box-shadow: none; }
}

/* --- STAGE --- */
.stage {
  position: relative; z-index: 10;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh;
  padding: 60px 2rem 50px;
  gap: 0;
}

/* --- LOGO BLOCK --- */
.logo-block {
  text-align: center;
  margin-bottom: 28px;
  animation: fadeDown 0.7s var(--ease-out) both;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.logo-eyebrow {
  display: flex; align-items: center; gap: 14px;
  justify-content: center;
  font-family: var(--font-hud); font-size: 10px;
  letter-spacing: 3px; color: var(--text-muted);
  text-transform: uppercase; margin-bottom: 10px;
}

.eyebrow-line {
  display: block; width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--red-dark));
}
.logo-eyebrow .eyebrow-line:last-child {
  background: linear-gradient(90deg, var(--red-dark), transparent);
}

.logo-main {
  font-family: var(--font-main);
  font-size: clamp(64px, 10vw, 96px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 10px;
  text-transform: uppercase;
  filter: drop-shadow(0 0 32px var(--red-glow));
}

.logo-part.white { color: #f0f3f6; }
.logo-part.red   { color: var(--red); }

.logo-tagline {
  font-family: var(--font-hud);
  font-size: 13px;
  letter-spacing: 5px;
  color: #cc4444;
  margin-top: 6px;
  text-transform: uppercase;
}

.logo-medals {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  margin-top: 12px;
  font-family: var(--font-hud); font-size: 9px;
  letter-spacing: 2px; color: var(--text-dim);
  text-transform: uppercase;
}

.medal {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border2);
  padding: 3px 10px;
}
.medal-sep { color: var(--red); }

/* --- ROLES --- */
.roles-block {
  display: flex; gap: 24px;
  margin-bottom: 26px;
  animation: fadeIn 0.9s var(--ease-out) 0.1s both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.role-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border2);
  position: relative;
  transition: transform 0.25s var(--ease-out), border-color 0.25s;
  cursor: default;
  min-width: 110px;
}

.role-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
}

.role-card:hover { transform: translateY(-4px); }

.role--innocent::before { background: var(--blue); }
.role--detective::before { background: var(--gold); }
.role--traitor::before  { background: var(--red); }

.role--innocent:hover { border-color: rgba(85,153,238,0.3); }
.role--detective:hover { border-color: rgba(221,187,51,0.3); }
.role--traitor:hover  { border-color: rgba(204,17,17,0.4); }

.role-icon { width: 56px; height: 56px; }
.role-icon svg { width: 100%; height: 100%; }

.role-name {
  font-family: var(--font-main);
  font-weight: 700; font-size: 15px;
  letter-spacing: 1px; text-transform: uppercase;
}

.role--innocent .role-name { color: var(--blue); }
.role--detective .role-name { color: var(--gold); }
.role--traitor .role-name  { color: var(--red); }

.role-desc {
  font-family: var(--font-hud); font-size: 10px;
  color: var(--text-muted); letter-spacing: 1px;
  text-align: center;
}

/* --- MATCH INFO --- */
.match-info {
  display: flex; align-items: center; gap: 0;
  background: rgba(204,17,17,0.05);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  animation: fadeIn 1s var(--ease-out) 0.2s both;
}

.info-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
}

.info-pill__label {
  font-family: var(--font-hud); font-size: 9px;
  letter-spacing: 2px; color: var(--text-dim);
  text-transform: uppercase;
}

.info-pill__val {
  font-family: var(--font-hud); font-size: 13px;
  color: var(--text); letter-spacing: 1px;
}

.info-pill__total { color: var(--text-dim); }

.status-blink {
  animation: status-blink 1.2s step-end infinite;
}
@keyframes status-blink {
  0%, 100% { opacity: 1; color: #44cc44; }
  50%       { opacity: 0.3; }
}

.info-divider {
  width: 1px; height: 36px;
  background: var(--border);
}

/* --- PLAYERS STRIP --- */
.players-strip {
  display: flex; gap: 6px; flex-wrap: wrap;
  justify-content: center;
  max-width: 560px;
  margin-bottom: 24px;
  animation: fadeIn 1.1s var(--ease-out) 0.3s both;
}

.player-slot {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-hud); font-size: 10px;
  font-weight: 700; border: 1.5px solid;
  position: relative;
  transition: transform 0.2s;
}

.player-slot:hover { transform: scale(1.15); }

.player-slot.ready   { background: rgba(30,80,30,0.45);  border-color: #33aa33; color: #33aa33; }
.player-slot.loading { background: rgba(80,60,0,0.45);   border-color: #ccaa22; color: #ccaa22; }
.player-slot.empty   { background: rgba(20,20,28,0.5);   border-color: #2a3340; color: #2a3340; }

.player-slot.loading::after {
  content: '';
  position: absolute; inset: -3px; border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: #ccaa22;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- LOAD SECTION --- */
.load-section {
  width: 100%; max-width: 520px;
  animation: fadeIn 1.2s var(--ease-out) 0.4s both;
}

.load-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}

.load-label {
  font-family: var(--font-hud); font-size: 11px;
  letter-spacing: 2px; color: var(--text-muted);
  text-transform: uppercase;
}

.load-pct {
  font-family: var(--font-hud); font-size: 13px;
  color: var(--red); letter-spacing: 1px;
  animation: pct-blink 0.8s step-end infinite;
}

@keyframes pct-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.load-pct.done { color: #44cc44; animation: none; }

.progress-track {
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(204,17,17,0.15);
  position: relative; overflow: hidden;
}

.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #770808, var(--red), #ff5555);
  transition: width 0.12s linear;
  position: relative;
}

.progress-shine {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,140,140,0.25) 50%, transparent 100%);
  animation: shine 1.8s linear infinite;
}

@keyframes shine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.progress-tip {
  position: absolute; right: -4px; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff6666;
  box-shadow: 0 0 10px 2px rgba(255,80,80,0.7);
}

.progress-segments {
  position: absolute; inset: 0;
  display: flex;
  pointer-events: none;
}

.seg {
  flex: 1;
  border-right: 1px solid rgba(0,0,0,0.4);
}
.seg:last-child { border-right: none; }

.load-sublabel {
  font-family: var(--font-hud); font-size: 10px;
  color: var(--text-dim); letter-spacing: 1px;
  margin-top: 6px;
}

/* --- TIP BLOCK --- */
.tip-block {
  display: flex; align-items: flex-start; gap: 14px;
  max-width: 520px; width: 100%;
  background: rgba(8,9,14,0.7);
  border-left: 3px solid var(--red);
  padding: 12px 16px;
  margin-top: 20px;
  animation: fadeIn 1.4s var(--ease-out) 0.6s both;
}

.tip-icon {
  color: var(--red); font-size: 10px;
  margin-top: 2px; flex-shrink: 0;
}

.tip-heading {
  font-family: var(--font-hud); font-size: 9px;
  letter-spacing: 3px; color: var(--red);
  text-transform: uppercase; margin-bottom: 5px;
}

.tip-body {
  font-family: var(--font-hud); font-size: 11px;
  color: #667788; line-height: 1.7; letter-spacing: 0.5px;
}

/* --- BOTTOM HUD --- */
.hud-bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 250;
  height: 32px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 54px;
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  font-family: var(--font-hud); font-size: 10px;
  letter-spacing: 2px; color: var(--text-dim);
  border-top: 1px solid rgba(204,17,17,0.06);
}

.hud-bottom__brand {
  font-size: 11px; color: var(--red);
  letter-spacing: 4px; font-weight: 600;
}

/* --- RESPONSIVE --- */
@media (max-width: 640px) {
  .logo-main { font-size: 56px; letter-spacing: 6px; }
  .logo-eyebrow { display: none; }
  .roles-block { gap: 12px; }
  .role-card { padding: 10px 14px; min-width: 88px; }
  .role-icon { width: 44px; height: 44px; }
  .match-info { flex-direction: column; gap: 0; }
  .info-divider { width: 100%; height: 1px; }
  .hud-top, .hud-bottom { padding: 0 30px; font-size: 9px; }
  .logo-medals { display: none; }
}

/* --- DONE STATE --- */
.done-flash {
  animation: done-flash 0.5s ease both;
}

@keyframes done-flash {
  0%   { opacity: 0.4; }
  50%  { opacity: 1; }
  100% { opacity: 1; }
}

/* ══════════════════════════════════════════════════════
   PLAYER CARD — tarjeta del jugador que está cargando
   ══════════════════════════════════════════════════════ */
.player-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(204,17,17,0.06);
  border: 1px solid rgba(204,17,17,0.25);
  padding: 10px 18px;
  margin-bottom: 20px;
  opacity: 0;
  transition: opacity 0.5s ease;
  position: relative;
  animation: fadeIn 0.6s var(--ease-out) 0.3s both;
  /* Forzar visible aunque JS tarde en actualizar */
  opacity: 1;
}

.player-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--red);
}

.pc-avatar {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border: 1px solid rgba(204,17,17,0.3);
  position: relative;
  overflow: hidden;
  background: #0e1018;
}

.pc-avatar-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-hud);
  font-size: 20px;
  color: var(--text-dim);
}

.pc-avatar img {
  position: absolute;
  inset: 0;
}

.pc-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.pc-label {
  font-family: var(--font-hud);
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--red);
  text-transform: uppercase;
}

.pc-name {
  font-family: var(--font-main);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-steamid {
  font-family: var(--font-hud);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.pc-badge {
  flex-shrink: 0;
  background: var(--red);
  color: #fff;
  font-family: var(--font-hud);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 3px 8px;
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
}
