/* Custom Font Definition */
@font-face {
    font-family: 'Press Start 2P';
    src: url('../fonts/PressStart2P-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Global Styles */
body {
    font-family: 'Share Tech Mono', monospace;
    background-color: #0f0f12;
    color: #e0e0e0;
}

.pixel-font {
    font-family: 'Press Start 2P', cursive;
}

/* Logo Styles */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
    text-decoration: none;
    font-size: 1.25rem;
}

.logo:hover {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

.logo-rom {
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #e5f0ff;
}

.logo-hacks {
    font-weight: 400;
    letter-spacing: 0.03em;
    color: #9bb6ff;
}

.logo-underscore {
    font-weight: 400;
    color: #4d7cff;
    margin-left: 0.05em;
}

@media (min-width: 768px) {
    .logo {
        font-size: 1.5rem;
    }
}

/* In Development Badge */
.dev-badge {
    display: inline-flex !important;
    align-items: center;
    padding: 0.1rem 0.35rem;
    font-size: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #fbbf24 !important;
    background: transparent !important;
    border: 1px solid #fbbf24;
    border-radius: 0.2rem;
    text-transform: uppercase;
    position: relative;
    z-index: 50;
    visibility: visible !important;
    opacity: 0.9 !important;
}

/* CRT Scanline Effect */
.scanline {
    width: 100%;
    height: 100%;
    z-index: 10;
    background: linear-gradient(0deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.25) 50%), 
                linear-gradient(90deg, rgba(255,0,0,0.06), rgba(0,255,0,0.02), rgba(0,0,255,0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
}

/* Remove scanline from screenshot sections and modals */
.no-crt-filter {
    position: relative;
    z-index: 20;
    isolation: isolate;
}

#screenshot-modal {
    z-index: 60 !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #1a1a20; }
::-webkit-scrollbar-thumb { background: #60a5fa; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

/* Glitch Text Effect */
.glitch-text:hover {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: #60a5fa;
}

@keyframes 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) }
}

/* Cards & UI Elements */
.step-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}
.step-card:hover {
    border-color: #60a5fa;
    background: rgba(96,165,250,0.05);
}

.btn-retro {
    background-color: #1d4ed8;
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    text-transform: uppercase;
    padding: 12px 24px;
    border: 2px solid #60a5fa;
    box-shadow: 4px 4px 0px 0px rgba(59, 130, 246, 0.5);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.1s;
    text-decoration: none;
}
.btn-retro:hover {
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0px 0px rgba(59, 130, 246, 0.6);
}

.input-dark {
    background: #0f0f12;
    border: 1px solid #333;
    color: white;
    padding: 8px 12px;
    width: 100%;
    font-family: 'Share Tech Mono', monospace;
}
.input-dark:focus {
    outline: none;
    border-color: #60a5fa;
}

/* Patcher Specific Styles */
.drop-zone {
    border: 2px dashed #4b5563;
    transition: all 0.3s ease;
}
.drop-zone:hover, .drop-zone.dragover {
    background-color: rgba(96, 165, 250, 0.1);
    border-color: #60a5fa;
    transform: scale(1.02);
    cursor: pointer;
}
.drop-zone.active-file {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
}

details > summary {
    list-style: none;
}
details > summary::-webkit-details-marker {
    display: none;
}

/* --- NEW: SHAKE ANIMATION --- */
@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(3px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(3px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.shake-logo:hover {
  animation: shake 0.5s;
  animation-iteration-count: infinite;
}

/* Pixel Grid Background */
.pixel-grid-bg {
    background-image: 
        radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.4) 100%),
        linear-gradient(0deg, transparent 24%, rgba(59, 130, 246, 0.02) 25%, rgba(59, 130, 246, 0.02) 26%, transparent 27%, transparent 74%, rgba(59, 130, 246, 0.02) 75%, rgba(59, 130, 246, 0.02) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(59, 130, 246, 0.02) 25%, rgba(59, 130, 246, 0.02) 26%, transparent 27%, transparent 74%, rgba(59, 130, 246, 0.02) 75%, rgba(59, 130, 246, 0.02) 76%, transparent 77%, transparent);
    background-size: 100% 100%, 40px 40px, 40px 40px;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Mobile Touch Targets - minimum 44x44px for accessibility */
@media (max-width: 767px) {
    /* Improve tap targets */
    .btn-retro {
        padding: 14px 20px;
        font-size: 0.6rem;
        min-height: 44px;
    }
    
    /* Hide CRT scanline effect on mobile for better performance */
    .scanline {
        display: none;
    }
    
    /* Smaller font for pixel-font headings on mobile */
    .pixel-font {
        font-size: 0.85em;
    }
    
    /* Better scrollbar for mobile */
    ::-webkit-scrollbar {
        width: 6px;
    }
    
    /* Improve form inputs for mobile */
    .input-dark,
    input[type="text"],
    input[type="email"],
    input[type="date"],
    input[type="url"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
        padding: 12px 14px;
        min-height: 44px;
    }
    
    /* Make filter buttons scrollable horizontally */
    #filter-buttons {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 8px;
        gap: 6px;
    }
    
    #filter-buttons::-webkit-scrollbar {
        display: none;
    }
    
    .filter-btn {
        flex-shrink: 0;
        padding: 8px 12px;
        min-width: 44px;
        min-height: 36px;
    }
    
    /* Cards adjustments */
    .hack-card {
        margin-bottom: 0;
    }
    
    .hack-card .p-4 {
        padding: 12px;
    }
    
    /* Drop zone improvements for mobile */
    .drop-zone {
        padding: 24px 16px;
    }
    
    .drop-zone:hover {
        transform: none; /* Disable scale on mobile to prevent layout issues */
    }
    
    /* Step cards mobile layout */
    .step-card {
        padding: 16px;
    }
    
    /* Footer grid improvements */
    footer .grid {
        gap: 24px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .pixel-font {
        font-size: 0.75em;
        word-break: break-word;
    }
    
    .btn-retro {
        padding: 12px 16px;
        font-size: 0.55rem;
        box-shadow: 2px 2px 0px 0px rgba(59, 130, 246, 0.5);
    }
    
    .btn-retro:hover {
        box-shadow: 3px 3px 0px 0px rgba(59, 130, 246, 0.6);
        transform: translate(-1px, -1px);
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Fix for iOS momentum scrolling */
html {
    -webkit-overflow-scrolling: touch;
}

/* Mobile-friendly modal styling */
@media (max-width: 767px) {
    #screenshot-modal,
    .modal {
        padding: 10px;
    }
    
    #screenshot-modal img,
    .modal img {
        max-height: 80vh;
        object-fit: contain;
    }
}

/* Prevent horizontal scroll on mobile */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Mobile navigation animation */
#mobile-menu {
    transition: all 0.3s ease-in-out;
}

#mobile-menu.hidden {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobile-menu:not(.hidden) {
    max-height: 500px;
    opacity: 1;
}

/* Ensure proper spacing for sticky header on mobile */
@media (max-width: 767px) {
    main {
        padding-top: 16px;
        padding-bottom: 32px;
    }
}

/* Screenshot gallery mobile improvements */
@media (max-width: 767px) {
    #thumbnail-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        justify-content: flex-start;
    }
    
    #thumbnail-container button {
        width: 60px;
        height: 60px;
    }
}

/* Game page hero section mobile */
@media (max-width: 767px) {
    .game-hero,
    [class*="h-[380px]"] {
        height: auto;
        min-height: 280px;
    }
    
    /* Keep tags inside banner on mobile */
    .rounded-2xl.overflow-hidden .flex-wrap {
        max-width: 100%;
    }
    
    /* Smaller tags on mobile */
    .rounded-2xl.overflow-hidden span[class*="text-[10px]"] {
        font-size: 8px;
        padding: 2px 6px;
    }
}

/* Improve social links touch targets */
@media (max-width: 767px) {
    .social-links a,
    a[title*="twitter"],
    a[title*="discord"],
    a[title*="github"] {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Better text readability on mobile */
@media (max-width: 767px) {
    p, .text-gray-400, .text-gray-300 {
        line-height: 1.6;
    }
    
    .text-xs {
        font-size: 0.8rem;
        line-height: 1.5;
    }
}

/* Fix search input icon overlap on mobile */
@media (max-width: 767px) {
    #search-input {
        padding-left: 2.75rem !important;
    }
}
/* Modern Development Status Badge */
.dev-status-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(251, 191, 36, 0.5);
    border-radius: 9999px;
    color: #fbbf24;
    font-family: 'Share Tech Mono', monospace;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.dev-status-modern:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: #fbbf24;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dev-status-modern .material-symbols-outlined {
    font-size: 1.5rem;
}

/* Status Color Variants */
.dev-status-modern.status-complete {
    border-color: rgba(74, 222, 128, 0.5);
    color: #4ade80;
}
.dev-status-modern.status-complete:hover {
    border-color: #4ade80;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.3);
}

.dev-status-modern.status-alpha {
    border-color: rgba(248, 113, 113, 0.5);
    color: #f87171;
}
.dev-status-modern.status-alpha:hover {
    border-color: #f87171;
    box-shadow: 0 0 15px rgba(248, 113, 113, 0.3);
}

.dev-status-modern.status-demo {
    border-color: rgba(96, 165, 250, 0.5);
    color: #60a5fa;
}
.dev-status-modern.status-demo:hover {
    border-color: #60a5fa;
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.3);
}

.dev-status-modern.status-wip {
    border-color: rgba(251, 146, 60, 0.5);
    color: #fb923c;
}
.dev-status-modern.status-wip:hover {
    border-color: #fb923c;
    box-shadow: 0 0 15px rgba(251, 146, 60, 0.3);
}
