:root {
    --bg-dark: #0f0f11;
    --metal-dark: #1a1a1d;
    --metal-light: #2c2c31;
    --accent-neon: #00ffcc; /* Bright stage blue/green */
    --accent-glow: rgba(0, 255, 204, 0.4);
    --switch-red: #c62828;
    --switch-dark-red: #8e0000;
    --switch-toggle-on: #f0f0f0;
    --switch-toggle-off: #d0d0d0;
    --text-main: #e0e0e0;
    --text-dim: #888888;
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-ui);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

header {
    background: linear-gradient(to bottom, #222, var(--bg-dark));
    padding: 1rem;
    text-align: center;
    border-bottom: 2px solid var(--metal-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.logo h1 {
    font-family: var(--font-mono);
    font-size: 2rem;
    letter-spacing: 2px;
    color: var(--accent-neon);
    text-shadow: 0 0 10px var(--accent-glow);
    margin: 0;
}

.logo .subtitle {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 3px;
    text-transform: uppercase;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* Ads Placeholder */
.ad-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px dashed #444;
    color: #666;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.desktop-leaderboard {
    display: none;
}

.mobile-banner {
    width: 320px;
    height: 50px;
}

/* Display Section */
.display-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--metal-dark);
    border-radius: 12px;
    padding: 2rem 1rem;
    margin-bottom: 2rem;
    box-shadow: inset 0 2px 5px rgba(255,255,255,0.05),
                0 10px 30px rgba(0,0,0,0.8);
    border: 1px solid #333;
}

.address-display {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.address-display .label {
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 2px;
    display: block;
    margin-bottom: 0.5rem;
}

.address-display .value {
    font-family: var(--font-mono);
    font-size: 4rem;
    line-height: 1;
    color: var(--text-dim);
    text-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    min-height: 4rem;
}

.address-display .value.active {
    color: var(--accent-neon);
    text-shadow: 0 0 20px var(--accent-glow);
}

.error-msg {
    color: #ff3366;
    font-size: 0.8rem;
    min-height: 1rem;
    margin-top: 0.5rem;
}

/* Photorealistic DIP Switchboard */
.switchboard-container {
    perspective: 800px;
    margin-bottom: 2rem;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.switchboard-container.flipped {
    transform: rotate(180deg);
}

.switchboard {
    background: linear-gradient(135deg, var(--switch-red) 0%, var(--switch-dark-red) 100%);
    padding: 1.5rem 1rem 1rem 1rem;
    border-radius: 8px;
    display: flex;
    gap: 8px;
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.3),
        inset 0 -4px 6px rgba(0,0,0,0.5),
        0 8px 15px rgba(0,0,0,0.6),
        0 2px 4px rgba(0,0,0,0.4);
    border: 1px solid #5a0000;
    position: relative;
}

/* Switchboard Labels */
.switchboard::before {
    content: "ON";
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.8);
    font-weight: bold;
    letter-spacing: 1px;
}

.switchboard::after {
    content: "\2193"; /* Arrow down */
    position: absolute;
    top: 6px;
    left: 28px;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.8);
    font-weight: bold;
}

.dip-switch {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 24px;
}

.dip-track {
    width: 16px;
    height: 40px;
    background-color: #111;
    border-radius: 2px;
    position: relative;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.9);
    margin-bottom: 8px;
}

.dip-toggle {
    width: 14px;
    height: 18px;
    background: linear-gradient(to bottom, #ffffff, #d0d0d0);
    position: absolute;
    left: 1px;
    bottom: 1px; /* OFF position */
    border-radius: 1px;
    box-shadow: 
        0 2px 2px rgba(0,0,0,0.5),
        inset 0 1px 1px rgba(255,255,255,0.8),
        inset 0 -1px 2px rgba(0,0,0,0.3);
    transition: bottom 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.dip-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: rgba(0,0,0,0.1);
}

.dip-switch.on .dip-toggle {
    bottom: 21px; /* ON position */
    box-shadow: 
        0 4px 4px rgba(0,0,0,0.6),
        inset 0 1px 1px rgba(255,255,255,0.8),
        inset 0 -1px 2px rgba(0,0,0,0.3);
}

.dip-label {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.9);
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0,0,0,0.8);
}

/* Number Label Orientation flip handling */
.switchboard-container.flipped .dip-label {
    transform: rotate(180deg);
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #2a2a30;
    color: var(--text-main);
    border: 1px solid #444;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.action-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-btn:hover {
    background-color: #35353d;
    border-color: #666;
}

.action-btn svg {
    transition: transform 0.3s ease;
}

.switchboard-container.flipped ~ .controls .action-btn svg {
    transform: rotate(180deg);
}

/* Keypad Section */
.keypad-section {
    width: 100%;
    max-width: 400px;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.key {
    background: linear-gradient(to bottom, #2c2c31, #1a1a1d);
    border: 1px solid #333;
    border-top-color: #444;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 2rem;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    transition: all 0.1s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.key:active {
    transform: scale(0.95) translateY(2px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.6);
    background: linear-gradient(to bottom, #1a1a1d, #2c2c31);
}

.key.action {
    font-size: 1.25rem;
    font-family: var(--font-ui);
    font-weight: 800;
    color: #ffaa00;
}

.key.clear {
    color: #ff3366;
}

/* Responsive Adjustments */
@media (min-width: 768px) {
    .mobile-banner {
        display: none;
    }
    .desktop-leaderboard {
        display: flex;
        width: 728px;
        height: 90px;
    }
    .key {
        padding: 1.5rem;
        font-size: 2.5rem;
    }
    .key.action {
        font-size: 1.5rem;
    }
    .address-display .value {
        font-size: 5rem;
    }
    .dip-switch {
        width: 32px;
    }
    .dip-track {
        width: 20px;
        height: 50px;
        border-radius: 3px;
    }
    .dip-toggle {
        width: 18px;
        height: 22px;
        border-radius: 2px;
    }
    .dip-switch.on .dip-toggle {
        bottom: 27px;
    }
    .switchboard {
        gap: 12px;
        padding: 2rem 1.5rem 1.5rem 1.5rem;
        border-radius: 12px;
    }
    .switchboard::before {
        top: 8px;
        left: 12px;
        font-size: 0.8rem;
    }
    .switchboard::after {
        top: 8px;
        left: 38px;
        font-size: 0.8rem;
    }
    .dip-label {
        font-size: 0.8rem;
    }
}

/* ═══════════════ AFFILIATE & SEO ═══════════════ */
.seo-card {
    background: var(--metal-dark);
    border: 1px solid var(--metal-light);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}
.seo-card h2 {
    color: var(--accent-neon);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}
.seo-card p {
    color: var(--text-dim);
    line-height: 1.6;
}
.affiliate-gear a {
    color: var(--text-main);
    font-weight: 600;
    text-decoration: none;
}
.affiliate-gear a:hover {
    color: var(--accent-neon);
    text-decoration: underline;
}
