/* ==========================================================================
   DAIRY QUEEN: OPERACIÓN BLIZZARD - V3.0 ULTRA STYLESHEET
   Autor: Emiliano Flores
   Motor Gráfico: CSS3 Hardware Accelerated
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. SISTEMA DE VARIABLES (THEME ENGINE)
   -------------------------------------------------------------------------- */
:root {
    /* --- PALETA CORPORATIVA EXPANDIDA --- */
    --dq-blue: #005EB8;
    --dq-blue-dark: #003875;
    --dq-blue-neon: #00a8ff; /* Para efectos de luz */
    
    --dq-red: #EF3340;
    --dq-red-dark: #C41230;
    --dq-red-neon: #ff4757;

    --dq-orange: #F58025;
    --dq-orange-dark: #C25E00;
    --dq-orange-neon: #ffa502;

    /* --- PALETA UI (MODO OSCURO/CYBER) --- */
    --bg-dark: #0f1015;
    --bg-panel: #1b1e26;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ecf0f1;
    --text-muted: #95a5a6;

    /* --- SEMÁNTICA --- */
    --success: #2ecc71;
    --warning: #f1c40f;
    --danger: #e74c3c;
    --info: #3498db;

    /* --- TIPOGRAFÍA --- */
    --font-arcade: 'Bungee', cursive;
    --font-ui: 'Montserrat', sans-serif;
    --font-code: 'Roboto Mono', monospace;

    /* --- EFECTOS --- */
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.3);
    --shadow-neon-blue: 0 0 15px rgba(0, 168, 255, 0.5);
    --shadow-neon-red: 0 0 15px rgba(255, 71, 87, 0.5);
    --crt-flicker: flicker 0.15s infinite;
}

/* --------------------------------------------------------------------------
   2. RESET GLOBAL Y NORMALIZACIÓN
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden; /* Evita scrollbars */
    background-color: var(--bg-dark);
    font-family: var(--font-ui);
    color: var(--text-main);
    user-select: none; /* No seleccionar texto */
}

/* El Contenedor Maestro */
#app-root {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: radial-gradient(circle at center, #1a1c24 0%, #000 100%);
}

/* --------------------------------------------------------------------------
   3. OVERLAYS Y EFECTOS DE PANTALLA (POST-PROCESSING)
   -------------------------------------------------------------------------- */
/* Scanlines tipo Monitor CRT Antiguo */
.overlay-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.2) 50%,
        rgba(0,0,0,0.2)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 900;
    opacity: 0.3;
}

/* Viñeta Oscura en los bordes */
.overlay-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 60%, black 100%);
    pointer-events: none;
    z-index: 901;
    opacity: 0.8;
}

/* Partículas de Fondo (CSS Puro) */
.background-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(#ffffff 1px, transparent 1px),
        radial-gradient(#ffffff 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px;
    opacity: 0.05;
    animation: particleDrift 60s linear infinite;
    z-index: 0;
}

@keyframes particleDrift {
    from { transform: translateY(0); }
    to { transform: translateY(-500px); }
}

/* --------------------------------------------------------------------------
   4. SISTEMA DE PANTALLAS (TRANSICIONES)
   -------------------------------------------------------------------------- */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.5s ease-in-out, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 10;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.1); /* Efecto Zoom Out al salir */
    z-index: -1;
}

.screen.active {
    z-index: 100;
    transform: scale(1);
}

.overlay-blur {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

/* --------------------------------------------------------------------------
   5. SECUENCIA DE ARRANQUE (BOOT TERMINAL)
   -------------------------------------------------------------------------- */
#boot-sequence {
    background-color: #000;
    font-family: var(--font-code);
    z-index: 9999;
}

.terminal-loader {
    width: 500px;
    background: #111;
    border: 1px solid #333;
    border-radius: 6px;
    box-shadow: 0 0 50px rgba(0, 255, 0, 0.1);
    padding: 0;
    overflow: hidden;
}

.terminal-header {
    background: #222;
    padding: 10px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #333;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.status-dot.red { background: #ff5f56; }
.status-dot.yellow { background: #ffbd2e; }
.status-dot.green { background: #27c93f; }

.terminal-window {
    padding: 20px;
    color: #27c93f; /* Verde Terminal */
}

.code-line {
    margin: 5px 0;
    opacity: 0;
    animation: typeLine 0.1s forwards;
    white-space: nowrap;
    overflow: hidden;
}

.code-line:nth-child(1) { animation-delay: 0.5s; }
.code-line:nth-child(2) { animation-delay: 1.5s; }
.code-line:nth-child(3) { animation-delay: 2.5s; }
.code-line:nth-child(4) { animation-delay: 3.5s; color: white; }

.dev-credits {
    margin-top: 30px;
    font-family: var(--font-arcade);
    font-size: 2rem;
    color: var(--dq-blue-neon);
    text-shadow: 0 0 10px var(--dq-blue);
    text-align: center;
    opacity: 0;
    animation: fadeIn 1s forwards 4s;
}

.dev-subcredits {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    letter-spacing: 5px;
    opacity: 0;
    animation: fadeIn 1s forwards 4.5s;
}

@keyframes typeLine {
    to { opacity: 1; }
}
@keyframes fadeIn {
    to { opacity: 1; }
}

/* --------------------------------------------------------------------------
   6. MENÚ PRINCIPAL (LAYOUT & BRANDING)
   -------------------------------------------------------------------------- */
#screen-menu {
    display: flex;
    flex-direction: row;
    background: linear-gradient(135deg, #0b0c10 0%, #1f2833 100%);
}

/* Panel Izquierdo (Logo) */
.menu-brand-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-right: 1px solid rgba(255,255,255,0.05);
    position: relative;
}

/* Logo DQ 3D CSS Puro */
.dq-logo-3d {
    width: 250px;
    height: 160px;
    position: relative;
    transform: perspective(1000px) rotateY(-15deg) rotateX(5deg);
    transform-style: preserve-3d;
    transition: transform 0.5s;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5));
    animation: logoFloat 6s ease-in-out infinite;
}

.dq-logo-3d:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg) scale(1.1);
}

.lip-top {
    position: absolute;
    top: 0;
    width: 100%;
    height: 55%;
    background: var(--dq-orange);
    border-radius: 80% 80% 20% 20% / 100% 100% 20% 20%;
    box-shadow: inset 0 -5px 10px rgba(0,0,0,0.2);
}

.lip-bottom {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 55%;
    background: var(--dq-red);
    border-radius: 20% 20% 80% 80% / 20% 20% 100% 100%;
    box-shadow: inset 0 5px 10px rgba(0,0,0,0.2);
}

.logo-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) skewX(-10deg);
    font-family: var(--font-ui);
    font-weight: 900;
    font-style: italic;
    font-size: 6rem;
    color: white;
    text-shadow: 4px 4px 0px rgba(0,0,0,0.2);
    z-index: 10;
}

/* Título con Glitch */
.game-main-title {
    margin-top: 50px;
    font-family: var(--font-arcade);
    font-size: 3.5rem;
    text-align: center;
    line-height: 1;
    color: white;
    text-shadow: 0 5px 0 var(--dq-blue-dark);
}

.highlight-glitch {
    color: var(--dq-blue-neon);
    position: relative;
    display: inline-block;
}

.highlight-glitch::before,
.highlight-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0b0c10;
}

.highlight-glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--dq-red-neon);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.highlight-glitch::after {
    left: -2px;
    text-shadow: -1px 0 var(--dq-orange-neon);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(38px, 9999px, 81px, 0); }
    20% { clip: rect(6px, 9999px, 14px, 0); }
    40% { clip: rect(54px, 9999px, 86px, 0); }
    60% { clip: rect(18px, 9999px, 5px, 0); }
    80% { clip: rect(72px, 9999px, 34px, 0); }
    100% { clip: rect(61px, 9999px, 66px, 0); }
}
@keyframes glitch-anim2 {
    0% { clip: rect(5px, 9999px, 58px, 0); }
    20% { clip: rect(81px, 9999px, 9px, 0); }
    40% { clip: rect(16px, 9999px, 57px, 0); }
    60% { clip: rect(45px, 9999px, 32px, 0); }
    80% { clip: rect(3px, 9999px, 89px, 0); }
    100% { clip: rect(24px, 9999px, 4px, 0); }
}

.version-badge {
    margin-top: 20px;
    background: rgba(255,255,255,0.1);
    padding: 5px 15px;
    border-radius: 20px;
    font-family: var(--font-code);
    font-size: 0.7rem;
    display: flex;
    gap: 10px;
    border: 1px solid rgba(255,255,255,0.1);
}
.status-indicator {
    color: var(--success);
    font-weight: bold;
    text-shadow: 0 0 5px var(--success);
}

/* Panel Derecho (Controles) */
.menu-control-panel {
    flex: 1.2;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.panel-header h3 {
    font-family: var(--font-code);
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-bottom: 10px;
}
.decorative-line {
    width: 100px;
    height: 3px;
    background: var(--dq-red);
    margin-bottom: 40px;
    box-shadow: 0 0 10px var(--dq-red-neon);
}

/* Selector de Dificultad */
.difficulty-selector {
    margin-bottom: 40px;
}
.diff-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 10px;
    font-weight: bold;
}
.diff-options {
    display: flex;
    gap: 15px;
}
.diff-btn {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    position: relative;
    overflow: hidden;
}
.diff-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}
.diff-btn.active {
    border-color: var(--dq-orange);
    background: rgba(245, 128, 37, 0.1);
    box-shadow: 0 0 15px rgba(245, 128, 37, 0.2);
}
.diff-btn .icon { font-size: 1.2rem; display: block; margin-bottom: 5px; }
.diff-btn .text { display: block; font-weight: 800; font-family: var(--font-ui); color: white; }
.diff-btn .subtext { font-size: 0.7rem; color: #888; }

/* Botones Mega */
.menu-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mega-button {
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    font-family: var(--font-ui);
}

.mega-button.primary {
    background: linear-gradient(45deg, var(--dq-blue), var(--dq-blue-dark));
    padding: 25px;
    color: white;
    box-shadow: 0 10px 0 #002855, 0 20px 20px rgba(0,0,0,0.3);
}

.mega-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 0 #002855, 0 25px 30px rgba(0, 94, 184, 0.4);
}

.mega-button.primary:active {
    transform: translateY(8px);
    box-shadow: 0 2px 0 #002855, 0 5px 10px rgba(0,0,0,0.2);
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.btn-icon {
    font-size: 2.5rem;
    background: rgba(0,0,0,0.2);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

.btn-text-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.main-text {
    font-size: 1.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sub-text {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Efecto Brillo en Botón */
.btn-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
    z-index: 1;
}
.mega-button:hover .btn-glare {
    transform: translateX(100%);
}

.secondary-actions {
    display: flex;
    gap: 15px;
}

.mega-button.secondary {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mega-button.secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

/* Footer Ticker */
.values-ticker {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    overflow: hidden;
}
.ticker-content {
    white-space: nowrap;
    animation: tickerMove 20s linear infinite;
    font-family: var(--font-code);
    color: var(--dq-orange);
    font-size: 0.8rem;
}
@keyframes tickerMove {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* --- FIN PARTE 1 CSS --- */

/* --------------------------------------------------------------------------
   7. HUD DE JUEGO (KITCHEN DISPLAY SYSTEM - KDS)
   -------------------------------------------------------------------------- */
#screen-game {
    background-color: #1a1a1a;
    overflow: hidden;
}

.hud-dashboard {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: #111;
    border-bottom: 4px solid var(--dq-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    /* Patrón de fibra de carbono sutil en el fondo */
    background-image: radial-gradient(black 15%, transparent 16%),
                      radial-gradient(black 15%, transparent 16%);
    background-size: 10px 10px;
    background-color: #222;
}

.hud-module {
    background: #000;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 0 10px rgba(255,255,255,0.05);
}

.hud-label {
    font-size: 0.6rem;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 5px;
    font-family: var(--font-ui);
    font-weight: bold;
    text-transform: uppercase;
}

/* Pantallas Digitales (Estilo VFD/LCD) */
.digital-display {
    font-family: var(--font-code);
    font-size: 2rem;
    color: var(--success);
    text-shadow: 0 0 5px var(--success);
    background: #051a05;
    padding: 5px 15px;
    border-radius: 4px;
    border: 1px solid #0f3d0f;
    min-width: 120px;
    text-align: right;
    position: relative;
}

.currency-symbol { font-size: 1rem; vertical-align: top; margin-right: 5px; opacity: 0.7; }

/* Módulo Central: Riel de Pedidos */
.orders-module {
    flex: 1;
    margin: 0 20px;
    height: 85px;
    position: relative;
    border-color: #444;
}

.orders-header {
    position: absolute;
    top: -8px;
    left: 10px;
    background: #222;
    padding: 0 5px;
    font-size: 0.6rem;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f00;
    box-shadow: 0 0 5px #f00;
}
.status-led.blink { animation: blinkLed 1s infinite; }

.orders-rail-container {
    width: 100%;
    height: 100%;
    background: #ccc; /* Riel metálico */
    border-radius: 4px;
    box-shadow: inset 0 5px 10px rgba(0,0,0,0.3);
    overflow: hidden;
    position: relative;
    /* Textura metálica */
    background: linear-gradient(to bottom, #999 0%, #eee 20%, #bbb 100%);
}

.rail-track {
    display: flex;
    align-items: center;
    padding-left: 10px;
    height: 100%;
    gap: 10px;
}

/* Timer Module */
.timer-display {
    color: var(--dq-orange-neon);
    text-shadow: 0 0 5px var(--dq-orange-neon);
    background: #1a0f00;
    border-color: #3d2200;
}
.timer-module.urgent .timer-display {
    color: #ff0000;
    text-shadow: 0 0 10px red;
    animation: pulseAlarm 0.5s infinite;
}

/* --------------------------------------------------------------------------
   8. EL MUNDO DE JUEGO (COCINA INDUSTRIAL)
   -------------------------------------------------------------------------- */
.kitchen-floor {
    position: absolute;
    top: 100px;
    left: 0;
    width: 100%;
    height: calc(100% - 100px);
    background-color: #dcdde1;
    /* Loseta Industrial Antideslizante */
    background-image: 
        linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc),
        linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc);
    background-position: 0 0, 20px 20px;
    background-size: 40px 40px;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.5);
    perspective: 1200px; /* Perspectiva para elementos 3D */
}

/* Zonas de Jugador */
.zone {
    position: absolute;
    width: 100%;
    left: 0;
    transition: background-color 0.3s;
}

.zone-p1 {
    top: 0;
    height: 40%;
    background-color: rgba(0, 94, 184, 0.05);
    border-bottom: 2px dashed rgba(0,0,0,0.1);
}

.zone-transfer {
    top: 40%;
    height: 20%;
    background: #2c3e50; /* Suelo oscuro para la mesa */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.zone-p2 {
    top: 60%;
    height: 40%;
    background-color: rgba(239, 51, 64, 0.05);
    border-top: 2px dashed rgba(0,0,0,0.1);
}

.floor-marking {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-code);
    font-size: 4rem;
    font-weight: 900;
    opacity: 0.03;
    pointer-events: none;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   9. MAQUINARIA DETALLADA (CSS ART)
   -------------------------------------------------------------------------- */
.machine-unit {
    position: absolute;
    background: #ecf0f1;
    border-radius: 8px;
    /* Efecto 3D falso con sombras duras */
    box-shadow: 
        1px 1px 0 #bdc3c7,
        2px 2px 0 #bdc3c7,
        3px 3px 0 #bdc3c7,
        4px 4px 0 #bdc3c7,
        5px 5px 10px rgba(0,0,0,0.3);
    z-index: 10;
}

.machine-label {
    position: absolute;
    bottom: -20px;
    width: 100%;
    text-align: center;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 0.6rem;
    padding: 2px 0;
    border-radius: 4px;
    font-family: var(--font-code);
}

/* --- ESTACIÓN: IMPRESORA TICKETS --- */
.printer-station {
    width: 70px;
    height: 60px;
    top: 20px;
    left: 30px;
    background: #34495e;
}
.paper-slot {
    width: 50px;
    height: 4px;
    background: #000;
    margin: 10px auto;
    border-radius: 2px;
}
.led-light {
    width: 8px;
    height: 8px;
    background: #555;
    border-radius: 50%;
    margin: 0 auto;
    margin-top: 20px;
    border: 1px solid rgba(0,0,0,0.5);
}
.led-light.green {
    background: #2ecc71;
    box-shadow: 0 0 5px #2ecc71;
    animation: blinkLed 2s infinite;
}

/* --- ESTACIÓN: VASOS --- */
.cup-dispenser {
    width: 60px;
    height: 60px;
    top: 20px;
    right: 150px;
    background: transparent;
    box-shadow: none;
}
.cup-stack-tube {
    width: 40px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}
.cup-rim {
    width: 30px;
    height: 10px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: absolute;
    left: 3px;
    background: white;
}
.cup-rim:nth-child(1) { top: 40px; }
.cup-rim:nth-child(2) { top: 35px; }
.cup-rim:nth-child(3) { top: 30px; }

/* --- ESTACIÓN: HELADO (SOFT SERVE) --- */
.icecream-station {
    width: 100px;
    height: 110px;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to right, #e0e0e0, #fff, #e0e0e0);
}
.tank-top {
    width: 100%;
    height: 60px;
    border-bottom: 2px solid #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
}
.brand-sticker {
    background: var(--dq-blue);
    color: white;
    padding: 2px 5px;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    border: 2px solid var(--dq-orange);
}
.spout-group {
    position: relative;
    height: 40px;
}
.handle {
    width: 6px;
    height: 25px;
    background: #333;
    margin: 0 auto;
    border-radius: 3px;
    cursor: pointer;
    transition: transform 0.1s;
}
.icecream-station:active .handle { transform: scaleY(0.8); }
.nozzle {
    width: 20px;
    height: 20px;
    background: #7f8c8d;
    margin: -5px auto 0;
    clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
}
.drip-tray-grid {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 10px;
    background: repeating-linear-gradient(90deg, #333 0, #333 2px, #666 2px, #666 4px);
}

/* --- MESA DE PASE (INDUSTRIAL) --- */
.transfer-table-surface {
    width: 70%;
    height: 100px;
    background: #7f8c8d;
    border-radius: 10px;
    position: relative;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    overflow: hidden;
    border: 2px solid #555;
}

/* Cinta de Precaución */
.hazard-stripes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 15px;
    background: repeating-linear-gradient(
        45deg,
        #000,
        #000 10px,
        #f1c40f 10px,
        #f1c40f 20px
    );
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.transfer-text {
    position: absolute;
    bottom: 5px;
    width: 100%;
    text-align: center;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.3);
    font-weight: bold;
    letter-spacing: 2px;
}

.transfer-slot {
    width: 70px;
    height: 70px;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    border: 3px dashed rgba(255,255,255,0.3);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}
.transfer-slot.has-item {
    border-color: var(--success);
    border-style: solid;
    background: rgba(46, 204, 113, 0.1);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.3);
}
.slot-number {
    position: absolute;
    font-size: 2rem;
    font-weight: 900;
    color: rgba(255,255,255,0.1);
}

/* --- ESTACIÓN: TOPPINGS (TEXTURAS REALISTAS) --- */
.toppings-bar {
    width: 220px;
    height: 70px;
    bottom: 30px;
    left: 30px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    background: #ecf0f1;
}

.ingredient-bin {
    width: 50px;
    height: 50px;
    background: white;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.1);
}

.bin-fill { width: 100%; height: 100%; }

/* Textura Oreo: Negro con puntos grises */
.texture-oreo {
    background-color: #2c2c2c;
    background-image: radial-gradient(#555 15%, transparent 16%);
    background-size: 8px 8px;
}

/* Textura M&Ms: Puntos de colores */
.texture-mms {
    background-color: #fff;
    background-image: 
        radial-gradient(#e74c3c 20%, transparent 21%),
        radial-gradient(#f1c40f 20%, transparent 21%),
        radial-gradient(#3498db 20%, transparent 21%);
    background-size: 15px 15px;
    background-position: 0 0, 5px 5px, 10px 10px;
}

/* Textura Chocolate: Marrón líquido */
.texture-choco {
    background: linear-gradient(45deg, #5d4037, #795548);
}

.bin-tag {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.5rem;
    text-align: center;
}

/* --- ESTACIÓN: MEZCLADORA (BLENDER) --- */
.blender-station {
    width: 70px;
    height: 100px;
    bottom: 50px;
    right: 200px;
    background: var(--dq-blue);
    border-radius: 10px;
}

.blender-motor-head {
    width: 100%;
    height: 30px;
    background: #2c3e50;
    border-radius: 10px 10px 0 0;
}

.blender-shaft {
    width: 6px;
    height: 40px;
    background: linear-gradient(to right, #999, #fff, #999); /* Metal */
    margin: 0 auto;
}

.safety-shield {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2); /* Vidrio */
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    position: absolute;
    bottom: 15px;
    left: 10px;
    /* Reflejo */
    box-shadow: inset 5px 5px 10px rgba(255,255,255,0.2);
}

/* Animación de mezclado */
.blender-station.working .blender-shaft {
    animation: spinShaft 0.1s linear infinite;
}
.blender-station.working {
    animation: shakeMachine 0.2s infinite;
}

/* --- ESTACIÓN: ENTREGA --- */
.delivery-window {
    width: 120px;
    height: 120px;
    right: 0;
    bottom: 50%;
    transform: translateY(50%);
    background: transparent;
    box-shadow: none;
    border-left: 15px solid #bdc3c7;
}
.window-frame {
    width: 100%;
    height: 100%;
    background: rgba(135, 206, 235, 0.1);
    position: relative;
}
.counter-top {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 15px;
    background: var(--dq-red);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    text-align: center;
    line-height: 15px;
}
.service-bell {
    position: absolute;
    bottom: 20px;
    right: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.1s;
}
.service-bell:active { transform: scale(0.8); }

/* --- ANIMACIONES DE MAQUINARIA --- */
@keyframes blinkLed {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
@keyframes spinShaft {
    0% { transform: scaleX(1); }
    50% { transform: scaleX(0.5); } /* Fake spin */
    100% { transform: scaleX(1); }
}
@keyframes shakeMachine {
    0% { transform: translate(0, 0); }
    25% { transform: translate(1px, 1px); }
    50% { transform: translate(-1px, -1px); }
    75% { transform: translate(1px, -1px); }
    100% { transform: translate(0, 0); }
}
@keyframes pulseAlarm {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* --- FIN PARTE 2 CSS --- */

/* --------------------------------------------------------------------------
   10. ENTIDADES DE JUGADORES (PLAYERS & ANIMATIONS)
   -------------------------------------------------------------------------- */
.player-entity {
    width: 60px;
    height: 60px;
    position: absolute;
    z-index: 100;
    /* transition: none;  <-- LA BORRAMOS O COMENTAMOS */
    will-change: left, top;
}

/* Sombra de contacto */
.player-shadow {
    width: 40px;
    height: 12px;
    background: rgba(0,0,0,0.4);
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    left: 10px;
    filter: blur(2px);
    z-index: 0;
}

/* Cuerpo del Personaje */
.player-body {
    width: 44px;
    height: 35px;
    background: #2c3e50; /* Camisa oscura */
    border-radius: 12px;
    position: absolute;
    bottom: 5px;
    left: 8px;
    z-index: 1;
    box-shadow: inset -2px -2px 5px rgba(0,0,0,0.3);
}

/* Delantales (Aprons) */
.uniform-apron {
    width: 26px;
    height: 30px;
    background: var(--dq-blue);
    margin: 0 auto;
    border-radius: 0 0 8px 8px;
    position: relative;
    top: 0;
    box-shadow: 0 2px 2px rgba(0,0,0,0.2);
}
.uniform-apron.red { background: var(--dq-red); }

/* Bolsillo del delantal */
.uniform-apron::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 5px;
    width: 16px;
    height: 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 0 0 4px 4px;
}

/* Cabeza */
.player-head {
    width: 40px;
    height: 40px;
    background: #f1c27d; /* Tono de piel */
    border-radius: 50%;
    position: absolute;
    top: -15px;
    left: 10px;
    z-index: 2;
    box-shadow: 0 4px 5px rgba(0,0,0,0.2);
}

/* Gorras (Viseras) */
.hat-visor {
    width: 44px;
    height: 20px;
    border-radius: 20px 20px 0 0;
    position: absolute;
    top: -8px;
    left: -2px;
    border-bottom: 3px solid #fff; /* Borde blanco DQ style */
}
.hat-visor.blue { background: var(--dq-blue); }
.hat-visor.red { background: var(--dq-red); }

/* Etiqueta de Nombre Flotante */
.name-tag {
    position: absolute;
    top: -45px;
    width: 100%;
    text-align: center;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 2px 0;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: bold;
    backdrop-filter: blur(2px);
    z-index: 200;
}

/* --- ESTADO: PENALIZACIÓN (TURTLE MODE) --- */
.player-entity.penalty .penalty-indicator {
    display: block;
    animation: bounceText 0.5s infinite alternate;
}
.player-entity.penalty .player-body {
    filter: grayscale(100%); /* Se pone gris cuando falla */
}
.penalty-indicator {
    display: none;
    position: absolute;
    top: -65px;
    width: 120%;
    left: -10%;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    text-align: center;
    border-radius: 10px;
    padding: 2px;
    box-shadow: 0 0 10px var(--danger);
    z-index: 201;
}

/* --- ANIMACIÓN CAMINAR (WOBBLE) --- */
.player-entity.walking .player-body {
    animation: walkWobble 0.3s ease-in-out infinite alternate;
}
.player-entity.walking .player-head {
    animation: headBob 0.3s ease-in-out infinite alternate;
}

@keyframes walkWobble {
    from { transform: rotate(-3deg); }
    to { transform: rotate(3deg); }
}
@keyframes headBob {
    from { transform: translateY(0); }
    to { transform: translateY(1px); }
}

/* --- ITEMS EN MANO (VISUALES) --- */
.player-hands-container {
    position: absolute;
    width: 100%;
    bottom: 5px;
    z-index: 5;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.held-item {
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.3));
    transform-origin: bottom center;
    animation: itemBob 2s ease-in-out infinite;
}

/* Vaso */
.item-cup { font-size: 2rem; }
/* Helado */
.item-icecream { font-size: 2.2rem; transform: scale(1.2); }
/* Blizzard en proceso */
.item-raw { font-size: 2rem; }
/* Blizzard Listo */
.item-done { 
    font-size: 2.2rem; 
    filter: drop-shadow(0 0 10px gold);
    animation: glowItem 1s infinite alternate;
}

/* --------------------------------------------------------------------------
   11. TICKETS DE PEDIDO (THERMAL PAPER EFFECT)
   -------------------------------------------------------------------------- */
.ticket {
    width: 90px;
    height: 100%; /* Ocupa altura del riel */
    background: #fff;
    margin-right: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    transform-origin: top center;
    animation: slideTicketIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Efecto de borde dentado (Papel cortado) */
.ticket::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(135deg, transparent 33%, white 33%, white 66%, transparent 66%),
                linear-gradient(45deg, transparent 33%, white 33%, white 66%, transparent 66%);
    background-size: 10px 10px;
    background-position: 0 0; 
}

/* Agujero para colgar */
.ticket-hole {
    width: 10px;
    height: 10px;
    background: #333; /* Color del fondo del riel */
    border-radius: 50%;
    margin: 5px auto 0;
    box-shadow: inset 0 2px 2px rgba(0,0,0,0.2);
}

.ticket-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2px;
}

.order-id {
    font-family: var(--font-code);
    font-size: 0.6rem;
    color: #999;
}

.icon-order {
    font-size: 1.8rem;
    margin: 2px 0;
}

.progress-bar {
    width: 80%;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    width: 100%;
    background: var(--success);
    transform-origin: left;
    transition: width 0.1s linear, background-color 0.3s;
}

/* Animaciones de Estado de Ticket */
.ticket.urgent {
    animation: shakeTicket 0.5s infinite;
}
.ticket.urgent .fill { background: var(--danger); }

.ticket.done {
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s;
}

@keyframes slideTicketIn {
    from { transform: translateY(-50px) scaleY(0); opacity: 0; }
    to { transform: translateY(0) scaleY(1); opacity: 1; }
}

@keyframes shakeTicket {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(2deg); }
    75% { transform: rotate(-2deg); }
    100% { transform: rotate(0deg); }
}

/* --------------------------------------------------------------------------
   12. PANTALLA DE RESULTADOS (GAME OVER)
   -------------------------------------------------------------------------- */
#screen-results {
    background: rgba(0,0,0,0.9);
}

.results-card {
    width: 700px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    position: relative;
    /* Efecto borde neón */
    animation: borderGlow 4s infinite alternate;
}

@keyframes borderGlow {
    from { box-shadow: 0 0 20px var(--dq-blue-dark); border-color: var(--dq-blue); }
    to { box-shadow: 0 0 30px var(--dq-blue-neon); border-color: var(--dq-blue-neon); }
}

.results-header {
    background: linear-gradient(to right, var(--dq-blue), var(--dq-blue-dark));
    padding: 20px;
    text-align: center;
    border-bottom: 4px solid var(--dq-orange);
}

.title-end {
    font-family: var(--font-arcade);
    font-size: 3rem;
    color: white;
    margin-bottom: 5px;
    text-shadow: 3px 3px 0 var(--dq-red);
}

.shift-info {
    font-family: var(--font-code);
    color: rgba(255,255,255,0.7);
    letter-spacing: 3px;
    font-size: 0.8rem;
}

/* Layout de Estadísticas */
.stats-container {
    display: flex;
    padding: 40px;
    gap: 40px;
    align-items: center;
}

/* Gráfica Circular SVG */
.score-circle {
    width: 180px;
    height: 180px;
    position: relative;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 100%;
}

.circle-bg {
    fill: none;
    stroke: #333;
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke: var(--dq-orange);
    stroke-width: 2.8;
    stroke-linecap: round;
    /* La animación se controla vía JS cambiando stroke-dasharray */
    transition: stroke-dasharray 1s ease-out;
}

.percentage {
    fill: #fff;
    font-family: var(--font-code);
    font-weight: bold;
    font-size: 0.5em;
    text-anchor: middle;
}

.score-label {
    position: absolute;
    bottom: -30px;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    font-weight: bold;
}

/* Lista de Stats */
.stats-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
    font-size: 1.1rem;
}

.stat-value { font-weight: 800; font-family: var(--font-code); }
.stat-value.danger { color: var(--danger); }
.stat-value.warning { color: var(--warning); }

/* Rating de Estrellas */
.star-rating-box {
    text-align: center;
    background: #111;
    padding: 20px;
    margin: 0 40px;
    border-radius: 8px;
    border: 1px solid #222;
}

.stars-container {
    font-size: 3rem;
    color: #444; /* Estrellas vacías */
    margin: 10px 0;
}

.star-filled {
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700;
    animation: popStar 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.manager-comment {
    font-style: italic;
    color: #aaa;
    font-size: 0.9rem;
}

@keyframes popStar {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.4); }
    100% { transform: scale(1); opacity: 1; }
}

/* Botones Finales */
.results-actions {
    padding: 30px 40px;
    display: flex;
    gap: 20px;
}

.action-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 6px;
    font-weight: 800;
    font-family: var(--font-ui);
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.1s, filter 0.2s;
}

.action-btn.restart {
    background: var(--success);
    color: white;
    box-shadow: 0 5px 0 #27ae60;
}

.action-btn.menu {
    background: #555;
    color: white;
    box-shadow: 0 5px 0 #333;
}

.action-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* --------------------------------------------------------------------------
   13. FEEDBACK VISUAL (Burbujas de texto)
   -------------------------------------------------------------------------- */
.feedback-bubble {
    position: absolute;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;
    color: white;
    pointer-events: none;
    z-index: 999;
    white-space: nowrap;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
    animation: floatUpFade 1s forwards;
}

.feedback-success { background: var(--success); }
.feedback-error { background: var(--danger); }
.feedback-info { background: var(--info); }
.feedback-neutral { background: #7f8c8d; }

@keyframes floatUpFade {
    0% { opacity: 0; transform: translateY(0) scale(0.8); }
    20% { opacity: 1; transform: translateY(-10px) scale(1.1); }
    100% { opacity: 0; transform: translateY(-50px) scale(1); }
}

/* Key Prompts (Teclas flotantes) */
.key-prompt.floating {
    width: 25px;
    height: 25px;
    background: #fff;
    color: #333;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 900;
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px white;
    animation: promptBounce 1s infinite;
    font-size: 0.7rem;
    border: 2px solid #333;
    z-index: 300;
}
.key-prompt.p1-key { background: var(--dq-blue-neon); color: white; border-color: var(--dq-blue); }
.key-prompt.p2-key { background: var(--dq-red-neon); color: white; border-color: var(--dq-red); }

@keyframes promptBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

/* --- FIN DEL ARCHIVO CSS MAESTRO --- */

/* --- PARCHE V3.1: FIX MANUAL Y MOVIMIENTO --- */

/* Arreglo del Manual Empalmado */
.manual-page {
    display: none !important; /* Oculta todo por defecto */
}
.manual-page.active {
    display: block !important; /* Solo muestra la activa */
    animation: fadeIn 0.3s ease;
}

/* Arreglo visual para botones de dificultad */
.diff-btn { pointer-events: all; }

/* Asegurar que el juego tenga foco para moverse */
body:focus-within { outline: none; }



/* ==============================================
   PARCHE DE EMERGENCIA: VISIBILIDAD DE JUGADORES
   ============================================== */

/* 1. Forzar que estén encima del piso */
.player-entity {
    z-index: 9999 !important; /* Capa superior absoluta */
    display: block !important; /* Asegurar que no estén ocultos */
    /* Quitar transición para arreglar el movimiento */
    transition: none !important; 
    will-change: transform;
}

/* 2. Definir dimensiones y colores base por si fallan las variables */
.player-body {
    width: 44px;
    height: 35px;
    background-color: #333 !important; /* Camisa gris oscuro */
    position: absolute;
    bottom: 5px;
    left: 8px;
    border: 2px solid white; /* Borde para verlos mejor */
}

.player-head {
    width: 40px;
    height: 40px;
    background-color: #f1c27d !important; /* Color piel */
    border-radius: 50%;
    position: absolute;
    top: -15px;
    left: 10px;
    z-index: 2;
    border: 2px solid black; /* Borde para ver la cabeza */
}

/* 3. Colores de Equipo (Hardcoded para asegurar que se vean) */
.p1-skin .uniform-apron {
    background-color: blue !important; /* AZUL FUERTE */
}
.p1-skin .hat-visor {
    background-color: blue !important;
}

.p2-skin .uniform-apron {
    background-color: red !important; /* ROJO FUERTE */
}
.p2-skin .hat-visor {
    background-color: red !important;
}

/* 4. Debug: Borde rojo si algo falla en el contenedor */
.player-entity {
    /* Descomenta la siguiente línea si SIGUEN sin verse para ver el cuadro invisible */
    /* border: 1px solid magenta; */ 
}