/* Reset + Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: fadeIn 1s;
}

.header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* === Game Menu === */
.game-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.game-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.game-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.game-card .icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.game-card h3 {
    color: #333;
    margin-bottom: 10px;
}

/* === Game Containers === */
.game-container {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideIn 0.5s;
}

.game-container.active {
    display: block;
}

.back-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.back-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* === Rock Paper Scissors === */
.rps-choices {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.choice-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 20px;
    padding: 30px;
    font-size: 3em;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.choice-btn:hover {
    transform: scale(1.1) rotate(5deg);
}

.choice-btn:active {
    transform: scale(0.95);
}

.game-result {
    text-align: center;
    margin: 30px 0;
    font-size: 2em;
    font-weight: bold;
    color: #333;
    min-height: 60px;
    animation: bounce 0.5s;
}

/* === Scoreboard === */
.score-board {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.score-item {
    text-align: center;
}

.score-item .label {
    font-size: 14px;
    color: #666;
}

.score-item .value {
    font-size: 2em;
    font-weight: bold;
    color: #333;
}

/* === Guess Number === */
.guess-input {
    width: 100%;
    padding: 15px;
    font-size: 1.5em;
    border: 3px solid #667eea;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

.guess-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.guess-btn:hover {
    transform: scale(1.05);
}

.hint {
    text-align: center;
    font-size: 1.5em;
    margin: 20px 0;
    color: #667eea;
    font-weight: bold;
}

/* === Memory Game === */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 30px auto;
    max-width: 500px;
}

.memory-card {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    cursor: pointer;
    transition: all 0.3s;
    transform-style: preserve-3d;
}

.memory-card:hover {
    transform: scale(1.05);
}

.memory-card.flipped {
    background: white;
    border: 3px solid #667eea;
}

.memory-card.matched {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    pointer-events: none;
}

/* === Tic Tac Toe === */
.ttt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 30px auto;
    max-width: 400px;
}

.ttt-cell {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border: none;
    border-radius: 15px;
    font-size: 3em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    color: #333;
}

.ttt-cell:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.ttt-cell:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

/* === Dice Game === */
.dice-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.dice {
    width: 120px;
    height: 120px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    animation: roll 0.5s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.roll-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 20px 50px;
    font-size: 1.5em;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
}

.roll-btn:hover {
    transform: scale(1.05);
}

/* === "More Games Coming Soon" Section === */
#MoreGameSect {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 60px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: fadeIn 1s ease-in-out;
}

#MoreGameSect.active {
    display: flex;
}

#MoreGameSect .game-title {
    font-size: 2.5em;
    color: #764ba2;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 1px 2px 8px rgba(102, 126, 234, 0.4);
    animation: pulse 2s infinite;
}

#MoreGameSect::after {
    content: "🎮 New adventures are loading...";
    color: #667eea;
    font-size: 1.3em;
    font-style: italic;
    animation: float 3s ease-in-out infinite;
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes roll {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* === General === */
.game-title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2em;
}

.restart-btn {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.restart-btn:hover {
    transform: scale(1.05);
}

/* === Responsive === */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }

    .game-card .icon {
        font-size: 3em;
    }

    .choice-btn {
        padding: 20px;
        font-size: 2em;
    }

    .game-result {
        font-size: 1.5em;
    }

    .memory-grid {
        max-width: 350px;
    }

    .memory-card {
        font-size: 2em;
    }
}
