@import url('https://fonts.googleapis.com/css2?family=Bungee&family=Fredoka+One&family=Inter:wght@400;900&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    max-width: 100%;
}

:root {
    --primary: #FFD700;
    --secondary: #E63946;
    --accent: #1D3557;
    --bright-blue: #457B9D;
    --plastic-white: #F1FAEE;
    --success: #2A9D8F;
    --error: #E63946;
    --text: #1d3557;
    --text-muted: #457b9d;
    --neon-pink: #FF69B4;
    --m-yellow: #FFEA00;
    --m-red: #FF3C38;
    --m-blue: #00A6FB;
}

body {
    background-color: var(--m-blue);
    margin: 0;
    padding: 0;
    font-family: 'Fredoka One', cursive;
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.2) 2px, transparent 0);
    background-size: 30px 30px;
    background-attachment: fixed;
}

/* --- LAYOUTS --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(1rem, 5vw, 3rem);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: center;
    overflow: hidden;
    /* Prevent spill */
}

.container-fluid {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.center-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* --- COMPONENTS --- */
.glass-panel {
    background: var(--plastic-white);
    border: 8px solid var(--accent);
    border-radius: 30px;
    padding: clamp(1.5rem, 4vw, 3rem);
    box-shadow: 12px 12px 0px var(--accent);
    width: 100%;
    max-width: 600px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.btn-primary,
.btn-secondary,
.btn-success,
.btn-error,
.btn-option {
    font-family: 'Bungee', cursive;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    border: 4px solid var(--accent);
    cursor: pointer;
    text-transform: uppercase;
    font-weight: 900;
    transition: 0.1s;
    box-shadow: 6px 6px 0px var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    word-break: break-all;
}

.btn-primary {
    background: var(--primary);
    color: var(--accent);
}

.btn-secondary {
    background: var(--neon-pink);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-error {
    background: var(--error);
    color: white;
}

.btn-option {
    background: white;
    color: var(--text);
}

.btn-primary:active,
.btn-secondary:active,
.btn-option:active {
    transform: translate(3px, 3px);
    box-shadow: 2px 2px 0px var(--accent);
}

.input-lg {
    width: 100%;
    max-width: 400px;
    padding: 1.2rem;
    font-size: 1.5rem;
    border-radius: 50px;
    border: 4px solid var(--accent);
    margin-bottom: 2rem;
    text-align: center;
    font-family: inherit;
}

/* --- HOME PAGE SPECIALS --- */
.logo-text {
    font-family: 'Bungee', cursive;
    font-size: clamp(3.5rem, 15vw, 8rem);
    display: flex;
    gap: 0.2rem;
    margin-bottom: 0px;
    line-height: 1;
}

.logo-text span {
    display: inline-block;
    color: white;
    -webkit-text-stroke: 3px var(--accent);
    filter: drop-shadow(6px 6px 0px var(--accent));
    animation: jump 2s ease-in-out infinite;
}

.logo-text span:nth-child(even) {
    animation-delay: 0.2s;
    color: var(--primary);
}

.logo-text span:nth-child(3n) {
    color: var(--neon-pink);
}

.logo-text span:nth-child(5n) {
    color: var(--m-red);
}

@keyframes jump {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

.subtitle {
    font-family: 'Bungee', cursive;
    background: var(--accent);
    color: white;
    padding: 0.5rem 2rem;
    transform: rotate(-2deg);
    margin-top: -0.5rem;
    margin-bottom: 3.5rem;
    box-shadow: 8px 8px 0px var(--neon-pink);
    border-radius: 5px;
    font-size: clamp(0.8rem, 3vw, 1.2rem);
}

.btn-group-v {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 420px;
}

.floating-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    opacity: 0.4;
}

/* --- GAME SPECIFIC --- */
.game-grid {
    display: grid;
    gap: 0.8rem;
    padding: 0.5rem;
    flex: 1;
}

.grid-cell {
    background: white;
    border: 4px solid var(--accent);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(1rem, 4vw, 2.5rem);
    font-weight: 900;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 4px 4px 0px var(--accent);
    aspect-ratio: 4/3;
    min-height: 80px;
}

.grid-cell:hover:not(.used) {
    background: var(--primary);
    transform: scale(1.03) rotate(1deg);
}

.grid-cell.used {
    background: #ccc;
    opacity: 0.5;
    box-shadow: none;
    cursor: default;
}

.cat-header {
    background: var(--accent);
    color: white;
    padding: 0.5rem;
    border-radius: 10px;
    text-align: center;
    font-family: 'Bungee', cursive;
    margin-bottom: 0.5rem;
    font-size: clamp(0.6rem, 2vw, 1rem);
    text-transform: uppercase;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-ticker {
    display: flex;
    gap: 1rem;
    padding: 0.8rem;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    margin-bottom: 1rem;
    scrollbar-width: none;
}

.team-ticker::-webkit-scrollbar {
    display: none;
}

.ticker-item {
    background: white;
    padding: 0.5rem 1.5rem;
    border-radius: 12px;
    border: 3px solid var(--accent);
    min-width: 140px;
    text-align: center;
    box-shadow: 4px 4px 0px var(--accent);
    flex-shrink: 0;
}

.ticker-item.active {
    background: var(--neon-pink);
    color: white;
    transform: scale(1.05);
}

.board-scroll-area {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2rem;
    scrollbar-width: thin;
}

/* --- ANIMATIONS --- */
@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes popOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.5);
        opacity: 0;
    }
}

@keyframes slideUp {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slamZoom {
    0% {
        transform: scale(2);
        opacity: 0;
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.animate-pop {
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out;
}

.animate-slam {
    animation: slamZoom 0.4s cubic-bezier(1, 0, 0, 1) forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* --- TOASTS --- */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 2rem;
    border-radius: 15px;
    color: white;
    font-weight: 900;
    border: 4px solid var(--accent);
    box-shadow: 6px 6px 0px var(--accent);
    z-index: 9999;
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--error);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .glass-panel {
        padding: 1.5rem;
    }

    .game-grid {
        min-width: 600px;
    }

    .logo-text {
        font-size: 3rem;
    }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border: 8px solid var(--accent);
    border-radius: 30px;
    padding: clamp(1rem, 5vw, 4rem);
    box-shadow: 20px 20px 0px var(--accent);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
}

.ques-img {
    max-width: 100%;
    max-height: 40vh;
    border-radius: 20px;
    border: 4px solid var(--accent);
    margin: 1.5rem 0;
    object-fit: contain;
}