:root[data-theme="light"] {
    --bg-color: #f0f0f0;
    --text-color: #333;
    --cell-bg: white;
    --cell-hover: #f0f0f0;
    --grid-bg: #333;
    --marked-bg: #ffeb3b;
    --marked-text: #000000;
    --completed-bg: #4CAF50;
    --completed-text: #ffffff;
}

:root[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --cell-bg: #2d2d2d;
    --cell-hover: #3d3d3d;
    --grid-bg: #000000;
    --marked-bg: #ffd700;
    --marked-text: #000000;
    --completed-bg: #388E3C;
    --completed-text: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.container {
    text-align: center;
    width: 100%;
    max-width: 1000px;
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    padding: 0;
    width: 100%;
}

.logo-container {
    height: 150px;
    display: flex;
    justify-content: center;
    position: relative;
    width: 100%;
}

.logo {
    height: 100%;
    position: absolute;
    opacity: 0;
    transition: opacity 0.3s;
    left: 50%;
    transform: translateX(-50%);
}

:root[data-theme="light"] .light-logo {
    opacity: 1;
}

:root[data-theme="dark"] .dark-logo {
    opacity: 1;
}

.header-buttons {
    display: flex;
    gap: 10px;
    position: fixed;
    right: 20px;
    top: 10px;
    z-index: 1000;
    align-items: center;
}

.lines-counter {
    position: fixed;
    left: 20px;
    top: 10px;
    z-index: 1000;
    background-color: #2d2d2d;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: white;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: transform 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.lines-counter:not(:empty) {
    transform: scale(1);
}

#completed-lines {
    font-weight: bold;
    color: #4CAF50;
    display: inline-block;
    transition: transform 0.2s ease;
}

h1 {
    color: var(--text-color);
}

.bingo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    max-width: 650px;
    margin: 0 auto;
    background-color: var(--grid-bg);
    padding: 5px;
    border-radius: 10px;
}

.bingo-cell {
    aspect-ratio: 1;
    background-color: var(--cell-bg);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    color: var(--text-color);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.bingo-cell .bingo-letter {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: bold;
    color: white;
    opacity: 0;
    pointer-events: none;
}

.bingo-cell .cell-content {
    width: 100%;
    position: relative;
    transform: translateY(0);
    font-weight: bold;
    transition: transform 0.5s ease-in-out;
}

.bingo-cell:hover {
    background-color: var(--cell-hover);
}

.bingo-cell.marked {
    background-color: var(--marked-bg);
    color: var(--marked-text);
    transition: background-color 0.3s;
}

.bingo-cell.completed {
    background-color: var(--completed-bg);
    color: var(--completed-text);
    transition: background-color 0.3s;
}

.bingo-cell.completed.newly-completed .cell-content {
    animation: slideContent 3.5s ease-in-out;
}

.bingo-cell.completed.newly-completed .bingo-letter {
    animation: showLetter 3.5s ease-in-out;
}

.bingo-cell.completed.newly-completed span:nth-child(1) {
    left: 50%;
    top: 50%;
    --tx: calc(20% - (random(40) * 1%));
    --ty: calc(20% - (random(40) * 1%));
    animation: particle3 0.6s ease-out 0.2s;
}

.bingo-cell.completed.newly-completed span:nth-child(2) {
    right: 25%;
    bottom: 25%;
    --tx: calc(20% - (random(40) * 1%));
    --ty: calc(20% - (random(40) * 1%));
    animation: particle4 0.6s ease-out 0.15s;
}

.bingo-cell.completed.newly-completed span:nth-child(3) {
    left: 25%;
    bottom: 25%;
    --tx: calc(20% - (random(40) * 1%));
    --ty: calc(20% - (random(40) * 1%));
    animation: particle5 0.6s ease-out 0.25s;
}

.buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

.icon-button {
    padding: 8px;
    background: none;
    border: none;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.icon-button:hover {
    transform: scale(1.1);
    background-color: rgba(128, 128, 128, 0.1);
}

.icon-button .material-icons {
    font-size: 22px;
}

@media (hover: hover) {
    .icon-button:hover {
        background-color: rgba(128, 128, 128, 0.1);
    }
}

@media print {
    html {
        --bg-color: white !important;
        --text-color: black !important;
        --cell-bg: white !important;
        --grid-bg: black !important;
        --marked-bg: #ffeb3b !important;
        --marked-text: black !important;
        --completed-bg: #4CAF50 !important;
        --completed-text: white !important;
    }
    
    body {
        background-color: white;
    }
    
    .buttons, .header-buttons {
        display: none;
    }

    .logo-container {
        margin: 0 auto;
    }
    
    .logo {
        position: static;
    }

    .dark-logo {
        display: none;
    }

    .light-logo {
        opacity: 1 !important;
    }
    
    .bingo-grid {
        border: 2px solid black;
    }
    
    .bingo-cell {
        border: 1px solid black;
    }
}

/* Media Queries pour le responsive */
@media only screen and (max-width: 768px) {
    body {
        align-items: flex-start;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    html {
        height: -webkit-fill-available;
    }

    .container {
        padding: 5px;
        height: 100%;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        display: flex;
        flex-direction: column;
    }

    .header {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .logo-container {
        height: 100px;
        margin-top: 60px;
    }

    .bingo-grid-wrapper {
        position: relative;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding-bottom: 15%;
        min-height: 0; /* Important pour le flex */
    }

    .bingo-grid {
        width: 100%;
        max-width: 100%;
        gap: 3px;
        padding: 3px;
        aspect-ratio: 1;
    }

    .bingo-cell {
        padding: 4px;
        font-size: 11px;
        min-height: 0; /* Important pour le flex */
    }
}

@media only screen and (max-width: 480px) {
    .container {
        padding: 5px;
    }

    .logo-container {
        height: 80px;
        margin-top: 55px;
    }

    .bingo-grid-wrapper {
        padding-bottom: 20%;
    }

    .bingo-cell {
        font-size: 9px;
        padding: 3px;
    }
}

/* Ajustement spécifique pour les appareils mobiles */
@media only screen and (max-width: 480px) and (orientation: portrait) {
    .bingo-grid {
        width: 95vw;
        height: 95vw;
    }
}

@media only screen and (max-width: 480px) and (orientation: landscape) {
    .bingo-grid {
        width: 95vh;
        height: 95vh;
    }
}

@media screen and (max-width: 320px) {
    .logo-container {
        height: 60px;
        margin-top: 50px;
    }

    .bingo-grid-wrapper {
        padding-bottom: 25%;
    }

    .bingo-cell {
        font-size: 8px;
        padding: 2px;
    }

    .bingo-cell[style*="font-size: 12px"] {
        font-size: 7px !important;
    }

    .bingo-cell[style*="font-size: 10px"] {
        font-size: 6px !important;
    }
}

/* Ajustement pour l'orientation paysage sur mobile */
@media screen and (max-height: 500px) {
    .container {
        padding-top: 40px;
    }

    .logo-container {
        height: 60px;
        margin-top: 0;
    }

    .header {
        margin-bottom: 10px;
    }

    .bingo-grid {
        max-width: 80vh;
        margin: auto 0;
    }
}

@keyframes slideContent {
    0% { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    10% { 
        transform: translateY(50px) scale(0.8);
        opacity: 0;
    }
    90% { 
        transform: translateY(-50px) scale(0.8);
        opacity: 0;
    }
    100% { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes showLetter {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    15% {
        transform: translate(-50%, -50%) scale(1);
    }
    85% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    90% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
}

@keyframes validationGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        box-shadow: 0 0 15px 5px rgba(76, 175, 80, 0.4);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
} 