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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: #e8eaed;
    background: #0f1117;
    line-height: 1.6;
}

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

/* === Hero === */
.hero {
    min-height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    padding: 3rem 1.5rem;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.6rem;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: #a0aec0;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.hero-cta {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: 2px solid #38b2ac;
    border-radius: 8px;
    font-weight: 600;
    color: #38b2ac;
    transition: all 0.25s ease;
}

.hero-cta:hover {
    background: #38b2ac;
    color: #0f1117;
}

/* === Section Shared === */
.games-section,
.contribute-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-desc {
    text-align: center;
    color: #a0aec0;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* === Search & Filter === */
.filter-bar {
    max-width: 600px;
    margin: 0 auto 2rem;
    text-align: center;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #2d3148;
    border-radius: 10px;
    background: #1a1d2e;
    color: #e8eaed;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 1rem;
}

.search-input::placeholder {
    color: #718096;
}

.search-input:focus {
    border-color: #38b2ac;
}

.filter-tags {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tag {
    padding: 0.4rem 1rem;
    border: 1px solid #2d3148;
    border-radius: 20px;
    background: transparent;
    color: #a0aec0;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tag:hover {
    border-color: #38b2ac;
    color: #38b2ac;
}

.filter-tag.active {
    background: #38b2ac;
    border-color: #38b2ac;
    color: #0f1117;
    font-weight: 600;
}

.no-results {
    text-align: center;
    color: #718096;
    font-size: 1rem;
    padding: 2rem 0;
}

/* === Game Grid === */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: #1a1d2e;
    border: 1px solid #2d3148;
    border-radius: 14px;
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: #38b2ac;
    box-shadow: 0 8px 30px rgba(56, 178, 172, 0.15);
}

.game-icon {
    font-size: 2rem;
    margin-bottom: 0.8rem;
}

.game-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.game-desc {
    font-size: 0.9rem;
    color: #a0aec0;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.game-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(56, 178, 172, 0.15);
    color: #38b2ac;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    width: fit-content;
}

/* === Contribute Section === */
.contribute-section {
    text-align: center;
}

.contribute-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.step-card {
    background: #1a1d2e;
    border: 1px solid #2d3148;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: left;
}

.step-number {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #38b2ac;
    color: #0f1117;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.step-card h4 {
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.step-card p {
    font-size: 0.9rem;
    color: #a0aec0;
}

.step-card code {
    background: rgba(56, 178, 172, 0.1);
    color: #38b2ac;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.contribute-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: #38b2ac;
    color: #0f1117;
    font-weight: 600;
    border-radius: 8px;
    transition: background 0.25s ease;
}

.contribute-btn:hover {
    background: #2c9a94;
}

/* === Footer === */
.footer {
    text-align: center;
    padding: 2rem 1.5rem;
    border-top: 1px solid #2d3148;
    color: #718096;
    font-size: 0.85rem;
}

.footer a {
    color: #38b2ac;
}

.footer a:hover {
    text-decoration: underline;
}

/* === Responsive === */
@media (max-width: 640px) {
    .hero {
        min-height: 50vh;
    }

    .game-grid {
        grid-template-columns: 1fr;
    }
}

/* === Skip Link === */
.skip-link {
    position: fixed;
    top: -100%;
    left: 1rem;
    padding: 0.6rem 1.2rem;
    background: #38b2ac;
    color: #0f1117;
    font-weight: 600;
    border-radius: 8px;
    z-index: 300;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 1rem;
}

/* === Focus Visible === */
:focus-visible {
    outline: 2px solid #38b2ac;
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* === Hub Animations === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.hero-content {
    animation: fadeInUp 0.6s ease both;
}

.section-title {
    animation: fadeInUp 0.5s ease both;
}

.game-card {
    opacity: 0;
    animation: fadeInUp 0.5s ease both;
}

.game-card:nth-child(1) { animation-delay: 0.05s; }
.game-card:nth-child(2) { animation-delay: 0.1s; }
.game-card:nth-child(3) { animation-delay: 0.15s; }
.game-card:nth-child(4) { animation-delay: 0.2s; }
.game-card:nth-child(5) { animation-delay: 0.25s; }
.game-card:nth-child(6) { animation-delay: 0.3s; }
.game-card:nth-child(7) { animation-delay: 0.35s; }
.game-card:nth-child(8) { animation-delay: 0.4s; }
.game-card:nth-child(9) { animation-delay: 0.45s; }
.game-card:nth-child(10) { animation-delay: 0.5s; }
.game-card:nth-child(11) { animation-delay: 0.55s; }
.game-card:nth-child(12) { animation-delay: 0.6s; }
.game-card:nth-child(13) { animation-delay: 0.65s; }
.game-card:nth-child(14) { animation-delay: 0.7s; }
.game-card:nth-child(15) { animation-delay: 0.75s; }
.game-card:nth-child(16) { animation-delay: 0.8s; }
.game-card:nth-child(17) { animation-delay: 0.85s; }
.game-card:nth-child(18) { animation-delay: 0.9s; }
.game-card:nth-child(19) { animation-delay: 0.95s; }

.step-card {
    opacity: 0;
    animation: fadeInUp 0.5s ease both;
}

.step-card:nth-child(1) { animation-delay: 0.1s; }
.step-card:nth-child(2) { animation-delay: 0.2s; }
.step-card:nth-child(3) { animation-delay: 0.3s; }

.contribute-btn {
    animation: fadeIn 0.6s ease 0.4s both;
}

/* === Filter Tag Active State Transition === */
.filter-tag:focus-visible {
    outline: 2px solid #38b2ac;
    outline-offset: 2px;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

    .contribute-steps {
        grid-template-columns: 1fr;
    }
}
