/* Pip-Boy Vault-Tec Theme - Inspired by Fire Pool */
/* Full retro terminal aesthetic for home mining operations */

/* ===== CSS VARIABLES ===== */
:root {
    --pipboy-primary: #14F593;
    --pipboy-warn: #FFD700;
    --pipboy-error: #FF6B6B;
    --pipboy-bg: #0A0F0D;
    --pipboy-card-bg: rgba(26, 51, 41, 0.95);
    --pipboy-border: rgba(20, 245, 147, 0.3);
    --pipboy-hover: rgba(20, 245, 147, 0.1);
    --pipboy-text: #E8F4F0;
    --pipboy-text-dim: #A8C8B8;
}

/* Light theme */
[data-theme="light"] {
    --pipboy-primary: #0D8B5F;
    --pipboy-warn: #D4AF37;
    --pipboy-bg: #F0F4F2;
    --pipboy-card-bg: rgba(255, 255, 255, 0.95);
    --pipboy-border: rgba(13, 139, 95, 0.4);
    --pipboy-hover: rgba(13, 139, 95, 0.1);
    --pipboy-text: #0A0F0D;
    --pipboy-text-dim: #4A6A5A;
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background-color: var(--pipboy-bg);
    color: var(--pipboy-text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* CRT Scanline effect */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 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: 9999;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Rajdhani', sans-serif;
    color: var(--pipboy-primary);
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(20, 245, 147, 0.4);
    letter-spacing: 0.5px;
}

h1 {
    font-size: 3em;
    border-bottom: 3px solid var(--pipboy-primary);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.25em;
}

h3 {
    font-size: 1.75em;
}

p {
    margin-bottom: 1rem;
    color: var(--pipboy-text);
}

.mono {
    font-family: 'Share Tech Mono', monospace;
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== NAVIGATION HEADER ===== */
header {
    background: var(--pipboy-card-bg);
    border-bottom: 3px solid var(--pipboy-primary);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(20, 245, 147, 0.2);
}

.navigation {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 15px;
}

/* Logo/Title area */
.navigation > div:first-child {
    text-align: center;
}

.navigation img {
    height: 60px;
    filter: drop-shadow(0 0 10px rgba(20, 245, 147, 0.5));
}

.navigation ul {
    display: flex;
    list-style: none;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.navigation li a {
    color: var(--pipboy-primary);
    text-decoration: none;
    padding: 10px 18px;
    border: 2px solid var(--pipboy-primary);
    border-radius: 5px;
    background: rgba(20, 245, 147, 0.1);
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.95em;
    letter-spacing: 1px;
    display: inline-block;
}

.navigation li a:hover {
    background: var(--pipboy-primary);
    color: var(--pipboy-bg);
    box-shadow: 0 0 15px rgba(20, 245, 147, 0.6);
    transform: translateY(-2px);
}

/* ===== CARDS ===== */
.card {
    background: var(--pipboy-card-bg);
    border: 2px solid var(--pipboy-border);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 0 20px rgba(20, 245, 147, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(20, 245, 147, 0.1);
    border-radius: 6px;
    pointer-events: none;
}

.card:hover {
    border-color: var(--pipboy-primary);
    box-shadow: 0 0 30px rgba(20, 245, 147, 0.3);
    transform: translateY(-3px);
}

/* ===== BUTTONS ===== */
.btn, button {
    background: var(--pipboy-primary);
    color: var(--pipboy-bg);
    border: 2px solid var(--pipboy-primary);
    border-radius: 5px;
    padding: 12px 28px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    display: inline-block;
}

.btn:hover, button:hover {
    background: transparent;
    color: var(--pipboy-primary);
    box-shadow: 0 0 20px rgba(20, 245, 147, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--pipboy-primary);
}

.btn-secondary:hover {
    background: var(--pipboy-primary);
    color: var(--pipboy-bg);
}

.btn-warn {
    background: var(--pipboy-warn);
    border-color: var(--pipboy-warn);
    color: var(--pipboy-bg);
}

.btn-warn:hover {
    background: transparent;
    color: var(--pipboy-warn);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

/* ===== FORMS ===== */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: rgba(20, 245, 147, 0.05);
    border: 2px solid var(--pipboy-border);
    border-radius: 5px;
    color: var(--pipboy-text);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1em;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--pipboy-primary);
    box-shadow: 0 0 15px rgba(20, 245, 147, 0.3);
    background: rgba(20, 245, 147, 0.1);
}

label {
    color: var(--pipboy-primary);
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

/* ===== GRID LAYOUTS ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* ===== INFO BOXES / STATS ===== */
.stat-box {
    background: rgba(20, 245, 147, 0.08);
    padding: 25px;
    border-radius: 8px;
    border: 2px solid var(--pipboy-primary);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    background: rgba(20, 245, 147, 0.15);
    box-shadow: 0 0 25px rgba(20, 245, 147, 0.3);
    transform: translateY(-3px);
}

.stat-box .icon {
    font-size: 2.5em;
    margin-bottom: 10px;
    display: block;
}

.stat-box .label {
    color: var(--pipboy-text-dim);
    font-size: 0.95em;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-box .value {
    color: var(--pipboy-warn);
    font-size: 2em;
    font-weight: 700;
    display: block;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* ===== ALERTS ===== */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid;
    position: relative;
}

.alert-info {
    background: rgba(20, 245, 147, 0.1);
    border-color: var(--pipboy-primary);
    color: var(--pipboy-text);
}

.alert-warning {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--pipboy-warn);
    color: var(--pipboy-text);
}

.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border-color: var(--pipboy-error);
    color: var(--pipboy-text);
}

/* ===== TABLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    background: var(--pipboy-card-bg);
    border: 2px solid var(--pipboy-border);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--pipboy-border);
}

th {
    background: rgba(20, 245, 147, 0.2);
    color: var(--pipboy-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

tr:hover {
    background: var(--pipboy-hover);
}

tr:last-child td {
    border-bottom: none;
}

/* ===== FOOTER ===== */
footer {
    background: var(--pipboy-card-bg);
    border-top: 3px solid var(--pipboy-primary);
    padding: 40px 20px;
    margin-top: 60px;
    text-align: center;
    box-shadow: 0 -4px 20px rgba(20, 245, 147, 0.2);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--pipboy-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--pipboy-warn);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 25px 0;
}

.social-icons a {
    color: var(--pipboy-primary);
    font-size: 1.8em;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    color: var(--pipboy-warn);
    transform: scale(1.2);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

/* ===== THEME TOGGLE ===== */
#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: var(--pipboy-primary);
    color: var(--pipboy-bg);
    border: 2px solid var(--pipboy-primary);
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1em;
    font-weight: 600;
    z-index: 10000;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    box-shadow: 0 0 20px rgba(20, 245, 147, 0.6);
    transform: scale(1.05);
}

/* ===== VAULT DOOR ANIMATION ===== */
.vault-btn {
    position: relative;
    background: transparent;
    border: none;
    width: 200px;
    height: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vault-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><circle cx="100" cy="100" r="95" fill="none" stroke="%2314F593" stroke-width="3"/><circle cx="100" cy="100" r="70" fill="none" stroke="%2314F593" stroke-width="2"/><circle cx="100" cy="100" r="50" fill="none" stroke="%2314F593" stroke-width="2"/><line x1="100" y1="5" x2="100" y2="30" stroke="%2314F593" stroke-width="3"/><line x1="100" y1="170" x2="100" y2="195" stroke="%2314F593" stroke-width="3"/><line x1="5" y1="100" x2="30" y2="100" stroke="%2314F593" stroke-width="3"/><line x1="170" y1="100" x2="195" y2="100" stroke="%2314F593" stroke-width="3"/></svg>');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    filter: drop-shadow(0 0 20px rgba(20, 245, 147, 0.4));
    transition: all 0.3s ease;
}

.vault-btn:hover::before {
    animation: vault-spin 2s linear infinite;
    filter: drop-shadow(0 0 30px rgba(20, 245, 147, 0.8));
}

@keyframes vault-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

.glow {
    animation: glow-pulse 2s infinite ease-in-out;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(20, 245, 147, 0.2);
    }
    50% {
        box-shadow: 0 0 25px rgba(20, 245, 147, 0.4);
    }
}

/* ===== GLITCH EFFECTS ===== */

/* Text Glitch - RGB split chromatic aberration */
.glitch {
    position: relative;
    animation: glitch-skew 4s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    opacity: 0.8;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 rgba(255, 0, 255, 0.7);
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    animation: glitch-anim 3s infinite linear alternate-reverse;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 0, 255, 0.5);
}

.glitch::after {
    left: -2px;
    text-shadow: 2px 0 rgba(0, 255, 255, 0.7);
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    animation: glitch-anim2 2s infinite linear alternate-reverse;
    color: transparent;
    -webkit-text-stroke: 1px rgba(0, 255, 255, 0.5);
}

@keyframes glitch-anim {
    0% {
        clip-path: polygon(0 2%, 100% 2%, 100% 5%, 0 5%);
        transform: translate(-2px, -1px);
    }
    10% {
        clip-path: polygon(0 15%, 100% 15%, 100% 15%, 0 15%);
        transform: translate(2px, 1px);
    }
    20% {
        clip-path: polygon(0 10%, 100% 10%, 100% 20%, 0 20%);
        transform: translate(-1px, 2px);
    }
    30% {
        clip-path: polygon(0 1%, 100% 1%, 100% 2%, 0 2%);
        transform: translate(1px, -1px);
    }
    40% {
        clip-path: polygon(0 33%, 100% 33%, 100% 33%, 0 33%);
        transform: translate(-2px, 1px);
    }
    50% {
        clip-path: polygon(0 44%, 100% 44%, 100% 44%, 0 44%);
        transform: translate(1px, 2px);
    }
    60% {
        clip-path: polygon(0 50%, 100% 50%, 100% 20%, 0 20%);
        transform: translate(-1px, -2px);
    }
    70% {
        clip-path: polygon(0 70%, 100% 70%, 100% 70%, 0 70%);
        transform: translate(2px, 1px);
    }
    80% {
        clip-path: polygon(0 80%, 100% 80%, 100% 80%, 0 80%);
        transform: translate(-2px, -1px);
    }
    90% {
        clip-path: polygon(0 50%, 100% 50%, 100% 55%, 0 55%);
        transform: translate(1px, 1px);
    }
    100% {
        clip-path: polygon(0 70%, 100% 70%, 100% 80%, 0 80%);
        transform: translate(-1px, 2px);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip-path: polygon(0 25%, 100% 25%, 100% 30%, 0 30%);
        transform: translate(2px, 1px);
    }
    15% {
        clip-path: polygon(0 3%, 100% 3%, 100% 3%, 0 3%);
        transform: translate(-1px, -1px);
    }
    30% {
        clip-path: polygon(0 5%, 100% 5%, 100% 20%, 0 20%);
        transform: translate(1px, 2px);
    }
    45% {
        clip-path: polygon(0 20%, 100% 20%, 100% 20%, 0 20%);
        transform: translate(-2px, 1px);
    }
    60% {
        clip-path: polygon(0 40%, 100% 40%, 100% 40%, 0 40%);
        transform: translate(2px, -1px);
    }
    75% {
        clip-path: polygon(0 52%, 100% 52%, 100% 59%, 0 59%);
        transform: translate(-1px, 2px);
    }
    100% {
        clip-path: polygon(0 60%, 100% 60%, 100% 60%, 0 60%);
        transform: translate(1px, -2px);
    }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    20% { transform: skew(0deg); }
    21% { transform: skew(2deg); }
    22% { transform: skew(0deg); }
    40% { transform: skew(0deg); }
    41% { transform: skew(-1deg); }
    42% { transform: skew(0deg); }
    60% { transform: skew(0deg); }
    61% { transform: skew(1deg); }
    62% { transform: skew(0deg); }
    80% { transform: skew(0deg); }
    81% { transform: skew(-2deg); }
    82% { transform: skew(0deg); }
    100% { transform: skew(0deg); }
}

/* Subtle glitch - less aggressive, good for body text */
.glitch-subtle {
    animation: glitch-flicker 5s infinite;
}

@keyframes glitch-flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.8; transform: translateX(2px); }
    94% { opacity: 1; transform: translateX(-1px); }
    95% { opacity: 0.9; transform: translateX(0); }
    96% { opacity: 1; }
}

/* Hover glitch effect */
.glitch-hover {
    position: relative;
    transition: all 0.3s ease;
}

.glitch-hover:hover {
    animation: glitch-shake 0.3s linear;
    text-shadow:
        2px 0 #ff00ff,
        -2px 0 #00ffff;
}

@keyframes glitch-shake {
    0% { transform: translate(0); }
    10% { transform: translate(-2px, 1px); }
    20% { transform: translate(2px, -1px); }
    30% { transform: translate(-1px, 2px); }
    40% { transform: translate(1px, -2px); }
    50% { transform: translate(-2px, 1px); }
    60% { transform: translate(2px, -1px); }
    70% { transform: translate(-1px, 1px); }
    80% { transform: translate(1px, -1px); }
    90% { transform: translate(-1px, 2px); }
    100% { transform: translate(0); }
}

/* Screen glitch overlay - random screen tears */
.glitch-screen::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        transparent 0%,
        rgba(20, 245, 147, 0.03) 50%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 9998;
    animation: glitch-screen-tear 8s infinite;
}

@keyframes glitch-screen-tear {
    0%, 100% {
        opacity: 0;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    92% {
        opacity: 0;
    }
    93% {
        opacity: 1;
        clip-path: polygon(0 30%, 100% 30%, 100% 32%, 0 32%);
        transform: translateX(5px);
    }
    94% {
        opacity: 1;
        clip-path: polygon(0 60%, 100% 60%, 100% 65%, 0 65%);
        transform: translateX(-3px);
    }
    95% {
        opacity: 0;
        transform: translateX(0);
    }
}

/* Image/box glitch effect */
.glitch-box {
    position: relative;
    overflow: hidden;
}

.glitch-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 0, 255, 0.1),
        transparent
    );
    animation: glitch-box-scan 3s infinite linear;
    pointer-events: none;
    z-index: 1;
}

@keyframes glitch-box-scan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Chromatic aberration on images */
.glitch-image {
    position: relative;
}

.glitch-image:hover {
    animation: glitch-rgb-shift 0.5s infinite;
}

@keyframes glitch-rgb-shift {
    0% {
        filter: drop-shadow(2px 0 0 rgba(255, 0, 255, 0.5))
                drop-shadow(-2px 0 0 rgba(0, 255, 255, 0.5));
    }
    25% {
        filter: drop-shadow(-2px 0 0 rgba(255, 0, 255, 0.5))
                drop-shadow(2px 0 0 rgba(0, 255, 255, 0.5));
    }
    50% {
        filter: drop-shadow(1px 1px 0 rgba(255, 0, 255, 0.5))
                drop-shadow(-1px -1px 0 rgba(0, 255, 255, 0.5));
    }
    75% {
        filter: drop-shadow(-1px 1px 0 rgba(255, 0, 255, 0.5))
                drop-shadow(1px -1px 0 rgba(0, 255, 255, 0.5));
    }
    100% {
        filter: drop-shadow(2px 0 0 rgba(255, 0, 255, 0.5))
                drop-shadow(-2px 0 0 rgba(0, 255, 255, 0.5));
    }
}

/* Data corruption text effect */
.glitch-data {
    position: relative;
}

.glitch-data::before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    color: var(--pipboy-primary);
    animation: glitch-data-corrupt 4s infinite;
    clip-path: inset(0);
}

@keyframes glitch-data-corrupt {
    0%, 100% {
        clip-path: inset(0 0 100% 0);
    }
    5% {
        clip-path: inset(40% 0 30% 0);
        transform: translateX(-3px);
        text-shadow: 2px 0 #ff00ff;
    }
    10% {
        clip-path: inset(0 0 100% 0);
        transform: translateX(0);
    }
    45% {
        clip-path: inset(0 0 100% 0);
    }
    50% {
        clip-path: inset(20% 0 60% 0);
        transform: translateX(2px);
        text-shadow: -2px 0 #00ffff;
    }
    55% {
        clip-path: inset(0 0 100% 0);
        transform: translateX(0);
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    h1 { font-size: 2.5em; }
}

/* Tablets */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    h1 {
        font-size: 1.8em;
        line-height: 1.2;
        word-wrap: break-word;
    }
    h2 { font-size: 1.5em; }
    h3 { font-size: 1.25em; }

    body {
        padding-top: 0;
    }

    .container {
        padding: 10px;
    }

    /* Navigation */
    .navigation {
        flex-direction: column;
        gap: 20px;
        padding: 0 15px;
    }

    .navigation > div:first-child {
        margin-right: 0;
        margin-bottom: 10px;
        text-align: center;
    }

    .navigation ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 8px;
    }

    .navigation li a {
        display: block;
        text-align: center;
        padding: 8px 12px;
        font-size: 0.85em;
    }

    /* Grids */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Cards */
    .card {
        padding: 20px;
        margin-bottom: 20px;
    }

    /* Stat boxes */
    .stat-box {
        padding: 20px;
    }

    .stat-box .icon {
        font-size: 2em;
    }

    .stat-box .value {
        font-size: 1.5em;
    }

    /* Buttons */
    .btn, button {
        padding: 10px 20px;
        font-size: 0.9em;
        width: 100%;
        margin-bottom: 10px;
    }

    .btn + .btn,
    button + button {
        margin-left: 0;
    }

    /* Theme toggle */
    #theme-toggle {
        top: 10px;
        right: 10px;
        padding: 8px 14px;
        font-size: 0.85em;
    }

    /* Product cards */
    .product-card .price {
        font-size: 1.5em;
    }

    .product-card .product-info {
        padding: 15px;
    }

    /* Tables - make scrollable */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    th, td {
        padding: 10px;
        font-size: 0.9em;
    }

    /* Alerts */
    .alert {
        padding: 12px 15px;
    }

    /* Footer */
    footer {
        padding: 30px 15px;
    }

    .footer-links {
        flex-direction: column;
        gap: 15px;
    }

    .social-icons {
        gap: 15px;
    }

    .social-icons a {
        font-size: 1.5em;
    }

    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Glitch effect - reduce intensity on mobile */
    .glitch::before,
    .glitch::after {
        display: none;
    }

    .glitch {
        animation: none;
    }

    /* Hide network background on mobile for performance */
    #network-bg {
        opacity: 0.2;
    }
}

/* Small phones */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 1.5em;
        padding-bottom: 0.3rem;
        border-bottom-width: 2px;
    }
    h2 { font-size: 1.3em; }
    h3 { font-size: 1.1em; }

    .container {
        padding: 8px;
    }

    /* Navigation - stack vertically on very small screens */
    .navigation ul {
        flex-direction: column;
        gap: 5px;
    }

    .navigation li a {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    /* Cards */
    .card {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 5px;
    }

    .card::before {
        top: 5px;
        left: 5px;
        right: 5px;
        bottom: 5px;
    }

    /* Stat boxes */
    .stat-box {
        padding: 15px;
    }

    .stat-box .icon {
        font-size: 1.8em;
        margin-bottom: 5px;
    }

    .stat-box .label {
        font-size: 0.85em;
    }

    .stat-box .value {
        font-size: 1.3em;
    }

    /* Buttons */
    .btn, button {
        padding: 12px 15px;
        font-size: 0.9em;
    }

    /* Product cards */
    .product-card .price {
        font-size: 1.3em;
    }

    /* Price display */
    .price {
        font-size: 1.2em !important;
        word-wrap: break-word;
    }

    /* Theme toggle - smaller and repositioned */
    #theme-toggle {
        top: 8px;
        right: 8px;
        padding: 6px 10px;
        font-size: 0.8em;
    }

    /* Footer */
    footer {
        padding: 20px 10px;
    }

    .footer-links a {
        font-size: 0.9em;
    }

    /* Alerts */
    .alert h3,
    .alert h4 {
        font-size: 1em;
    }

    .alert p {
        font-size: 0.9em;
    }

    .alert ul,
    .alert ol {
        padding-left: 20px;
        font-size: 0.9em;
    }

    /* Hide heavy animations on small devices */
    .glitch-box::before {
        display: none;
    }

    .glitch-screen::after {
        display: none;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    html {
        font-size: 13px;
    }

    h1 {
        font-size: 1.3em;
    }

    .navigation li a span {
        display: none; /* Hide icons on very small screens */
    }

    .stat-box .icon {
        font-size: 1.5em;
    }
}

/* Landscape phones */
@media (max-width: 768px) and (orientation: landscape) {
    .navigation ul {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* High DPI / Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card,
    .stat-box,
    .product-card {
        border-width: 1px;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .glitch::before,
    .glitch::after {
        display: none;
    }

    #network-bg {
        display: none;
    }
}

/* Print styles */
@media print {
    body::before,
    #network-bg,
    #theme-toggle,
    .glitch::before,
    .glitch::after {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card,
    .stat-box {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* ===== PRODUCT CARDS (for shop) ===== */
.product-card {
    background: var(--pipboy-card-bg);
    border: 2px solid var(--pipboy-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--pipboy-primary);
    box-shadow: 0 0 30px rgba(20, 245, 147, 0.3);
    transform: translateY(-5px);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 2px solid var(--pipboy-border);
}

.product-card .product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card h3 {
    margin-bottom: 10px;
    font-size: 1.4em;
}

.product-card .price {
    color: var(--pipboy-warn);
    font-size: 1.8em;
    font-weight: 700;
    margin: 15px 0;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.product-card p {
    flex-grow: 1;
    margin-bottom: 15px;
    color: var(--pipboy-text-dim);
}
