@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Rajdhani:wght@400;500;600;700&display=swap');

@font-face {
    font-family: "Directors Gothic";
    src: url('assets/fonts/directorsgothic.woff') format('woff');
}

/* Pip-Boy Color Palette */
:root {
    --pipboy-primary: #14F593;
    --pipboy-primary-dark: #0a7d4b;
    --pipboy-bg: #0D1A14;
    --pipboy-bg-light: #1A3329;
    --pipboy-error: #FF7862;
    --pipboy-warn: #FFD700;
}

/* Light Mode */
body[data-theme="light"] {
    --pipboy-primary: #0a7d4b;
    --pipboy-primary-dark: #065a36;
    --pipboy-bg: #ffffff;
    --pipboy-bg-light: #f0f0f0;
    --pipboy-error: #d32f2f;
    --pipboy-warn: #e65100;
    color: #1a1a1a;
}

body[data-theme="light"]::before,
body[data-theme="light"]::after {
    opacity: 0.05;
}

body[data-theme="light"] h1,
body[data-theme="light"] h2,
body[data-theme="light"] h3 {
    color: #0a7d4b;
}

body[data-theme="light"] a {
    color: #0a7d4b;
}

body[data-theme="light"] .maincontainer,
body[data-theme="light"] .subcontainer {
    background-color: rgba(240, 240, 240, 0.8);
    border-color: #0a7d4b;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--pipboy-bg);
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: var(--pipboy-primary);
}

/* CRT Scanline Effect */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    z-index: 100;
    opacity: 0.3;
    animation: flicker 0.3s infinite;
}

/* Random Background Glitch Overlay */
body::after {
    content: "";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
    opacity: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 0, 0, 0.1) 25%,
        rgba(0, 255, 0, 0.1) 50%,
        rgba(0, 0, 255, 0.1) 75%,
        transparent 100%
    );
    animation: random-glitch 120s infinite;
}

@keyframes flicker {
    0% { opacity: 0.25; }
    50% { opacity: 0.35; }
    100% { opacity: 0.25; }
}

/* Text Glitch Effect */
@keyframes glitch {
    0% {
        text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
                    -0.05em -0.025em 0 rgba(0, 255, 0, 0.75),
                    -0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    }
    14% {
        text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
                    -0.05em -0.025em 0 rgba(0, 255, 0, 0.75),
                    -0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    }
    15% {
        text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
                    0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
                    -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    49% {
        text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
                    0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
                    -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    50% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
                    0.05em 0 0 rgba(0, 255, 0, 0.75),
                    0 -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    99% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
                    0.05em 0 0 rgba(0, 255, 0, 0.75),
                    0 -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    100% {
        text-shadow: -0.025em 0 0 rgba(255, 0, 0, 0.75),
                    -0.025em -0.025em 0 rgba(0, 255, 0, 0.75),
                    -0.025em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
}

/* RGB Glitch Effect */
@keyframes rgb-glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

/* Screen Tear Effect */
@keyframes screen-tear {
    0% {
        clip-path: inset(0 0 0 0);
    }
    10% {
        clip-path: inset(20% 0 30% 0);
        transform: translateX(10px);
    }
    20% {
        clip-path: inset(40% 0 20% 0);
        transform: translateX(-5px);
    }
    30% {
        clip-path: inset(0 0 0 0);
        transform: translateX(0);
    }
    100% {
        clip-path: inset(0 0 0 0);
        transform: translateX(0);
    }
}

/* Background Glitch Overlay */
@keyframes bg-glitch {
    0% {
        background-position: 0 0;
        filter: hue-rotate(0deg);
    }
    10% {
        background-position: -5px 0;
        filter: hue-rotate(90deg);
    }
    20% {
        background-position: 5px 0;
        filter: hue-rotate(0deg);
    }
    30% {
        background-position: 0 0;
        filter: hue-rotate(0deg);
    }
    100% {
        background-position: 0 0;
        filter: hue-rotate(0deg);
    }
}

/* Random Screen Glitch */
@keyframes random-glitch {
    0% {
        opacity: 0;
        transform: translateX(0);
    }
    2% {
        opacity: 0;
    }
    3% {
        opacity: 0.8;
        transform: translateX(-10px);
    }
    4% {
        opacity: 0;
        transform: translateX(10px);
    }
    5% {
        opacity: 0;
        transform: translateX(0);
    }
    25% {
        opacity: 0;
    }
    26% {
        opacity: 0.6;
        transform: translateX(5px) scaleX(1.02);
    }
    27% {
        opacity: 0;
        transform: translateX(-5px);
    }
    28% {
        opacity: 0;
        transform: translateX(0);
    }
    60% {
        opacity: 0;
    }
    61% {
        opacity: 0.9;
        transform: translateX(-8px);
        filter: hue-rotate(45deg);
    }
    62% {
        opacity: 0.5;
        transform: translateX(8px);
    }
    63% {
        opacity: 0;
        transform: translateX(0);
        filter: hue-rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateX(0);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--pipboy-bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--pipboy-primary);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--pipboy-primary-dark);
}

::selection {
    background: var(--pipboy-primary);
    color: var(--pipboy-bg);
}

/* Header */
header {
    text-align: center;
    margin: 0 auto;
    padding: 0;
}

/* Pip-Boy 3000 Style Navigation */
.navigation {
    width: 95%;
    max-width: 900px;
    height: auto;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(13, 26, 20, 0.95) 0%, rgba(13, 26, 20, 0.85) 100%);
    backdrop-filter: blur(10px);
    box-shadow:
        0 0 30px rgba(20, 245, 147, 0.4),
        inset 0 0 50px rgba(20, 245, 147, 0.05),
        inset 0 2px 0 rgba(20, 245, 147, 0.3),
        inset 0 -2px 0 rgba(20, 245, 147, 0.3);
    border: 3px solid var(--pipboy-primary);
    border-radius: 12px;
    margin: 16px auto;
    padding: 15px 20px;
    position: relative;
    overflow: hidden;
}

/* CRT Screen scanline effect for nav */
.navigation::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 3px
    );
    pointer-events: none;
    z-index: 1;
}

/* Pip-Boy screen corners */
.navigation::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    bottom: 8px;
    left: 8px;
    border: 1px solid rgba(20, 245, 147, 0.2);
    border-radius: 8px;
    pointer-events: none;
    z-index: 0;
}

.navigation a {
    text-decoration: none;
    color: var(--pipboy-primary);
    position: relative;
    z-index: 2;
}

.navigation img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
    margin: 0 12px 0 0;
    filter: brightness(0) saturate(100%) invert(77%) sepia(62%) saturate(424%) hue-rotate(100deg) brightness(95%) contrast(93%);
    vertical-align: middle;
    position: relative;
    z-index: 2;
}

ul {
    list-style-type: none;
}

header ul {
    display: inline-block;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    position: relative;
    z-index: 2;
}

header ul li {
    display: inline-block;
    margin: 0 6px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    text-decoration: none;
}

header ul li a {
    display: inline-block;
    padding: 8px 14px;
    background: linear-gradient(180deg, rgba(20, 245, 147, 0.1) 0%, rgba(20, 245, 147, 0.05) 100%);
    border: 2px solid rgba(20, 245, 147, 0.6);
    border-radius: 4px;
    color: var(--pipboy-primary);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 13px;
    transition: all 0.2s ease;
    box-shadow: 0 0 8px rgba(20, 245, 147, 0.15), inset 0 0 8px rgba(20, 245, 147, 0.08);
    position: relative;
}

header ul li a:hover {
    background: linear-gradient(180deg, var(--pipboy-primary) 0%, rgba(20, 245, 147, 0.9) 100%);
    color: var(--pipboy-bg);
    border-color: var(--pipboy-primary);
    box-shadow:
        0 0 20px rgba(20, 245, 147, 0.7),
        inset 0 0 15px rgba(20, 245, 147, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
    text-shadow: 0 0 5px rgba(13, 26, 20, 0.8);
}

header ul li a:active {
    transform: translateY(0);
    box-shadow:
        0 0 15px rgba(20, 245, 147, 0.5),
        inset 0 0 10px rgba(20, 245, 147, 0.2);
}

a {
    transition: 0.2s;
    color: var(--pipboy-primary);
    position: relative;
}

a:hover {
    text-shadow: 0 0 10px var(--pipboy-primary);
    color: var(--pipboy-primary);
    animation: glitch 0.3s infinite;
}

h1 {
    position: relative;
    font-family: "Directors Gothic", 'Rajdhani', sans-serif;
    color: var(--pipboy-primary);
    font-size: 2.6em;
    text-align: center;
    text-shadow: 0 0 20px rgba(20, 245, 147, 0.7), 0 0 30px rgba(20, 245, 147, 0.5);
    cursor: default;
    margin: 15px 0 10px 0;
    padding: 0;
    letter-spacing: 0.05em;
}

h1:hover {
    animation: glitch 0.5s ease-in-out;
}

h2 {
    font-family: 'Rajdhani', sans-serif;
    color: var(--pipboy-primary);
    font-size: 1.8em;
    text-shadow: 0 0 10px rgba(20, 245, 147, 0.5);
    cursor: default;
}

h2:hover {
    animation: glitch 0.5s ease-in-out;
}

h3 {
    font-family: 'Share Tech Mono', monospace;
    font-size: 18px;
    font-weight: normal;
    color: var(--pipboy-primary);
}

p {
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    color: var(--pipboy-primary);
}

.logo {
    filter: brightness(0) saturate(100%) invert(77%) sepia(62%) saturate(424%) hue-rotate(100deg) brightness(95%) contrast(93%);
}

.navigation img {
    width: 48px !important;
    height: 48px !important;
    object-fit: contain;
}

/* Main Container */
.maincontainer {
    width: 68vw;
    height: fit-content;
    margin: 12px auto;
    padding: 3vw;
    background-color: rgba(26, 51, 41, 0.6);
    backdrop-filter: blur(5px);
    box-shadow: 0 0 20px rgba(20, 245, 147, 0.3);
    border: 1px solid var(--pipboy-primary);
    border-radius: 8px;
}

.maincontainer .datacontainer {
    display: grid;
    grid-template-columns: 25% 25% 25% 25%;
}

/* Wallet page with 9 items */
#walletpage .datacontainer {
    grid-template-columns: 33.33% 33.33% 33.33%;
}

.maincontainer .datacontainer div {
    margin-left: 5vw;
}

.datacontainer h2 {
    font-family: "Directors Gothic", 'Rajdhani', sans-serif;
    font-size: 24px;
    font-weight: normal;
    color: var(--pipboy-primary);
    margin-top: -2vh;
    text-shadow: 0 0 15px rgba(20, 245, 147, 0.6);
}

#workerlist {
    padding: 0 12px;
}

#minerhashrate::after, #pool_hr::after, #global_hr::after {
    content: "H/s";
    font-size: 16px;
}

#minerworkers::after {
    content: " ACTIVE";
    font-size: 16px;
}

/* Coin symbol is now dynamically added via JavaScript based on selected coin */
/* #minerpending::after, #minerrewarded::after, #minerlifetime::after {
    content: " BC2";
    font-size: 16px;
} */

#minershares::after {
    content: " SENT";
    font-size: 16px;
}

/* Input Container */
.inputcontainer {
    background-color: rgba(26, 51, 41, 0.6);
    backdrop-filter: blur(5px);
    box-shadow: 0 0 20px rgba(20, 245, 147, 0.3);
    border: 1px solid var(--pipboy-primary);
    border-radius: 8px;
    width: fit-content;
    padding: 20px;
    margin: calc(12px + 4vw) auto;
}

input[type=text] {
    width: 40vw;
    height: 38px;
    background-color: var(--pipboy-bg);
    border: 1px solid var(--pipboy-primary);
    border-radius: 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: var(--pipboy-primary);
    vertical-align: bottom;
    float: left;
    padding: 0 10px;
}

input[type=text]:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(20, 245, 147, 0.5);
}

#workerlist li {
    font-family: 'Share Tech Mono', monospace;
    color: var(--pipboy-primary);
}

#minersearch {
    background-color: var(--pipboy-primary-dark);
    border: 1px solid var(--pipboy-primary);
    transition: 0.1s;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
}

#minersearch:hover {
    background-color: var(--pipboy-primary);
    color: var(--pipboy-bg);
    box-shadow: 0 0 15px rgba(20, 245, 147, 0.5);
    animation: glitch 0.3s infinite;
}

#minersearch:active {
    filter: brightness(78%);
}

#minersearch img {
    width: 38px;
    height: auto;
    border-radius: 8px;
    filter: brightness(0) saturate(100%) invert(77%) sepia(62%) saturate(424%) hue-rotate(100deg) brightness(95%) contrast(93%);
}

#addresslabel {
    font-size: 1.5em;
    margin: -8vw 0 8vw 0;
    color: var(--pipboy-primary);
    text-shadow: 0 0 15px rgba(20, 245, 147, 0.5);
}

/* Graph Containers */
.graphcontainer {
    margin: -16px auto;
    width: 90%;
    height: 80%;
}

.largegraphcontainer {
    margin: 22px auto;
    width: 90%;
    height: 30vw;
}

.largegraphcontainer h3 {
    margin-left: 24px;
}

/* Duo Container */
.duocontainer {
    display: grid;
    grid-template-columns: 50% 50%;
    margin: 12px auto;
    width: 80vw;
    padding: 20px;
}

.duocontainer h3 {
    margin: 24px;
}

.duocontainer .subcontainer {
    width: 34vw;
    height: 34vw;
    background-color: rgba(26, 51, 41, 0.6);
    backdrop-filter: blur(5px);
    box-shadow: 0 0 20px rgba(20, 245, 147, 0.3);
    border: 1px solid var(--pipboy-primary);
    border-radius: 8px;
    margin: 3vw;
}

.unknown {
    display: block;
    margin: 24px auto;
    width: 64%;
    height: auto;
    filter: brightness(0) saturate(100%) invert(77%) sepia(62%) saturate(424%) hue-rotate(100deg) brightness(95%) contrast(93%);
}

/* Footer */
footer {
    background-color: var(--pipboy-bg-light);
    border-top: 1px solid var(--pipboy-primary);
    width: 100%;
    height: fit-content;
    padding: 16px 0;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    margin-top: 24px;
}

footer h3 {
    margin-left: 10vw;
    color: var(--pipboy-primary);
}

footer .datacontainer {
    display: grid;
    grid-template-columns: 30% 30%;
    margin: 34px auto;
}

footer ul {
    padding-left: 0;
    margin-top: -10px;
    margin-left: 10vw;
}

footer li {
    margin: 10px 0;
}

footer a {
    color: var(--pipboy-primary);
    text-decoration: none;
}

footer a:hover {
    text-shadow: 0 0 10px var(--pipboy-primary);
}

footer p {
    margin-left: 10vw;
    font-size: 12px;
    color: var(--pipboy-primary-dark);
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    h1 {
        font-size: clamp(1.5em, 5vw, 2.5em);
        word-wrap: break-word;
        padding: 0 10px;
    }

    h2 {
        font-size: clamp(1.2em, 4vw, 1.8em);
    }

    .maincontainer {
        width: 85vw;
        padding: 4vw;
    }

    .maincontainer .datacontainer {
        grid-template-columns: 50% 50%;
    }

    #walletpage .datacontainer {
        grid-template-columns: 50% 50%;
    }

    .duocontainer {
        grid-template-columns: 100%;
        width: 90vw;
    }

    .duocontainer .subcontainer {
        width: 80vw;
        height: 80vw;
        margin: 2vw auto;
    }

    header ul li {
        margin: 24px 12px 0px 0px;
        font-size: 14px;
    }

    header ul li a {
        padding: 8px 16px;
        font-size: 13px;
    }

    .navigation {
        margin: 12px;
    }

    input[type=text] {
        width: 60vw;
    }

    .largegraphcontainer {
        height: 50vw;
    }

    table {
        font-size: 12px;
    }

    table th, table td {
        padding: 8px !important;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        font-size: 12px;
    }

    h1 {
        font-size: clamp(1.2em, 6vw, 2em);
        word-wrap: break-word;
        padding: 0 15px;
        line-height: 1.2;
    }

    h2 {
        font-size: clamp(1em, 4vw, 1.5em);
        padding: 0 10px;
    }

    h3 {
        font-size: 14px;
    }

    p {
        font-size: 12px;
    }

    /* Navigation mobile adjustments */
    .navigation {
        width: 95%;
        height: auto;
        border-radius: 24px;
        margin: 12px auto;
        padding: 8px 0;
    }

    .navigation img {
        width: 36px;
        height: 36px;
    }

    header ul {
        float: none;
        margin: 0;
        padding: 0;
        text-align: center;
    }

    header ul li {
        display: inline-block;
        margin: 8px 4px;
        font-size: 12px;
    }

    header ul li a {
        padding: 6px 12px;
        font-size: 11px;
        border-width: 1px;
    }

    /* Theme toggle button mobile */
    #theme-toggle {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 0.9em;
        z-index: 1001;
    }

    /* Main containers */
    .maincontainer {
        width: 90vw;
        padding: 4vw;
        margin: 12px auto;
    }

    .maincontainer .datacontainer {
        grid-template-columns: 100%;
        margin-left: 0;
    }

    .maincontainer .datacontainer div {
        margin-left: 0;
        margin-bottom: 1em;
    }

    #walletpage .datacontainer {
        grid-template-columns: 100%;
    }

    /* Input fields */
    .inputcontainer {
        width: 85vw;
        padding: 15px;
    }

    input[type=text] {
        width: 100%;
        max-width: none;
        font-size: 12px;
        margin-bottom: 10px;
    }

    #minersearch {
        width: 100%;
        margin-top: 10px;
    }

    /* Graphs */
    .duocontainer {
        display: block;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    .duocontainer .subcontainer {
        width: 90vw;
        height: 90vw;
        max-height: 400px;
        margin: 12px auto;
    }

    .largegraphcontainer {
        height: 60vw;
        min-height: 200px;
        max-height: 400px;
        width: 95%;
    }

    .graphcontainer {
        width: 95%;
        height: auto;
        min-height: 150px;
    }

    /* Tables */
    table {
        font-size: 10px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    table th,
    table td {
        padding: 6px 4px !important;
        font-size: 10px;
    }

    /* Footer */
    footer {
        padding: 12px 0;
    }

    footer .datacontainer {
        grid-template-columns: 100%;
        width: 90%;
        margin: 20px auto;
    }

    footer h3 {
        margin-left: 5vw;
        font-size: 14px;
    }

    footer ul {
        margin-left: 5vw;
    }

    footer p {
        margin-left: 5vw;
        font-size: 11px;
    }

    /* Home button */
    #homebtn {
        padding: 10px 20px;
        font-size: 12px;
    }

    /* Worker list grid */
    #workerlist > div {
        grid-template-columns: 100% !important;
    }

    /* Address label */
    #addresslabel {
        font-size: 1em;
        word-break: break-all;
        padding: 0 10px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.2em;
    }

    header ul li {
        margin: 6px 3px;
        font-size: 11px;
    }

    header ul li a {
        padding: 5px 10px;
        font-size: 10px;
    }

    .maincontainer {
        width: 95vw;
        padding: 3vw;
    }

    table {
        font-size: 9px;
    }

    table th,
    table td {
        padding: 4px 2px !important;
        font-size: 9px;
    }

    #theme-toggle {
        padding: 6px 10px;
        font-size: 0.8em;
    }

    .largegraphcontainer {
        height: 70vw;
    }

    .duocontainer .subcontainer {
        width: 95vw;
        height: 95vw;
    }

    /* Fire title mobile optimization */
    .fire-title {
        font-size: 1.5em !important;
        line-height: 1.3 !important;
        padding: 0 10px !important;
    }
}

/* Responsive adjustments for BC2 Market Data and Charts */
@media (max-width: 768px) {
    /* BC2 stats grid - stack on mobile */
    div[style*="grid-template-columns: repeat(auto-fit, minmax(150px, 1fr))"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.8em !important;
    }

    /* Charts section - stack vertically on mobile */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    /* BC2 stats - single column on very small screens */
    div[style*="grid-template-columns: repeat(auto-fit, minmax(150px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }

    /* Work contribution grid - single column on very small screens */
    div[style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* Wallet page work contribution responsive */
@media (max-width: 768px) {
    /* Work contribution - 2 columns on tablets/mobile */
    div[style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Expected reward font size adjustment */
    #miner_expected_reward {
        font-size: 1.5em !important;
    }

    /* Pool address - better wrapping on mobile */
    #pool_address {
        font-size: 1em !important;
        word-break: break-all;
        padding: 8px !important;
    }

    /* Expected time / probability cards - reduce font size */
    #expected_time, #daily_chance, #monthly_blocks {
        font-size: 1.8em !important;
    }

    /* Progress bar parent adjustments */
    div[style*="display: flex; justify-content: space-between"] {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}

@media (max-width: 480px) {
    /* Expected time / probability cards - single column on small screens */
    div[style*="display: grid; grid-template-columns: 1fr 1fr 1fr"]:not(.datacontainer) {
        grid-template-columns: 1fr !important;
    }

    /* Pool address - even smaller on tiny screens */
    #pool_address {
        font-size: 0.85em !important;
    }

    /* Smaller progress percentage */
    #progress_percentage {
        font-size: 1.2em !important;
    }
}

#homebtn {
    background-color: var(--pipboy-primary-dark);
    border: 1px solid var(--pipboy-primary);
    padding: 12px 24px;
    border-radius: 8px;
    color: var(--pipboy-primary);
    text-decoration: none;
    display: inline-block;
    font-family: 'Share Tech Mono', monospace;
    transition: 0.2s;
}

#homebtn:hover {
    background-color: var(--pipboy-primary);
    color: var(--pipboy-bg);
    box-shadow: 0 0 20px rgba(20, 245, 147, 0.5);
    text-shadow: none;
    animation: glitch 0.3s infinite;
}

.menuimg {
    transition: 0.2s;
}

.menuimg:hover {
    filter: brightness(0) saturate(100%) invert(77%) sepia(62%) saturate(424%) hue-rotate(100deg) brightness(150%) contrast(93%) !important;
}

code {
    background-color: var(--pipboy-bg);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95em;
    border: 1px solid var(--pipboy-primary-dark);
}

/* ==============================================
   ENHANCED PIP-BOY VISUAL ELEMENTS
   ============================================== */

/* Animated Stat Cards - Subtle CRT Glitch Style */
.stat-card {
    background: linear-gradient(135deg, rgba(26, 51, 41, 0.9) 0%, rgba(13, 26, 20, 0.95) 100%);
    border: 2px solid var(--pipboy-primary);
    border-radius: 8px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 20px rgba(20, 245, 147, 0.2),
        inset 0 0 30px rgba(20, 245, 147, 0.05);
    animation: subtle-crt-flicker 8s infinite;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -200%;
    width: 200%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(20, 245, 147, 0.03) 2px,
        rgba(20, 245, 147, 0.03) 4px
    );
    pointer-events: none;
    z-index: 1;
}

.stat-card:hover {
    animation: crt-glitch 0.3s ease-out;
    box-shadow:
        0 0 25px rgba(20, 245, 147, 0.3),
        inset 0 0 35px rgba(20, 245, 147, 0.08);
}

/* Subtle CRT Flicker */
@keyframes subtle-crt-flicker {
    0%, 100% { opacity: 1; }
    45% { opacity: 1; }
    50% { opacity: 0.98; }
    55% { opacity: 1; }
    96% { opacity: 1; }
    97% { opacity: 0.97; }
    98% { opacity: 1; }
}

/* Max Headroom Style Digital Glitch */
@keyframes crt-glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 1px); }
    40% { transform: translate(2px, -1px); clip-path: inset(0 0 0 0); }
    42% { transform: translate(2px, -1px); clip-path: inset(10px 0 10px 0); }
    44% { transform: translate(0); clip-path: inset(0 0 0 0); }
    60% { transform: translate(1px, -1px); }
    80% { transform: translate(-1px, 1px); }
    100% { transform: translate(0); }
}

/* Subtle value indicators with CRT glow */
.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--pipboy-warn);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    font-family: 'Rajdhani', sans-serif;
    display: block;
    margin: 10px 0;
    animation: subtle-value-glow 4s infinite;
}

@keyframes subtle-value-glow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    }
    50% {
        text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    }
}

/* Enhanced Progress Bars */
.progress-bar-container {
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--pipboy-primary);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 15px rgba(20, 245, 147, 0.3);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg,
        var(--pipboy-primary) 0%,
        var(--pipboy-warn) 50%,
        var(--pipboy-primary) 100%);
    background-size: 200% 100%;
    transition: width 1s ease;
    box-shadow: 0 0 20px rgba(20, 245, 147, 0.7);
    animation: progress-crt-flicker 6s infinite;
    position: relative;
}

.progress-bar-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(20, 245, 147, 0.03) 2px,
        rgba(20, 245, 147, 0.03) 4px
    );
}

@keyframes progress-crt-flicker {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 20px rgba(20, 245, 147, 0.7);
    }
    50% {
        opacity: 0.97;
        box-shadow: 0 0 18px rgba(20, 245, 147, 0.65);
    }
    93% {
        opacity: 0.95;
        transform: translateX(1px);
    }
    95% {
        transform: translateX(0);
    }
}

/* Glowing Number Counters */
.counter-number {
    font-size: 3em;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: var(--pipboy-primary);
    text-shadow:
        0 0 10px rgba(20, 245, 147, 0.8),
        0 0 20px rgba(20, 245, 147, 0.6),
        0 0 30px rgba(20, 245, 147, 0.4);
    display: inline-block;
    animation: counter-crt-jitter 7s infinite;
}

@keyframes counter-crt-jitter {
    0%, 100% {
        transform: translate(0, 0);
        text-shadow:
            0 0 10px rgba(20, 245, 147, 0.8),
            0 0 20px rgba(20, 245, 147, 0.6),
            0 0 30px rgba(20, 245, 147, 0.4);
    }
    50% {
        text-shadow:
            0 0 12px rgba(20, 245, 147, 0.85),
            0 0 22px rgba(20, 245, 147, 0.65),
            0 0 32px rgba(20, 245, 147, 0.45);
    }
    87% {
        transform: translate(0.5px, 0);
    }
    89% {
        transform: translate(-0.5px, 0);
    }
    91% {
        transform: translate(0, 0);
    }
}

/* Data Grid Enhancement */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.data-grid-item {
    background: rgba(26, 51, 41, 0.6);
    border: 1px solid var(--pipboy-primary);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.data-grid-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: var(--pipboy-warn);
    transition: height 0.3s ease;
}

.data-grid-item:hover {
    background: rgba(26, 51, 41, 0.9);
    transform: translateX(5px);
    box-shadow: -5px 0 15px rgba(20, 245, 147, 0.3);
    animation: data-grid-glitch 0.3s ease-out;
}

.data-grid-item:hover::before {
    height: 100%;
}

@keyframes data-grid-glitch {
    0% { transform: translateX(5px); }
    25% { transform: translateX(6px) translateY(1px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(5px) translateY(-1px); }
    100% { transform: translateX(5px); }
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    animation: status-pulse 2s infinite;
}

.status-indicator.online {
    background: var(--pipboy-primary);
    box-shadow: 0 0 10px var(--pipboy-primary);
}

.status-indicator.warning {
    background: var(--pipboy-warn);
    box-shadow: 0 0 10px var(--pipboy-warn);
}

.status-indicator.offline {
    background: var(--pipboy-error);
    box-shadow: 0 0 10px var(--pipboy-error);
}

@keyframes status-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
    93% {
        opacity: 0.8;
    }
}

/* Chart Container Enhancements */
.chart-container-enhanced {
    background: linear-gradient(135deg, rgba(13, 26, 20, 0.95) 0%, rgba(26, 51, 41, 0.9) 100%);
    border: 2px solid var(--pipboy-primary);
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    box-shadow:
        0 0 30px rgba(20, 245, 147, 0.2),
        inset 0 0 50px rgba(20, 245, 147, 0.05);
    position: relative;
    overflow: hidden;
    animation: chart-crt-static 10s infinite;
}

.chart-container-enhanced::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(20, 245, 147, 0.02) 2px,
        rgba(20, 245, 147, 0.02) 4px
    );
    pointer-events: none;
}

@keyframes chart-crt-static {
    0%, 100% {
        border-color: var(--pipboy-primary);
    }
    50% {
        border-color: rgba(20, 245, 147, 0.95);
    }
    94% {
        transform: translateX(0);
    }
    95% {
        transform: translateX(1px);
    }
    96% {
        transform: translateX(-1px);
    }
    97% {
        transform: translateX(0);
    }
}

/* Metric Badge */
.metric-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(20, 245, 147, 0.2);
    border: 1px solid var(--pipboy-primary);
    border-radius: 20px;
    font-size: 0.9em;
    margin: 5px;
    transition: all 0.3s ease;
}

.metric-badge:hover {
    background: rgba(20, 245, 147, 0.3);
    box-shadow: 0 0 15px rgba(20, 245, 147, 0.5);
    transform: scale(1.05);
}

/* Larger, More Readable Data Display */
.data-display-large {
    font-size: 2.2em;
    font-weight: bold;
    color: var(--pipboy-primary);
    text-shadow: 0 0 15px rgba(20, 245, 147, 0.7);
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 0.05em;
}

.label-large {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 5px;
    display: block;
}

/* ==========================================
   RESPONSIVE DESIGN FOR ENHANCED COMPONENTS
   ========================================== */

/* Tablet Responsive - Enhanced Components */
@media (max-width: 1024px) {
    /* Stat cards - 2 columns on tablet */
    .stat-card {
        padding: 18px;
    }
    
    .stat-value {
        font-size: 2.5em;
    }
    
    .counter-number {
        font-size: 2.5em;
    }
    
    /* Data grid - ensure minimum width adapts */
    .data-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .data-display-large {
        font-size: 2em;
    }
    
    /* Chart containers */
    .chart-container-enhanced {
        padding: 20px;
    }
    
    /* Coin selector - slightly smaller */
    #coin-selector {
        top: 15px;
        left: 15px;
        gap: 8px;
    }
    
    #coin-selector button {
        padding: 8px 16px !important;
        font-size: 0.95em !important;
    }
}

/* Mobile Responsive - Enhanced Components */
@media (max-width: 768px) {
    /* Stat cards - single column on mobile */
    .stat-card {
        padding: 15px;
        margin: 8px 0;
    }
    
    .stat-card h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .stat-value {
        font-size: 2em;
    }
    
    .counter-number {
        font-size: 2em;
    }
    
    /* Data grid - smaller minmax for mobile */
    .data-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .data-grid-item {
        padding: 15px;
    }
    
    .data-display-large {
        font-size: 1.8em;
    }
    
    .label-large {
        font-size: 1em;
    }
    
    /* Chart containers - less padding on mobile */
    .chart-container-enhanced {
        padding: 15px;
        border-radius: 8px;
    }
    
    /* Progress bars */
    .progress-bar-container {
        height: 25px;
    }
    
    /* Coin selector - stack or move for mobile */
    #coin-selector {
        top: 10px;
        left: 10px;
        gap: 6px;
        flex-wrap: wrap;
    }
    
    #coin-selector button {
        padding: 6px 12px !important;
        font-size: 0.85em !important;
    }
    
    /* Metric badges */
    .metric-badge {
        padding: 6px 12px;
        font-size: 0.8em;
        margin: 3px;
    }
}

/* Small Mobile Devices - Enhanced Components */
@media (max-width: 480px) {
    /* Further reduce font sizes for very small screens */
    .stat-card h3 {
        font-size: 14px;
    }
    
    .stat-value {
        font-size: 1.6em;
    }
    
    .counter-number {
        font-size: 1.8em;
    }
    
    .data-display-large {
        font-size: 1.5em;
    }
    
    .label-large {
        font-size: 0.9em;
    }
    
    /* Stat cards - even less padding */
    .stat-card {
        padding: 12px;
    }
    
    .data-grid-item {
        padding: 12px;
    }
    
    /* Chart containers */
    .chart-container-enhanced {
        padding: 10px;
        border-radius: 6px;
    }
    
    /* Progress bars smaller */
    .progress-bar-container {
        height: 20px;
        border-radius: 10px;
    }
    
    /* Coin selector - ensure it doesn't overlap */
    #coin-selector {
        position: relative;
        top: 0;
        left: 0;
        margin: 10px;
        justify-content: center;
    }
    
    /* Disable some animations on very small screens for performance */
    .stat-card {
        animation: none;
    }
    
    .chart-container-enhanced {
        animation: none;
    }
}

/* Landscape mode on mobile - optimize layout */
@media (max-width: 768px) and (orientation: landscape) {
    .stat-card {
        padding: 12px;
    }
    
    .stat-value, .counter-number {
        font-size: 1.8em;
    }
    
    .data-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover animations on touch devices */
    .stat-card:hover {
        animation: none;
        border-color: var(--pipboy-primary);
    }
    
    .data-grid-item:hover {
        animation: none;
        transform: none;
    }
    
    /* Increase tap target sizes for better touch usability */
    button, a, input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    #coin-selector button {
        min-height: 44px;
        padding: 10px 16px !important;
    }
    
    header ul li a {
        min-height: 44px;
        padding: 10px 16px !important;
    }
    
    /* Disable CRT glitch on touch for better performance */
    .stat-card, .chart-container-enhanced, .counter-number {
        animation-duration: 15s; /* Slower, less frequent */
    }
}

/* High DPI / Retina Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper text rendering */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Adjust border widths for crisp display */
    .stat-card, .data-grid-item, .chart-container-enhanced {
        border-width: 1.5px;
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    /* Disable all animations for users who prefer reduced motion */
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .stat-card, .chart-container-enhanced, .counter-number, 
    .progress-bar-fill, .stat-value {
        animation: none !important;
    }
}
