/* ============================================
   Mini Arcade - Landing Page Styles
   ============================================ */

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 40px 20px;
    text-align: center;
    overflow: hidden;
}

.hero-content {
    max-width: 600px;
    animation: fadeIn 0.8s ease-out;
}

.hero-badge {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.hero-title {
    margin-bottom: 20px;
    line-height: 1.1;
}

.title-line {
    display: block;
    font-size: 3.5rem;
    font-weight: 200;
    color: var(--text-primary);
    letter-spacing: 8px;
    text-transform: uppercase;
}

.title-accent {
    display: block;
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: -3px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--gem-yellow) 40%, var(--gem-purple) 80%, var(--gem-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 30px rgba(255, 107, 53, 0.3));
    background-size: 200% 200%;
    animation: gradientShift 6s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto 36px auto;
}

.hero-cta {
    font-size: 1.1rem;
    padding: 16px 56px;
}

/* --- Hero Decorations (floating gems) --- */
.hero-decorations {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    opacity: 0.3;
    animation: floatAround 12s ease-in-out infinite;
}

.shape-1 {
    width: 20px; height: 20px;
    background: var(--gem-red);
    border-radius: 50%;
    top: 15%; left: 10%;
    animation-duration: 10s;
}
.shape-2 {
    width: 24px; height: 24px;
    background: var(--gem-blue);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    top: 25%; right: 15%;
    animation-duration: 14s;
    animation-delay: -2s;
}
.shape-3 {
    width: 18px; height: 18px;
    background: var(--gem-green);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    bottom: 30%; left: 8%;
    animation-duration: 11s;
    animation-delay: -4s;
}
.shape-4 {
    width: 22px; height: 22px;
    background: var(--gem-yellow);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    top: 60%; right: 10%;
    animation-duration: 13s;
    animation-delay: -6s;
}
.shape-5 {
    width: 16px; height: 16px;
    background: var(--gem-purple);
    clip-path: polygon(50% 10%, 90% 90%, 10% 90%);
    bottom: 20%; left: 50%;
    animation-duration: 9s;
    animation-delay: -3s;
}

@keyframes floatAround {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0.2; }
    25% { transform: translate(20px, -30px) rotate(90deg); opacity: 0.4; }
    50% { transform: translate(-10px, -50px) rotate(180deg); opacity: 0.3; }
    75% { transform: translate(30px, -20px) rotate(270deg); opacity: 0.5; }
    100% { transform: translate(0, 0) rotate(360deg); opacity: 0.2; }
}

/* --- User Stats Modal --- */
.stats-modal {
    position: relative;
    max-width: 480px;
    width: 92%;
    padding: 32px 28px 28px;
    animation: slideInUp 0.3s ease;
}

.stats-modal .stats-grid {
    grid-template-columns: repeat(2, 1fr);
}

.stats-greeting {
    text-align: center;
    margin-bottom: 24px;
}

.stats-hello {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.stats-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    margin-left: 6px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 8px;
}

.stat-item {
    text-align: center;
    padding: 12px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 1.4rem;
    margin-bottom: 6px;
    line-height: 1;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* --- Best Moments --- */
.best-moments {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.moments-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 14px;
}

.moments-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.moment-card {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.moment-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
}

.moment-game {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent);
    margin-bottom: 6px;
}

.moment-score {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
}

.moment-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.moment-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- Games Section --- */
.games-section {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 20px 60px;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
}

/* --- Games Grid --- */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

/* --- Game Card --- */
.game-card {
    display: flex;
    flex-direction: column;
    padding: 28px;
    text-decoration: none;
    color: inherit;
    transition: all 0.35s ease;
    opacity: 0;
    transform: translateY(30px);
    position: relative;
    overflow: hidden;
}

.game-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.game-card:not(.card-coming-soon):hover {
    transform: translateY(-4px);
    border-color: rgba(255, 107, 53, 0.3);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(255, 107, 53, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.game-card:not(.card-coming-soon):hover .play-arrow {
    transform: translateX(4px);
}

/* --- Card Preview --- */
.card-preview {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    position: relative;
}

/* --- Mini Match 3 Canvas --- */
.mini-canvas {
    width: 140px;
    height: 140px;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.game-card:hover .mini-canvas {
    opacity: 1;
}

/* --- Mini Memotest Board --- */
.mini-memotest-board {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    perspective: 800px;
}

.mini-memotest-card {
    width: 52px;
    height: 66px;
    cursor: default;
}

.mini-mt-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.mini-memotest-card.flipped .mini-mt-inner {
    transform: rotateY(180deg);
}

.mini-mt-front,
.mini-mt-back {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-mt-front {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(165, 94, 234, 0.1));
    border: 2px solid rgba(255, 107, 53, 0.25);
}

.mini-mt-front::after {
    content: '?';
    font-size: 1.4rem;
    font-weight: 800;
    color: rgba(255, 107, 53, 0.5);
}

.mini-mt-back {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.15), rgba(55, 66, 250, 0.1));
    border: 2px solid rgba(46, 213, 115, 0.3);
    transform: rotateY(180deg);
}

.mini-mt-back i {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.mini-memotest-card.matched .mini-mt-back {
    border-color: var(--gem-green);
    background: rgba(46, 213, 115, 0.2);
    box-shadow: 0 0 12px rgba(46, 213, 115, 0.3);
}

/* --- Card Info --- */
.card-info {
    flex: 1;
}

.card-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent);
    margin-bottom: 10px;
}

.badge-soon {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-item {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* --- Card Play Button --- */
.card-play {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    transition: gap 0.3s ease;
}

.play-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.coming-soon-label {
    color: var(--text-muted);
}

/* --- Coming Soon Card --- */
.card-coming-soon {
    opacity: 0.7;
    cursor: default;
}

/* --- Overlay (for Auth Modal) --- */
.overlay {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay.active {
    display: flex;
    animation: slideInUp 0.3s ease;
}

/* --- Auth Navbar --- */
.auth-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
    padding: 12px 20px;
}

.auth-nav-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.nav-logo:hover {
    opacity: 1;
}

.auth-nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-auth-btn {
    padding: 8px 20px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border-radius: 10px;
}

.nav-auth-btn:hover {
    color: var(--accent);
    border-color: rgba(255, 107, 53, 0.2);
}

/* --- User Menu --- */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.user-menu-btn {
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 50px;
    transition: all var(--transition-speed) ease;
}

/* --- User Avatar --- */
.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(0, 255, 200, 0.25), rgba(0, 170, 255, 0.25));
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
    text-transform: uppercase;
    line-height: 1;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.username-text {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    padding: 6px;
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    text-align: left;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--gem-red);
}

/* --- Auth Modal --- */
.auth-modal {
    position: relative;
    max-width: 400px;
    width: 90%;
    padding: 36px 32px 32px;
}

.auth-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
}

.auth-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

/* --- Auth Tabs --- */
.auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.25s ease;
}

.auth-tab.active {
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent);
}

.auth-tab:not(.active):hover {
    color: var(--text-secondary);
}

/* --- Auth Form --- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-error {
    padding: 10px 14px;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.2);
    border-radius: 8px;
    color: var(--gem-red);
    font-size: 0.82rem;
    line-height: 1.4;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.form-group label .optional {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.75rem;
}

.form-group input {
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus {
    border-color: var(--accent);
    background: rgba(255, 107, 53, 0.04);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.auth-submit {
    margin-top: 4px;
    width: 100%;
    min-width: unset;
}

/* --- Auth Divider --- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.auth-divider span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Google Button --- */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-width: unset;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: none;
}

.btn-google:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.btn-google:active {
    transform: translateY(0);
}

.google-icon {
    flex-shrink: 0;
}

/* --- Auth Success --- */
.auth-success {
    text-align: center;
    padding: 20px 0;
}

.auth-success-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.auth-success p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* --- Adjust hero for fixed navbar --- */
.hero {
    padding-top: 80px;
}

/* --- Footer --- */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.site-footer .footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.site-footer .footer-links a:hover {
    color: var(--accent);
}

/* --- Dropdown Divider --- */
.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

/* --- Dropdown Stats Item --- */
.dropdown-item-stats i {
    margin-right: 6px;
    font-size: 0.8rem;
    opacity: 0.7;
}

.dropdown-item-stats:hover {
    color: var(--accent) !important;
    background: rgba(255, 107, 53, 0.08) !important;
}

/* --- Responsive --- */
@media (max-width: 720px) {
    .games-grid {
        grid-template-columns: 1fr;
        max-width: 440px;
        margin: 0 auto;
    }

    .title-line {
        font-size: 2.5rem;
        letter-spacing: 5px;
    }

    .title-accent {
        font-size: 3.8rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }
}

@media (max-width: 400px) {
    .title-line {
        font-size: 2rem;
    }

    .title-accent {
        font-size: 3rem;
    }

    .hero-cta {
        padding: 14px 40px;
        font-size: 1rem;
    }

    .game-card {
        padding: 20px;
    }

    .card-preview {
        height: 110px;
    }

    .stats-grid {
        gap: 10px;
    }

    .stat-item {
        padding: 10px 6px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .mini-memotest-card {
        width: 44px;
        height: 56px;
    }

    .mini-mt-back i {
        font-size: 1.1rem;
    }

    .mini-canvas {
        width: 110px;
        height: 110px;
    }
}
