/* ==========================================================================
   NOTTO — Sistema de interfaz
   Dirección: sala de máquinas nocturna.

   El neón es material, no un filtro de brillo. Un tubo apagado es cristal
   oscuro con un reflejo tenue; encendido tiene núcleo casi blanco, halo corto
   y deja luz sobre la laca. Encendido/apagado codifica estado.

   El color dice en qué mundo estás:
     naranja  fábrica, el dinero que ganas
     magenta  sala de apuestas, el dinero que arriesgas
     cian     información y navegación
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800;900&family=Archivo+Black&family=Chivo+Mono:wght@400;500;700&display=swap');

/* --------------------------------------------------------------------------
   1. Fichas
   -------------------------------------------------------------------------- */

:root {
    /* Superficies: negro con un poso violeta, no negro puro */
    --void: #07070A;
    --lacquer: #0E0E14;
    --lacquer-hi: #16161F;
    --glass: #1B1B26;
    /* cristal del tubo apagado */
    --seam: #272733;
    --seam-hi: #353546;

    /* Texto */
    --chalk: #ECECF2;
    --ash: #8B8BA0;
    --ash-dim: #5E5E70;

    /* Neones */
    --neon-orange: #FF6B00;
    --neon-magenta: #FF2D95;
    --neon-cyan: #22E0FF;
    --neon-lime: #38F58A;
    --neon-red: #FF3B4E;
    --neon-gold: #FFC145;

    /* Acento activo. Lo reescribe cada mundo. */
    --accent: var(--neon-orange);
    --accent-core: #FFD2A8;
    /* núcleo casi blanco del tubo */

    /* Ritmo */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 24px;
    --sp-6: 32px;
    --sp-7: 48px;
    --sp-8: 64px;

    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-pill: 999px;

    /* Tipografía */
    --font-sign: 'Archivo Black', 'Archivo', system-ui, sans-serif;
    --font-ui: 'Archivo', system-ui, -apple-system, sans-serif;
    --font-num: 'Chivo Mono', ui-monospace, 'SF Mono', monospace;

    /* Movimiento */
    --ease: cubic-bezier(.2, .8, .2, 1);
    --ease-snap: cubic-bezier(.34, 1.56, .64, 1);
    --t-fast: .12s;
    --t-med: .24s;
    --t-slow: .5s;

    --z-panel: 100;
    --z-overlay: 900;
    --z-modal: 1000;
    --z-toast: 1100;
}

/* Mundos. Se pone en <body data-world="..."> */
[data-world="factory"] {
    --accent: var(--neon-orange);
    --accent-core: #FFD2A8;
}

[data-world="floor"] {
    --accent: var(--neon-magenta);
    --accent-core: #FFB8DC;
}

[data-world="info"] {
    --accent: var(--neon-cyan);
    --accent-core: #C4F6FF;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.5;
    color: var(--chalk);
    background: var(--void);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* La sala: una luz alta y fría, y el rebote cálido del acento desde abajo.
   Es estática — el ambiente da profundidad sin moverse. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(90% 55% at 50% -12%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 68%),
        radial-gradient(70% 45% at 50% 112%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%),
        radial-gradient(120% 80% at 50% 45%, transparent 40%, rgba(0, 0, 0, .55) 100%);
}

/* Grano fino: evita el degradado plástico de las superficies oscuras */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: .026;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-sign);
    font-weight: 400;
    letter-spacing: .04em;
    line-height: 1.1;
    text-transform: uppercase;
}

a {
    color: var(--accent);
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

/* Foco visible: un tubo que se enciende alrededor */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

::selection {
    background: color-mix(in srgb, var(--accent) 40%, transparent);
    color: #fff;
}

/* --------------------------------------------------------------------------
   3. Cursor — flecha y mano de neón
   -------------------------------------------------------------------------- */

body {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M5 3l6.5 20 2.9-7.6 7.6-2.9z' fill='%23FF6B00' opacity='.35' stroke='%23FF6B00' stroke-width='5' stroke-linejoin='round'/%3E%3Cpath d='M5 3l6.5 20 2.9-7.6 7.6-2.9z' fill='%23FF6B00' stroke='%23FFE9D6' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 3, auto;
}

a,
button,
select,
summary,
label[for],
[role="button"],
input[type="submit"],
input[type="button"],
input[type="checkbox"],
input[type="radio"],
.n-btn,
.click-button,
.upgrade-card,
.upgrade-header,
.upgrade-icon,
.ranking-toggle,
.close-ranking,
.options-link,
.nav-btn,
.theme-btn,
.game-card,
.play-button,
.back-button {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M13.5 6.5v-4a2 2 0 10-4 0v12l-2.6-1.3a1.4 1.4 0 00-1.7 2.1l5.6 7.2h11V11a2 2 0 10-4 0v2.6h-3V6.5z' fill='%23FF6B00' opacity='.35' stroke='%23FF6B00' stroke-width='5' stroke-linejoin='round'/%3E%3Cpath d='M13.5 6.5v-4a2 2 0 10-4 0v12l-2.6-1.3a1.4 1.4 0 00-1.7 2.1l5.6 7.2h11V11a2 2 0 10-4 0v2.6h-3V6.5z' fill='%23FF6B00' stroke='%23FFE9D6' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 10 3, pointer;
}

[disabled],
.is-locked,
.disabled {
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   4. Neón — el material
   -------------------------------------------------------------------------- */

/* Texto encendido. El halo cae rápido: dos paradas cortas y una larga tenue. */
.n-lit {
    color: var(--accent-core);
    text-shadow:
        0 0 3px color-mix(in srgb, var(--accent) 90%, transparent),
        0 0 12px color-mix(in srgb, var(--accent) 65%, transparent),
        0 0 34px color-mix(in srgb, var(--accent) 32%, transparent);
}

/* Texto apagado: cristal, sin halo */
.n-unlit {
    color: var(--glass);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .05);
}

/* Trazo encendido, para bordes y reglas */
.n-lit-edge {
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent),
        0 0 14px -2px color-mix(in srgb, var(--accent) 55%, transparent),
        inset 0 0 12px -6px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* Tubo: una regla de cristal que se enciende. Sirve de separador con estado. */
.n-tube {
    height: 2px;
    border-radius: var(--r-pill);
    background: var(--glass);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.n-tube.is-lit {
    background: var(--accent-core);
    box-shadow:
        0 0 4px color-mix(in srgb, var(--accent) 85%, transparent),
        0 0 16px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* El cebado de un tubo real: dos parpadeos y se queda. Una sola vez. */
@keyframes n-strike {
    0% {
        opacity: .2;
    }

    8% {
        opacity: 1;
    }

    12% {
        opacity: .3;
    }

    20% {
        opacity: 1;
    }

    24% {
        opacity: .5;
    }

    30%,
    100% {
        opacity: 1;
    }
}

.n-strike {
    animation: n-strike .5s steps(1, end) 1;
}

/* Latido lento, reservado para "la máquina está produciendo" */
@keyframes n-breathe {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .72;
    }
}

/* --------------------------------------------------------------------------
   5. Laca — las superficies
   -------------------------------------------------------------------------- */

.n-panel {
    position: relative;
    background: linear-gradient(180deg, var(--lacquer-hi) 0%, var(--lacquer) 60%);
    border: 1px solid var(--seam);
    border-radius: var(--r-lg);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .06),
        0 24px 48px -28px #000;
    overflow: hidden;
}

/* El reflejo del neón de arriba sobre la laca */
.n-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(120% 70% at 50% -20%,
            color-mix(in srgb, var(--accent) 13%, transparent), transparent 65%);
}

.n-panel>* {
    position: relative;
}

.n-panel.is-flat {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* Hueco: lo contrario de un panel. Para biseles y visores. */
.n-inset {
    background: #05050A;
    border: 1px solid #000;
    border-radius: var(--r-md);
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, .9),
        0 1px 0 rgba(255, 255, 255, .05);
}

/* --------------------------------------------------------------------------
   6. Rótulos y etiquetas
   -------------------------------------------------------------------------- */

.n-sign {
    font-family: var(--font-sign);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.n-label {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ash);
}

.n-num {
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    letter-spacing: -.01em;
}

.n-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    color: var(--accent-core);
}

.n-tag.is-win {
    --accent: var(--neon-lime);
    --accent-core: #C6FFE0;
}

.n-tag.is-loss {
    --accent: var(--neon-red);
    --accent-core: #FFC9CE;
}

.n-tag.is-muted {
    background: var(--glass);
    border-color: var(--seam);
    color: var(--ash);
}

/* --------------------------------------------------------------------------
   7. Botones
   -------------------------------------------------------------------------- */

.n-btn {
    --accent: var(--neon-orange);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 11px 20px;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
    border-radius: var(--r-md);
    background: linear-gradient(180deg,
            color-mix(in srgb, var(--accent) 22%, var(--lacquer-hi)),
            color-mix(in srgb, var(--accent) 8%, var(--lacquer)));
    color: var(--accent-core);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .1),
        0 0 18px -8px color-mix(in srgb, var(--accent) 70%, transparent);
    transition: transform var(--t-fast) var(--ease),
        box-shadow var(--t-med) var(--ease),
        background var(--t-med) var(--ease);
}

.n-btn:hover:not([disabled]) {
    background: linear-gradient(180deg,
            color-mix(in srgb, var(--accent) 34%, var(--lacquer-hi)),
            color-mix(in srgb, var(--accent) 14%, var(--lacquer)));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .14),
        0 0 26px -6px color-mix(in srgb, var(--accent) 85%, transparent);
}

/* Se hunde. Un botón físico no se encoge, baja. */
.n-btn:active:not([disabled]) {
    transform: translateY(1px);
    box-shadow:
        inset 0 3px 8px rgba(0, 0, 0, .6),
        0 0 12px -8px color-mix(in srgb, var(--accent) 60%, transparent);
}

.n-btn[disabled],
.n-btn.is-locked {
    background: var(--glass);
    border-color: var(--seam);
    color: var(--ash-dim);
    box-shadow: none;
    opacity: .75;
}

.n-btn.is-primary {
    --accent: var(--neon-orange);
}

.n-btn.is-bet {
    --accent: var(--neon-magenta);
    --accent-core: #FFB8DC;
}

.n-btn.is-info {
    --accent: var(--neon-cyan);
    --accent-core: #C4F6FF;
}

.n-btn.is-win {
    --accent: var(--neon-lime);
    --accent-core: #C6FFE0;
}

.n-btn.is-danger {
    --accent: var(--neon-red);
    --accent-core: #FFC9CE;
}

.n-btn.is-ghost {
    background: transparent;
    border-color: var(--seam-hi);
    color: var(--ash);
    box-shadow: none;
}

.n-btn.is-ghost:hover:not([disabled]) {
    background: var(--glass);
    color: var(--chalk);
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
    box-shadow: none;
}

.n-btn.is-sm {
    padding: 7px 13px;
    font-size: 11px;
}

.n-btn.is-lg {
    padding: 15px 30px;
    font-size: 15px;
}

.n-btn.is-block {
    width: 100%;
}

/* --------------------------------------------------------------------------
   8. Campos
   -------------------------------------------------------------------------- */

.n-field {
    width: 100%;
    padding: 11px 14px;
    background: #05050A;
    border: 1px solid var(--seam);
    border-radius: var(--r-md);
    color: var(--chalk);
    font-size: 14px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, .7);
    transition: border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}

.n-field::placeholder {
    color: var(--ash-dim);
}

.n-field:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--accent) 60%, transparent);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, .7),
        0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.n-field.n-num {
    font-family: var(--font-num);
}

/* --------------------------------------------------------------------------
   9. Visores — la firma
   El número es el producto. Va en cristal hundido, encendido como un tubo.
   -------------------------------------------------------------------------- */

.n-readout {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    padding: var(--sp-4) var(--sp-5);
    background: #05050A;
    border: 1px solid #000;
    border-radius: var(--r-md);
    box-shadow:
        inset 0 2px 14px rgba(0, 0, 0, .9),
        inset 0 0 30px -10px color-mix(in srgb, var(--accent) 30%, transparent),
        0 1px 0 rgba(255, 255, 255, .05);
}

.n-readout__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ash-dim);
}

.n-readout__value {
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: clamp(1.5rem, 5vw, 2.6rem);
    line-height: 1;
    color: var(--accent-core);
    text-shadow:
        0 0 4px color-mix(in srgb, var(--accent) 90%, transparent),
        0 0 16px color-mix(in srgb, var(--accent) 60%, transparent),
        0 0 44px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Piloto: dice si la máquina está produciendo */
.n-lamp {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--glass);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .1);
    flex: none;
}

.n-lamp.is-on {
    background: var(--accent-core);
    box-shadow:
        0 0 5px color-mix(in srgb, var(--accent) 90%, transparent),
        0 0 14px color-mix(in srgb, var(--accent) 60%, transparent);
    animation: n-breathe 2.4s var(--ease) infinite;
}

/* --------------------------------------------------------------------------
   10. Barras de progreso
   -------------------------------------------------------------------------- */

.n-bar {
    position: relative;
    height: 8px;
    border-radius: var(--r-pill);
    background: #05050A;
    border: 1px solid #000;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .8);
    overflow: hidden;
}

.n-bar__fill {
    height: 100%;
    border-radius: var(--r-pill);
    background: linear-gradient(90deg,
            color-mix(in srgb, var(--accent) 70%, transparent),
            var(--accent-core));
    box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent);
    transition: width var(--t-slow) var(--ease);
}

/* --------------------------------------------------------------------------
   11. Tablas y listas de datos
   -------------------------------------------------------------------------- */

.n-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.n-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ash-dim);
    border-bottom: 1px solid var(--seam);
}

.n-table td {
    padding: 11px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--seam) 60%, transparent);
}

.n-table tbody tr:hover {
    background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.n-table .num {
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* --------------------------------------------------------------------------
   12. Superposiciones
   -------------------------------------------------------------------------- */

.n-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay);
    background: rgba(3, 3, 6, .82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
}

.n-modal {
    position: relative;
    width: min(520px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    padding: var(--sp-6);
    background: linear-gradient(180deg, var(--lacquer-hi) 0%, var(--lacquer) 70%);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--seam));
    border-radius: var(--r-lg);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .07),
        0 40px 80px -30px #000,
        0 0 60px -30px color-mix(in srgb, var(--accent) 80%, transparent);
    animation: n-rise var(--t-med) var(--ease-snap);
}

@keyframes n-rise {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   13. Barras de desplazamiento
   -------------------------------------------------------------------------- */

.n-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--seam-hi) transparent;
}

.n-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    display: block;
}

.n-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.n-scroll::-webkit-scrollbar-thumb {
    background: var(--seam-hi);
    border-radius: var(--r-pill);
}

.n-scroll::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--accent) 55%, var(--seam-hi));
}

/* --------------------------------------------------------------------------
   14. Utilidades
   -------------------------------------------------------------------------- */

.n-stack {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.n-row {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.n-wrap {
    width: min(1180px, 100%);
    margin-inline: auto;
    padding-inline: var(--sp-4);
}

.n-mute {
    color: var(--ash);
}

.n-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   15. Movimiento reducido
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
