/* ===================== DUNGEONPUNK COMPLETE CSS ===================== */

/* ===================== BODY ===================== */
body {
    background-color: #0f120c; /* deep shadow, forest dungeon */
    color: #c0d08b; /* muted torchlight greenish-amber */
    font-family: 'Uncial Antiqua', 'Gloock', serif; /* archaic/fantasy font */
    line-height: 1.6;
    margin: 0;
    padding: 2em;
    position: relative;
    overflow-x: hidden;
}

/* ===================== MOSSES AND DRIFTING SPORES ===================== */
body::before,
body::after {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 5;
    background-repeat: repeat;
    opacity: 0.1;
}

body::before {
    background-image: radial-gradient(circle, rgba(155,187,107,0.4) 1px, transparent 2px);
    animation: driftSpore 20s linear infinite;
}

body::after {
    background-image: radial-gradient(circle, rgba(183,220,143,0.2) 1px, transparent 2px);
    animation: driftSpore 25s linear infinite reverse;
}

@keyframes driftSpore {
    0% { transform: translate(0,0); }
    100% { transform: translate(100vw, 100vh); }
}

/* ===================== HEADINGS ===================== */
h2, heading {
    color: #9dbb6b; /* forest torchlight amber-green */
    font-family: 'Uncial Antiqua', 'Gloock', serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 2px #5b6b3a, 0 0 6px #c0d08b;
    margin-bottom: 1em;
    animation: torch-flicker 5s infinite; /* slower, more natural flicker */
}

@keyframes torch-flicker {
    0%, 100% { text-shadow: 0 0 2px #5b6b3a, 0 0 6px #c0d08b; }
    20% { text-shadow: 0 0 3px #c0d08b, 0 0 8px #5b6b3a; }
    40% { text-shadow: 0 0 2px #a3c45f, 0 0 5px #5b6b3a; }
    60% { text-shadow: 0 0 4px #c0d08b, 0 0 10px #5b6b3a; }
    80% { text-shadow: 0 0 3px #9dbb6b, 0 0 6px #556b2f; }
}

/* ===================== GENERATOR BOX ===================== */
.generator-box {
    border: 2px solid #556b2f; /* forest bronze/metal */
    background: #1a1f12; /* mossy dungeon shadow */
    padding: 1em 2em;
    margin-bottom: 2em;
    box-shadow: inset 0 0 10px #a3c45f, 0 0 5px #556b2f, 0 0 20px rgba(155, 187, 107, 0.2);
    position: relative;
}

.generator-box::before {
    content: "⚔ 🜂 ⛧";
    position: absolute;
    top: -0.5em;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: rgba(83, 107, 47, 0.3);
    pointer-events: none;
    animation: rune-flicker 2s infinite;
}

@keyframes rune-flicker {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ===================== BUTTONS ===================== */
button {
    background: #243217; /* dark forest stone */
    color: #c0d08b; /* mossy amber */
    border: 2px solid #556b2f; /* rustic metal */
    padding: 0.6em 1.2em;
    font-family: 'Uncial Antiqua', serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 0 3px #a3c45f;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

button:hover {
    background: #2e3b1a;
    color: #e0f2a3;
    box-shadow: 0 0 8px #a3c45f, 0 0 15px #556b2f;
}

button::after {
    content: "";
    position: absolute;
    top:0; left:0; width:100%; height:100%;
    background: radial-gradient(circle, rgba(183,220,143,0.3) 1px, transparent 2px);
    animation: buttonSpore 10s linear infinite;
    pointer-events: none;
    mix-blend-mode: overlay;
}

@keyframes buttonSpore {
    0% { transform: translate(0,0); }
    100% { transform: translate(20%,20%); }
}

/* ===================== OUTPUT SPANS ===================== */
span {
    color: #c0d08b;
    text-shadow: 0 0 2px #556b2f;
    font-weight: bold;
}

/* ===================== PARAGRAPHS ===================== */
p {
    max-width: 900px;
    line-height: 1.6;
    margin-bottom: 1em;
    color: #b0c480; /* muted forest amber */
}

/* ===================== TABLE ===================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: #1b2412; /* mossy dungeon tile */
    color: #c0d08b;
    font-family: 'Uncial Antiqua', serif;
    margin-top: 2em;
    box-shadow: 0 0 5px #556b2f inset;
}

th, td {
    border: 1px solid #556b2f;
    padding: 0.5em;
    text-align: center;
}

th {
    background: #243217;
    color: #9dbb6b;
    text-shadow: 0 0 2px #556b2f;
}

tr:nth-child(even) {
    background: #1a1f12;
}

tr:hover {
    background: #2a3b1a;
    box-shadow: inset 0 0 5px #a3c45f;
}

/* ===================== SMALL ICONS / SYMBOLS ===================== */
.symbol {
    color: #9dbb6b;
    text-shadow: 0 0 3px #a3c45f;
    font-size: 1.2rem;
}

/* ===================== CRT / PIXEL SHIMMER ===================== */
.crt-overlay {
    position: fixed;
    top:0; left:0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1000;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255,255,255,0.03),
            rgba(255,255,255,0.03) 1px,
            transparent 1px,
            transparent 2px
        );
    animation: crtNoise 1s steps(2) infinite; /* slower shimmer */
}

@keyframes crtNoise {
    0% { background-position: 0 0; }
    100% { background-position: 0 100%; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 600px) {
    body { padding: 1em; }

    button {
        font-size: 0.9rem;
        padding: 0.4em 0.8em;
    }

    table { font-size: 0.8rem; }
}
