/* ═══════════════════════════════════════════════════════════════════════════
   Truefair – Sistema de Diseño Sobrio y Oscuro (Sober & Dark Theme)
   ═══════════════════════════════════════════════════════════════════════════
   Paleta: Negro Absoluto (Pitch Black), Gris Carbón, Acentos Plata/Gris
   Tipografía: Outfit (Principal) + JetBrains Mono (Datos/Criptografía)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Variables del Tema ─────────────────────────────────────────────────── */
:root {
  /* Colores Base */
  --bg-base:        #000000;
  --bg-radial:      none;
  --bg-surface:     #08080a;
  --bg-card:        #0c0c0e;
  --bg-card-hover:  #111114;
  --bg-input:       #020203;

  /* Acentos Temáticos Unificados */
  --theme-accent:      #cbd5e1; /* Plata */
  --theme-accent-rgb:  203, 213, 225;
  --theme-border:      rgba(255, 255, 255, 0.07);
  --theme-border-hover:rgba(255, 255, 255, 0.18);

  /* Acentos de Juego */
  /* Moneda - Oro viejo / Bronce apagado */
  --coin-accent:       #d4af37;
  --coin-accent-rgb:   212, 175, 55;
  --coin-gradient:     linear-gradient(135deg, #8a7024, #4a3c10);
  
  /* Números y Dado - Plata/Slate */
  --random-accent:     #cbd5e1;
  --random-accent-rgb: 203, 213, 225;
  --random-gradient:   linear-gradient(135deg, #94a3b8, #475569);
  
  --dice-accent:       #cbd5e1;
  --dice-accent-rgb:   203, 213, 225;
  --dice-gradient:     linear-gradient(135deg, #cbd5e1, #64748b);

  /* Colores de Estado */
  --success:        #10b981;
  --success-glow:   rgba(16, 185, 129, 0.08);
  --danger:         #ef4444;
  --danger-glow:    rgba(239, 68, 68, 0.08);
  --info:           #64748b;
  --info-glow:      rgba(100, 116, 139, 0.08);

  /* Textos */
  --text-primary:   #ffffff;
  --text-secondary: #94a3b8;
  --text-muted:     #4b5563;

  /* Bordes */
  --border:         rgba(255, 255, 255, 0.04);
  --border-hover:   rgba(255, 255, 255, 0.1);

  /* Espaciado */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Radios */
  --radius-xs:  6px;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Sombras y Luces */
  --shadow-premium: 0 12px 36px rgba(0, 0, 0, 0.95);
  --glass-blur:     12px;

  /* Transiciones */
  --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   450ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset y Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Canvas de confetti */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ─── Tipografía ──────────────────────────────────────────────────────────── */
.mono { 
  font-family: 'JetBrains Mono', 'Courier New', monospace; 
  font-size: 0.85em;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* ─── Header Sticky ───────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  background: rgba(0, 0, 0, 0.8);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-8);
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1.45rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: -0.04em;
}
.logo-icon {
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  margin-right: 2px;
}
.logo-accent {
  color: var(--text-primary);
}

/* ─── Tabs de Navegación ──────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-full);
  padding: 4px;
}

.tab-btn {
  padding: var(--space-2) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
}
.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}
.tab-btn.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-weight: 600;
}

/* ─── Layout Principal ────────────────────────────────────────────────────── */
.main-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-6);
  min-height: calc(100vh - 180px);
}

/* Paneles */
.panel { display: block; }
.panel.hidden { display: none !important; }
.panel.active { animation: smoothFadeIn var(--transition-slow) forwards; }

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

/* Tarjetas Base */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-premium);
  transition: border-color var(--transition-normal);
}
.card:hover {
  border-color: var(--border-hover);
}

/* Cabeceras de Tarjeta */
.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.card-icon.icon-historial {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}
.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}
.card-description {
  color: var(--text-secondary);
  font-size: 0.925rem;
  margin-bottom: var(--space-6);
}

/* ─── HOME LAYOUT: BARRAS HORIZONTALES SOBRIAS ────────────────────────────── */
.home-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 800px;
  margin: 0 auto;
}

.game-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.game-card:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: var(--theme-border-hover);
  box-shadow: var(--shadow-premium);
}

.game-card-content {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex: 1;
}

/* Iconos de Juegos Uniformes y Sobrios */
.game-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.game-card:hover .game-card-icon {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.game-card-text {
  display: flex;
  flex-direction: column;
}
.game-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--text-primary);
}
.game-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Botón Jugar Ahora Uniforme */
.game-card .btn-launch-glow {
  width: auto;
  padding: 8px 18px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: #0f0f11;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  box-shadow: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-normal);
}
.game-card:hover .btn-launch-glow {
  background: #1c1c1f;
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-primary);
}

/* ─── VISTA INTERNA DEL JUEGO (CENTRADO) ───────────────────────────────────── */
.game-layout-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* Botón Volver */
.btn-back-home {
  align-self: flex-start;
  margin-bottom: var(--space-4);
  font-size: 0.85rem;
}

.game-center-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-premium);
  position: relative;
}

/* Desactivar glows en el fondo */
.coin-glow {
  display: none !important;
}


/* ─── MONEDA 3D SOBRIA (Metales Cepillados Oscuros) ───────────────────────── */
.coin-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 240px;
  z-index: 2;
}

.coin-scene {
  perspective: 800px;
  width: 180px;
  height: 180px;
}

.coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: coin-idle-rotation 12s linear infinite;
}

@keyframes coin-idle-rotation {
  from { transform: rotateY(0deg) rotateX(12deg); }
  to   { transform: rotateY(360deg) rotateX(12deg); }
}

.coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px; /* Deja ver el borde segmentado exterior */
  box-shadow: 
    inset 0 3px 6px rgba(255,255,255,0.1),
    inset 0 -3px 8px rgba(0,0,0,0.5),
    0 10px 24px rgba(0, 0, 0, 0.7);
}

/* Cara: Ficha Oro Viejo */
.coin-cara {
  background: conic-gradient(
    #121214 0% 6.25%, #8a7024 6.25% 12.5%,
    #121214 12.5% 18.75%, #8a7024 18.75% 25%,
    #121214 25% 31.25%, #8a7024 31.25% 37.5%,
    #121214 37.5% 43.75%, #8a7024 43.75% 50%,
    #121214 50% 56.25%, #8a7024 56.25% 62.5%,
    #121214 62.5% 68.75%, #8a7024 68.75% 75%,
    #121214 75% 81.25%, #8a7024 81.25% 87.5%,
    #121214 87.5% 93.75%, #8a7024 93.75% 100%
  );
  transform: rotateY(0deg);
}
.coin-cara .coin-symbol {
  color: #d4af37;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.coin-cara .coin-label {
  color: #8a7024;
}

/* Cruz: Ficha Gris Pizarra */
.coin-cruz {
  background: conic-gradient(
    #121214 0% 6.25%, #475569 6.25% 12.5%,
    #121214 12.5% 18.75%, #475569 18.75% 25%,
    #121214 25% 31.25%, #475569 31.25% 37.5%,
    #121214 37.5% 43.75%, #475569 43.75% 50%,
    #121214 50% 56.25%, #475569 56.25% 62.5%,
    #121214 62.5% 68.75%, #475569 68.75% 75%,
    #121214 75% 81.25%, #475569 81.25% 87.5%,
    #121214 87.5% 93.75%, #475569 93.75% 100%
  );
  transform: rotateY(180deg);
}
.coin-cruz .coin-symbol {
  color: #cbd5e1;
}
.coin-cruz .coin-label {
  color: #475569;
}

.coin-face-inner {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background: #070709;
  border: 3px dashed rgba(255, 255, 255, 0.05); /* Borde interior discontinuo de ficha de póker */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.8);
}

.coin-symbol {
  font-size: 3.1rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coin-svg {
  width: 52px;
  height: 52px;
  color: inherit;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.coin-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-top: 4px;
  text-transform: uppercase;
}

/* Lanzamientos y transiciones */
.coin.flipping {
  animation: coin-flip-motion 1.6s cubic-bezier(0.2, 0.8, 0.3, 1.05) forwards;
}

@keyframes coin-flip-motion {
  0%   { transform: rotateY(0deg) rotateX(12deg) scale(1); }
  40%  { transform: rotateY(720deg) rotateX(12deg) scale(1.2) translateY(-50px); }
  75%  { transform: rotateY(1260deg) rotateX(12deg) scale(0.97) translateY(-10px); }
  100% { transform: rotateY(var(--flip-end-angle)) rotateX(12deg) scale(1) translateY(0); }
}

.coin.show-cara { --flip-end-angle: 0deg; }
.coin.show-cruz { --flip-end-angle: 180deg; }

/* Retorno a reposo tras tirar */
@keyframes idle-cara {
  from { transform: rotateY(0deg) rotateX(12deg); }
  to   { transform: rotateY(360deg) rotateX(12deg); }
}
@keyframes idle-cruz {
  from { transform: rotateY(180deg) rotateX(12deg); }
  to   { transform: rotateY(540deg) rotateX(12deg); }
}
.coin.idle-cara { animation: idle-cara 12s linear infinite; }
.coin.idle-cruz { animation: idle-cruz 12s linear infinite; }


/* ─── NÚMERO ALEATORIO ZONE ───────────────────────────────────────────────── */
.random-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 240px;
  z-index: 2;
  width: 100%;
}

.random-number-display {
  font-size: 6.5rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  background: #020203;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 8px 24px rgba(0,0,0,0.8);
  padding: 10px 40px;
  border-radius: var(--radius-md);
  min-width: 180px;
  text-align: center;
  transition: transform 0.1s;
  letter-spacing: -0.05em;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.random-number-display.rolling {
  animation: jitter-display 0.08s linear infinite;
  color: var(--text-secondary);
  text-shadow: none;
  border-color: rgba(255,255,255,0.08);
}

@keyframes jitter-display {
  0%   { transform: translate(1px, 1px) scale(1.02); }
  25%  { transform: translate(-1px, -1.5px) scale(0.98); }
  50%  { transform: translate(-2px, 0.5px) scale(1.01); }
  75%  { transform: translate(2px, 1.5px) scale(0.99); }
  100% { transform: translate(-1px, -1px) scale(1.02); }
}


/* ─── DADO ZONE ───────────────────────────────────────────────────────────── */
.dice-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 240px;
  z-index: 2;
}

.dice-display {
  font-size: 7.5rem;
  line-height: 140px;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020203;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  box-shadow: 
    inset 0 4px 12px rgba(255,255,255,0.02),
    0 10px 24px rgba(0, 0, 0, 0.6);
  z-index: 2;
  transition: transform 0.15s;
  user-select: none;
}

.dice-display.rolling {
  animation: jitter-display 0.08s linear infinite;
  color: var(--text-secondary);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}


/* ─── PANEL DE LANZAMIENTO (SOBRIO) ────────────────────────────────────────── */
.launch-panel-centered {
  width: 100%;
  max-width: 320px;
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  z-index: 2;
}

/* Rango de entradas (Random number) */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

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

.field-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Inputs sobrios */
.text-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}
.text-input:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(0,0,0,0.9);
}

/* Botón de Lanzar Sobrio */
.btn-launch-glow {
  width: 100%;
  padding: 12px 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: #111113;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.btn-launch-glow:hover {
  transform: translateY(-2px);
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 16px rgba(0,0,0,0.6);
}

.btn-launch-glow:active {
  transform: translateY(1px);
}
.btn-launch-glow:disabled, .btn-launch-glow.loading {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: var(--text-muted) !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none;
}

/* Spinner de carga en botón */
.btn-launch-glow.loading .btn-launch-text::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--text-secondary);
  border-radius: var(--radius-full);
  animation: spin 0.6s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ─── RESULTADO DEL LANZAMIENTO (SOBRIO) ────────────────────────────────────── */
.result-display-centered {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: var(--space-8);
  animation: slideUpFade 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.result-main-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.result-icon-hero {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-family: 'Outfit', sans-serif;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.result-text-hero {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}


/* ─── DETALLES PROVABLY FAIR COLAPSABLES (Subtle & Dark) ───────────────────── */
.pf-details-subtle {
  margin-top: var(--space-4);
  width: 100%;
  max-width: 400px;
}

.pf-summary-subtle {
  display: flex;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast);
  list-style: none;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.pf-summary-subtle::-webkit-details-marker { display: none; }
.pf-summary-subtle:hover {
  color: var(--text-secondary);
}

.pf-grid-subtle {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: #040405;
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  box-shadow: inset 0 8px 24px rgba(0,0,0,0.6);
  animation: slideDownPF 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

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

.pf-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pf-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.pf-value {
  font-size: 0.72rem;
  color: var(--text-secondary);
  word-break: break-all;
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.01);
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.03);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.4;
}


/* ─── RONDA ACTIVA (Muted indicators) ─────────────────────────────────────── */
.round-info-subtle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  width: 100%;
}

.subtle-badge {
  background: rgba(255,255,255,0.01);
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}

.hash-subtle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
}
.hash-subtle:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.04);
}

.hash-icon-badge {
  font-size: 0.6rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
}
.hash-label {
  font-weight: 500;
}
.hash-value-subtle {
  font-family: 'JetBrains Mono', monospace;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}


/* ─── BOTONES COMUNES & HOVERS ────────────────────────────────────────────── */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-ghost:hover {
  border-color: rgba(255,255,255,0.15);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.btn-secondary.danger {
  border-color: rgba(239, 68, 68, 0.15);
  color: rgba(239, 68, 68, 0.7);
}
.btn-secondary.danger:hover {
  background: rgba(239, 68, 68, 0.03);
  border-color: rgba(239, 68, 68, 0.3);
  color: rgba(239, 68, 68, 1);
}


/* ─── HISTORIAL LOCAL DE JUEGOS SOBRIO ──────────────────────────────────────── */
.historial-card {
  max-width: 900px;
  margin: 0 auto;
}

.historial-actions {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.historial-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-10) 0;
  color: var(--text-muted);
  text-align: center;
}
.empty-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.historial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.15);
}
.historial-table th {
  text-align: left;
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}
.historial-table td {
  padding: var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  vertical-align: middle;
}
.historial-table tr:last-child td {
  border-bottom: none;
}
.historial-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-primary);
}

/* Badges del Historial Sobrios */
.badge-result {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Cara: Muted Gold */
.badge-result.cara {
  background: rgba(var(--coin-accent-rgb), 0.06);
  color: var(--coin-accent);
  border: 1px solid rgba(var(--coin-accent-rgb), 0.18);
}
/* Cruz: Muted Slate */
.badge-result.cruz {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Para otros resultados genéricos */
.badge-result:not(.cara):not(.cruz) {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.badge-juego {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hmac-truncated {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: help;
}
.historial-table tr:hover .hmac-truncated {
  color: var(--text-secondary);
}


/* ─── TOAST NOTIFICATIONS (Subtle Glass float) ────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 20px;
  background: rgba(8, 8, 10, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.8);
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 250px;
  max-width: 380px;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.toast.fade-out {
  animation: toastOut 0.25s ease forwards;
}

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

.toast.success { border-color: rgba(16, 185, 129, 0.2); }
.toast.error   { border-color: rgba(239, 68, 68, 0.2); }
.toast.info    { border-color: rgba(255, 255, 255, 0.08); }


/* ─── FOOTER ──────────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: var(--space-10);
  background: rgba(0, 0, 0, 0.4);
}


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


/* ─── RESPONSIVE DESIGN ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header {
    padding: 0 var(--space-4);
  }
  .header-inner {
    height: 60px;
  }
  .logo {
    font-size: 1.25rem;
  }
  .tab-btn {
    padding: var(--space-2) var(--space-4);
    font-size: 0.8rem;
  }
  .main-content {
    padding: var(--space-6) var(--space-4);
  }
  
  .game-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-5);
  }
  .game-card .btn-launch-glow {
    width: 100%;
    text-align: center;
  }

  .game-center-container {
    padding: var(--space-6);
  }

  .coin-scene, .coin, .coin-face {
    width: 140px;
    height: 140px;
  }
  .coin-symbol {
    font-size: 2.8rem;
  }
  .coin-label {
    font-size: 0.65rem;
  }
  
  .random-number-display {
    font-size: 4.8rem;
    padding: 6px 24px;
    min-width: 140px;
  }
  
  .dice-display {
    font-size: 5.5rem;
    width: 110px;
    height: 110px;
    line-height: 110px;
  }

  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
  }
  .toast {
    min-width: auto;
    max-width: 100%;
  }
}
