/* ============================================
   OneHit.io - Pixel Art Retro Design
   ============================================ */

/* CSS Variables */
:root {
    /* Colors - Retro Dark Theme */
    --bg-primary: #0a0a12;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-elevated: #222230;
    --bg-hover: #2a2a3a;
    
    /* Accent Colors - Vibrant Retro Green */
    --accent-primary: #00e436;
    --accent-secondary: #50ff7d;
    --accent-tertiary: #29adff;
    --accent-cyan: #29adff;
    --accent-yellow: #ffec27;
    --accent-purple: #ab5236;
    --accent-gradient: linear-gradient(180deg, #00e436 0%, #50ff7d 100%);
    --accent-glow: 0 0 0 2px #00e436, 0 4px 0 0 #006b1a;
    
    /* Text Colors */
    --text-primary: #fff1e8;
    --text-secondary: #c2c3c7;
    --text-muted: #5f574f;
    
    /* Border Colors */
    --border-color: #2a2a3a;
    --border-light: #3a3a4a;
    
    /* Pixel Shadows */
    --pixel-shadow: 4px 4px 0px #000;
    --pixel-shadow-sm: 2px 2px 0px #000;
    --pixel-shadow-accent: 4px 4px 0px #006b1a;
    
    /* Status Colors */
    --success: #50ff7d;
    --error: #ff004d;
    --warning: #ffec27;
    
    /* Spacing */
    --header-height: 56px;
    --sidebar-width: 300px;
    --content-max-width: 1200px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border Radius - Pixel style (none!) */
    --radius-sm: 0px;
    --radius-md: 0px;
    --radius-lg: 0px;
    --radius-xl: 0px;
    --radius-full: 0px;
    
    /* Transitions */
    --transition-fast: 100ms steps(2);
    --transition-normal: 150ms steps(3);
    --transition-slow: 200ms steps(4);
    
    /* Pixel Border */
    --pixel-border: 3px solid var(--border-light);
}

/* Pixel Font Import */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
    overflow-x: hidden;
    width: 100%;
    image-rendering: pixelated;
}

body {
    font-family: 'Press Start 2P', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    font-size: 10px;
    /* CRT Scanline Effect */
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.15) 2px,
            rgba(0, 0, 0, 0.15) 4px
        );
    background-attachment: fixed;
}

/* Add subtle screen flicker animation */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.95; }
    94% { opacity: 1; }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 9999;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: 'Press Start 2P', monospace;
    cursor: pointer;
    border: none;
    background: none;
}

img, svg {
    display: block;
    max-width: 100%;
    image-rendering: pixelated;
}

/* App Container */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    animation: flicker 8s infinite;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 4px solid var(--accent-primary);
    width: 100%;
    box-shadow: 0 4px 0 0 rgba(0, 0, 0, 0.5);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--spacing-md);
    max-width: var(--content-max-width);
    margin: 0 auto;
    width: 100%;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 400;
    font-size: 10px;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.logo:hover {
    transform: translateY(-2px);
}

.logo:active {
    transform: translateY(2px);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    border: 3px solid var(--text-primary);
    box-shadow: var(--pixel-shadow-sm);
    color: white;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 14px;
    height: 14px;
}

.logo-text {
    color: var(--text-primary);
    text-shadow: 2px 2px 0 #000;
}

.logo-accent {
    color: var(--accent-primary);
    text-shadow: 2px 2px 0 #006b1a;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 8px;
    transition: all var(--transition-fast);
    white-space: nowrap;
    border: 2px solid transparent;
    text-shadow: 1px 1px 0 #000;
}

.nav-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.nav-link.active {
    background: var(--bg-elevated);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: var(--pixel-shadow-sm);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.btn-play {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 8px 16px;
    background: var(--accent-primary);
    color: #000;
    font-weight: 400;
    font-size: 8px;
    border: 3px solid var(--text-primary);
    box-shadow: var(--pixel-shadow);
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-shadow: 1px 1px 0 #50ff7d;
}

.btn-play svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 0px #000;
}

.btn-play:active {
    transform: translateY(2px);
    box-shadow: 2px 2px 0px #000;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main {
    flex: 1;
    width: 100%;
}

/* Page Layout - Centered Content */
.page-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    padding: var(--spacing-md);
}

/* Content Main */
.content-main {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-secondary);
    border-top: 4px solid var(--accent-primary);
    padding: var(--spacing-lg) var(--spacing-md);
    margin-top: auto;
    width: 100%;
}

.footer-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    text-align: center;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.footer-logo {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-primary);
    text-shadow: 2px 2px 0 #000;
}

.footer-tagline {
    color: var(--accent-yellow);
    font-size: 6px;
    text-shadow: 1px 1px 0 #000;
}

.footer-links {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 6px;
    transition: all var(--transition-fast);
    padding: 4px 8px;
    border: 2px solid transparent;
}

.footer-links a:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    background: var(--bg-elevated);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 6px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-weight: 400;
    font-size: 8px;
    border: 3px solid var(--text-primary);
    box-shadow: var(--pixel-shadow);
    transition: all var(--transition-fast);
    text-shadow: 1px 1px 0 #000;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 0px #000;
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 2px 2px 0px #000;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

/* ============================================
   FLASH MESSAGES
   ============================================ */
.flash-messages {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
}

.flash-message {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 8px;
    animation: pixelSlideIn 0.3s steps(4);
    border: 3px solid;
    box-shadow: var(--pixel-shadow-sm);
}

.flash-message svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.flash-success {
    background: #003d00;
    color: var(--success);
    border-color: var(--success);
}

.flash-error {
    background: #3d0000;
    color: var(--error);
    border-color: var(--error);
}

@keyframes pixelSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Medium screens */
@media (max-width: 768px) {
    :root {
        --header-height: 52px;
    }
    
    body {
        font-size: 8px;
    }
    
    .header-inner {
        padding: 0 var(--spacing-sm);
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link {
        padding: var(--spacing-sm);
    }
    
    .btn-play {
        padding: 6px 10px;
        font-size: 6px;
    }
    
    .page-layout {
        padding: var(--spacing-sm);
    }
    
    .content-main {
        max-width: 100%;
    }
}

/* Small screens */
@media (max-width: 540px) {
    .logo-text {
        display: none;
    }
    
    .btn-play span {
        display: none;
    }
    
    .btn-play {
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
    }
    
    .nav-link {
        padding: 6px;
    }
    
    .nav-link svg {
        width: 18px;
        height: 18px;
    }
    
    .footer-links {
        gap: var(--spacing-sm);
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
}

/* Pixel Art Decorative Elements */
.pixel-corner {
    position: relative;
}

.pixel-corner::before,
.pixel-corner::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
}

.pixel-corner::before {
    top: -4px;
    left: -4px;
}

.pixel-corner::after {
    bottom: -4px;
    right: -4px;
}

/* Selection styling */
::selection {
    background: var(--accent-primary);
    color: var(--text-primary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-left: 4px solid var(--accent-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Input focus outline pixel style */
*:focus-visible {
    outline: 3px solid var(--accent-cyan);
    outline-offset: 2px;
}
