﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.game-title {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.game-info {
    color: #4a5568;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.game-info strong {
    color: #667eea;
    font-weight: 700;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.stat-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 2rem;
    border-radius: 15px;
    flex: 1;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.stat-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.stat-value {
    display: block;
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
}

/* Game Area */
.game-area {
    margin-bottom: 2rem;
}

.feedback {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 2rem;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.feedback.too-high {
    background: #fed7d7;
    color: #c53030;
}

.feedback.too-low {
    background: #bee3f8;
    color: #2c5282;
}

.feedback.correct {
    background: #c6f6d5;
    color: #22543d;
}

/* Input Container */
.input-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.guess-input {
    flex: 1;
    padding: 1.2rem;
    font-size: 1.2rem;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    text-align: center;
    font-weight: 600;
    color: #2d3748;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.guess-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.guess-input::placeholder {
    color: #cbd5e0;
}

.guess-btn {
    padding: 1.2rem 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.guess-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.guess-btn:active {
    transform: translateY(0);
}

.guess-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Guess History */
.guess-history {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 15px;
}

.guess-history h3 {
    color: #2d3748;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    min-height: 50px;
    align-items: center;
}

.empty-history {
    color: #a0aec0;
    font-style: italic;
}

.history-item {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.history-item.too-high {
    color: #c53030;
    border: 2px solid #fc8181;
}

.history-item.too-low {
    color: #2c5282;
    border: 2px solid #63b3ed;
}

/* Win Screen */
.win-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.win-screen.hidden {
    display: none;
}

.win-content {
    background: white;
    padding: 3rem;
    border-radius: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.win-content h2 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.win-content p {
    color: #4a5568;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.win-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 4rem;
    font-weight: 700;
    padding: 2rem;
    border-radius: 20px;
    margin: 1.5rem 0;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.play-again-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-top: 1rem;
}

.play-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Reset Button */
.reset-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.reset-btn:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 600px) {
    .game-container {
        padding: 2rem 1.5rem;
    }

    .game-title {
        font-size: 2rem;
    }

    .game-info {
        font-size: 1rem;
    }

    .stats-bar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .input-container {
        flex-direction: column;
    }

    .guess-btn {
        width: 100%;
    }

    .feedback {
        font-size: 1.1rem;
        padding: 1rem;
    }

    .win-content {
        padding: 2rem;
    }

    .win-content h2 {
        font-size: 2rem;
    }

    .win-number {
        font-size: 3rem;
        padding: 1.5rem;
    }
}

/* ========================================
   RESPONSIVE ADDITIONS
   ======================================== */

/* ========================================
   Universal Responsive Game Styles
   Add this to all game style.css files
   ======================================== */

/* Canvas Auto-Resize */
.canvas-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    /* Maintains square aspect ratio */
}

#game-canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    border-radius: 15px;
    touch-action: none;
    /* Prevents scrolling while playing */
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .canvas-container {
        max-width: 100%;
        padding: 0 !important;
    }

    .game-title {
        font-size: 1.8rem !important;
        text-align: center;
    }

    .score-display {
        flex-wrap: wrap;
        gap: 0.5rem !important;
        justify-content: center;
    }

    .score-item {
        padding: 0.7rem 1.5rem !important;
        font-size: 0.9rem;
    }

    .score-value {
        font-size: 1.5rem !important;
    }

    /* Make social buttons stack vertically on mobile */
    .social-section {
        margin-top: 1rem;
    }

    .social-buttons {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .social-btn {
        width: 100% !important;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px !important;
    }

    .game-container {
        padding: 1rem 0.5rem !important;
        gap: 1rem;
    }

    .game-title {
        font-size: 1.5rem !important;
        margin-bottom: 0.8rem !important;
    }

    .score-display {
        gap: 0.4rem !important;
        margin-bottom: 1rem !important;
        flex-direction: column;
        align-items: stretch;
    }

    .score-item {
        padding: 0.6rem 1rem !important;
        flex: 1;
        min-width: auto;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .score-label {
        font-size: 0.75rem !important;
    }

    .score-value {
        font-size: 1.3rem !important;
    }

    .canvas-container {
        padding: 0 !important;
        border-radius: 12px !important;
        margin: 0 auto;
    }

    .instructions {
        font-size: 0.85rem !important;
        padding: 0.5rem !important;
        text-align: center;
    }

    .overlay {
        padding: 1.5rem !important;
    }

    .overlay h2 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }

    .overlay p {
        font-size: 0.9rem !important;
        margin: 0.5rem 0 !important;
    }

    .game-btn {
        padding: 0.8rem 2rem !important;
        font-size: 1rem !important;
        width: 100%;
        max-width: 200px;
    }

    /* Mobile hint for touch controls */
    .canvas-container::after {
        content: "ðŸ’¡ Swipe to move";
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.5);
        margin-top: 0.5rem;
        font-style: italic;
    }
}

/* Touch Controls Enhancement */
@media (hover: none) and (pointer: coarse) {

    /* Touch device detected */
    .game-btn {
        min-height: 44px;
        min-width: 120px;
    }

    button,
    .social-btn {
        min-height: 44px;
        padding: 0.7rem 1.2rem;
    }
}

/* Landscape Mode for Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding: 5px;
    }

    .game-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto 1fr auto;
        gap: 0.5rem;
        max-width: 100%;
    }

    .game-title {
        grid-column: 1 / -1;
        font-size: 1.3rem !important;
        margin-bottom: 0.5rem !important;
    }

    .score-display {
        grid-column: 1 / -1;
        margin-bottom: 0.5rem !important;
    }

    .canvas-container {
        grid-column: 1;
        grid-row: 3;
        max-width: 400px;
        justify-self: center;
    }

    .instructions {
        grid-column: 1 / -1;
        grid-row: 4;
        margin-top: 0.5rem;
    }

    .social-section {
        grid-column: 2;
        grid-row: 3;
        align-self: start;
    }
}