@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ===== CSS RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: #2d3748;
}

body.loading-active {
    overflow: hidden;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 1200px;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== HEADER SECTION ===== */
.game-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1.5rem;
}

.game-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.timer-container,
.score-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 1.5rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.timer-label,
.score-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

#timer,
#score {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
    min-width: 4rem;
    text-align: center;
}

/* ===== MAIN GAME AREA ===== */
.game-main {
    margin-bottom: 2rem;
}

.art-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: start;
}

.reference-section,
.drawing-section {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.reference-section h3,
.drawing-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    text-align: center;
}

.image-container,
.canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    border-radius: 1.5rem;
    border: 3px dashed #cbd5e0;
    min-height: 350px;
    overflow: hidden;
}

#prompt-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#drawing-canvas {
    width: 100%;
    height: 350px;
    border-radius: 1rem;
    background: #ffffff;
    cursor: crosshair;
    display: block;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 1rem;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
}

.canvas-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===== DRAWING TOOLS ===== */
.tools-section {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: 2fr 1fr; /* Adjusted for removed eraser section */
    gap: 2rem;
    align-items: start;
}

.tools-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
}

.colors {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.color-option.active {
    border-color: #667eea;
    transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.brush-sizes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.brush-size {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.brush-size:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.brush-size.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.tool-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Adjusted to occupy the last column */
    grid-column: 2 / 3;
    align-self: end;
}

.tool-btn {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.tool-btn:hover {
    border-color: #f56565;
    background: rgba(245, 101, 101, 0.1);
    color: #f56565;
}

/* ===== GAME CONTROLS ===== */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.primary-btn,
.secondary-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    min-width: 180px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.secondary-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

/*
* Added new styles specifically for the result page
*/
.result-page .game-container {
    max-width: 600px;
    padding: 4rem;
}

.result-page .game-header {
    border-bottom: none;
}

.result-page .game-main {
    margin-bottom: 4rem;
}

.result-page .drawing-section {
    background: none;
    box-shadow: none;
    border: none;
}

.result-page #drawn-image {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: block;
}

.result-page .canvas-container {
    padding: 1rem;
    border: none;
    min-height: auto;
}

.result-page .match-result {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    margin-bottom: 2rem;
}

.result-page .game-controls {
    margin-bottom: 0;
}

/* Styles for the fake AI loading screen */
.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(102, 126, 234, 0.95);
    backdrop-filter: blur(5px);
    color: white;
    z-index: 1000;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.ai-loading.hidden {
    display: none;
}

.ai-loading-content {
    animation: slideUp 0.6s ease-out;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.spinner {
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-loading h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.ai-loading p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Styles for the match result element */
.match-result {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2rem;
    padding: 2rem;
    text-align: center;
    color: white;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
    animation: slideUp 0.6s ease-out;
    z-index: 1001;
}

.match-result.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 30px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.result-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.match-message {
    font-size: 1.5rem;
    margin-bottom: 0;
    opacity: 0.9;
    font-style: italic;
}


/* ===== LANDING PAGE STYLES (INDEX.HTML) ===== */
.landing-container {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.game-title {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.3)); }
    to { filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.6)); }
}

.game-subtitle {
    font-size: 1.5rem;
    color: #4a5568;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.game-description {
    font-size: 1.1rem;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.features-section {
    margin-bottom: 4rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #718096;
    line-height: 1.5;
}

.difficulty-section {
    margin-bottom: 4rem;
}

.difficulty-section h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 2rem;
}

.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.difficulty-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.difficulty-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.difficulty-card.easy {
    border-color: rgba(72, 187, 120, 0.3);
}

.difficulty-card.medium {
    border-color: rgba(237, 137, 54, 0.3);
}

.difficulty-card.hard {
    border-color: rgba(245, 101, 101, 0.3);
}

.difficulty-header {
    margin-bottom: 1.5rem;
}

.difficulty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.difficulty-card h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
}

.difficulty-details {
    margin-bottom: 2rem;
}

.time-limit {
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.difficulty-desc {
    color: #718096;
    margin-bottom: 0.5rem;
}

.score-range {
    font-size: 0.9rem;
    color: #a0aec0;
}

.start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    width: 100%;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.instructions-section {
    margin-bottom: 3rem;
}

.instructions-section h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 2rem;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.instruction-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.6);
    padding: 1.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.step-content p {
    color: #718096;
    line-height: 1.5;
}

.game-footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.game-footer p {
    font-size: 1.1rem;
    color: #4a5568;
    font-weight: 500;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .game-container {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .game-info {
        gap: 1.5rem;
    }
    
    .art-workspace {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tools-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .colors {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .primary-btn,
    .secondary-btn {
        width: 100%;
        max-width: 300px;
    }
    
    #prompt-image,
    #drawing-canvas {
        height: 280px;
    }
    
    .image-container,
    .canvas-container {
        min-height: 280px;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    #timer {
        font-size: 1.4rem;
    }
    
    .result-content h2 {
        font-size: 1.5rem;
    }
    
    .match-message {
        font-size: 1rem;
    }
    
    .ai-loading h2 {
        font-size: 1.8rem;
    }
    
    .ai-loading p {
        font-size: 1rem;
    }
}

