/* GLOBAL STYLES - 8BIT FLAT STYLE */
:root {
    --color1: #88aba3; /* Muted teal */
    --color2: #a42e3d; /* Deep red */
    --color3: #2e2f36; /* Dark gray */
    --glitch-color: #ff00ff; /* Rare error color */
    --link-color: #88aba3; /* Colore normale del link */
    --link-hover-color: #a42e3d; /* Colore quando il mouse ci passa sopra */
    --link-active-color: #ff0000; /* Colore quando cliccato */
    --link-visited-color: #7766aa; /* Colore per link già visitati */
}

@font-face {
    font-family: 'Typewriter';
    src: url('https://fonts.cdnfonts.com/s/20943/SFArborcrestHeavy.woff') format('woff');
}

body {
    background-color: var(--color3);
    color: var(--color1);
    font-family: 'Courier New', 'MS Gothic', monospace;
    font-weight: bold;
    margin: 0;
    padding: 0;
    line-height: 1.4;
    letter-spacing: 0.5px;
    overflow-x: hidden;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><rect x="0" y="0" width="16" height="16" fill="%2388aba3" opacity="0.7"/><rect x="4" y="4" width="8" height="8" fill="%23a42e3d"/></svg>'), auto;
    min-height: 100vh;
    position: relative;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* STILE BASE PER TUTTI I LINK */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s, text-shadow 0.3s;
}

/* QUANDO CI PASSI SOPRA COL MOUSE */
a:hover {
    color: var(--link-hover-color);
    text-shadow: 0 0 3px var(--link-hover-color);
    background-color: rgba(164, 46, 61, 0.1);
}

/* QUANDO È CLICCATO/ATTIVO */
a:active {
    color: var(--link-active-color);
}

/* LINK GIÀ VISITATI */
a:visited {
    color: var(--link-visited-color);
}

/* PER LINK SPECIFICI NEL TUO SITO */
.debug-item a {
    color: var(--link-color);
    padding: 0 2px;
}

.debug-item a:hover {
    color: var(--link-hover-color);
    text-shadow: 0 0 3px var(--link-hover-color);
    background-color: rgba(164, 46, 61, 0.1);
}

.nav-link {
    color: var(--link-color);
    border-color: var(--link-color);
}

.nav-link:hover {
    color: var(--link-hover-color);
    border-color: var(--link-hover-color);
    background-color: rgba(164, 46, 61, 0.2);
}

/* DOTTED GRID BACKGROUND - 8BIT STYLE */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0d1c18;
    background-image: 
        /* Albero con rami frattali semplici */
        /* Tronco */
        linear-gradient(90deg,
            transparent calc(50% - 2px),
            #88aba3 calc(50% - 2px),
            #88aba3 calc(50% + 2px),
            transparent calc(50% + 2px)
        ),
        /* Ramo orizzontale */
        linear-gradient(0deg,
            transparent calc(50% - 50px),
            #88aba3 calc(50% - 50px),
            #88aba3 calc(50% - 48px),
            transparent calc(50% - 48px)
        ),
        /* Rami diagonali */
        linear-gradient(45deg,
            transparent calc(50% - 30px),
            #88aba3 calc(50% - 30px),
            #88aba3 calc(50% - 28px),
            transparent calc(50% - 28px)
        ),
        linear-gradient(-45deg,
            transparent calc(50% - 30px),
            #88aba3 calc(50% - 30px),
            #88aba3 calc(50% - 28px),
            transparent calc(50% - 28px)
        ),
        /* Sub-rami */
        linear-gradient(30deg,
            transparent calc(50% - 45px),
            #88aba3 calc(50% - 45px),
            #88aba3 calc(50% - 43px),
            transparent calc(50% - 43px)
        ),
        linear-gradient(-30deg,
            transparent calc(50% - 45px),
            #88aba3 calc(50% - 45px),
            #88aba3 calc(50% - 43px),
            transparent calc(50% - 43px)
        );
    background-size: 300px 400px;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 
        100% 100%,
        10px 10px,
        10px 10px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.7;
}

/* SNOW EFFECT CONTAINER - FIXED */
#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.2;
}

.snowflake {
    position: absolute;
    background-color: var(--color1);
    border-radius: 0; /* SQUARE SNOW FOR 8BIT */
    opacity: 0.5;
    pointer-events: none;
    z-index: -1;
    image-rendering: pixelated;
}

/* MAIN CONTAINER */
.container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    padding: 20px;
    margin-top: 40px;
    background-color: rgba(46, 47, 54);
    border: 2px solid var(--color1);
    box-shadow: none; /* REMOVED GRADIENTS/SHADOWS */
}

/* HEADER & TITLE */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    position: relative;
    border-bottom: 1px solid var(--color2);
}

.main-title {
    font-family: 'Typewriter', 'Courier New', monospace;
    font-size: 24px;
    color: var(--color2);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 10px 0;
    animation: glitch 5s infinite;
    border: 2px solid var(--color2);
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
}

.payoff {
    color: var(--color1);
    font-size: 14px;
    margin: 10px 0;
    font-style: italic;
    letter-spacing: 1px;
}

.japanese-subtitle {
    color: rgba(136, 171, 163, 0.8);
    font-size: 11px;
    margin: 5px 0;
    font-family: 'MS Gothic', 'MS PGothic', monospace;
    letter-spacing: 1px;
}

/* ASCII FOXES - UPDATED WITH YOUR DESIGNS */
.ascii-fox {
    font-family: monospace;
    font-size: 6px;
    line-height: 6px;
    color: var(--color2);
    margin: 30px auto;
    text-align: center;
    opacity: 0.8;
    animation: fadeInOut 12s infinite alternate;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    display: inline-block;
    border: 1px solid var(--color1);
    display: flex;
    justify-content: center; /* horizontal */
    align-items: center;     /* vertical */
}

/* CONTENT BLOCKS - LESS PROMPT-LIKE */
.block {
    margin: 40px 0;
    padding: 15px;
    border-left: 2px solid transparent;
    transition: all 0.5s;
    position: relative;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color1);
}

.block:hover {
    border-left-color: var(--color2);
    background-color: rgba(136, 171, 163, 0.1);
    border-color: var(--color2);
}

.block-title {
    color: var(--color2);
    font-size: 16px;
    margin-bottom: 10px;
    font-family: 'Typewriter', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-left: 10px;
    border-bottom: 1px solid var(--color2);
    padding-bottom: 5px;
}

.content {
    font-size: 13px;
    margin-left: 15px;
    letter-spacing: 0.3px;
    line-height: 1.5;
}

.content p {
    margin: 8px 0;
    padding-left: 0;
}

.content.jp {
    color: rgba(153, 153, 153, 0.9);
    font-family: 'MS Gothic', 'MS PGothic', monospace;
    margin-top: 12px;
    border-top: 1px solid rgba(68, 68, 68, 0.5);
    padding-top: 12px;
    font-size: 12px;
    line-height: 1.5;
}

/* DEBUG MENU */
.debug-menu {
    background-color: rgba(0, 0, 0, 0.4);
    padding: 15px;
    margin: 30px 0;
    border: 2px solid var(--color1);
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

.debug-item {
    margin: 6px 0;
    font-family: monospace;
}

/* BAZI DISPLAY */
.bazi-display {
    font-family: monospace;
    font-size: 22px;
    color: var(--color2);
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--color1);
    animation: pulse 15s infinite;
    text-shadow: 0 0 5px rgba(164, 46, 61, 0.3);
}

/* NFT ARTIFACTS */
.artifact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 20px 0;
}

.artifact {
    border: 1px solid var(--color1);
    padding: 8px;
    text-align: center;
    font-size: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    transition: all 0.5s;
    font-family: 'Courier New', monospace;
}

.artifact:hover {
    border-color: var(--color2);
    transform: translateY(-3px);
    background-color: rgba(0, 0, 0, 0.5);
}

/* ACTIVE BLINKING EFFECT */
.active-blink {
    animation: blink 1s infinite;
    color: var(--color2);
    font-weight: bold;
}

/* GLITCH EFFECTS */
.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch-text::before {
    left: 1px;
    text-shadow: -1px 0 var(--glitch-color);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch-text::after {
    left: -1px;
    text-shadow: 1px 0 var(--color1);
    animation: glitch-anim-2 7s infinite linear alternate-reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

/* FOOTER */
.footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--color1);
    font-size: 10px;
    color: rgba(102, 102, 102, 0.8);
    font-family: 'Courier New', monospace;
}

/* ANIMATIONS */
@keyframes glitch {
    0%, 100% { transform: translate(0); }
    97% { transform: translate(-0.5px, 0.5px); }
    98% { transform: translate(1px, -0.5px); }
    99% { transform: translate(-0.5px, 0); }
}

@keyframes glitch-anim-1 {
    0% { transform: translate(0); }
    20% { transform: translate(-1px, 1px); }
    40% { transform: translate(-1px, -1px); }
    60% { transform: translate(1px, 1px); }
    80% { transform: translate(1px, -1px); }
    100% { transform: translate(0); }
}

@keyframes glitch-anim-2 {
    0% { transform: translate(0); }
    25% { transform: translate(1px, -1px); }
    50% { transform: translate(-1px, 2px); }
    75% { transform: translate(-2px, -1px); }
    100% { transform: translate(0); }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; text-shadow: 0 0 5px rgba(164, 46, 61, 0.3); }
    50% { opacity: 0.9; text-shadow: 0 0 10px rgba(164, 46, 61, 0.5); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* WARNING TEXT */
.warning {
    color: var(--color2);
    font-size: 10px;
    text-align: center;
    margin: 8px 0;
    font-style: italic;
    animation: blink 4s infinite;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* SPOTIFY PLAYER */
.player-container {
    margin: 30px 0;
    border: 2px solid var(--color1);
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.3);
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .container {
        padding: 15px;
        margin-top: 20px;
        border: 2px solid var(--color1);
    }
    
    .main-title {
        font-size: 18px;
    }
    
    .artifact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    body {
        padding: 10px;
    }
    
    .ascii-fox {
        font-size: 4px;
        line-height: 4px;
    }
}

/* SCROLLBAR STYLING */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(26, 26, 26, 0.5);
}

::-webkit-scrollbar-thumb {
    background: var(--color1);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color2);
}

/* TAOIST/SHINTO ELEMENTS */
.shinto-symbol {
    font-family: 'MS Gothic', monospace;
    color: var(--color2);
    font-size: 20px;
    text-align: center;
    margin: 20px 0;
}

.taoist-symbol {
    font-size: 18px;
    color: var(--color1);
    text-align: center;
    margin: 15px 0;
    font-family: 'MS Gothic', monospace;
}

.ritual-border {
    border: 1px dashed var(--color1);
    padding: 5px;
    margin: 10px 0;
}

/* Snow animations */
@keyframes snow-fall {
    to {
        transform: translateY(100vh);
    }
}