/* style.css */

/* --- Variables & Reset --- */
:root {
    --color-paper: #f8fafc;
    --color-ink: #0f172a;
    --color-subtle: #94a3b8;
    --color-slate-50: #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-300: #cbd5e1;
    --color-slate-400: #94a3b8;
    --color-slate-500: #64748b;
    --color-slate-800: #1e293b;
    --color-slate-900: #0f172a;
    --color-indigo-600: #4c67ac;
    --font-sans: 'Inter', sans-serif;
    --max-width: 80rem; /* equivalent to max-w-7xl */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-paper);
    color: var(--color-ink);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- Background Grid Pattern --- */
.bg-grid-pattern {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(var(--color-slate-300) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

/* --- Layout Wrappers --- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem; /* py-12 px-6 */
    position: relative;
    z-index: 10;
}

.main-content {
    flex: 1;
    width: 100%;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- Header --- */
.header-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

@media (min-width: 768px) {
    .header-content {
        flex-direction: row;
    }
}

.title {
    font-size: 2.25rem; /* text-4xl */
    font-weight: 900;
    color: var(--color-slate-900);
}

@media (min-width: 768px) {
    .title { font-size: 3rem; } /* text-5xl */
}

.subtitle {
    color: var(--color-slate-500);
    font-weight: 500;
    margin-top: 0.5rem;
    letter-spacing: 0.025em;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .subtitle { font-size: 1rem; }
}

/* --- Scrollable Game List --- */
.games-scroll-container {
    display: flex;
    overflow-x: auto;
    padding: 2.5rem 1.5rem;
    gap: 2rem;
    scroll-snap-type: x mandatory;
    width: 100%;
    align-items: center;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;     /* Firefox */
}

/* Mobile: Hide scrollbar for Chrome/Safari/Opera */
.games-scroll-container::-webkit-scrollbar {
    display: none;
}

.games-scroll-container::-webkit-scrollbar {
    display: none;
}

.spacer-xl {
    display: none;
    flex-shrink: 0;
    width: calc((100vw - 80rem) / 2);
}

@media (min-width: 1280px) {
    .spacer-xl { display: block; }
}

.spacer-end {
    width: 1.5rem;
    flex-shrink: 0;
}

/* --- Game Cards --- */
.card-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 280px;
    height: 400px;
    scroll-snap-align: center;
}

/* Bell Game Card (Active) */
.card-bg {
    position: absolute;
    inset: 0;
    background-color: white;
    border-radius: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid var(--color-slate-100);
    transition: all 0.5s ease-out;
}

.card-wrapper:hover .card-bg {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(-0.5rem);
    border-color: var(--color-slate-200);
}

.card-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.card-icon-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-emoji {
    font-size: 4.5rem; /* text-7xl */
    transition: all 0.5s;
    animation: float 6s ease-in-out infinite;
}

.card-wrapper:hover .card-emoji {
    transform: scale(1.1);
}

.tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-slate-400);
    background-color: var(--color-slate-50);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-slate-900);
    margin-bottom: 0.25rem;
    transition: color 0.3s;
}

.card-wrapper:hover .card-title {
    color: var(--color-indigo-600);
}

.card-desc {
    font-size: 0.875rem;
    color: var(--color-slate-400);
    font-weight: 500;
    transition: color 0.3s;
}

.card-wrapper:hover .card-desc {
    color: var(--color-slate-500);
}

/* Locked Card */
.locked-bg {
    position: absolute;
    inset: 0;
    background-color: rgba(248, 250, 252, 0.5);
    border-radius: 1.5rem;
    border: 1px solid var(--color-slate-100);
}

.locked-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    opacity: 0.6;
}

.emoji-faint {
    font-size: 3rem; /* text-5xl */
    opacity: 0.3;
}

.tag-locked {
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--color-slate-200);
    color: var(--color-slate-500);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 0.25rem;
}

.title-subtle {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-slate-400);
    margin-bottom: 0.25rem;
}

/* Empty Slot */
.empty-slot {
    width: 100%;
    height: 100%;
    border-radius: 1.5rem;
    border: 2px dashed var(--color-slate-200);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-slate-300);
    gap: 0.5rem;
    transition: color 0.3s;
    cursor: default;
}

.empty-slot:hover {
    background-color: rgba(255, 255, 255, 0.5);
    border-color: var(--color-slate-300);
}

.plus-sign {
    font-size: 2.25rem;
    font-weight: 300;
}

.empty-text {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --- Footer --- */
.footer {
    width: 100%;
    max-width: var(--max-width);
    margin: 2rem auto 0;
    padding: 3rem 1.5rem 4rem;
    position: relative;
    z-index: 10;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
}

@media (min-width: 1024px) {
    .footer-grid { grid-template-columns: repeat(4, 1fr); }
}

.footer-brand h3 {
    font-weight: 900;
    color: var(--color-slate-900);
    font-size: 1.125rem;
}

.footer-brand p {
    color: var(--color-slate-400);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    max-width: 20rem;
}

.copyright {
    margin-top: 1.5rem;
    color: var(--color-slate-300);
    font-size: 0.75rem;
    font-weight: 500;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-col h4 {
    font-weight: 700;
    color: var(--color-slate-800);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.footer-link {
    color: var(--color-slate-500);
    font-size: 0.875rem;
    transition: color 0.3s;
}

.footer-link:hover {
    color: var(--color-indigo-600);
}

.contact-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-label {
    font-size: 0.75rem;
    color: var(--color-slate-400);
    font-weight: 500;
}

/* --- 404 Specifics --- */
.page-404-main {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    padding: 0 1.5rem;
}

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 32rem;
}

.ghost-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.ghost-blur {
    font-size: 8rem;
    opacity: 0.2;
    filter: blur(4px);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -1rem);
}

.ghost-main {
    font-size: 6rem;
    position: relative;
    z-index: 10;
    display: inline-block;
    animation: float 6s ease-in-out infinite;
}

.error-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-slate-400);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background-color: var(--color-slate-100);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 1.5rem;
}

.error-title {
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--color-slate-900);
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .error-title { font-size: 3.75rem; }
}

.error-desc {
    color: var(--color-slate-500);
    font-size: 1.125rem;
    font-weight: 500;
    max-width: 28rem;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-weight: 700;
    color: white;
    background-color: var(--color-slate-900);
    border-radius: 1rem;
    transition: all 0.2s;
}

.btn-back:hover {
    background-color: var(--color-indigo-600);
}

.btn-back:active {
    transform: scale(0.95);
}

.icon-arrow {
    margin-left: 0.5rem;
    transition: transform 0.2s;
}

.btn-back:hover .icon-arrow {
    transform: translateX(-0.25rem);
}

/* --- Animations --- */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Grid Span Helpers for Footer */
.col-span-2 {
    grid-column: span 1;
}

@media (min-width: 1024px) {
    .col-span-2 { grid-column: span 2; }
    
    .games-scroll-container {
        /* Firefox: Show thin scrollbar */
        scrollbar-width: thin;
        scrollbar-color: var(--color-slate-300) transparent;
    }

    /* Webkit (Chrome/Edge/Safari): Custom styling */
    .games-scroll-container::-webkit-scrollbar {
        display: block;
        height: 12px; /* Hit area height */
    }

    .games-scroll-container::-webkit-scrollbar-track {
        background: transparent;
        margin: 0 1.5rem; /* Align track with container padding */
    }

    .games-scroll-container::-webkit-scrollbar-thumb {
        background-color: var(--color-slate-200); /* Normal state */
        border-radius: 20px;
        /* Creates a padding effect so the bar looks "floating" */
        border: 3px solid var(--color-paper); 
    }

    .games-scroll-container::-webkit-scrollbar-thumb:hover {
        background-color: var(--color-slate-400); /* Hover state */
    }
}