:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --text-color: #f0f6fc;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --border-color: #30363d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.portal-container {
    max-width: 900px;
    width: 100%;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
    color: var(--accent-color);
    letter-spacing: 2px;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    text-align: left;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.90rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 4px;
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    margin-bottom: 12px;
}

.btn {
    display: inline-block;
    background-color: #238636;
    color: white;
    text-decoration: none;
    text-align: center;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #2ea043;
}

/* Styles communs pour les pages de jeux */
.card-game {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin: 0 auto;
    width: fit-content;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.game-header {
    display: flex;
    justify-content: space-around;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.controls-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 15px;
}

.hidden {
    display: none !important;
}

/* Grilles additionnelles (Morpion, Puissance 4, 2048) */
.morpion-grid, .p4-grid {
    display: grid;
    gap: 10px;
    background-color: #21262d;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    margin: 20px auto;
    width: fit-content;
}

.morpion-grid {
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
}

.morpion-cell, .p4-cell {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 2.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    color: var(--text-color);
}

.morpion-cell:hover, .p4-cell:hover {
    background-color: #30363d;
    transform: scale(1.03);
}

.p4-grid {
    grid-template-columns: repeat(7, 50px);
    grid-template-rows: repeat(6, 50px);
}

.p4-cell {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 0;
}

.grid-2048 {
    display: grid;
    grid-template-columns: repeat(4, 80px);
    grid-template-rows: repeat(4, 80px);
    gap: 10px;
    background-color: #21262d;
    padding: 15px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    margin: 20px auto;
    width: fit-content;
}

.tile-2048 {
    width: 80px;
    height: 80px;
    background-color: #30363d;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
}

/* --- Styles additionnels pour Cookie Clicker et Bubble Shooter --- */
.cookie-container, .bubble-container {
    text-align: center;
}

.cookie-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 8rem;
    transition: transform 0.1s ease;
    margin: 20px 0;
    outline: none;
}

.cookie-btn:active {
    transform: scale(0.9);
}

.shop-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.shop-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    transition: background 0.2s;
}

.shop-btn:hover {
    background-color: #30363d;
}

.shop-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#bubbleCanvas {
    background-color: #010409;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}
