@font-face {
  font-family: "Airlock";
  src: url("../fonts/Airlock.otf");
}

@font-face {
  font-family: "AchtungBravo";
  src: url("../fonts/AchtungBravo.otf");
}

:root {
  --bg-color: #000000;
  --panel-bg: #000000;
  --primary: #ff4d4d;
  --primary-rgb: 255, 77, 77;
  --primary-glow: rgba(var(--primary-rgb), 0.28);
  --primary-dim: rgba(var(--primary-rgb), 0.45);
  --primary-faint: rgba(var(--primary-rgb), 0.08);
  --frame-border-color: var(--primary);
  --frame-accent-color: var(--primary);
  --frame-glow-color: var(--primary-glow);
  --icon-filter: none;
  --text-main: #ffffff;
  --text-muted: #aaaaaa;
  --border-thick: 3px;
  --border-thin: 1px;
  --bg-a: #000000;
  --bg-b: #0a0a0a;
  --text-color: #ffffff;
}

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

.hidden { display: none !important; }

/* --- CUSTOM SCROLLBAR (CYBERPUNK AESTHETIC) --- */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  box-shadow: 0 0 5px var(--primary);
}
::-webkit-scrollbar-thumb:hover {
  background: #fff;
}
body {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  /* Mezcla de grid técnico y destellos rojos de ambiente */
  background-image:
    radial-gradient(
      circle at 10% 10%,
      rgba(var(--primary-rgb), 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 90% 90%,
      rgba(var(--primary-rgb), 0.1) 0%,
      transparent 50%
    ),
    linear-gradient(rgba(255, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 0, 0.05) 1px, transparent 1px);
  background-size:
    100% 100%,
    100% 100%,
    30px 30px,
    30px 30px;
  color: var(--text-main);
  font-family: "Airlock", "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-x: hidden;
}

/* Efecto de líneas de escaneo */
body::before {
  content: " ";
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background:
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(
      90deg,
      rgba(255, 0, 0, 0.03),
      rgba(0, 255, 0, 0.01),
      rgba(0, 0, 255, 0.03)
    );
  z-index: 9999;
  background-size:
    100% 4px,
    3px 100%;
  pointer-events: none;
  opacity: 0.3;
}

/* Destello ambiental animado */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 0, 0, 0.05) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
  animation: ambient-pulse 8s infinite alternate;
}

@keyframes ambient-pulse {
  from {
    opacity: 0.4;
    transform: scale(1);
  }

  to {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

/* --- LAYOUT CONTAINER --- */
.phone-frame {
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  min-height: 100dvh;
  background: rgba(0, 0, 0, 0.9);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  display: flex;
  flex-direction: column;
  padding: 0; 
  position: relative;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  transition: max-width 0.3s ease;
}

#app-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.app-main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

@media (min-width: 1024px) {
  .phone-frame {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: row;
    background: #090c10;
  }
}

@media (max-width: 1023px) {
  .desktop-sidebar {
    display: none !important;
  }

  html, body {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 0;
  }

  .phone-frame {
    width: 100vw;
    max-width: 100vw;
    min-height: 100dvh;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
  }

  #app-viewport,
  .app-main-container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .screen,
  .view-panel,
  #dashboard-screen,
  #battles-screen,
  #torneos-screen,
  #torneo-detalle-screen,
  #torneo-cuadro-screen,
  #ranking-screen,
  #hall-screen,
  #medals-screen,
  #formato-screen,
  #calendar-screen,
  #ruleta-screen,
  #anuncios-screen,
  #profile-screen,
  #admin-screen,
  #hub-home-screen,
  #room-selector-screen {
    flex: 1;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- PERFIL MODAL --- */
.perfil-header {
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
}

.perfil-avatar-frame {
  width: 60px;
  height: 60px;
  background: rgba(var(--primary-rgb), 0.05);
  border: 1px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(15% 0, 100% 0, 100% 85%, 85% 100%, 0 100%, 0 15%);
  flex-shrink: 0;
}

.perfil-avatar-frame img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

/* --- LOGIN SCREEN --- */
#login-screen {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  animation: authFadeIn 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-title {
  font-family: "Airlock", sans-serif;
  font-size: 2.8rem; /* Scaled down for mobile */
  color: var(--primary);
  text-transform: uppercase;
  margin: 0;
  letter-spacing: 4px;
  text-align: center;
  line-height: 1;
  text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3);
  position: relative;
  animation: glitch-text 4s infinite;
}

@media (max-width: 400px) {
  .auth-title {
    font-size: 2.2rem;
  }
}

.auth-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(var(--primary-rgb), 0.1);
  padding: 30px;
  position: relative;
  overflow: hidden;
  clip-path: polygon(
    0 15px,
    15px 0,
    100% 0,
    100% calc(100% - 15px),
    calc(100% - 15px) 100%,
    0 100%
  );
}

.auth-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  opacity: 0.5;
}

.auth-input-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-input-group label {
  font-size: 0.7rem;
  color: var(--primary);
  letter-spacing: 2px;
  opacity: 0.7;
}

.login-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  border-left: 4px solid var(--primary);
  color: white;
  padding: 12px 20px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.05rem;
  width: 100%;
  outline: none;
  transition: all 0.3s ease;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

/* Custom Select Styling */
select.login-input, 
select.input-sm,
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ff4d4d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px !important;
  cursor: pointer;
}

/* Estilo para las opciones del desplegable */
select option {
  background-color: #111;
  color: white;
  padding: 12px;
  font-family: sans-serif; /* Some browsers ignore custom fonts in options */
}

/* Fix para hover y focus en selectores */
select:focus {
  background-color: rgba(var(--primary-rgb), 0.15) !important;
  box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.2);
}

.login-input:focus {
  background: rgba(var(--primary-rgb), 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.2);
}

.auth-btn {
  width: 100%;
  margin-top: 10px;
  padding: 15px;
  font-size: 1.1rem;
  letter-spacing: 2px;
}

.auth-footer {
  text-align: center;
}

.auth-toggle {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
  letter-spacing: 1px;
}

.auth-toggle:hover {
  color: var(--primary);
  text-decoration: underline;
}

.auth-error {
  color: var(--primary);
  font-size: 0.8rem;
  margin-top: 15px;
  text-align: center;
  border: 1px solid var(--primary);
  padding: 10px;
  background: rgba(255, 0, 0, 0.1);
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* --- CAPTCHA MODULE STYLES --- */
.auth-captcha-group {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-captcha-group label {
  font-size: 0.65rem;
  color: var(--primary);
  letter-spacing: 1px;
  font-family: 'Airlock', sans-serif;
  text-transform: uppercase;
}

.captcha-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 12, 18, 0.8);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  border-radius: 6px;
  padding: 6px 10px;
}

.captcha-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--primary);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.25), rgba(0,0,0,0.8));
  border: 1px dashed rgba(var(--primary-rgb), 0.5);
  padding: 4px 10px;
  letter-spacing: 4px;
  text-decoration: line-through;
  user-select: none;
  cursor: pointer;
  border-radius: 4px;
  text-shadow: 0 0 6px rgba(var(--primary-rgb), 0.6);
  flex-shrink: 0;
}

.captcha-reload-btn {
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.2s ease;
}

.captcha-reload-btn:hover {
  transform: rotate(45deg);
}

.captcha-input {
  flex: 1;
  text-transform: uppercase;
  font-family: 'Airlock', sans-serif;
  font-size: 0.85rem !important;
  padding: 6px 8px !important;
  letter-spacing: 2px;
  border: none !important;
  background: transparent !important;
}

.auth-toggle-sub {
  display: block;
  font-size: 0.72rem;
  color: #888;
  cursor: pointer;
  margin-top: 8px;
  transition: color 0.2s;
  letter-spacing: 0.5px;
}

.auth-toggle-sub:hover {
  color: var(--primary);
  text-decoration: underline;
}

@keyframes shake {
  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(4px, 0, 0);
  }
}

/* --- GLITCH ANIMATIONS --- */
@keyframes glitch-anim {
  0% {
    clip: rect(2px, 9999px, 44px, 0);
    transform: skew(0.35deg);
  }

  5% {
    clip: rect(62px, 9999px, 88px, 0);
    transform: skew(0.42deg);
  }

  10% {
    clip: rect(12px, 9999px, 56px, 0);
    transform: skew(0.18deg);
  }

  15% {
    clip: rect(92px, 9999px, 14px, 0);
    transform: skew(0.85deg);
  }

  20% {
    clip: rect(3px, 9999px, 82px, 0);
    transform: skew(0.01deg);
  }

  100% {
    clip: rect(3px, 9999px, 82px, 0);
    transform: skew(0.01deg);
  }
}

@keyframes glitch-anim2 {
  0% {
    clip: rect(65px, 9999px, 22px, 0);
    transform: skew(0.51deg);
  }

  5% {
    clip: rect(10px, 9999px, 78px, 0);
    transform: skew(0.12deg);
  }

  10% {
    clip: rect(82px, 9999px, 12px, 0);
    transform: skew(0.38deg);
  }

  15% {
    clip: rect(22px, 9999px, 64px, 0);
    transform: skew(0.67deg);
  }

  20% {
    clip: rect(43px, 9999px, 92px, 0);
    transform: skew(0.1deg);
  }

  100% {
    clip: rect(43px, 9999px, 92px, 0);
    transform: skew(0.1deg);
  }
}

@keyframes glitch-text {
  0% {
    text-shadow:
      2px 2px var(--primary-dim),
      -2px -2px rgba(255, 255, 255, 0.1);
  }

  1% {
    text-shadow:
      -2px -2px var(--primary-dim),
      2px 2px rgba(255, 255, 255, 0.1);
  }

  2% {
    text-shadow: 0 0 10px var(--primary);
  }

  100% {
    text-shadow: 0 0 10px var(--primary);
  }
}

/* --- GLOBAL BUTTONS --- */
.btn-primary {
  background: var(--primary);
  color: black;
  border: none;
  padding: 10px 30px;
  font-family: "Airlock", sans-serif;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: all 0.2s ease;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:hover {
  background: white;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

.btn-danger {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 10px 20px;
  font-family: "Airlock", sans-serif;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-danger:hover {
  background: rgba(var(--primary-rgb), 0.1);
  box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.3);
}

.btn-danger:active {
  transform: scale(0.98);
}

/* --- DASHBOARD --- */
#hub-home-screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

#dashboard-screen {
  display: none;
  /* JS toggles active class or removes hidden */
}

#dashboard-screen:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  padding: 0; /* No horizontal padding to keep top-bar aligned */
  position: relative;
}

.dashboard-bg-medal {
  position: absolute;
  top: 40px;
  left: 0;
  width: 100%;
  height: calc(100% - 40px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
}

.top-bar {
  grid-area: header;
  display: flex;
}

#login-screen:not(.hidden) + #dashboard-screen .top-bar {
  display: none !important;
}

.main-title {
  text-align: center;
  font-family: "Airlock", sans-serif;
  font-size: 1.5rem;
  /* Smaller */
  color: white;
  margin: 5px 0;
  letter-spacing: 4px;
  grid-area: title;
  position: relative;
  animation: glitch-text 7s infinite alternate;
}

.stats-card {
  grid-area: stats;
}

.control-deck {
  grid-area: controls;
}

.chart-section {
  grid-area: chart;
}

/* Responsive Handlers */
/* Responsive Handlers Moved to End of File */

/* TOP BAR */
.top-bar {
  display: flex;
  gap: 0;
  height: 40px;
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  background: rgba(0, 0, 0, 0.8);
  flex-shrink: 0;
  width: 100%;
}

.top-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid rgba(var(--primary-rgb), 0.2);
  padding: 0 8px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  color: #fff;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seg-role {
  background: var(--primary);
  color: #000;
  border-left: none;
  width: 55px;
  font-weight: bold;
  font-size: 0.55rem;
  cursor: pointer;
  transition: all 0.2s;
}

.seg-role:hover {
  background: #fff;
}

.seg-year {
  width: 60px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  color: var(--primary);
  font-weight: bold;
}

.top-segment.seg-hub {
  flex: 1;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}


.seg-name {
  width: auto;
  min-width: 75px;
  max-width: 120px;
  justify-content: center;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.03);
}

.seg-menu {
  width: 44px;
  min-width: 44px;
  font-size: 1.35rem !important;
  font-weight: bold;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-left: 1px solid rgba(var(--primary-rgb), 0.3);
  cursor: pointer;
  order: 99; /* Always at the end */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.seg-menu:hover, .seg-menu:active {
  background: rgba(var(--primary-rgb), 0.25);
  color: #ffffff;
}

.seg-hub {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(var(--primary-rgb), 0.05);
  cursor: pointer;
  padding: 0 5px;
  border-left: 1px solid rgba(var(--primary-rgb), 0.2);
  min-width: 0; /* Important for ellipsis */
  overflow: hidden;
}

#active-hub-name {
  color: #fff;
  font-weight: bold;
  letter-spacing: 0.5px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.55rem;
  line-height: 1.1;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  max-width: 100%;
}

/* Hub ID moved to side menu */

.seg-back {
  width: 55px;
  flex: 0 0 auto;
  cursor: pointer;
  font-size: 0.55rem;
  font-weight: bold;
  background: rgba(var(--primary-rgb), 0.08);
  border-left: 1px solid rgba(var(--primary-rgb), 0.3);
  letter-spacing: 0.5px;
  transition: background 0.2s;
  order: 98; /* just before menu */
}

.seg-back:hover {
  background: rgba(var(--primary-rgb), 0.22);
}


/* CHART SECTION DASHBOARD — Vertical bar chart */
.chart-section {
  margin: 0 10px;
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  background: rgba(0, 0, 0, 0.4);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: rgba(var(--primary-rgb), 0.12);
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.4);
  font-family: 'Airlock', sans-serif;
  font-size: 0.7rem;
  color: white;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.2s;
}
.chart-header:hover { background: rgba(var(--primary-rgb), 0.22); }

.chart-title { display: flex; align-items: center; gap: 6px; }
.gear-icon   { opacity: 0.6; font-size: 0.75rem; }

.chart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  /* 175px total: ~113px bar area + 32px label area + 30px val+gap on top */
  height: 175px;
  padding: 10px 8px 32px;
  box-sizing: border-box;
  position: relative;
}

.chart-empty {
  text-align: center;
  padding: 20px 0;
  font-family: 'Airlock', sans-serif;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 2px;
}

.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* bar grows from bottom */
  flex: 1;
  height: 100%;
  position: relative;
}

.chart-val {
  font-family: 'Airlock', sans-serif;
  font-size: 0.7rem;
  color: var(--primary);
  margin-bottom: 4px;
  text-shadow: 0 0 8px rgba(var(--primary-rgb), 0.5);
  line-height: 1;
}

.chart-bar {
  width: 26px;
  background: linear-gradient(180deg, var(--primary) 0%, #7a0000 100%);
  border-radius: 3px 3px 0 0;
  border: 1px solid rgba(var(--primary-rgb), 0.5);
  border-bottom: none;
  box-shadow: 0 0 14px rgba(var(--primary-rgb), 0.45);
  /* height set in px via JS — no transition needed, requestAnimationFrame handles it */
  transition: height 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

/* Label sits in the 32px padding zone at the bottom */
.chart-label {
  position: absolute;
  bottom: -26px;
  left: 0;
  right: 0;
  font-family: 'Airlock', sans-serif;
  font-size: 0.52rem;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
  letter-spacing: 0.5px;
}

/* ANIMATIONS */
@keyframes spinning-y {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

.spinning-y {
  animation: spinning-y 4s linear infinite;
}

@keyframes highlight-pulse {
  0% { box-shadow: 0 0 0px var(--primary); }
  50% { box-shadow: 0 0 20px var(--primary); }
  100% { box-shadow: 0 0 0px var(--primary); }
}

.action-btn.highlight {
  animation: highlight-pulse 2s infinite ease-in-out;
  background: var(--primary) !important;
  color: black !important;
}

/* TITLE */
.main-title {
  text-align: center;
  font-family: "Airlock", sans-serif;
  font-size: 1.5rem;
  /* Smaller */
  color: white;
  margin: 5px 0;
  letter-spacing: 4px;
}

/* STATS CARD */
.stats-card {
  border: 2px solid var(--primary);
  margin: 10px;
  background: radial-gradient(circle at center, #1a0000 0%, #000000 100%);
  position: relative;
  box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.2);
  clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
}

.stats-header {
  display: flex;
  align-items: center;
  gap: 5px;
  border-bottom: 2px solid white;
  /* Cambiado a blanco */
  padding: 8px 15px;
  margin-bottom: 5px;
}

.box-id,
.box-lvl {
  border: 1px solid white;
  /* Cambiado a blanco */
  padding: 2px 5px;
  font-size: 0.8rem;
}

.box-id {
  background: var(--primary);
  /* Fondo rojo */
  color: white;
}

.hp-bar-container {
  flex: 1;
  height: 20px;
  background: #330000;
  border: 1px solid white;
  /* Cambiado a blanco */
  position: relative;
}

.hp-bar-fill {
  background: #00ff88;
  width: 100%;
  /* Placeholder */
  height: 100%;
}

.hp-text {
  position: absolute;
  right: 2px;
  top: 0;
  font-size: 0.8rem;
  color: white; /* Changed from black to white */
  font-weight: bold;
}

.stats-body {
  display: flex;
  gap: 30px;
  padding: 15px 20px;
  justify-content: center;
  align-items: center;
}

.stats-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-around;
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 8px 12px;
  min-height: 130px;
  background: rgba(255, 255, 255, 0.02);
}

.stats-icons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 70px;
  flex-shrink: 0;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Más separación */
  margin: 2px 0;
  /* Menos espacio vertical (antes 4px) */
}

/*Move SINGLES label and graph to the right*/
.stat-row.singles {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  justify-content: flex-end;
  /* Alinea todo a la derecha */
}

.stat-label {
  width: 65px;
  /* Más ancho */
  font-size: 0.8rem;
  /* Texto más grande */
  text-align: right;
  margin-right: -7px;
  color: white;
}

.stat-bars {
  display: flex;
  gap: 3px;
}

.bar-tick {
  width: 10px;
  height: 20px;
  background-color: var(--primary);
  opacity: 0.3;
  transition: all 0.3s ease;
}

.bar-tick.active {
  opacity: 1;
  box-shadow: 0 0 8px var(--primary);
}

.stat-value {
  font-family: 'Airlock', sans-serif;
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: bold;
  margin-left: 5px;
  text-shadow: 0 0 5px var(--primary);
  min-width: 32px;
  text-align: left;
}

.stats-crown {
  width: 100%;
  flex: 1;
  border: 1px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.stats-crown:hover {
  background: rgba(255, 0, 0, 0.15);
  box-shadow: inset 0 0 10px var(--primary);
}

.stats-crown img {
  width: 40%;
  filter: drop-shadow(0 0 5px red);
}

/* CONTROL DECK */
.control-deck {
  display: flex;
  flex-direction: row;
  justify-content: space-around; /* Changed from space-between for better spacing */
  align-items: center;
  min-height: 140px; /* Increased from 120px */
  gap: 15px;
  padding: 0 15px;
}

/* Action widget centered in the remaining space */
.action-widget {
  order: 2;
  flex: 1; /* Occupy remaining space */
  height: 105px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center; /* Center horizontally in its container */
  perspective: 1000px;
}

/* Buttons on the LEFT */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 54%; /* Reduced width to around half */
  order: 1; /* Moved to the left side */
}

.action-btn.highlight {
  background: var(--primary);
  color: black;
  box-shadow: 0 0 25px var(--primary);
}

/* HUB INFO BAR */
.hub-info-bar {
  display: flex;
  background: rgba(var(--primary-rgb), 0.1);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  padding: 4px 10px;
  margin-top: 10px;
  font-size: 0.65rem;
  gap: 8px;
  align-items: center;
  font-family: 'Airlock', sans-serif;
}

.hub-label, .hub-code-label { color: var(--primary); opacity: 0.7; }
.hub-value { color: white; font-weight: bold; }


/* ACTION BUTTONS */

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 1.5s ease, color 0.5s ease, box-shadow 1.2s ease;
  border: 2px solid var(--primary);
  outline: 4px solid rgba(255, 0, 0, 0.1);
  outline-offset: 2px;
  color: var(--primary);
  background: transparent;
  padding: 8px 0;
  font-family: "Airlock", sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  width: 100%;
  text-align: center;
  position: relative;
  cursor: pointer;
  letter-spacing: 1px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.action-btn:hover {
  background: var(--primary);
  color: black;
  box-shadow: 0 0 10px var(--primary);
}

.action-btn span {
  display: block;
}

.action-widget {
  width: 80px;
  height: 80px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
  flex-shrink: 0;
}

#main-action-img,
.widget-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.5));
  will-change: transform, filter, opacity;
  transform-style: preserve-3d;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.widget-icon.active {
  opacity: 1;
}

#fragments-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform-style: preserve-3d;
}

.action-fragment {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  will-change: transform, opacity;
  transform-style: preserve-3d;
}

@keyframes spin-y {
  from {
    transform: rotateY(0deg);
  }

  to {
    transform: rotateY(360deg);
  }
}

.spinning-y {
  animation: spin-y 3s linear infinite;
}

.glitch-red {
  filter: sepia(100%) saturate(500%) hue-rotate(-50deg) !important;
  mix-blend-mode: screen;
}

.glitch-cyan {
  filter: sepia(100%) saturate(500%) hue-rotate(130deg) !important;
  mix-blend-mode: screen;
}

/* --- SIDE MENU (Redesigned) --- */
.side-menu-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 900;
}

.side-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.side-menu {
  position: absolute;
  top: 0;
  right: -290px;
  width: 270px;
  height: 100%;
  background: #030303;
  border-left: 2px solid var(--primary);
  box-shadow: -8px 0 40px rgba(var(--primary-rgb), 0.15);
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 1000;
  overflow: hidden;
}

/* Línea decorativa animada en el borde */
.side-menu::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--primary), transparent);
  animation: side-line-scan 3s ease-in-out infinite;
}

@keyframes side-line-scan {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1; }
}

.side-menu.active {
  right: 0;
}

/* ── HEADER ── */
.side-menu-header {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(var(--primary-rgb), 0.04);
}

.side-menu-logo {
  font-family: 'Airlock', sans-serif;
  font-size: 1rem;
  color: var(--primary);
  line-height: 1.15;
  letter-spacing: 3px;
  text-shadow: 0 0 12px rgba(var(--primary-rgb), 0.5);
  flex-shrink: 0;
}

.side-menu-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.side-menu-role-badge {
  display: inline-block;
  background: rgba(var(--primary-rgb), 0.15);
  border: 1px solid rgba(var(--primary-rgb), 0.4);
  color: var(--primary);
  font-size: 0.6rem;
  padding: 2px 7px;
  letter-spacing: 2px;
  font-family: 'Airlock', sans-serif;
  width: fit-content;
}

.side-menu-role-badge.admin {
  background: rgba(0, 136, 255, 0.15);
  border-color: rgba(0, 136, 255, 0.5);
  color: #4db8ff;
}

.side-menu-username {
  font-family: 'Airlock', sans-serif;
  font-size: 0.95rem;
  color: #ffffff;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── DIVIDERS & LABELS ── */
.side-menu-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(var(--primary-rgb), 0.25), transparent);
  margin: 6px 0;
}

.side-menu-section-label {
  font-size: 0.55rem;
  color: rgba(var(--primary-rgb), 0.5);
  letter-spacing: 3px;
  padding: 6px 20px 4px;
  font-family: 'Airlock', sans-serif;
}

/* ── NAV ── */
.side-menu-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 4px 0;
}

.side-menu-nav::-webkit-scrollbar { width: 3px; }
.side-menu-nav::-webkit-scrollbar-thumb { background: rgba(var(--primary-rgb), 0.3); }

/* ── ITEMS ── */
.side-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Airlock', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.side-menu-item:hover {
  background: rgba(var(--primary-rgb), 0.07);
  border-left-color: var(--primary);
  color: #ffffff;
}

.side-menu-item:hover .sm-item-icon {
  color: var(--primary);
  text-shadow: 0 0 8px var(--primary);
}

.side-menu-item:active {
  background: rgba(var(--primary-rgb), 0.15);
}

.sm-item-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: rgba(var(--primary-rgb), 0.5);
  transition: all 0.2s ease;
}

.sm-item-label {
  flex: 1;
}

/* Admin variant */
.side-menu-item--admin {
  color: rgba(77, 184, 255, 0.7);
}

.side-menu-item--admin .sm-item-icon {
  color: rgba(0, 136, 255, 0.5);
}

.side-menu-item--admin:hover {
  background: rgba(0, 136, 255, 0.07);
  border-left-color: #0088ff;
  color: #4db8ff;
}

.side-menu-item--admin:hover .sm-item-icon {
  color: #0088ff;
  text-shadow: 0 0 8px #0088ff;
}

/* Logout variant */
.side-menu-item--logout {
  color: rgba(var(--primary-rgb), 0.5);
}

.side-menu-item--logout:hover {
  background: rgba(255, 0, 0, 0.1);
  border-left-color: var(--primary);
  color: var(--primary);
}

/* ── FOOTER ── */
.side-menu-footer {
  padding-bottom: 16px;
}

.side-menu-version {
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.12);
  letter-spacing: 2px;
  text-align: center;
  padding: 8px 0 0;
  font-family: 'Airlock', sans-serif;
}

/* ── Hidden admin section inside nav ── */
#sm-admin-section {
  display: contents; /* when not hidden, flow naturally */
}
#sm-admin-section.hidden {
  display: none !important;
}

/* CHART SECTION */
.chart-section {
  flex: 1;
  border: 1px solid white;
  border-top: 2px solid white;
  padding: 15px 20px;
  position: relative;
}

.chart-header {
  background: var(--primary);
  color: white;
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.chart-container {
  display: flex;
  justify-content: space-between;
  /* Space out the 5 bars */
  align-items: flex-end;
  height: 80px;
  padding: 0 20px;
}

.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.chart-bar {
  width: 25px;
  background: var(--primary);
  transition: height 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  justify-content: center;
  border-top: 2px solid #ff9999;
}

.chart-val {
  margin-bottom: 5px;
  font-size: 0.8rem;
  color: white;
}

.chart-label {
  font-size: 0.6rem;
  color: white;
  margin-top: 5px;
  text-transform: uppercase;
  white-space: nowrap;
  width: 100%;
  text-align: center;
}

/* UTILS */
.hidden {
  display: none !important;
}

@media (max-width: 200px) {
  .control-deck {
    flex-wrap: wrap;
    /* ya no queda otra */
  }
}

@media (max-width: 420px) {
  .stats-body {
    gap: 6px;
  }
}

/* Responsive Handlers Moved to End of File */
@media (max-width: 900px) {
  #dashboard-screen:not(.hidden) {
    display: flex;
    /* Mobile Stack */
    flex-direction: column;
    gap: 8px; /* Reduced gap to avoid scroll */
    height: 100dvh;
    overflow: hidden;
    padding: 0 5px;
    justify-content: space-between;
  }

  .phone-frame {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    clip-path: none;
    background-color: #000;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* Mobile Specific Overrides */
  .main-title {
    font-size: 1.1rem; /* Smaller title */
    margin: 5px 0;
  }

  /* Stats Card: Maintain row layout */
  .stats-body {
    flex-direction: row;
    flex-wrap: nowrap;
    height: auto;
    padding: 5px 0;
    gap: 10px;
    align-items: stretch;
    /* Asegura que ambos lados crezcan igual */
  }

  .stats-list {
    padding: 6px 12px;
    flex: 0 0 180px;
    /* Ancho fijo para alineación */
    width: 180px;
    height: auto;
    min-height: 120px;
  }

  /* Scale up Icons en móvil */
  .stats-icons {
    flex: 1;
    /* Ocupan todo el resto del ancho */
    height: auto;
    /* Dejar que crezca según contenido */
    min-height: 110px; /* Reduced */
    min-width: 0;
    gap: 8px;
    margin-top: 0;
  }

  .stats-crown {
    width: 100% !important;
    height: auto !important;
    flex: 1;
    /* Distribuye equitativamente */
  }

  .stat-row {
    gap: 10px;
    margin: 5px 0;
  }

  /* Reset SINGLES specific alignment for mobile */
  .stat-row.singles {
    justify-content: flex-start;
    margin: 5px 0;
  }

  .stat-label {
    width: 60px;
    font-size: 0.85rem;
    margin-right: 0;
    /* Reset global margin-right */
  }

  .stat-label[data-stat="singles"] {
    transform: translateX(-1px);
  }

  #bar-singles {
    transform: translateX(1px);
  }

  .bar-tick {
    width: 5px;
    /* Ligeramente más estrechas para caber mejor */
    height: 12px;
  }

  /* Control Deck: Buttons Left, Animation Right as requested */
  .control-deck {
    flex-direction: row; 
    height: auto;
    gap: 10px;
    padding: 0 10px;
    justify-content: space-between;
  }

  .action-buttons {
    flex-direction: column;
    flex: 0 0 55%; /* Half size as requested */
    gap: 5px;
    order: 1; /* Left side */
  }

  .action-btn {
    width: 100% !important;
    height: 36px; /* Slightly shorter */
    font-size: 0.85rem;
  }

  .action-widget {
    order: 2; /* Right side */
    margin-right: 5px; /* Moved slightly right */
    margin-left: 0;
    width: 90px; /* Larger animation in mobile too */
    height: 90px;
    flex-shrink: 0;
  }

  .chart-section {
    margin-top: 5px;
  }

  .chart-container {
    height: 110px; /* Reduced from 140px */
    padding: 10px 5px 5px;
  }

  @media (max-width: 480px) {
    .hub-info-inline {
      display: none; /* Hide ID in very small mobile to prevent overflow */
    }
    .seg-hub {
      justify-content: center;
    }
  }

/* --- MISC --- */
.hidden {
  display: none !important;
}

  .action-circle {
    width: 25px;
    height: 25px;
  }

  .action-arc-top,
  .action-arc-bot {
    width: 50px;
    height: 25px;
  }

  /* Lore section mobile */
  .lore-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .lore-box {
    font-size: 0.7rem;
  }

  .lore-status {
    font-size: 0.6rem;
    padding: 3px;
  }

  .chart-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    margin-bottom: 0;
    padding-bottom: 25px;
    /* Espacio extra para los nombres escalonados */
  }

  .chart-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end;
    height: 80px;
    width: 100% !important;
    margin-top: auto;
    /* IMPORTANTE: empuja al borde inferior */
    padding: 0 10px;
  }

  .chart-col {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: center !important;
    height: 100% !important;
    flex: 1 !important;
  }

  .chart-bar {
    width: 35px;
    background: var(--primary);
    /* Color visible */
    border-radius: 6px 6px 0 0;
    min-height: 5px;
    transition: height 0.3s ease;
  }

  .chart-val {
    margin-bottom: 5px;
    font-size: 1rem;
    color: white;
  }

  .chart-label {
    font-size: 0.75rem;
    color: white;
    margin-top: 5px;
    text-transform: uppercase;
  }

  /* Auth Screen Mobile Fixes */
  .auth-container {
    gap: 15px;
    padding: 10px;
  }

  .auth-title {
    font-size: 2.2rem;
    /* Smaller for mobile */
  }

  .auth-box {
    padding: 20px;
    clip-path: polygon(
      0 10px,
      10px 0,
      100% 0,
      100% calc(100% - 10px),
      calc(100% - 10px) 100%,
      0 100%
    );
  }

  #login-screen {
    padding: 0;
    min-height: 100vh;
  }

  .login-input {
    font-size: 1rem;
    padding: 10px;
  }

  .auth-btn {
    padding: 12px;
    font-size: 1rem;
  }

  /* Reset grid props for mobile no longer needed if we want to keep order */

  /* Side menu styles moved to global section */
}

/* END MOBILE MEDIA QUERY */

.side-menu button#admin-panel-btn {
  background: white;
  color: black;
  border: 4px solid var(--primary);
  margin-bottom: 10px;
}

/* LOADING SPINNER */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  background: #000000; /* Fully opaque background to hide index */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1100;
  display: none;
}

.loading-overlay.active {
  display: flex;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner::before,
.loading-spinner::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 4px solid transparent;
}

.loading-spinner::before {
  width: 100%;
  height: 100%;
  border-top-color: var(--primary);
  animation: spinner-spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.3);
}

.loading-spinner::after {
  width: 70%;
  height: 70%;
  border-bottom-color: white;
  animation: spinner-spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite reverse;
}

@keyframes spinner-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-status {
  font-family: "Airlock", monospace;
  color: var(--primary);
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: pulse-text 1.5s infinite;
}



@keyframes pulse-text {
  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
    text-shadow: 0 0 10px var(--primary);
  }
}

/* ADMIN MODAL */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--panel-bg);
  border: 3px solid var(--primary);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.modal-header h2 {
  margin: 0;
  font-family: "Airlock", sans-serif;
  color: var(--primary);
}

.close-modal {
  font-size: 2rem;
  cursor: pointer;
  color: white;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-user-item {
  border: 1px solid #333;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.admin-user-item:hover {
  border-color: var(--primary);
}

.edit-form {
  display: none;
  flex-direction: column;
  gap: 15px;
}

.edit-form.active {
  display: flex;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-group input {
  background: #111;
  border: 1px solid #444;
  color: white;
  padding: 8px;
  font-family: "Segoe UI", sans-serif;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid white;
  color: white;
  padding: 8px 15px;
  cursor: pointer;
  font-family: 'Airlock', sans-serif;
  font-size: 0.75rem;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

/* MEDALLERO SCREEN */
#medals-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
}

.medals-container {
  flex: 1;
  background: #0a0a0a;
  border: 2px solid var(--primary);
  padding: 15px;
  overflow-y: auto;
}

.medals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 15px;
}

.medal-item {
  width: 80px;
  height: 80px;
  border: 1px solid #333;
  background: rgba(255, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.2s,
    border-color 0.2s;
  position: relative;
}

.medal-item:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.medal-item canvas {
  width: 100% !important;
  height: 100% !important;
}

.medal-item.locked {
  filter: grayscale(1) brightness(0.3);
  cursor: not-allowed;
}

.medal-item.admin-preview {
  border-color: #0077ff;
  background: rgba(0, 119, 255, 0.1);
  cursor: pointer;
}

/* MEDAL INSPECTOR */
#medal-inspector {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding: 20px;
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
}

#medal-canvas-container {
  flex: 1;
  width: 100%;
  cursor: grab;
}

#medal-canvas-container:active {
  cursor: grabbing;
}

/* Refined Inspector Content */
.medal-viewer-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  /* Ocupa el espacio restante bajo el header */
  overflow: hidden;
  /* Evita scroll doble */
  padding: 10px 0;
  text-align: center;
}

#medal-canvas-container {
  flex: 1;
  /* Crece para ocupar espacio */
  width: 100%;
  background: radial-gradient(circle, #222 0%, #000 100%);
  border: 2px solid #333;
  border-radius: 12px;
  margin: 10px 0;
  min-height: 250px;
  position: relative;
  overflow: hidden;
}

/* SCANNER VFX */
#scanner-vfx {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(var(--primary-rgb), 0.1), transparent);
  border-bottom: 2px solid rgba(var(--primary-rgb), 0.8);
  box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.5);
  animation: move-scanner 2.5s ease-in-out infinite;
  z-index: 10;
}

@keyframes move-scanner {
  0% {
    transform: translateY(-100%);
  }
  50% {
    transform: translateY(100%);
    transform: translateY(calc(300px));
  } /* Safety calc */
  100% {
    transform: translateY(-100%);
  }
}

/* Adjust animation to container height more reliably */
@keyframes move-scanner {
  0% {
    top: -10%;
  }
  50% {
    top: 100%;
  }
  100% {
    top: -10%;
  }
}

#inspector-long-desc {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #444;
  border-radius: 6px;
  padding: 12px;
  color: #ddd;
  font-size: 0.9rem;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 10px;
  text-align: left;
  line-height: 1.4;
}

#delete-medal-btn {
  margin-top: auto;
  /* Push to bottom */
  background: darkred;
  border-color: #ff4444;
  width: 100%;
  padding: 12px;
}

#inspector-desc {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 10px;
}

#close-inspector {
  font-size: 2.5rem;
  cursor: pointer;
}

/* ADMIN UPLOAD SECTION */
.admin-upload-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px dashed #333;
}

.file-input-wrapper {
  margin: 10px 0;
}

.file-input-wrapper input[type="file"] {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
}

/* --- TOAST NOTIFICATIONS (LOCKE-TECH) --- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 15px;
  pointer-events: none;
}

.toast {
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--primary);
  border-left: 5px solid var(--primary);
  padding: 15px 25px;
  color: white;
  font-family: "Airlock", sans-serif;
  font-size: 0.9rem;
  min-width: 280px;
  max-width: 400px;
  box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.2);
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%
  );
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.toast.active {
  opacity: 1;
  transform: translateX(0);
}

.toast::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(255, 0, 0, 0.05) 50%, transparent 50%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.2;
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast.success {
  border-color: #00ff88;
  color: #00ff88;
  border-left-color: #00ff88;
}
.toast.error {
  border-color: var(--primary);
  color: var(--primary);
  border-left-color: var(--primary);
}
.toast.info {
  border-color: #0088ff;
  color: #0088ff;
  border-left-color: #0088ff;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  width: 100%;
  transform-origin: left;
  animation: toast-progress 5s linear forwards;
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* --- ADMIN SCREEN REDESIGN --- */
#admin-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  background: var(--bg-color);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#admin-screen.hidden {
  display: none !important;
}

.admin-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100dvh - 50px);
}

/* Sidebar & Mobile Nav Bar */
#admin-screen button {
  font-family: 'Airlock', sans-serif;
  cursor: pointer;
  outline: none;
}

#admin-screen .btn-sm {
  padding: 6px 14px !important;
  font-size: 0.68rem !important;
  flex: initial !important;
  border-radius: 6px;
}

.admin-nav {
  width: 220px;
  min-width: 220px;
  background: rgba(12, 14, 20, 0.95);
  border-right: 1px solid rgba(var(--primary-rgb), 0.2);
  display: flex;
  flex-direction: column;
  padding: 15px 10px;
  gap: 8px;
  z-index: 5;
}

.admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #999;
  text-align: left;
  padding: 12px 14px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 1px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.admin-nav-btn .nav-icon {
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-nav-btn .nav-text {
  font-family: 'Airlock', sans-serif;
  letter-spacing: 1px;
}

.admin-nav-btn:hover {
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.3);
  color: #fff;
}

.admin-nav-btn.active {
  color: var(--primary);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.22), rgba(var(--primary-rgb), 0.08));
  border-color: rgba(var(--primary-rgb), 0.6);
  box-shadow: 0 0 14px rgba(var(--primary-rgb), 0.2);
  text-shadow: 0 0 8px rgba(var(--primary-rgb), 0.4);
}

/* Content Area */
.admin-content-area {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
  position: relative;
  scroll-behavior: smooth;
}

.admin-tab {
  display: none;
}
.admin-tab.active {
  display: block;
  animation: authFadeIn 0.4s ease;
}

.admin-section-title {
  font-family: 'Airlock', sans-serif;
  color: var(--primary);
  font-size: 1.1rem;
  letter-spacing: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.2);
  padding-bottom: 8px;
}

/* RealRandom Bar */
.admin-realrandom-bar {
  background: rgba(20, 24, 33, 0.7);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

.realrandom-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.realrandom-title {
  font-family: 'Airlock', sans-serif;
  font-size: 0.75rem;
  color: #fff;
  letter-spacing: 1px;
  margin-bottom: 3px;
}

.realrandom-subtitle {
  font-size: 0.65rem;
  color: #888;
}

.realrandom-global-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-action-success {
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid #4caf50;
  color: #4caf50;
  font-family: 'Airlock', sans-serif;
  font-size: 0.65rem;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-success:hover {
  background: rgba(76, 175, 80, 0.3);
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.btn-action-danger {
  background: rgba(var(--primary-rgb), 0.15);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-family: 'Airlock', sans-serif;
  font-size: 0.65rem;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-danger:hover {
  background: rgba(var(--primary-rgb), 0.3);
  box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.3);
}

.realrandom-bar-footer {
  border-top: 1px dashed rgba(var(--primary-rgb), 0.2);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.realrandom-deadline-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.deadline-label {
  font-family: 'Airlock', sans-serif;
  font-size: 0.65rem;
  color: #fff;
}

.deadline-status {
  font-size: 0.65rem;
  color: #aaa;
}

.realrandom-deadline-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* User Cards Grid */
.admin-grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  padding-bottom: 40px;
}

.admin-user-card {
  background: rgba(20, 24, 33, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s ease;
}

.admin-user-card:hover {
  border-color: rgba(var(--primary-rgb), 0.4);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.user-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.user-card-info h4 {
  margin: 0;
  color: #fff;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-card-info p {
  margin: 4px 0 0;
  color: #aaa;
  font-size: 0.7rem;
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge-lock {
  font-family: 'Airlock', sans-serif;
  font-size: 0.55rem;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.badge-lock.locked {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.15);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
}

.badge-lock.unlocked {
  color: #4caf50;
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.user-pts {
  color: var(--primary);
  font-weight: bold;
}

.user-id-sub {
  color: #666;
  font-size: 0.65rem;
}

.btn-edit-user {
  padding: 6px 14px !important;
  font-size: 0.65rem !important;
  font-family: 'Airlock', sans-serif !important;
  border-radius: 6px !important;
  flex-shrink: 0;
}

.user-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-spin-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.spin-label {
  font-size: 0.75rem;
}

.quick-spins-val {
  font-family: 'Airlock', sans-serif;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: bold;
  min-width: 18px;
  text-align: center;
}

.btn-sub-spin-quick,
.btn-add-spin-quick {
  padding: 2px 8px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.2s ease;
}

.btn-sub-spin-quick {
  background: rgba(var(--primary-rgb), 0.2);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-sub-spin-quick:hover {
  background: rgba(var(--primary-rgb), 0.4);
}

.btn-add-spin-quick {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid #4caf50;
  color: #4caf50;
}

.btn-add-spin-quick:hover {
  background: rgba(76, 175, 80, 0.4);
}

.btn-reset-spin-quick {
  padding: 5px 8px;
  font-size: 0.6rem;
  font-family: 'Airlock', sans-serif;
  border-radius: 4px;
  cursor: pointer;
  background: rgba(255, 165, 0, 0.15);
  border: 1px solid #ffa500;
  color: #ffa500;
  transition: all 0.2s ease;
}

.btn-reset-spin-quick:hover {
  background: rgba(255, 165, 0, 0.3);
}

.btn-lock-toggle {
  padding: 5px 10px;
  font-size: 0.6rem;
  font-family: 'Airlock', sans-serif;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-lock-toggle.locked {
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid #4caf50;
  color: #4caf50;
}

.btn-lock-toggle.unlocked {
  background: rgba(var(--primary-rgb), 0.15);
  border: 1px solid var(--primary);
  color: var(--primary);
}

/* Forms Container */
.admin-card-form {
  max-width: 640px;
  background: rgba(20, 24, 33, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.tiebreak-header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px dashed rgba(var(--primary-rgb), 0.2);
  padding-bottom: 8px;
  gap: 10px;
  flex-wrap: wrap;
}

.tiebreak-header-text {
  flex: 1;
  min-width: 200px;
}

.tiebreak-header-actions {
  display: flex;
  gap: 6px;
}

.tiebreak-crit-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: 4px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tiebreak-crit-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.tiebreak-crit-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .tiebreak-header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .tiebreak-header-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .tiebreak-header-actions button {
    flex: 1;
  }
  .tiebreak-crit-row {
    padding: 8px 10px;
    gap: 8px;
  }
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.form-row .form-group {
  flex: 1;
}

.form-group label {
  display: block;
  font-size: 0.68rem;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: 1px;
  font-family: 'Airlock', sans-serif;
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(10, 12, 18, 0.8);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  border-radius: 6px;
  color: white;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.2);
}

/* Global Edit Modal Overlay (Fixed Viewport Overlay) */
#admin-edit-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 15px !important;
  overflow-y: auto !important;
}

#admin-edit-overlay.hidden {
  display: none !important;
}

.edit-form-modern {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: #0d0f17;
  border: 1px solid rgba(var(--primary-rgb), 0.4);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(var(--primary-rgb), 0.15);
  position: relative;
  animation: authFadeIn 0.3s ease;
}

.edit-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.2);
  padding-bottom: 12px;
}

.edit-modal-header h3 {
  color: var(--primary);
  margin: 0;
  font-family: 'Airlock', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.modal-close-btn:hover {
  color: var(--primary);
}

.team-lock-btn {
  width: 100%;
  font-family: 'Airlock', sans-serif;
  font-size: 0.65rem;
  padding: 9px;
  border-radius: 6px;
  cursor: pointer;
}

.modal-spins-section {
  margin-top: 18px;
  border-top: 1px dashed rgba(var(--primary-rgb), 0.25);
  padding-top: 14px;
}

.modal-spins-label {
  color: var(--primary);
  font-family: 'Airlock', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}

.modal-spins-box {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  flex-wrap: wrap;
}

.spins-box-text {
  font-size: 0.72rem;
  color: #aaa;
  flex: 1;
}

.spins-box-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.spins-count-display {
  font-family: 'Airlock', sans-serif;
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: bold;
  min-width: 28px;
  text-align: center;
}

.btn-spin-ctrl {
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-spin-ctrl.sub {
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
  font-weight: bold;
  background: rgba(var(--primary-rgb), 0.2);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-spin-ctrl.add {
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
  font-weight: bold;
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid #4caf50;
  color: #4caf50;
}

.btn-spin-ctrl.reset {
  padding: 6px 12px;
  font-size: 0.65rem;
  font-family: 'Airlock', sans-serif;
  background: rgba(255, 165, 0, 0.2);
  border: 1px solid #ffa500;
  color: #ffa500;
}

.edit-modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn-expel {
  font-family: 'Airlock', sans-serif !important;
  font-size: 0.65rem !important;
  padding: 8px 14px !important;
}

.edit-modal-right-actions {
  display: flex;
  gap: 10px;
}

#mod-permissions-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
    height: auto;
    overflow-y: auto;
  }

  .admin-nav {
    width: 100%;
    min-width: auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px;
    border-right: none;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.2);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    background: rgba(10, 12, 18, 0.95);
  }

  .admin-nav-btn {
    width: auto;
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 0.68rem;
    scroll-snap-align: start;
    white-space: nowrap;
    border-radius: 20px;
  }

  .admin-content-area {
    padding: 12px;
  }

  .admin-grid-list {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .realrandom-bar-header,
  .realrandom-bar-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .realrandom-global-actions,
  .realrandom-deadline-controls {
    width: 100%;
    justify-content: space-between;
  }

  .edit-modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .edit-modal-right-actions {
    width: 100%;
  }

  .edit-modal-right-actions button {
    flex: 1;
  }
}


/* ═══════════════════════════════════════════════
   RULETA SCREEN
═══════════════════════════════════════════════ */

#ruleta-screen {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0;
  min-height: 100dvh;
  animation: authFadeIn 0.4s ease;
}

#ruleta-screen:not(.hidden) {
  display: flex;
}

.ruleta-layout {
  display: flex;
  gap: 25px;
  flex: 1;
  align-items: flex-start;
  padding: 0 20px 20px 20px;
}

/* ── WHEEL AREA ── */
.ruleta-wheel-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  flex: 0 0 auto;
}

.ruleta-wheel-wrapper {
  position: relative;
  width: 300px;
  height: 300px;
}

#ruleta-canvas {
  display: block;
  border-radius: 50%;
  /* Outer glow matching the app theme */
  box-shadow:
    0 0 0 4px rgba(var(--primary-rgb), 0.4),
    0 0 30px rgba(var(--primary-rgb), 0.25),
    0 0 60px rgba(255, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

#ruleta-canvas:hover {
  box-shadow:
    0 0 0 4px rgba(var(--primary-rgb), 0.6),
    0 0 40px rgba(var(--primary-rgb), 0.4),
    0 0 80px rgba(255, 0, 0, 0.2);
}

/* Pointer — fixed right side, pointing INTO the wheel */
.ruleta-pointer {
  position: absolute;
  right: -28px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
  color: var(--primary);
  text-shadow:
    0 0 10px var(--primary),
    0 0 20px var(--primary);
  z-index: 10;
  line-height: 1;
  /* Subtle pulse animation */
  animation: pointer-pulse 1.5s ease-in-out infinite;
}

@keyframes pointer-pulse {
  0%,
  100% {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
  50% {
    opacity: 0.7;
    transform: translateY(-50%) translateX(-3px);
  }
}

/* ── RESULT ── */
.ruleta-result {
  border: 2px solid var(--primary);
  background: radial-gradient(circle at center, #1a0000 0%, #000000 60%);
  padding: 14px 24px;
  text-align: center;
  min-width: 280px;
  position: relative;
  clip-path: polygon(
    0 10px,
    10px 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%
  );
  box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3);
}

.ruleta-result::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  opacity: 0.8;
}

.ruleta-result-label {
  font-size: 0.65rem;
  color: var(--primary);
  letter-spacing: 3px;
  margin-bottom: 6px;
  opacity: 0.8;
}

.ruleta-result-name {
  font-family: "Airlock", sans-serif;
  font-size: 1.5rem;
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 0 15px rgba(var(--primary-rgb), 0.6);
  word-break: break-word;
}

@keyframes result-pop-anim {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  60% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.result-pop {
  animation: result-pop-anim 0.5s cubic-bezier(0.23, 1, 0.32, 1) both;
}

/* ── CONTROLS ── */
.ruleta-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.ruleta-spin-btn {
  padding: 12px 32px;
  font-size: 1.1rem;
  letter-spacing: 2px;
}

.ruleta-spin-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.ruleta-secondary-btn {
  background: transparent;
  border: 2px solid rgba(var(--primary-rgb), 0.4);
  color: var(--text-muted);
  padding: 10px 18px;
  font-family: "Airlock", sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s ease;
  clip-path: polygon(
    6px 0,
    100% 0,
    100% calc(100% - 6px),
    calc(100% - 6px) 100%,
    0 100%,
    0 6px
  );
}

.ruleta-secondary-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.3);
}

/* ── OPTIONS PANEL ── */
.ruleta-options-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  padding: 18px;
  background: rgba(var(--primary-rgb), 0.02);
  clip-path: polygon(
    0 14px,
    14px 0,
    100% 0,
    100% calc(100% - 14px),
    calc(100% - 14px) 100%,
    0 100%
  );
  max-height: 420px;
}

.ruleta-panel-header {
  font-size: 0.7rem;
  color: var(--primary);
  letter-spacing: 3px;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.3);
  padding-bottom: 10px;
  margin-bottom: 4px;
}

.ruleta-option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 260px;
  padding-right: 4px;
}

.ruleta-option-list::-webkit-scrollbar {
  width: 4px;
}
.ruleta-option-list::-webkit-scrollbar-track {
  background: transparent;
}
.ruleta-option-list::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), 0.4);
  border-radius: 2px;
}

.ruleta-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: authFadeIn 0.25s ease;
}

.ruleta-option-color {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ruleta-option-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  border-left: 3px solid var(--primary);
  color: #fff;
  padding: 8px 10px;
  font-family: "Airlock", sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
  text-transform: uppercase;
  -webkit-user-select: text;
  user-select: text;
}

.ruleta-option-input:focus {
  background: rgba(var(--primary-rgb), 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.2);
}

.ruleta-remove-btn {
  background: transparent;
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  color: rgba(var(--primary-rgb), 0.6);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.ruleta-remove-btn:hover {
  background: var(--primary);
  color: black;
  border-color: var(--primary);
}

.ruleta-add-btn {
  background: transparent;
  border: 2px dashed rgba(var(--primary-rgb), 0.4);
  color: rgba(var(--primary-rgb), 0.7);
  padding: 10px;
  font-family: "Airlock", sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s ease;
  width: 100%;
}

.ruleta-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.05);
}

.ruleta-note {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 2px;
  text-align: center;
}

/* ── RESPONSIVE (mobile) ── */
@media (max-width: 900px) {
  #ruleta-screen {
    padding: 0;
    overflow-y: auto;
  }

  .ruleta-layout {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 0 15px 15px 15px;
  }

  .ruleta-wheel-wrapper {
    width: 260px;
    height: 260px;
  }

  #ruleta-canvas {
    width: 260px;
    height: 260px;
  }

  .ruleta-options-panel {
    width: 100%;
    max-width: 340px;
    max-height: none;
  }

  .ruleta-result {
    min-width: 230px;
  }
}

/* ── SHARED TABS SYSTEM ── */
.tc-tabs {
  display: flex;
  background: rgba(var(--primary-rgb), 0.05);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: 4px;
  margin-bottom: 15px;
}

.tc-tab {
  flex: 1;
  background: none;
  border: none;
  color: #888;
  font-family: 'Airlock';
  font-size: 0.7rem;
  padding: 10px 0;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
}

.tc-tab:hover {
  color: white;
}

.tc-tab.active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  text-shadow: 0 0 5px var(--primary);
}

/* ── GACHAPON MACHINE & POKEMON CARD ── */
.ruleta-gachapon-wrapper {
  position: relative;
  width: 320px;
  height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.gachapon-machine {
  width: 240px;
  height: 360px;
  background-image: url('../icons/gachapon_machine.png');
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  box-shadow: 0 15px 30px rgba(0,0,0,0.7), inset 0 0 40px rgba(0,0,0,0.5);
  border-radius: 20px;
  overflow: visible;
}


/* Shaking animation for the entire machine when crank turns */
.gachapon-machine.shaking {
  animation: shake-machine 0.4s ease-in-out infinite;
}

@keyframes shake-machine {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-3px, 2px) rotate(-1deg); }
  50% { transform: translate(3px, -1px) rotate(1.5deg); }
  75% { transform: translate(-2px, -2px) rotate(-0.8deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* High quality Pokéball capsule */
.gachapon-released-ball {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(to bottom, #ff3333 50%, #ffffff 50%);
  border: 2.5px solid #000000;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), inset -3px -3px 8px rgba(0, 0, 0, 0.3);
  z-index: 5;
  top: 86%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.3);
  overflow: visible;
}

.gachapon-released-ball::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
  z-index: 6;
}

.gachapon-released-ball::before {
  content: '';
  position: absolute;
  top: calc(50% - 1.25px);
  left: 0;
  right: 0;
  height: 2.5px;
  background: #000000;
  z-index: 5;
}

/* Released capsule exit, bounce and epic zoom animation */
.gachapon-released-ball.falling-out {
  animation: capsule-release-epic 2.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes capsule-release-epic {
  0% {
    top: 86%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.3) rotate(0deg);
    opacity: 0;
  }
  15% {
    top: 89%; /* moves forward to slide door edge */
    left: 50%;
    transform: translate(-50%, -50%) scale(0.65) rotate(45deg);
    opacity: 1;
  }
  28% {
    top: 98%; /* falls to the ground shelf and bounces */
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9) rotate(90deg);
  }
  40% {
    top: 92%; /* peak of bounce */
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95) rotate(140deg);
  }
  52% {
    top: 100%; /* lands and rolls off shelf */
    left: 48%;
    transform: translate(-50%, -50%) scale(1.1) rotate(220deg);
    opacity: 1;
  }
  65% {
    top: 110%; /* starts zooming directly to screen */
    left: 45%;
    transform: translate(-50%, -50%) scale(2) rotate(360deg);
  }
  88% {
    top: 40%; /* zooms right to the center of the viewport */
    left: 50%;
    transform: translate(-50%, -50%) scale(8) rotate(720deg);
    opacity: 1;
  }
  92% {
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) scale(8.5) rotate(720deg) translate(-2px, 1px);
    box-shadow: 0 0 35px rgba(255, 51, 51, 1), inset -3px -3px 8px rgba(0, 0, 0, 0.3);
  }
  96% {
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) scale(8.5) rotate(720deg) translate(2px, -1px);
    box-shadow: 0 0 35px rgba(255, 51, 51, 1), inset -3px -3px 8px rgba(0, 0, 0, 0.3);
  }
  100% {
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) scale(9) rotate(720deg);
    opacity: 0;
  }
}

.pokemon-card-wrapper {
  width: 170px;
  height: 255px;
  position: relative;
  overflow: visible;
  cursor: pointer;
  transition: transform 0.2s ease;
}

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

.pokemon-card-wrapper .pokemon-card {
  margin: 0 !important;
  transform: scale(0.5);
  transform-origin: top left;
  pointer-events: auto;
  box-shadow: none !important;
}

/* ── POKEMON CARD DISPLAY ── */
.pokemon-card {
  position: relative;
  width: 340px;
  height: 510px;
  background-image: url('../icons/file_00000000da6471f486ebbbbf719fd52c.png');
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  margin: 15px auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.7), 0 0 20px rgba(var(--primary-rgb), 0.25);
  overflow: hidden;
}

.pokemon-card.card-appear {
  animation: card-reveal 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes card-reveal {
  0% {
    transform: scale(0.3) rotateY(180deg);
    opacity: 0;
    filter: brightness(2);
  }
  70% {
    filter: brightness(1.5);
  }
  100% {
    transform: scale(1) rotateY(0deg);
    opacity: 1;
    filter: brightness(1);
  }
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.card-name {
  position: absolute;
  top: 22px;
  left: 28px;
  width: 250px;
  font-family: 'Airlock', sans-serif;
  font-size: 1.15rem;
  color: #fff;
  font-weight: bold;
  letter-spacing: 1.5px;
  text-shadow: 0 0 6px rgba(var(--primary-rgb), 0.9), 0 0 12px rgba(var(--primary-rgb), 0.5);
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-type-badge {
  position: absolute;
  top: 57px;
  left: 90px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.type-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.8));
}

.card-sprite-container {
  position: absolute;
  top: 92px;
  left: 17px;
  width: 306px;
  height: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.card-sprite-container img {
  max-width: 100%;
  max-height: 100%;
  transform: scale(1.65);
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.6));
}

.card-nature-value {
  position: absolute;
  top: 410px;
  left: 80px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.82rem;
  color: #a3e635; /* Neon green */
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 0 5px rgba(163, 230, 53, 0.5);
}

.card-stat-up {
  position: absolute;
  top: 396px;
  left: 220px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.5rem;
  color: #ef4444; /* Neon red */
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

.card-stat-down {
  position: absolute;
  top: 416px;
  left: 220px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.5rem;
  color: #3b82f6; /* Neon blue */
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 0 4px rgba(59, 130, 246, 0.4);
}

.card-ability-value {
  position: absolute;
  top: 457px;
  left: 185px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.68rem;
  color: #60a5fa; /* Soft neon blue */
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: 0 0 5px rgba(96, 165, 250, 0.5);
}

/* Flash effect */
.gachapon-flash {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  opacity: 0;
  z-index: 200;
  pointer-events: none;
  border-radius: 12px;
}
.gachapon-flash.flash-active {
  animation: flash-animation 0.5s ease-out forwards;
}

@keyframes flash-animation {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}

@media (max-width: 360px) {
  .pokemon-card {
    transform-origin: top center;
    transform: scale(0.9);
    margin-bottom: -50px;
  }
}



/* ═══════════════════════════════════════════════════════
   RANKING SCREEN
═══════════════════════════════════════════════════════ */
#ranking-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; /* Important for flex-child scroll */
  animation: authFadeIn 0.3s ease;
}
#ranking-screen:not(.hidden) { display: flex; }

.ranking-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 14px 16px;
  gap: 12px;
}

/* Controls: filters + search */
.ranking-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ranking-filters {
  display: flex;
  gap: 4px;
  flex: 1;
}

.ranking-filter-btn {
  background: transparent;
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  color: rgba(255,255,255,0.4);
  padding: 6px 12px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}
.ranking-filter-btn:hover  { color: var(--primary); border-color: rgba(var(--primary-rgb), 0.6); }
.ranking-filter-btn.active { background: var(--primary); color: #000; border-color: var(--primary); font-weight: bold; }

.ranking-search {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  border-left: 3px solid var(--primary);
  color: #fff;
  padding: 7px 12px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.75rem;
  outline: none;
  letter-spacing: 1px;
  width: 160px;
  transition: all 0.2s;
}
.ranking-search:focus        { background: rgba(var(--primary-rgb), 0.07); border-color: var(--primary); }
.ranking-search::placeholder { color: rgba(255,255,255,0.25); }

/* Table */
.ranking-table-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto; /* Allow horizontal scroll on very slim screens */
  border: 1px solid rgba(var(--primary-rgb), 0.2);
}
.ranking-table-wrapper::-webkit-scrollbar      { width: 4px; }
.ranking-table-wrapper::-webkit-scrollbar-thumb { background: rgba(var(--primary-rgb), 0.4); }

.ranking-table {
  width: 100%;
  min-width: 380px; /* Ensure columns don't collapse too much */
  border-collapse: collapse;
  font-family: 'Airlock', sans-serif;
}

.ranking-table thead tr {
  background: rgba(var(--primary-rgb), 0.08);
  border-bottom: 2px solid rgba(var(--primary-rgb), 0.3);
}
.ranking-table th {
  padding: 10px 8px;
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: rgba(var(--primary-rgb), 0.7);
  text-align: left;
  font-weight: normal;
}

.ranking-row {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
  animation: authFadeIn 0.2s ease both;
}
.ranking-row:hover { background: rgba(var(--primary-rgb), 0.05); }

.ranking-row.rank-gold   td:first-child { color: #FFD700; text-shadow: 0 0 10px #FFD700; }
.ranking-row.rank-silver td:first-child { color: #C0C0C0; text-shadow: 0 0 8px #C0C0C0; }
.ranking-row.rank-bronze td:first-child { color: #CD7F32; text-shadow: 0 0 8px #CD7F32; }

.ranking-row.rank-gold   { background: rgba(255,215,0,0.03); }
.ranking-row.rank-silver { background: rgba(192,192,192,0.02); }

.rank-pos-cell  { padding: 10px 8px; font-size: 1rem; text-align: center; width: 36px; }
.rank-name-cell { padding: 10px 8px; font-size: 0.75rem; letter-spacing: 1px; color: #fff; }
.rank-num-cell  { padding: 10px 8px; font-size: 0.8rem; text-align: right; width: 46px; }
.rank-action-cell { padding: 6px 8px; text-align: right; width: 60px; }

.rank-val-active { color: var(--primary); font-weight: bold; }
.rank-val-muted  { color: rgba(255,255,255,0.35); }

.rank-view-btn {
  background: transparent;
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  color: rgba(var(--primary-rgb), 0.6);
  padding: 4px 7px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.55rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.rank-view-btn:hover { background: var(--primary); color: #000; border-color: var(--primary); }

.ranking-empty {
  text-align: center;
  padding: 40px;
  color: rgba(255,255,255,0.2);
  font-size: 0.7rem;
  letter-spacing: 3px;
}


/* ═══════════════════════════════════════════════════════
   TORNEOS SCREEN
═══════════════════════════════════════════════════════ */
#torneos-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  animation: authFadeIn 0.3s ease;
}
#torneos-screen:not(.hidden) { display: flex; }

.torneos-layout {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.torneos-layout::-webkit-scrollbar      { width: 4px; }
.torneos-layout::-webkit-scrollbar-thumb { background: rgba(var(--primary-rgb), 0.3); }

.torneos-actions { display: flex; justify-content: flex-end; }

.torneos-create-btn {
  font-size: 0.8rem;
  padding: 10px 20px;
  letter-spacing: 1.5px;
}

.torneos-section-label {
  font-size: 0.6rem;
  color: rgba(var(--primary-rgb), 0.6);
  letter-spacing: 3px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.15);
  padding-bottom: 6px;
}

.torneos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.torneos-empty {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 2px;
  padding: 20px;
  grid-column: 1 / -1;
}

/* Torneo Card */
.torneo-card {
  display: flex;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  background: rgba(var(--primary-rgb), 0.02);
  transition: all 0.2s;
  overflow: hidden;
  animation: authFadeIn 0.25s ease both;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.torneo-card:hover { background: rgba(var(--primary-rgb), 0.06); border-color: rgba(var(--primary-rgb), 0.4); transform: translateY(-1px); }
.torneo-card--past { opacity: 0.7; }
.torneo-card--past:hover { opacity: 1; }

.mt-20 { margin-top: 20px; }
.pt-10 { padding-top: 10px; }
.w-100p { width: 100%; }
.fs-08 { font-size: 0.8rem; }
.fs-07 { font-size: 0.7rem; }
.fs-06 { font-size: 0.6rem; }
.c-666 { color: #666; }
.border-top-333 { border-top: 1px solid #333; }
.flex-1 { flex: 1; }
.gap-5 { gap: 5px; }
.d-block { display: block; }
.mb-10 { margin-bottom: 10px; }

.torneo-card-accent {
  width: 3px;
  flex-shrink: 0;
}
.torneo-card-body { flex: 1; padding: 15px 22px; display: flex; flex-direction: column; gap: 6px; }

.torneo-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.torneo-format-badge {
  font-size: 0.6rem;
  padding: 2px 8px;
  border: 1px solid;
  letter-spacing: 2px;
  font-family: 'Airlock', sans-serif;
  font-weight: bold;
}
.torneo-status-badge {
  font-size: 0.55rem;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.4);
}
.torneo-status-badge.in_progress { color: #ffe066; }
.torneo-status-badge.completed   { color: rgba(255,255,255,0.25); }

.torneo-name {
  font-family: 'Airlock', sans-serif;
  font-size: 0.85rem;
  color: #fff;
  letter-spacing: 1px;
  line-height: 1.2;
}

.torneo-meta {
  display: flex;
  gap: 10px;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1px;
}

.torneo-desc { font-size: 0.65rem; color: rgba(255,255,255,0.4); line-height: 1.4; }

.torneo-winner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.2);
  margin-top: 2px;
}
.torneo-winner-label { font-size: 0.55rem; color: rgba(255,215,0,0.6); letter-spacing: 2px; }
.torneo-winner-name  { font-size: 0.8rem; color: #FFD700; font-family: 'Airlock', sans-serif; }

.torneo-admin-actions { display: flex; gap: 6px; margin-top: 4px; }

.torneo-edit-btn, .torneo-delete-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.4);
  padding: 4px 10px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.6rem;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
}
.torneo-edit-btn:hover   { border-color: var(--primary); color: var(--primary); }
.torneo-delete-btn:hover { border-color: #ff2222; color: #ff2222; }


.torneo-open-btn {
  background: rgba(var(--primary-rgb), 0.12);
  border: 1px solid rgba(var(--primary-rgb), 0.45);
  color: #ff8080;
  padding: 4px 10px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.6rem;
  cursor: pointer;
  letter-spacing: 1px;
}

.torneo-modal-panel--detail { max-width: 560px; }
.torneo-detail-body { gap: 12px; }
.readonly-field {
  opacity: 0.7;
  filter: grayscale(0.2);
}

.locke-participants-list {
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  background: rgba(var(--primary-rgb), 0.03);
  min-height: 48px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.locke-participant-chip {
  font-size: 0.6rem;
  color: #ff9c9c;
  border: 1px solid rgba(var(--primary-rgb), 0.35);
  padding: 4px 8px;
  letter-spacing: 1px;
}

.locke-points-chart {
  min-height: 110px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.08), rgba(0,0,0,0.2));
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px;
}

.locke-point-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.locke-point-col span,
.locke-point-col small {
  font-size: 0.55rem;
  color: rgba(255,255,255,0.6);
}

.locke-point-col div {
  width: 100%;
  background: linear-gradient(180deg, #ff9a9a, var(--primary));
  border: 1px solid rgba(255,255,255,0.2);
  min-height: 8px;
}

/* Setup notice (table not created) */
.torneos-setup-notice {
  grid-column: 1 / -1;
  border: 1px dashed rgba(var(--primary-rgb), 0.3);
  padding: 30px;
  text-align: center;
}
.tsn-icon  { font-size: 2rem; margin-bottom: 10px; color: rgba(var(--primary-rgb), 0.5); }
.tsn-title { font-size: 0.7rem; color: var(--primary); letter-spacing: 3px; margin-bottom: 8px; }
.tsn-desc  { font-size: 0.65rem; color: rgba(255,255,255,0.3); line-height: 1.5; }

/* Torneo form modal */
.torneo-modal {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.torneo-modal.hidden { display: none; }

.torneo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.torneo-modal-panel {
  position: relative;
  background: #050505;
  border: 2px solid var(--primary);
  width: 95%; /* Better width for mobile */
  max-width: 500px;
  max-height: 85%;
  overflow-y: auto;
  box-shadow: 0 0 40px rgba(var(--primary-rgb), 0.3);
  animation: authFadeIn 0.25s ease;
}
.torneo-modal-panel::-webkit-scrollbar      { width: 3px; }
.torneo-modal-panel::-webkit-scrollbar-thumb { background: rgba(var(--primary-rgb), 0.4); }

.torneo-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.2);
  background: rgba(var(--primary-rgb), 0.05);
}
.torneo-modal-title { font-size: 0.8rem; letter-spacing: 3px; color: var(--primary); }
.torneo-modal-close {
  background: none; border: none; color: rgba(var(--primary-rgb), 0.6);
  font-size: 1rem; cursor: pointer; transition: color 0.2s; padding: 0;
}
.torneo-modal-close:hover { color: var(--primary); }

.torneo-form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

.tf-row { display: flex; gap: 10px; flex-wrap: wrap; }

.tf-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 100px;
}
.tf-group label {
  font-size: 0.6rem;
  color: rgba(var(--primary-rgb), 0.6);
  letter-spacing: 2px;
}
.tf-group input,
.tf-group select,
.tf-group textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  border-left: 3px solid var(--primary);
  color: #fff;
  padding: 8px 10px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.8rem;
  outline: none;
  resize: none;
  transition: all 0.2s;
}
.tf-group input:focus,
.tf-group select:focus,
.tf-group textarea:focus {
  background: rgba(var(--primary-rgb), 0.07);
  border-color: var(--primary);
}
.tf-group select option { background: #0a0a0a; }


/* ═══════════════════════════════════════════════════════
   PERFIL OVERLAY
═══════════════════════════════════════════════════════ */
.perfil-overlay {
  position: absolute;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.perfil-overlay.hidden { display: none; }
.perfil-overlay:not(.hidden) { display: flex; pointer-events: all; }

.perfil-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.perfil-overlay.active .perfil-backdrop { opacity: 1; }

.perfil-panel {
  position: relative;
  background: #040404;
  border: 2px solid var(--primary);
  border-bottom: none;
  width: 100%;
  max-width: 500px;
  max-height: 85%;
  overflow-y: auto;
  box-shadow: 0 -8px 60px rgba(var(--primary-rgb), 0.25);
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.23, 1, 0.32, 1);
  padding: 0;
}
.perfil-overlay.active .perfil-panel { transform: translateY(0); }
.perfil-panel::-webkit-scrollbar      { width: 3px; }
.perfil-panel::-webkit-scrollbar-thumb { background: rgba(var(--primary-rgb), 0.4); }

/* Close button */
.perfil-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  color: rgba(var(--primary-rgb), 0.6);
  width: 28px; height: 28px;
  cursor: pointer;
  font-size: 0.8rem;
  z-index: 10;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.perfil-close:hover { background: var(--primary); color: #000; border-color: var(--primary); }

/* Header */
.perfil-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px 16px;
  background: rgba(var(--primary-rgb), 0.04);
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.15);
}

.perfil-rank-badge {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
  text-align: center;
  min-width: 44px;
}

.perfil-header-info { display: flex; flex-direction: column; gap: 6px; }

.perfil-name {
  font-family: 'Airlock', sans-serif;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: 2px;
}

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

.perfil-level-badge {
  background: rgba(var(--primary-rgb), 0.15);
  border: 1px solid rgba(var(--primary-rgb), 0.4);
  color: var(--primary);
  font-size: 0.6rem;
  padding: 2px 8px;
  letter-spacing: 2px;
  font-family: 'Airlock', sans-serif;
}

.perfil-points-val {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
}

.perfil-divider {
  height: 1px;
  background: rgba(var(--primary-rgb), 0.12);
  margin: 0;
}

/* Body */
.perfil-body {
  display: flex;
  gap: 0;
  padding: 16px;
  gap: 16px;
}

.perfil-radar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.perfil-medals-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.perfil-section-label {
  font-size: 0.55rem;
  color: rgba(var(--primary-rgb), 0.5);
  letter-spacing: 3px;
  width: 100%;
}

#perfil-radar {
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.04) 0%, transparent 70%);
}

/* Stats trio under radar */
.perfil-stats-trio {
  display: flex;
  gap: 8px;
}
.perfil-stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  padding: 5px 4px;
  background: rgba(var(--primary-rgb), 0.03);
}
.psc-label { font-size: 0.5rem; color: rgba(var(--primary-rgb), 0.5); letter-spacing: 2px; }
.psc-val   { font-size: 0.9rem; color: var(--primary); font-family: 'Airlock', sans-serif; }

/* Medals grid */
.pf-medals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  max-height: 160px;
  align-content: start;
}
.pf-medals-grid::-webkit-scrollbar      { width: 3px; }
.pf-medals-grid::-webkit-scrollbar-thumb { background: rgba(var(--primary-rgb), 0.3); }

.pf-medal-item {
  aspect-ratio: 1;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  background: rgba(var(--primary-rgb), 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  overflow: hidden;
  cursor: default;
}
.pf-medal-item:hover { border-color: var(--primary); transform: scale(1.05); }
.pf-medal-item img   { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

.pf-no-medals {
  grid-column: 1 / -1;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 2px;
  text-align: center;
  padding: 20px 0;
}
.pf-loading { color: rgba(var(--primary-rgb), 0.4); font-size: 0.6rem; letter-spacing: 2px; }

/* Responsive torneos grid */
@media (max-width: 480px) {
  .torneos-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .torneo-card-title { font-size: 0.6rem; }
  .torneo-status-box { font-size: 0.55rem; }
  
  .top-bar { height: auto; flex-wrap: nowrap; overflow-x: auto; padding: 0; }
  .top-segment { height: 40px; font-size: 0.65rem; padding: 0 8px; }
  .seg-role { width: 60px; min-width: 60px; }
  .seg-name { width: auto; min-width: 80px; max-width: 120px; }
  .seg-hub { flex: 1; min-width: 120px; }
  .seg-menu { width: 40px; min-width: 40px; }

  .locke-main-interface { grid-template-columns: 1fr; }
  .locke-apuntarse-btn { height: 50px; }

  .ranking-filters { flex-wrap: wrap; }
  .ranking-search { width: 100%; }
  .perfil-body { flex-direction: column; align-items: center; }
  
  /* Admin responsive */
  .admin-layout {
    flex-direction: column;
    overflow-y: auto;
  }
  .admin-nav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding: 10px;
    border-right: none;
    border-bottom: 1px solid rgba(0, 136, 255, 0.2);
  }
  .admin-nav-btn {
    padding: 10px 15px;
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  .admin-nav-btn.active {
    border-left-color: transparent;
    border-bottom-color: #0088ff;
  }
  .admin-content-area {
    padding: 15px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }

  /* Calendar Mobile Optimization */
  .calendar-day {
    padding: 4px !important;
    font-size: 0.7rem !important;
  }
  .day-number {
    font-size: 0.7rem !important;
  }
  .event-indicators {
    flex-direction: row !important;
    justify-content: center !important;
    gap: 3px !important;
    margin-top: auto !important;
  }
  .event-dot {
    font-size: 0 !important;
    width: 5px !important;
    height: 5px !important;
    border-radius: 50% !important;
    background: var(--primary) !important;
    box-shadow: 0 0 5px var(--primary) !important;
    display: inline-block !important;
  }
  .event-dot::before {
    display: none !important;
  }
}


/* --- TORNEOS / LIGA LOCKE GRID --- */
.torneos-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 30px;
}

.torneos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 10px 0;
}

@media (max-width: 480px) {
  .torneos-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
}

/* ═══════════════════════════════════════════════════════
   GLOBAL MODALS & MOBILE SCROLL LOCKING
═══════════════════════════════════════════════════════ */
body.modal-open {
  overflow: hidden !important;
  touch-action: none;
}

.modal-responsive-wrapper {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  box-sizing: border-box;
  touch-action: none;
}

.modal-responsive-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  background: #0a0a0a;
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 0 25px rgba(var(--primary-rgb), 0.3);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.modal-responsive-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(85vh - 70px);
}

.torneo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.torneo-card:hover {
  transform: translateY(-2px);
}

.torneo-thumb-box {
  width: 100%;
  aspect-ratio: 16/9;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.torneo-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.torneo-card-title {
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  color: #ffffff;
  letter-spacing: 1px;
  text-align: center;
}

.torneo-status-box {
  width: 100%;
  text-align: center;
  border: 1px solid var(--primary);
  font-size: 0.7rem;
  padding: 4px 0;
  text-transform: uppercase;
  border-radius: 4px;
  font-family: 'Airlock', sans-serif;
  letter-spacing: 1px;
}

.status-en-curso { background: var(--primary); color: #000; font-weight: bold; }
.status-completado { background: transparent; color: var(--primary); }
.status-proximo { background: rgba(255, 255, 255, 0.05); color: #888; border-color: rgba(255, 255, 255, 0.2); }

/* --- TORNEO DETAIL UI --- */
.torneo-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all 0.3s;
}

.torneo-modal.active { opacity: 1; visibility: visible; }

.torneo-modal-backdrop {
  position: absolute; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9); backdrop-filter: blur(5px);
}

.torneo-modal-panel {
  width: 90%; max-width: 400px;
  background: #000; border: 2px solid var(--primary);
  position: relative; max-height: 85vh; overflow-y: auto; padding: 20px;
  clip-path: polygon(0 20px, 20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}

.locke-hero-box {
  width: 100%; height: 200px;
  background: rgba(var(--primary-rgb), 0.05); border: 2px solid var(--primary);
  display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
  overflow: hidden;
  position: relative;
}

.locke-hero-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.locke-info-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 5px; margin-bottom: 5px;
}

.locke-info-block {
  border: 1px solid var(--primary); color: var(--primary); font-size: 0.65rem;
  padding: 4px; text-align: center; font-weight: bold;
}

.locke-info-block.solid { background: var(--primary); color: black; }

.locke-sub-row {
  display: grid; grid-template-columns: 2fr 2fr; gap: 5px; margin-bottom: 20px;
}

.locke-stars-box {
  display: flex; justify-content: center; gap: 10px; border: 1px solid var(--primary); padding: 4px;
}

.battle-star { font-size: 1.2rem; color: var(--primary); opacity: 0.2; }
.battle-star.active { opacity: 1; text-shadow: 0 0 10px var(--primary); }

.locke-main-interface {
  display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px;
}

.locke-nav-stack { display: flex; flex-direction: column; gap: 10px; }

.locke-nav-btn {
  border: 1px solid var(--primary); background: transparent; color: var(--primary);
  font-family: "Airlock", sans-serif; font-size: 0.9rem; padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center; cursor: pointer; transition: all 0.2s;
  clip-path: polygon(0 8px, 8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.locke-nav-btn.active {
  background: var(--primary);
  color: #000;
}

.locke-nav-btn:disabled, .locke-nav-btn.disabled {
  border-color: rgba(var(--primary-rgb), 0.2);
  color: rgba(var(--primary-rgb), 0.3);
  cursor: not-allowed;
  pointer-events: none;
}

.locke-section-dynamic-content {
  margin-top: 15px;
  padding: 15px;
  border: 1px dashed rgba(var(--primary-rgb), 0.3);
  background: rgba(var(--primary-rgb), 0.02);
  min-height: 120px;
  margin-bottom: 20px;
}

.locke-content-placeholder {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  margin-top: 40px;
  letter-spacing: 2px;
}

.locke-participants-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.locke-participant-chip {
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--primary);
  display: flex;
  flex-direction: column;
}

.lpc-name { font-size: 0.7rem; font-weight: bold; color: #fff; }
.lpc-points { font-size: 0.6rem; color: var(--primary); }

.locke-battles-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lbi-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lbi-label { font-size: 0.65rem; color: rgba(255, 255, 255, 0.5); }
.lbi-val { font-size: 0.8rem; font-weight: bold; color: var(--primary); }

.lbi-progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.lbi-progress-fill {
  height: 100%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  transition: width 0.5s ease-out;
}

.locke-rules-box {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #ccc;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 5px;
}

.locke-rules-box::-webkit-scrollbar { width: 3px; }
.locke-rules-box::-webkit-scrollbar-thumb { background: var(--primary); }

.locke-apuntarse-btn {
  background: var(--primary); color: black; display: flex; align-items: center;
  justify-content: center; font-family: "Airlock", sans-serif; font-size: 1.1rem;
  font-weight: bold; cursor: pointer;
}

.locke-chart-container {
  border: 1px solid white; padding: 15px; position: relative;
}

.locke-chart-year-tab {
  position: absolute; top: -10px; left: 10px; background: white;
  color: black; font-size: 0.6rem; padding: 2px 5px;
}

.locke-chart-header {
  border-left: 4px solid var(--primary); padding-left: 10px;
  font-size: 0.8rem; color: white; margin-bottom: 20px;
}

#torneo-detalle-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

.torneo-detalle-layout {
  padding: 10px 10px 90px !important;
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1;
  min-height: min-content;
}

.locke-chart-bars,
#td-points-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 230px !important;
  min-height: 230px !important;
  padding: 15px 8px 30px !important;
  box-sizing: border-box;
}

.locke-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 65px;
  height: 100%;
  justify-content: flex-end;
}
.locke-bar-val {
  font-family: 'Airlock', sans-serif;
  font-size: 0.8rem;
  margin-bottom: 6px;
  font-weight: bold;
  color: var(--primary);
  text-shadow: 0 0 5px rgba(var(--primary-rgb), 0.4);
}
.locke-bar-fill {
  width: 28px;
  max-width: 36px;
  border-radius: 2px 2px 0 0;
  background: var(--primary);
  box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.4);
  transition: height 0.3s ease;
}
.locke-bar-label {
  font-family: 'Airlock', sans-serif;
  font-size: 0.6rem;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
  text-align: center;
}

/* --- FORMATO SCREEN --- */
#formato-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  animation: authFadeIn 0.3s ease;
}
#formato-screen:not(.hidden) { display: flex; }

.formato-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 10px;
  flex: 1;
  overflow-y: auto;
  padding: 10px 20px 30px 20px;
}
.formato-container::-webkit-scrollbar {
  width: 4px;
}
.formato-container::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), 0.3);
}

.formato-header {
  border: 1px solid var(--primary);
  padding: 8px 15px;
  font-family: "Airlock", sans-serif;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--primary-dim) 0%, transparent 100%);
}

.formato-content-box {
  border: 1px solid var(--primary);
  background: rgba(255, 255, 255, 0.02);
  padding: 15px;
  height: 320px;
  display: flex;
  flex-direction: column;
}

.formato-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.4;
  resize: none;
  width: 100%;
  outline: none;
  overflow-y: auto;
}
.formato-textarea::-webkit-scrollbar {
  width: 4px;
}
.formato-textarea::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), 0.3);
}

.formato-textarea:disabled,
.formato-textarea[readonly] {
  color: #ddd;
  opacity: 1;
  cursor: default;
}

.formato-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  padding: 0 40px;
}

/* --- ROOM SELECTOR --- */
.room-selector-layout {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 0 10px;
}

.rs-card {
  border: 1px solid var(--primary);
  background: rgba(var(--primary-rgb), 0.03);
  padding: 25px 28px;
  position: relative;
  clip-path: polygon(0 15px, 15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
}

.rs-card-header {
  font-family: "Airlock", sans-serif;
  font-size: 0.9rem;
  color: var(--primary);
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.2);
  padding-bottom: 10px;
  text-align: center;
}

.rs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  gap: 15px;
}

.rs-divider::before, .rs-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #333;
}

.my-rooms-grid {
  display: grid;
  gap: 10px;
}

.room-item {
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  padding: 12px 20px;
  background: rgba(var(--primary-rgb), 0.03);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.room-item:hover {
  border-color: var(--primary);
}

.room-item-name {
  font-size: 0.8rem;
  font-weight: bold;
}

.room-item-code {
  font-size: 0.6rem;
  opacity: 0.5;
  font-family: monospace;
}

/* --- CUSTOM MODALS --- */
.custom-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.custom-modal.hidden {
    display: none;
    opacity: 0;
}

.custom-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.custom-modal-panel {
    position: relative;
    background: var(--panel-bg);
    border: 2px solid var(--primary);
    width: 100%;
    max-width: 400px;
    animation: modalSlideIn 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 0 30px rgba(255, 70, 85, 0.2);
    clip-path: polygon(
        0 15px,
        15px 0,
        100% 0,
        100% calc(100% - 15px),
        calc(100% - 15px) 100%,
        0 100%
    );
}

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

.custom-modal-header {
    padding: 15px 20px;
    background: var(--primary);
    color: black;
    font-weight: bold;
}

.custom-modal-title {
    font-family: 'Airlock', sans-serif;
    letter-spacing: 2px;
    font-size: 0.9rem;
}

.custom-modal-body {
    padding: 30px 20px;
    text-align: center;
    color: white;
    font-family: 'Airlock', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.custom-modal-footer {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    border-top: 1px solid rgba(var(--primary-rgb), 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 10px 20px;
    font-family: 'Airlock', sans-serif;
    cursor: pointer;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.btn-secondary:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

/* --- BATCH USER CHECKBOXES --- */

#batch-user-checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
}

.batch-user-label {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* --- RANKING & COMBATES SCREEN --- */
.ranking-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0;
  gap: 15px;
  animation: fadeIn 0.5s ease;
}

.ranking-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 15px;
  margin-top: 10px;
}

.rank-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  color: var(--text-muted);
  padding: 8px 15px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.7rem;
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: all 0.3s ease;
  flex: 1;
  max-width: 110px;
}

.rank-tab-btn.active {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.4);
}

.rank-tab-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.ranking-content-area {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
}

.rank-tab-content {
  display: none;
}

.rank-tab-content.active {
  display: flex;
  flex-direction: column;
}

/* --- LOCKY TABLES --- */
.table-container {
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(var(--primary-rgb), 0.1);
  padding: 5px;
  clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
  margin-bottom: 70px; /* Space for add button */
}

.locke-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: 'Airlock', sans-serif;
  font-size: 0.7rem;
  color: #fff;
}

.locke-table th {
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  text-align: center;
  padding: 12px 8px;
  border-bottom: 2px solid var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.locke-table td {
  padding: 14px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
  text-align: center;
}

.locke-table tbody tr:hover {
  background: rgba(var(--primary-rgb), 0.05);
}

.role-badge {
  padding: 2px 5px;
  font-size: 0.5rem;
  border-radius: 3px;
  font-weight: bold;
}

.role-badge.god {
  background: linear-gradient(45deg, #ffd700, #ff8c00);
  color: #000;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  border: 1px solid #fff;
}

.role-badge.admin {
  background: var(--primary);
  color: #fff;
}

.role-badge.moderator {
  background: #a855f7;
  color: #fff;
}

.role-badge.player, .role-badge.user {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
}

.stats-cell {
  padding: 5px 2px !important;
}

.stats-badges {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.stat-badge {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.6rem;
  min-width: 68px;
  justify-content: center;
}

.stat-badge span {
  font-weight: bold;
  margin-right: 3px;
  font-size: 0.5rem;
}

.stat-badge.vgc span { color: #5bc0de; } /* Blue for VGC */
.stat-badge.singles span { color: #f0ad4e; } /* Orange for Singles */
.stat-badge.build span { color: #5cb85c; } /* Green for Build */

.stat-badge:hover {
  background: rgba(var(--primary-rgb), 0.1);
  border-color: var(--primary);
}

/* --- COMPACT COMBATS --- */
.combat-pair {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  font-size: 0.65rem;
  width: 100%;
}

.vs-divider {
  font-size: 0.5rem;
  color: var(--primary);
  opacity: 0.5;
  margin: 1px 0;
  font-weight: bold;
}

.combat-info-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.locke-tag {
  color: #fff;
  font-size: 0.55rem;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.combat-result-mini {
  display: flex;
  align-items: center;
  gap: 8px;
}

.res-num {
  font-weight: bold;
  font-size: 0.75rem;
}

.split-tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 4px;
  font-size: 0.5rem;
  border-radius: 2px;
  color: #aaa;
}

.pending-tag {
  font-size: 0.55rem;
  color: var(--primary);
  letter-spacing: 1px;
  animation: pulseOpacity 1.5s infinite;
}

@keyframes pulseOpacity {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* --- FLOATING FILTER BUTTON --- */
.btn-float-filter {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary);
  color: #000;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 0 15px var(--primary);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-float-filter:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 0 25px var(--primary);
}

/* --- FILTERS SIDEBAR --- */
.filters-sidebar {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100%;
  background: rgba(10, 10, 10, 0.95);
  border-left: 2px solid var(--primary);
  backdrop-filter: blur(10px);
  z-index: 2000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.filters-sidebar.active {
  right: 0;
}

.filters-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 15px;
  margin-bottom: 20px;
  font-family: 'Airlock', sans-serif;
  color: var(--primary);
}

.filters-sidebar-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.filter-group-sidebar {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.filter-group-sidebar label {
  font-size: 0.6rem;
  color: var(--primary);
  letter-spacing: 1px;
}

.filter-group-sidebar input,
.filter-group-sidebar select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px;
  color: #fff;
  font-size: 0.7rem;
  border-radius: 4px;
}

.filter-group-sidebar input:focus {
  border-color: var(--primary);
  outline: none;
}

/* --- CLICKABLE ROWS --- */
.admin-row-clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-row-clickable:hover {
  background: rgba(255, 0, 0, 0.1) !important;
  box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.2);
}

.admin-row-clickable:active {
  background: rgba(255, 0, 0, 0.2) !important;
}

/* --- ENHANCED MODAL --- */
.form-section {
  margin-bottom: 25px;
  background: rgba(255, 255, 255, 0.02);
  padding: 15px;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.section-title {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: var(--primary);
  margin-bottom: 15px;
  font-weight: bold;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

#section-result {
  transition: all 0.3s ease;
  overflow: hidden;
}

#section-result.hidden {
  max-height: 0;
  margin-bottom: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

/* --- HIGHLIGHTING --- */
.winner-text {
  color: #00ff88 !important;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

#add-combat-container {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: auto;
}

#btn-add-combat {
  box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.3);
}

/* --- MODAL --- */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.modal-content {
  background: #0d0d0d;
  border: 1px solid var(--primary);
  width: 90%;
  max-width: 400px;
  padding: 25px;
  clip-path: polygon(25px 0, 100% 0, 100% calc(100% - 25px), calc(100% - 25px) 100%, 0 100%, 0 25px);
  box-shadow: 0 0 50px rgba(var(--primary-rgb), 0.2);
}

.modal-header {
  font-family: 'Airlock', sans-serif;
  color: var(--primary);
  font-size: 1.4rem;
  margin-bottom: 20px;
  text-align: center;
  letter-spacing: 2px;
}

.form-group-ranking {
  margin-bottom: 15px;
}

.form-group-ranking label {
  display: block;
  font-size: 0.65rem;
  color: #aaa;
  margin-bottom: 5px;
  letter-spacing: 1px;
}

.form-group-ranking input, .form-group-ranking select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  padding: 10px;
  color: #fff;
  font-family: 'Airlock', sans-serif;
  outline: none;
}

/* --- FILTERS --- */
.filters-container {
  display: flex;
  gap: 10px;
  padding: 0 15px;
  margin-bottom: 5px;
}

.filter-input, .filter-select {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(var(--primary-rgb), 0.2) !important;
  color: #fff !important;
  padding: 8px 12px !important;
  font-family: 'Airlock', sans-serif !important;
  font-size: 0.65rem !important;
  outline: none;
  flex: 1;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.filter-input:focus {
  border-color: var(--primary) !important;
  background: rgba(var(--primary-rgb), 0.05) !important;
}

@media (max-width: 400px) {
  .filters-container {
    flex-direction: column;
    gap: 5px;
  }
}


/* ============================================
   ACTION ICON BUTTONS (Dashboard 3-button row)
   ============================================ */
.action-buttons--icons {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: flex-start;
  padding: 8px 10px;
}

.action-icon-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  transition: transform 0.15s ease;
  max-width: 90px;
}

.action-icon-btn:active {
  transform: scale(0.93);
}

.action-icon-img {
  width: 64px;
  height: 64px;
  border: 2px solid rgba(var(--primary-rgb), 0.4);
  background: rgba(var(--primary-rgb), 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.action-icon-btn:hover .action-icon-img,
.action-icon-btn.highlight .action-icon-img {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.15);
  box-shadow: 0 0 14px rgba(var(--primary-rgb), 0.4);
}

.action-icon-label {
  font-family: 'Airlock', sans-serif;
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.2s;
}

.action-icon-btn:hover .action-icon-label,
.action-icon-btn.highlight .action-icon-label {
  color: var(--primary);
}

/* Highlight animation overrides for icon buttons */
.action-icon-btn.highlight {
  animation: none;
  background: none;
  color: inherit;
}

/* ============================================
   PDF UPLOAD LABEL (Formato screen)
   ============================================ */
.pdf-upload-label {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: rgba(var(--primary-rgb), 0.06);
  border: 1px dashed rgba(var(--primary-rgb), 0.4);
  color: var(--primary);
  font-family: 'Airlock', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.pdf-upload-label:hover {
  background: rgba(var(--primary-rgb), 0.14);
  border-color: var(--primary);
}

/* ============================================
   HALL OF FAME SCREEN
   ============================================ */
#hall-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.4s ease;
  min-height: 0;
}

.hall-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 15px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hall-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hall-loading {
  text-align: center;
  opacity: 0.4;
  font-family: 'Airlock', sans-serif;
  font-size: 0.65rem;
  margin-top: 60px;
  letter-spacing: 2px;
}

.hall-card {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  border-left: 3px solid var(--primary);
  overflow: hidden;
  animation: slideInLeft 0.35s ease;
  position: relative;
}

.hall-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: rgba(var(--primary-rgb), 0.08);
}

.hall-card-image-placeholder {
  width: 100%;
  height: 180px;
  background: rgba(var(--primary-rgb), 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(var(--primary-rgb), 0.3);
  font-family: 'Airlock', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.1);
}

.hall-card-body {
  padding: 12px 14px;
}

.hall-card-title {
  font-family: 'Airlock', sans-serif;
  font-size: 0.85rem;
  color: var(--primary);
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(var(--primary-rgb), 0.4);
  margin-bottom: 8px;
}

.hall-card-desc {
  font-family: 'Airlock', sans-serif;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.hall-card-edit-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(var(--primary-rgb), 0.35);
  color: var(--primary);
  font-size: 0.55rem;
  padding: 3px 8px;
  cursor: pointer;
  font-family: 'Airlock', sans-serif;
  letter-spacing: 1px;
  transition: background 0.15s;
}

.hall-card-edit-btn:hover {
  background: rgba(var(--primary-rgb), 0.2);
}

.hall-admin-panel {
  margin-top: 6px;
}


/* --- DASHBOARD REDESIGN (Reference Match) --- */
.vertical-actions-container {
    margin: 10px 15px;
    padding: 12px;
    background: rgba(var(--primary-rgb), 0.05);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 15px;
}
.vertical-actions { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    align-items: flex-start;
    flex-shrink: 0;
}
.v-action-btn { 
    background: var(--primary); 
    color: black; 
    border: 1px solid var(--primary); 
    padding: 8px 14px; 
    font-family: 'Airlock', sans-serif; 
    font-size: 0.75rem; 
    font-weight: bold; 
    letter-spacing: 1.5px; 
    text-align: left; 
    cursor: pointer; 
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); 
    transition: all 0.2s ease; 
    min-width: 130px;
    width: auto;
    white-space: nowrap;
    box-sizing: border-box;
}

.v-action-btn:hover,
.v-action-btn:active { background: black; color: var(--primary); transform: scale(0.98); }

/* --- DASHBOARD LATEST ANNOUNCEMENT BOX --- */
.dashboard-announcement-box {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(var(--primary-rgb), 0.05);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.dashboard-announcement-box:hover {
  background: rgba(var(--primary-rgb), 0.08);
  border-color: rgba(var(--primary-rgb), 0.4);
}

.dashboard-announcement-box:active {
  transform: scale(0.98);
}

.dashboard-announcement-box .ann-box-header {
  font-family: 'Airlock', sans-serif;
  font-size: 0.6rem;
  color: var(--primary);
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.15);
  padding-bottom: 3px;
  margin-bottom: 2px;
}

.dashboard-announcement-box .ann-box-header span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.dashboard-announcement-box .ann-box-body {
  font-size: 0.65rem;
  color: #ccc;
  line-height: 1.3;
  overflow-y: auto;
  flex: 1;
  word-break: break-word;
  padding-right: 4px;
}

/* Custom scrollbar for announcement body */
.dashboard-announcement-box .ann-box-body::-webkit-scrollbar {
  width: 3px;
}
.dashboard-announcement-box .ann-box-body::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), 0.3);
  border-radius: 2px;
}

.blink-dot {
  width: 5px;
  height: 5px;
  background-color: var(--primary);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--primary);
  animation: blinker 1.5s linear infinite;
}

@keyframes blinker {
  50% { opacity: 0; }
}

.stats-footer-icons { 
    display: flex; 
    justify-content: space-between; 
    gap: 10px; 
    margin: 10px 15px; 
}
.stat-icon-box { 
    flex: 1; 
    border: 1px solid var(--primary); 
    height: 60px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    background: rgba(var(--primary-rgb), 0.05); 
    transition: background 0.2s, transform 0.1s;
}
.stat-icon-box img { 
    width: 45px; 
    height: 45px; 
    object-fit: contain; 
    filter: var(--icon-filter, none) drop-shadow(0 0 5px var(--primary)); 
    transition: filter 0.3s ease, transform 0.2s ease;
}
.stat-icon-box:hover,
.stat-icon-box:active { background: rgba(var(--primary-rgb), 0.3); transform: scale(0.95); }
.hub-ticker-bar {
  background: rgba(0,0,0,0.8);
  border: 1px solid var(--primary);
  margin: 5px 15px;
  padding: 5px 10px;
  display: flex;
  gap: 10px;
  font-family: 'Airlock', sans-serif;
  font-size: 0.65rem;
  overflow: hidden;
}
.ticker-label { color: var(--primary); font-weight: bold; }
.ticker-content { white-space: nowrap; overflow: hidden; }

.dashboard-3d-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

/* --- REFACTORED COMPONENT STYLES --- */

.admin-tools-panel {
  margin-top: 20px;
  padding: 15px;
  border: 1px dashed var(--primary);
  background: rgba(var(--primary-rgb), 0.05);
}

.panel-label {
  font-size: 0.75rem; /* Increased from 0.5rem/0.6rem for legibility */
  color: var(--primary);
  margin-bottom: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.label-mini {
  font-size: 0.65rem; /* Increased from 0.5rem */
  display: block;
  margin-bottom: 5px;
  opacity: 0.7;
  text-transform: uppercase;
}

.input-sm {
  height: 40px !important; /* Increased for better tap area */
  font-size: 0.8rem !important;
  padding: 0 12px !important;
}

.btn-sm {
  font-size: 0.8rem !important;
  padding: 10px !important;
  flex: 1;
}

.custom-modal-header {
  background: var(--primary);
  color: #000;
  padding: 12px 15px;
}

.custom-modal-title {
  font-size: 0.9rem;
  font-weight: bold;
}

.custom-modal-body {
  padding: 20px;
}

.match-info-banner {
  font-size: 0.8rem;
  margin-bottom: 20px;
  color: var(--primary);
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.2);
  padding-bottom: 10px;
}

.helper-text {
  font-size: 0.65rem;
  opacity: 0.5;
  margin-top: 10px;
}

.modal-footer-btns {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  padding: 15px 20px;
}

.btn-modal {
  font-size: 0.8rem !important;
  padding: 10px 20px !important;
}

.admin-logs-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(var(--primary-rgb), 0.1);
}

.log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--primary);
  font-family: 'Airlock', sans-serif;
  font-size: 0.65rem;
}

.log-date {
  color: #888;
  font-size: 0.55rem;
}

.log-action {
  color: #fff;
  flex: 1;
  margin: 0 15px;
}

.log-user {
  color: var(--primary);
  font-weight: bold;
}

/* Redundant safety rule */
.hidden { display: none !important; }


/* --- CUSTOM CHECKBOXES (ADMIN ROLES) --- */
.check-container {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 35px;
  cursor: pointer;
  font-size: 0.7rem;
  color: #ccc;
  min-height: 20px;
}
.check-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}
.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 20px;
  width: 20px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--primary);
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}
.check-container:hover input ~ .checkmark {
  background-color: rgba(var(--primary-rgb), 0.1);
}
.check-container input:checked ~ .checkmark {
  background-color: var(--primary);
}
.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}
.check-container input:checked ~ .checkmark:after {
  display: block;
}
.check-container .checkmark:after {
  left: 7px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid black;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* --- CALENDAR COMPONENT STYLES --- */
.calendar-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 15px;
    gap: 15px;
    overflow-y: auto;
    padding-bottom: 40px;
}

.calendar-header h1 {
    text-align: center;
    font-size: 1.8rem;
    margin: 10px 0;
    letter-spacing: 5px;
    color: white;
    font-family: "Airlock";
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(var(--primary-rgb), 0.05);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    padding: 8px 12px;
    border-radius: 4px;
}

.current-month-display {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Airlock', sans-serif;
    color: var(--primary);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.nav-btn, .btn-today {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary);
    color: var(--primary);
    cursor: pointer;
    padding: 5px 12px;
    font-family: 'Airlock';
    font-size: 0.8rem;
    transition: all 0.2s;
}

.nav-btn:hover, .btn-today:hover {
    background: var(--primary);
    color: black;
}

.calendar-grid-wrapper {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    text-align: center;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.3);
    padding: 10px 0;
    background: rgba(var(--primary-rgb), 0.05);
}

.calendar-grid-header span {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: 'Airlock';
    letter-spacing: 1px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-day {
    aspect-ratio: 1 / 1.1;
    border: 0.5px solid rgba(var(--primary-rgb), 0.15);
    padding: 6px;
    font-size: 0.8rem;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.calendar-day:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

.calendar-day.other-month {
    opacity: 0.2;
}

.calendar-day.today {
    color: var(--primary);
    font-weight: bold;
    background: rgba(var(--primary-rgb), 0.05);
}

.calendar-day.selected {
    border: 1.5px solid var(--primary);
    background: rgba(var(--primary-rgb), 0.2);
    z-index: 2;
}

.day-number {
    font-family: 'Airlock';
    font-size: 0.75rem;
}

.event-indicators {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 70%;
    overflow: hidden;
}

.event-dot {
    font-size: 0.45rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-main);
    line-height: 1;
}

.event-dot::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 5px var(--primary);
}

.events-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
}

.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.3);
    padding-bottom: 12px;
}

.events-title {
    font-family: 'Airlock';
    color: var(--primary);
    letter-spacing: 3px;
    font-size: 1rem;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-events {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-family: 'Airlock';
    letter-spacing: 2px;
    opacity: 0.5;
}

.event-card {
    background: rgba(var(--primary-rgb), 0.03);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    padding: 12px;
    display: flex;
    gap: 15px;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.event-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--primary);
    opacity: 0.5;
}

.event-card:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.4);
}

.event-date-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary);
    padding: 6px;
    min-width: 55px;
    height: 55px;
    font-family: 'Airlock';
    background: rgba(var(--primary-rgb), 0.05);
}

.event-date-box .day { font-size: 1.3rem; line-height: 1; color: white; }
.event-date-box .month { font-size: 0.6rem; color: var(--primary); margin-top: 2px; }

.event-info {
    flex: 1;
}

.event-info h4 {
    margin: 0;
    font-size: 0.95rem;
    color: white;
    font-family: 'Airlock';
    letter-spacing: 1px;
}

.event-info .meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.meta-item { display: flex; align-items: center; gap: 5px; }
.icon-loc { color: var(--primary); font-size: 0.8rem; }

.btn-add-event {
    width: 100%;
    margin-top: 20px;
    background: rgba(var(--primary-rgb), 0.05);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 12px;
    font-family: 'Airlock';
    font-size: 0.9rem;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.3s;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.btn-add-event:hover {
    background: var(--primary);
    color: black;
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.4);
}

.back-footer {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

#event-modal .modal-content {
    border: 1px solid var(--primary);
    background: rgba(0,0,0,0.95);
}

/* ============================================================
   DESKTOP SIDEBAR STYLES (VALORANT FANTASY STYLE)
   ============================================================ */
.desktop-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: 270px;
    min-width: 270px;
    height: 100vh;
    background: rgba(10, 14, 20, 0.95);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-right: 1px solid rgba(var(--primary-rgb), 0.25);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    z-index: 100;
    user-select: none;
  }

  .ds-header {
    padding: 18px 16px 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.08) 0%, transparent 100%);
    box-sizing: border-box;
    overflow: hidden;
  }

  .ds-logo {
    font-family: 'Airlock', sans-serif;
    font-size: 1.05rem;
    color: var(--primary);
    letter-spacing: 1.5px;
    font-weight: bold;
    text-shadow: 0 0 12px rgba(var(--primary-rgb), 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    box-sizing: border-box;
  }

  .ds-terminal-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
  }

  .ds-status-dot {
    width: 6px;
    height: 6px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
    animation: pulse-dot-green 2s infinite;
  }

  .ds-terminal-text {
    font-family: 'Airlock', sans-serif;
    font-size: 0.62rem;
    color: rgba(34, 197, 94, 0.7);
    letter-spacing: 1.5px;
    text-transform: uppercase;
  }

  .ds-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 15px 12px;
    overflow-y: auto;
  }

  .ds-nav::-webkit-scrollbar {
    width: 4px;
  }

  .ds-nav::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.3);
    border-radius: 2px;
  }

  .ds-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-family: 'Airlock', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    transition: all 0.2s ease;
  }

  .ds-nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
  }

  .ds-nav-item.active {
    color: #fff;
    background: rgba(var(--primary-rgb), 0.12);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.15);
  }

  .ds-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 10px var(--primary);
  }

  .ds-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
  }

  .ds-nav-item.active .ds-icon {
    filter: drop-shadow(0 0 5px rgba(var(--primary-rgb), 0.8));
  }

  .ds-label {
    text-transform: uppercase;
  }

  .ds-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .ds-active-hub-pill {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 6px;
    font-family: 'Airlock', sans-serif;
    font-size: 0.65rem;
  }

  .ds-hub-label {
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
  }

  .ds-hub-val {
    color: var(--primary);
    letter-spacing: 1.5px;
    font-weight: bold;
  }

  .ds-music-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(var(--primary-rgb), 0.1);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    border-radius: 6px;
    color: #fff;
    font-family: 'Airlock', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
  }

  .ds-music-btn:hover {
    background: rgba(var(--primary-rgb), 0.2);
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.2);
  }

  .ds-music-btn.muted {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
  }

  .ds-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
  }

  .ds-avatar {
    width: 34px;
    height: 34px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(var(--primary-rgb), 0.4);
    border-radius: 6px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  .ds-avatar svg {
    width: 100%;
    height: 100%;
    fill: var(--primary);
  }

  .ds-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
  }

  .ds-username {
    font-family: 'Airlock', sans-serif;
    font-size: 0.75rem;
    color: #fff;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }


  .ds-role-badge {
    font-family: 'Airlock', sans-serif;
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(var(--primary-rgb), 0.2);
    color: var(--primary);
    letter-spacing: 1px;
    display: inline-block;
    align-self: flex-start;
  }
}

@keyframes pulse-dot-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ============================================================
   WIDESCREEN DESKTOP ADAPTATION (PC)
   ============================================================ */
@media (min-width: 1024px) {
  /* ── PHONE FRAME OVERRIDES ── */
  .phone-frame {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: row !important;
  }

  /* ── DASHBOARD SCREEN ── */
  #dashboard-screen {
    display: grid !important;
    grid-template-columns: 1.2fr 1fr !important;
    grid-template-rows: auto auto auto auto !important;
    gap: 20px !important;
    align-items: start !important;
    padding: 10px 20px !important;
    height: 100% !important;
    overflow-y: auto !important;
  }
  #dashboard-screen .top-bar {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }
  #dashboard-screen .main-title {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    margin-top: 5px !important;
    margin-bottom: 5px !important;
  }
  #dashboard-screen .stats-card {
    grid-column: 1 !important;
    grid-row: 3 !important;
    margin: 0 !important;
  }
  #dashboard-screen .stats-footer-icons {
    grid-column: 1 !important;
    grid-row: 4 !important;
    margin: 0 !important;
  }
  #dashboard-screen .vertical-actions-container {
    grid-column: 1 !important;
    grid-row: 5 !important;
    flex-direction: column !important;
    gap: 15px !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  #dashboard-screen .vertical-actions-container .vertical-actions {
    width: 100% !important;
    gap: 10px !important;
  }
  #dashboard-screen .vertical-actions-container .dashboard-announcement-box {
    width: 100% !important;
    margin-right: 0 !important;
    min-height: 80px !important;
  }
  #dashboard-screen .chart-section {
    grid-column: 2 !important;
    grid-row: 3 / span 3 !important;
    margin: 0 !important;
    height: 100% !important;
    min-height: 480px !important;
    display: flex !important;
    flex-direction: column !important;
  }
  #dashboard-screen .chart-section .chart-container {
    flex: 1 !important;
    height: 100% !important;
    min-height: 440px !important;
  }

  .stat-icon-box {
    width: 60px !important;
    height: 60px !important;
  }

  .stat-icon-box img {
    width: 32px !important;
    height: 32px !important;
  }

  /* ── TORNEOS GRID (Competitions list) ── */
  .torneos-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 20px !important;
  }

  /* ── TORNEO CUADRO & BRACKET ADAPTATION ── */
  .torneo-cuadro-layout {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 20px 30px !important;
  }

  .tc-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  /* ── TORNEO DETALLE (Locke details) ── */
  .torneo-detalle-layout {
    display: grid !important;
    grid-template-columns: 1.2fr 1fr !important;
    gap: 20px !important;
    align-items: start !important;
    height: 100% !important;
    overflow-y: auto !important;
  }
  .torneo-detalle-layout .stats-card {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin: 0 !important;
  }
  .torneo-detalle-layout .control-deck {
    grid-column: 1 !important;
    grid-row: 2 !important;
    margin: 0 !important;
  }
  .torneo-detalle-layout .chart-section {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    margin: 0 !important;
    height: 100% !important;
    min-height: 480px !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .torneo-detalle-layout .chart-section .chart-container {
    flex: 1 !important;
    height: 100% !important;
    min-height: 440px !important;
  }

  /* ── RANKING SCREEN ── */
  .ranking-layout {
    display: grid !important;
    grid-template-columns: 280px 1fr !important;
    grid-template-rows: auto auto 1fr !important;
    gap: 15px 20px !important;
    height: 100% !important;
    padding: 15px !important;
  }

  .ranking-layout.no-sidebar {
    grid-template-columns: 1fr !important;
  }

  .ranking-layout.no-sidebar .filters-sidebar {
    display: none !important;
  }

  .ranking-layout.no-sidebar .ranking-tabs,
  .ranking-layout.no-sidebar .ranking-content-area {
    grid-column: 1 / -1 !important;
  }

  .ranking-layout .top-bar {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }
  .btn-float-filter {
    display: none !important;
  }
  .filters-sidebar {
    grid-column: 1 !important;
    grid-row: 2 / span 2 !important;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: 100% !important;
    height: 100% !important;
    border-left: none !important;
    border-right: 1px solid rgba(var(--primary-rgb), 0.3) !important;
    background: rgba(0, 0, 0, 0.4) !important;
    z-index: 1 !important;
    padding: 10px 15px 10px 0 !important;
    display: flex !important;
    transition: none !important;
  }
  .filters-sidebar-header button {
    display: none !important;
  }
  .ranking-tabs {
    grid-column: 2 !important;
    grid-row: 2 !important;
    margin-top: 0 !important;
    padding: 0 !important;
  }
  .ranking-content-area {
    grid-column: 2 !important;
    grid-row: 3 !important;
    height: 100% !important;
    overflow-y: auto !important;
  }

  /* ── CALENDAR SCREEN ── */
  .calendar-container {
    display: grid !important;
    grid-template-columns: 1.2fr 1fr !important;
    grid-template-rows: auto auto 1fr !important;
    gap: 20px !important;
    padding: 0 20px 20px 20px !important;
    height: 100% !important;
    overflow-y: auto !important;
  }
  .calendar-container .top-bar {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }
  .calendar-container .calendar-header {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
  }
  .calendar-container .calendar-nav {
    grid-column: 1 !important;
    grid-row: 3 !important;
    margin-bottom: 10px !important;
  }
  .calendar-container .calendar-grid-wrapper {
    grid-column: 1 !important;
    grid-row: 4 !important;
    height: fit-content !important;
  }
  .calendar-container .events-section {
    grid-column: 2 !important;
    grid-row: 3 / span 2 !important;
    margin-bottom: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .calendar-container .events-list {
    flex: 1 !important;
    overflow-y: auto !important;
  }

  /* ── PROFILE SCREEN ── */
  .pr-main-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    max-width: 620px !important;
    margin: 0 auto !important;
    padding: 16px !important;
    width: 100% !important;
  }
  .pr-recent-matches {
    margin: 0 !important;
  }
  .pr-recent-list {
    max-height: 350px !important;
    overflow-y: auto !important;
  }

  /* ── ADMIN PANEL SCREEN ── */
  .admin-layout {
    display: grid !important;
    grid-template-columns: 200px 1fr !important;
    gap: 20px !important;
    height: 100% !important;
    padding: 10px !important;
  }
  .admin-nav {
    flex-direction: column !important;
    border-bottom: none !important;
    border-right: 1px solid rgba(var(--primary-rgb), 0.2) !important;
    padding-bottom: 0 !important;
    padding-right: 15px !important;
    overflow-x: visible !important;
    overflow-y: auto !important;
    gap: 10px !important;
  }
  .admin-nav-btn {
    width: 100% !important;
    text-align: left !important;
  }
  .admin-content-area {
    height: 100% !important;
    overflow-y: auto !important;
  }
}

/* Custom Collapsible Folders in Combates Tab */
.locke-folder-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.locke-folder-header {
    background: rgba(var(--primary-rgb), 0.08);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.locke-folder-header:hover {
    background: rgba(var(--primary-rgb), 0.15);
}

.locke-folder-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-family: 'Airlock', monospace;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.folder-icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.locke-count-badge {
    color: #00ff88;
    font-weight: bold;
    font-size: 0.8rem;
}

.locke-folder-arrow, .split-folder-arrow, .matchup-folder-arrow {
    font-size: 0.7rem;
    color: var(--primary);
    transition: transform 0.2s ease;
}

.locke-folder-arrow.expanded, .split-folder-arrow.expanded, .matchup-folder-arrow.expanded {
    transform: rotate(0deg);
}

.locke-folder-arrow:not(.expanded), .split-folder-arrow:not(.expanded), .matchup-folder-arrow:not(.expanded) {
    transform: rotate(-90deg);
}

.locke-folder-content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Split Folder Card */
.split-folder-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.split-folder-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.split-folder-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-family: 'Airlock', monospace;
    font-size: 0.75rem;
}

.split-arrow-indicator {
    font-size: 0.55rem;
    color: var(--primary);
    transition: transform 0.2s ease;
    display: inline-block;
}

.split-arrow-indicator.expanded {
    transform: rotate(0deg);
}

.split-arrow-indicator:not(.expanded) {
    transform: rotate(-90deg);
}

.split-icon {
    width: 14px;
    height: 14px;
    color: var(--primary);
}

.split-count-badge {
    color: #00ff88;
    font-weight: bold;
}

.split-folder-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* Match Row */
.match-folder-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.15s ease;
}

.match-folder-row:last-child {
    border-bottom: none;
}

.match-folder-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.admin-match-clickable {
    cursor: pointer;
}

.match-players-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    text-align: center;
    gap: 2px;
}

.match-player-item {
    font-size: 0.75rem;
    font-family: 'Airlock', monospace;
    color: #fff;
    letter-spacing: 0.5px;
}

.match-player-item.winner-highlight {
    color: #00ff88;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
}

.match-vs-divider {
    font-size: 0.45rem;
    color: var(--primary);
    font-family: 'Airlock', monospace;
    letter-spacing: 1px;
}

.match-info-columns {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 30px;
}

.match-score-col {
    width: 60px;
    text-align: center;
}

.match-score {
    font-size: 0.85rem;
    font-weight: bold;
    font-family: monospace;
    color: #00ff88;
}

.match-score.pending {
    font-size: 0.55rem;
    color: #ffaa00;
    font-family: 'Airlock', monospace;
}

.match-locke-col {
    font-size: 0.55rem;
    color: #888;
    text-transform: uppercase;
    width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.match-split-col {
    font-size: 0.75rem;
    font-family: monospace;
    color: #fff;
    width: 15px;
    text-align: center;
}

.match-edit-col {
    width: 20px;
    text-align: center;
    font-size: 0.7rem;
    cursor: pointer;
}

.match-pencil-btn {
    opacity: 0.6;
    transition: opacity 0.15s;
}

.match-pencil-btn:hover {
    opacity: 1;
}

/* Matchup Folder Card */
.matchup-folder-card {
    background: rgba(var(--primary-rgb), 0.02);
    border: 1px solid rgba(var(--primary-rgb), 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 0 5px 15px; /* Indented inside split folder */
}

.matchup-folder-header {
    background: rgba(0, 0, 0, 0.15);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.matchup-folder-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #eee;
    font-family: 'Airlock', monospace;
    font-size: 0.65rem;
}

.matchup-count-badge {
    color: var(--primary);
    font-weight: bold;
    font-size: 0.6rem;
    opacity: 0.85;
}

.matchup-folder-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@keyframes pulse-opacity {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@media (max-width: 600px) {
    .btn-text {
        display: none !important;
    }
}

/* ============================================================
   MOBILE SMALL SCREEN TEXT OVERFLOW & SPACE FIXES (< 480px / < 380px)
   ============================================================ */
@media (max-width: 480px) {
  .top-bar {
    height: 40px;
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    padding: 0;
    align-items: stretch;
    width: 100%;
    background: rgba(10, 14, 20, 0.95);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.3);
  }

  .top-segment {
    height: 100%;
    padding: 0 4px;
    font-size: 0.6rem;
    letter-spacing: 0.2px;
  }

  .seg-role {
    width: 46px;
    min-width: 46px;
    font-size: 0.52rem;
  }

  .seg-year {
    width: 42px;
    min-width: 42px;
  }

  .seg-name {
    width: auto;
    max-width: 75px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .seg-hub {
    flex: 1;
    min-width: 0;
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .seg-menu {
    width: 40px;
    min-width: 40px;
    font-size: 1.25rem !important;
    font-weight: bold;
    flex-shrink: 0;
  }

  .seg-back {
    padding: 0 8px;
    font-size: 0.6rem;
    background: rgba(var(--primary-rgb), 0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .main-title {
    font-size: 1.1rem;
    letter-spacing: 1.5px;
    margin: 8px 0;
  }

  .stats-card {
    margin: 8px 10px;
    padding: 10px;
  }

  .stats-header {
    gap: 6px;
  }

  .box-id, .box-lvl {
    font-size: 0.65rem;
    padding: 2px 5px;
  }

  .stat-row {
    margin-bottom: 6px;
    gap: 6px;
  }

  .stat-label {
    font-size: 0.6rem;
    width: 58px;
    min-width: 58px;
  }

  .stat-value {
    font-size: 0.72rem;
    min-width: 32px;
  }

  .stats-footer-icons {
    margin: 8px 10px;
    gap: 6px;
  }

  .stat-icon-box {
    height: 52px;
  }

  .stat-icon-box img {
    width: 34px !important;
    height: 34px !important;
  }

  .vertical-actions-container {
    margin: 8px 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
  }

  .vertical-actions {
    display: flex;
    flex-direction: column !important;
    gap: 7px;
    width: 155px;
    min-width: 155px;
    flex-shrink: 0;
  }

  .v-action-btn {
    width: 100%;
    min-width: 0;
    font-size: 0.72rem !important;
    font-weight: bold;
    padding: 8px 8px !important;
    letter-spacing: 0.8px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: normal !important;
  }

  .dashboard-announcement-box {
    flex: 1;
    min-width: 0;
    min-height: auto;
    padding: 6px 8px;
  }

  .ann-box-header {
    font-size: 0.58rem;
  }

  .ann-box-body {
    font-size: 0.62rem;
    line-height: 1.25;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .chart-section {
    margin: 8px 10px;
    padding: 10px;
  }

  .chart-title {
    font-size: 0.75rem;
    letter-spacing: 1px;
  }

  .custom-modal-panel {
    max-width: 95%;
    padding: 14px;
  }

  .custom-modal-title {
    font-size: 0.85rem;
    word-break: break-word;
  }

  .custom-modal-body {
    font-size: 0.75rem;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  #ranking-chart {
    height: 240px !important;
  }
}

@media (max-width: 380px) {
  .top-segment {
    padding: 0 2px;
    font-size: 0.5rem;
  }

  .seg-role {
    max-width: 42px;
  }

  .seg-year {
    max-width: 38px;
  }

  .seg-name {
    max-width: 55px;
  }

  .seg-hub {
    max-width: 60px;
  }

  .vertical-actions {
    width: 146px;
    min-width: 146px;
    gap: 6px;
  }

  .v-action-btn {
    font-size: 0.68rem !important;
    padding: 7px 6px !important;
    letter-spacing: 0.5px !important;
    text-align: center !important;
  }

  .dashboard-announcement-box {
    padding: 4px 6px;
  }

  .ann-box-header {
    font-size: 0.54rem;
  }

  .ann-box-body {
    font-size: 0.58rem;
  }

  .stat-label {
    font-size: 0.55rem;
    width: 50px;
    min-width: 50px;
  }

  .stat-value {
    font-size: 0.65rem;
  }
}

@media (max-width: 340px) {
  .vertical-actions {
    width: 136px;
    min-width: 136px;
  }

  .v-action-btn {
    font-size: 0.62rem !important;
    padding: 6px 4px !important;
    letter-spacing: 0.2px !important;
  }
}

/* PAPELERA & RECUPERACIÓN — ESTILOS DE ALTO CONTRASTE */
.trash-list-container {
  background: rgba(15, 20, 30, 0.95);
  border: 1px solid rgba(var(--primary-rgb), 0.4);
  border-radius: 10px;
  padding: 16px;
  min-height: 140px;
  color: #ffffff;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.trash-card-item {
  background: rgba(var(--primary-rgb), 0.12);
  border: 1px solid rgba(var(--primary-rgb), 0.4);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
    color: #eee;
    font-family: 'Airlock', monospace;
    font-size: 0.65rem;
}

.matchup-count-badge {
    color: var(--primary);
    font-weight: bold;
    font-size: 0.6rem;
    opacity: 0.85;
}

.matchup-folder-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@keyframes pulse-opacity {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@media (max-width: 600px) {
    .btn-text {
        display: none !important;
    }
}

/* ============================================================
   MOBILE SMALL SCREEN TEXT OVERFLOW & SPACE FIXES (< 480px / < 380px)
   ============================================================ */
@media (max-width: 480px) {
  .top-bar {
    height: 40px;
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    padding: 0;
    align-items: stretch;
    width: 100%;
    background: rgba(10, 14, 20, 0.95);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.3);
  }

  .top-segment {
    height: 100%;
    padding: 0 5px;
    font-size: 0.62rem;
    letter-spacing: 0.2px;
  }

  .seg-role {
    width: 50px;
    min-width: 50px;
    font-size: 0.55rem;
  }

  .seg-year {
    width: 45px;
    min-width: 45px;
  }

  .seg-name {
    width: auto;
    max-width: 85px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .seg-hub {
    flex: 1;
    min-width: 0;
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .seg-menu {
    width: 44px;
    min-width: 44px;
    font-size: 1.35rem !important;
    font-weight: bold;
    flex-shrink: 0;
  }

  .main-title {
    font-size: 1.2rem;
    letter-spacing: 2px;
  }

  .v-action-btn {
    width: 100%;
    min-width: 0;
    font-size: 0.72rem !important;
    font-weight: bold;
    padding: 8px 8px !important;
    letter-spacing: 0.8px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: normal !important;
  }

  .dashboard-announcement-box {
    flex: 1;
    min-width: 0;
    min-height: auto;
    padding: 6px 8px;
  }

  .ann-box-header {
    font-size: 0.65rem;
  }

  .ann-box-body {
    font-size: 0.7rem;
    overflow-wrap: break-word;
  }

  .custom-modal-panel {
    max-width: 92%;
    padding: 15px;
  }

  .custom-modal-title {
    font-size: 0.9rem;
  }

  .custom-modal-body {
    font-size: 0.8rem;
    word-break: break-word;
  }

  #ranking-chart {
    height: 280px !important;
  }
}

@media (max-width: 380px) {
  .top-segment {
    padding: 0 3px;
    font-size: 0.52rem;
  }

  .seg-role {
    max-width: 55px;
  }

  .seg-year {
    max-width: 45px;
  }

  .seg-name {
    max-width: 65px;
  }

  .seg-hub {
    max-width: 70px;
  }

  .stats-header {
    flex-wrap: wrap;
    gap: 5px;
  }

  .box-id, .box-lvl {
    font-size: 0.65rem;
  }

  .stat-label {
    font-size: 0.65rem;
    width: 60px;
  }

  .stat-value {
    font-size: 0.7rem;
  }
}

/* PAPELERA & RECUPERACIÓN — ESTILOS DE ALTO CONTRASTE */
.trash-list-container {
  background: rgba(15, 20, 30, 0.95);
  border: 1px solid rgba(var(--primary-rgb), 0.4);
  border-radius: 10px;
  padding: 16px;
  min-height: 140px;
  color: #ffffff;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.trash-card-item {
  background: rgba(var(--primary-rgb), 0.12);
  border: 1px solid rgba(var(--primary-rgb), 0.4);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.trash-card-item:hover {
  border-color: rgba(var(--primary-rgb), 0.8);
  transform: translateY(-2px);
}

/* ============================================================
   PWA UPDATE & INSTALL NOTIFICATION BANNERS
   ============================================================ */
.pwa-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 480px;
  background: rgba(10, 12, 18, 0.96);
  border: 1.5px solid var(--primary, #ff4d4d);
  box-shadow: 0 0 25px var(--primary-glow, rgba(255, 77, 77, 0.45)), inset 0 0 15px rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  padding: 12px 14px;
  z-index: 10000;
  backdrop-filter: blur(10px);
  animation: slideUpBanner 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-banner.hidden {
  display: none !important;
}

@keyframes slideUpBanner {
  from {
    opacity: 0;
    transform: translate(-50%, 35px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--primary, #ff4d4d);
  background: rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.pwa-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pwa-banner-title {
  font-family: 'Airlock', sans-serif;
  font-size: 0.7rem;
  color: var(--primary, #ff4d4d);
  letter-spacing: 1px;
  font-weight: bold;
}

.pwa-banner-sub {
  font-size: 0.58rem;
  color: #ddd;
  line-height: 1.25;
}

.pwa-banner-close {
  background: transparent;
  border: none;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-banner-close:hover {
  color: #ffffff;
}

/* ==========================================================================
   TÉRMINOS DE USO Y POLÍTICA DE PRIVACIDAD (LEGAL MODULE)
   ========================================================================== */

/* --- VISTAS LEGALES DE PANTALLA COMPLETA --- */
#terminos-screen,
#privacidad-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  animation: fadeIn 0.35s ease;
  padding-bottom: 30px;
}

.legal-content {
  padding: 10px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.legal-header {
  text-align: center;
  margin-bottom: 25px;
}

.legal-title {
  color: var(--primary);
  font-family: 'Airlock', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 3px;
  margin: 0 0 5px 0;
  text-shadow: 0 0 15px rgba(var(--primary-rgb), 0.45);
  word-break: break-word;
}

.legal-subtitle {
  font-size: 0.68rem;
  color: #aaa;
  letter-spacing: 1.5px;
  font-family: 'Airlock', monospace;
  margin: 0;
}

.legal-terminal {
  background: rgba(10, 12, 18, 0.85);
  border: 1px solid rgba(var(--primary-rgb), 0.35);
  border-radius: 8px;
  padding: 25px 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.legal-terminal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(var(--primary-rgb), 0.02) 2px
  );
  pointer-events: none;
}

.legal-intro {
  margin-bottom: 25px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #eee;
  padding: 12px 16px;
  background: rgba(var(--primary-rgb), 0.08);
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
}

.legal-section {
  margin-bottom: 28px;
  border-left: 2px solid rgba(var(--primary-rgb), 0.6);
  padding-left: 18px;
}

.legal-section:last-child {
  margin-bottom: 15px;
}

.legal-section h3 {
  font-family: 'Airlock', sans-serif;
  font-size: 0.95rem;
  color: var(--primary);
  margin: 0 0 10px 0;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.legal-section p {
  font-size: 0.8rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 10px 0;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-list {
  padding-left: 20px;
  margin: 10px 0;
  list-style: square;
}

.legal-list li {
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 6px;
}

.legal-contact-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px dashed rgba(var(--primary-rgb), 0.4);
  padding: 12px 15px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #fff;
  margin: 12px 0 !important;
}

.legal-link {
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  transition: opacity 0.2s;
}

.legal-link:hover {
  opacity: 0.8;
}

/* --- VISOR MODAL LEGAL (GLOBAL) --- */
#legal-viewer-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 15px !important;
  box-sizing: border-box !important;
}

#legal-viewer-modal.hidden {
  display: none !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

#legal-viewer-modal:not(.hidden) {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#legal-viewer-modal .custom-modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.94) !important;
  backdrop-filter: blur(10px) !important;
  z-index: 9999999 !important;
}

.legal-modal-panel {
  z-index: 10000000 !important;
  position: relative !important;
  max-width: 720px !important;
  width: 100% !important;
  max-height: 88vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: rgba(12, 14, 20, 0.98) !important;
  border: 2px solid var(--primary) !important;
  border-radius: 8px !important;
  box-shadow: 0 0 45px rgba(var(--primary-rgb), 0.6) !important;
  clip-path: none !important;
  animation: modalSlideIn 0.25s cubic-bezier(0.23, 1, 0.32, 1) !important;
}

.legal-modal-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 12px 18px !important;
  background: rgba(0, 0, 0, 0.85) !important;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.3) !important;
  flex-shrink: 0 !important;
}

.legal-tab-group {
  display: flex !important;
  gap: 8px !important;
}

.legal-tab-btn {
  background: transparent !important;
  border: 1px solid rgba(var(--primary-rgb), 0.4) !important;
  color: #888 !important;
  font-family: 'Airlock', sans-serif !important;
  font-size: 0.65rem !important;
  letter-spacing: 1px !important;
  padding: 6px 12px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}

.legal-tab-btn.active {
  background: var(--primary) !important;
  color: #000 !important;
  border-color: var(--primary) !important;
  font-weight: bold !important;
  box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.4) !important;
}

.legal-tab-btn:hover:not(.active) {
  border-color: var(--primary) !important;
  color: #fff !important;
}

.legal-modal-close {
  background: transparent !important;
  border: none !important;
  color: #fff !important;
  font-size: 1.6rem !important;
  line-height: 1 !important;
  cursor: pointer !important;
  padding: 0 5px !important;
  transition: color 0.2s !important;
}

.legal-modal-close:hover {
  color: var(--primary) !important;
}

.legal-modal-body {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  padding: 20px 24px !important;
  font-size: 0.82rem !important;
  line-height: 1.65 !important;
  color: #e0e0e0 !important;
  background: rgba(5, 7, 10, 0.8) !important;
  -webkit-overflow-scrolling: touch !important;
}

.legal-modal-body::-webkit-scrollbar {
  width: 6px;
}

.legal-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.legal-modal-body::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

.legal-modal-footer {
  padding: 12px 18px !important;
  background: rgba(0, 0, 0, 0.85) !important;
  border-top: 1px solid rgba(var(--primary-rgb), 0.2) !important;
  display: flex !important;
  justify-content: flex-end !important;
  flex-shrink: 0 !important;
}

.legal-terminal-inner {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* --- MODAL BLOQUEANTE DE CONSENTIMIENTO --- */
.terms-consent-panel {
  max-width: 520px;
  width: 92%;
  padding: 24px;
  background: rgba(14, 16, 24, 0.98);
  border: 2px solid var(--primary);
  box-shadow: 0 0 40px rgba(var(--primary-rgb), 0.45);
  border-radius: 8px;
  animation: modalSlideIn 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.terms-consent-badge {
  display: inline-block;
  font-family: 'Airlock', monospace;
  font-size: 0.6rem;
  color: #000;
  background: var(--primary);
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: bold;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.terms-consent-heading {
  font-family: 'Airlock', sans-serif;
  font-size: 0.95rem;
  color: #fff;
  letter-spacing: 1px;
  margin: 0 0 10px 0;
}

.terms-consent-desc {
  font-size: 0.78rem;
  line-height: 1.55;
  color: #ccc;
  margin: 0 0 15px 0;
}

.terms-consent-links-box {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.terms-consent-links-box button {
  flex: 1;
  padding: 8px 6px;
  font-size: 0.62rem;
  letter-spacing: 0.8px;
  font-family: 'Airlock', sans-serif;
}

/* --- FORMULARIOS DE LOGIN / SIGNUP LEGALES --- */
.auth-legal-group {
  margin: 14px 0 16px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
}

.auth-legal-checkbox {
  margin-top: 2px;
  accent-color: var(--primary);
  width: 17px;
  height: 17px;
  cursor: pointer;
  flex-shrink: 0;
}

.auth-legal-label {
  font-size: 0.68rem;
  color: #ccc;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
}

.auth-legal-link {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 500;
  transition: opacity 0.2s;
}

.auth-legal-link:hover {
  opacity: 0.8;
}

.auth-legal-footer-links {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.auth-legal-footer-link {
  font-size: 0.65rem;
  color: #777;
  text-decoration: none;
  font-family: 'Airlock', sans-serif;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}

.auth-legal-footer-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.auth-legal-footer-sep {
  color: #555;
  font-size: 0.6rem;
}

/* --- DESKTOP SIDEBAR FOOTER LEGAL LINKS --- */
.ds-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.ds-legal-link {
  font-size: 0.62rem;
  color: #777;
  text-decoration: none;
  font-family: 'Airlock', sans-serif;
  letter-spacing: 1px;
  transition: color 0.2s;
}

.ds-legal-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.ds-legal-sep {
  color: #444;
  font-size: 0.6rem;
}

/* ==========================================================================
   REMIX ICON STYLING & CYBER INTEGRATION
   ========================================================================== */
i[class*="ri-"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
  font-size: 1.15em;
  flex-shrink: 0;
}

.ri-xs, .lucide-xs {
  font-size: 0.75em !important;
}

.ri-sm, .lucide-sm {
  font-size: 0.9em !important;
}

.ri-md, .lucide-md {
  font-size: 1.25em !important;
}

.ri-lg, .lucide-lg {
  font-size: 1.5em !important;
}

.ri-xl, .lucide-xl {
  font-size: 2em !important;
}

.ds-icon i[class*="ri-"] {
  font-size: 1.2rem;
  color: inherit;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.ds-nav-item:hover .ds-icon i[class*="ri-"],
.ds-nav-item.active .ds-icon i[class*="ri-"] {
  filter: drop-shadow(0 0 6px var(--primary));
  transform: scale(1.15);
}

.admin-nav-btn .nav-icon i[class*="ri-"] {
  font-size: 1.2rem;
}

.admin-nav-btn:hover .nav-icon i[class*="ri-"],
.admin-nav-btn.active .nav-icon i[class*="ri-"] {
  filter: drop-shadow(0 0 6px var(--primary));
}

.icon-gold {
  color: #ffd700 !important;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
}

.icon-silver {
  color: #d1d5db !important;
  text-shadow: 0 0 8px rgba(209, 213, 219, 0.5);
  filter: drop-shadow(0 0 5px rgba(209, 213, 219, 0.4));
}

.icon-bronze {
  color: #cd7f32 !important;
  text-shadow: 0 0 8px rgba(205, 127, 50, 0.5);
  filter: drop-shadow(0 0 5px rgba(205, 127, 50, 0.4));
}

.icon-primary {
  color: var(--primary) !important;
  text-shadow: 0 0 8px var(--primary-glow);
  filter: drop-shadow(0 0 5px var(--primary-glow));
}


