/* --- GLOBAL RESET & VARS --- */
:root {
    --primary-hue: 260;
    /* Purple base */
    --secondary-hue: 190;
    /* Cyan base */
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --text-main: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --card-hover: rgba(255, 255, 255, 0.25);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    background-color: #1a1a2e;
}

/* --- ANIMATED BACKGROUND --- */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: linear-gradient(45deg,
            #1a1a2e,
            #16213e,
            #4a148c,
            #0d47a1);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- LAYOUT --- */
.top-bar {
    background-color: rgba(255, 255, 255, 0.95);
    width: 100%;
    height: 25px;
    /* Match logo height exactly */
    display: flex;
    justify-content: flex-end;
    /* Align to right */
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.top-logo {
    height: 25px;
    /* Reduced size */
    width: auto;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* --- HERO --- */
.hero {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 4rem;
    margin: 0;
    background: linear-gradient(to right, #fff, #a5f3fc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 10px;
    font-weight: 300;
}

/* --- SECTIONS --- */
.section-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.translation {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    font-style: italic;
}

/* --- CARDS --- */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    text-align: center;
    color: white;
    /* Ensure button text is white */
    appearance: none;
    /* Remove default button styles */
    -webkit-appearance: none;
}

.card:hover {
    background: var(--card-hover);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
}

.card:active {
    transform: scale(0.95);
}

/* Ripple effect on click */
.card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.card:active::after {
    width: 300px;
    height: 300px;
}

.number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 5px;
    background: linear-gradient(to bottom right, #fff, #e0e0e0);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.word {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* --- GRID 1-9 --- */
.grid-1-9 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* --- SPECIAL SECTION (10 & 11) --- */
.special-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.logic-connector {
    font-size: 2rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5);
}

.special-card {
    flex: 1;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.2);
    /* Slightly lighter */
}

.special-card .number {
    font-size: 3.5rem;
}

.special-card .word {
    font-size: 1.3rem;
}

.explanation {
    font-size: 0.8rem;
    color: #a5f3fc;
    margin-top: 5px;
    font-weight: 300;
}

/* --- TENS LIST --- */
.list-tens {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.list-card {
    flex-direction: row;
    justify-content: flex-start;
    padding: 15px 25px;
    gap: 20px;
}

.list-card .number {
    font-size: 2rem;
    margin-bottom: 0;
    width: 50px;
    text-align: right;
}

.list-card .word {
    font-size: 1.2rem;
    text-align: left;
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 40px 0;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

/* --- ANIMATIONS --- */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

.fade-in-delay {
    opacity: 0;
    animation: fadeIn 1s ease 0.5s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 600px) {
    .hero h1 {
        font-size: 3rem;
    }

    .grid-1-9 {
        grid-template-columns: repeat(2, 1fr);
        /* 2 cols on mobile */
    }

    /* Make the 9th item span full width to look nice */
    .grid-1-9 .card:last-child {
        grid-column: span 2;
    }

    .special-grid {
        flex-direction: column;
        gap: 10px;
    }

    .logic-connector {
        transform: rotate(90deg);
    }

    .list-tens {
        grid-template-columns: 1fr;
        /* Stack tens on mobile */
    }
}