@font-face {
    font-family: 'DSEG7';
    src: url('../fonts/DSEG7Classic-Italic.woff2') format('woff2');
    font-weight: normal;
    font-style: italic;
}

:root {
    --color-idle: #2c3e50;
    --color-running: #3498db;
    --color-won: #27ae60;
    --color-lost: #e74c3c;
    --bg-overlay: rgba(0, 0, 0, 0.4);
    --font-main: 'Inter', sans-serif;
    --font-display: 'DSEG7', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prevent text selection on touch devices */
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: #000;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: manipulation;
    margin: 0;
}

/* TOTEM CONTAINER 9:16 AR */
#app {
    position: relative;
    width: 1080px;
    height: 1920px;
    flex-shrink: 0;
    transform-origin: center center;
    transform: scale(var(--scale-factor, 1));
    background: #000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0;
}

:root {
    --scale-factor: 1; /* Will be set via JS if needed, or we can use container queries/scaling */
}

#media-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Equivalent to background-size: cover */
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease;
}

#display-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* 3. Estilo de los números (Neon & 7-Segment style) */
.neon-counter {
  font-family: 'DSEG7', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 105px; 
  color: #ff33ff !important;
  
  text-shadow: 
    0 0 10px #ff33ff, 
    0 0 20px #ff33ff, 
    0 0 40px #cc00cc;
  
  letter-spacing: 0.1em;
  margin: 0;
  line-height: 1;
  text-align: center;
  width: 100%;
  display: flex;
  justify-content: center;
}

@keyframes neon-flicker {
    0% { opacity: 1; text-shadow: 0 0 10px #ff33ff, 0 0 20px #ff33ff, 0 0 40px #cc00cc; }
    100% { opacity: 0.9; text-shadow: 0 0 15px #ff33ff, 0 0 30px #ff33ff, 0 0 50px #cc00cc, 0 0 80px #cc00cc; }
}

.counter-container {
  position: absolute;
  width: 619px;
  height: 213px;
  left: 230px;
  top: 994px; /* Perfectly aligned with the red rect top found in frame */
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  border: none;
  box-shadow: none;
}

/* Result box removed as texts are in the video */
.result-box {
    display: none;
}

/* STATE FALLBACK COLORS (IF VIDEOS DON'T LOAD) */
body[data-state="IDLE"] #app { background: var(--color-idle); }
body[data-state="RUNNING"] #app { background: var(--color-running); }
body[data-state="WON"] #app { background: var(--color-won); }
body[data-state="WON"] #result-title { color: #2ecc71; }
body[data-state="LOST"] #app { background: var(--color-lost); }
body[data-state="LOST"] #result-title { color: #ff7675; }

/* Ensure neon counter is ALWAYS magenta regardless of state */
body .neon-counter {
    color: #ff33ff !important;
}
