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

:root {
    --primary-yellow: #FFD700;
    --primary-red: #FF4444;
    --dark-red: #CC0000;
    --dark-yellow: #FFB800;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --dark-gray: #333333;
    --text-gray: #666666;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Bangers', cursive, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-image: url('/assets/bg_level.png');
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* Pour iOS Safari */
    color: var(--dark-gray);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent; /* Retire le highlight bleu au tap sur mobile */
    touch-action: manipulation; /* Améliore la réactivité tactile */
    letter-spacing: 0.1em;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* Pour iOS Safari */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden; /* Empêche le scroll horizontal sur mobile */
    margin: 0;
    padding: 0;
}

/* Information Screen */
.information-screen {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 100vh;
    max-height: 100vh;
    padding: 0;
    margin: 0;
    background-color: #FFBB29;
    background-image: none;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.information-content {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0;
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

.information-link {
    width: 100%;
    display: block;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    margin: 0;
    padding: 0;
}

.information-image {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    display: block;
    object-fit: cover;
    object-position: top;
    cursor: pointer;
    transition: opacity 0.3s ease;
    margin: 0;
    padding: 0;
}

.information-image:hover {
    opacity: 0.9;
}

.information-image:active {
    opacity: 0.8;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background-color: #FFBB29;
    background-image: none;
}

.welcome-content {
    text-align: center;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.logo {
    max-width: 250px;
    width: 100%;
    height: auto;
    margin: 0;
    display: block;
    filter: drop-shadow(0 4px 8px var(--shadow-lg));
    animation: logoFloat 3s ease-in-out infinite;
}

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

.game-title {
    font-size: 4rem;
    font-weight: 900;
    color: var(--white);
    text-shadow: 3px 3px 6px var(--shadow-lg);
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.game-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white);
    text-shadow: 2px 2px 4px var(--shadow-lg);
    margin-bottom: 3rem;
    opacity: 0.95;
}

.welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    width: 100%;
    justify-content: center;
    text-align: center;
}

.welcome-buttons .btn {
    margin-left: 0;
    margin-right: 0;
    align-self: center;
}

.gift-image {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    margin-top: 2rem;
}

.btn-image {
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.commencer-btn {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 15px var(--shadow));
    -webkit-tap-highlight-color: transparent; /* Retire le highlight au tap sur mobile */
    touch-action: manipulation; /* Améliore la réactivité tactile */
}

.btn-image:hover .commencer-btn {
    transform: translateY(-2px);
    filter: drop-shadow(0 6px 20px var(--shadow-lg));
}

/* Auth Screen */
.auth-screen {
    display: flex;
    align-items: top;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background-image: url('/assets/bg_level.png');
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.auth-content {
    width: 100%;
    max-width: 450px;
}

/* Home Screen */
.home-screen {
    display: flex;
    align-items: top;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background-image: url('/assets/bg_home.png');
    background-size: 100% 100%;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.home-content {
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.welcome-message {
    text-align: center;
    margin-bottom: 1rem;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: white;
    font-weight: 600;
}

.home-buttons {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 1rem;
    margin-top: 0px;
    align-items: center;
    justify-content: center;
}

.button-image-link {
    display: block;
    text-decoration: none;
    flex: 1;
    max-width: 200px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.button-image-link:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.button-image-link:active {
    transform: scale(0.98);
}

.button-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.home-footer {
    margin-top: 1rem;
    text-align: center;
}

/* Levels Container */
.levels-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
    margin: 1rem 0;
}

.level-box {
    flex: 1;
    aspect-ratio: 1;
    max-width: 120px;
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: none;
    position: relative;
    min-height: 100px;
}

.level-box.unlocked {
    background: transparent;
    border: none;
    box-shadow: none;
}

.level-box.locked {
    background: transparent;
    border: none;
    opacity: 1;
}

.level-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.level-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.star-icon {
    font-size: 2.5rem;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.lock-icon {
    font-size: 2rem;
    display: block;
    opacity: 0.8;
}

.level-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5rem;
}

.level-stars {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    align-items: center;
}

.level-stars .star {
    font-size: 1.2rem;
    opacity: 0.3;
    filter: grayscale(100%);
}

.level-stars .star.filled {
    opacity: 1;
    filter: none;
    text-shadow: 0 0 4px rgba(255, 215, 0, 0.8);
}

.level-status {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    text-align: center;
    margin-top: 0.5rem;
}

.level-box.locked .level-status {
    color: #D3D3D3;
    font-size: 0.8rem;
}

.level-box-link {
    text-decoration: none;
    flex: 1;
    max-width: 120px;
}

.level-box.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.level-box.clickable:hover {
    transform: scale(1.05);
    box-shadow: none;
}

.level-box.clickable:active {
    transform: scale(0.98);
}

.btn-icon {
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.level-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-content-signup {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.auth-content-signup .form-group {
    gap: 0.25rem;
}

.auth-content-signup .form-group label {
    font-size: 0.85rem;
}

.auth-content-signup .form-group input {
    padding: 5px;
    font-size: 1rem;
}

.form-group-checkbox {
    flex-direction: row;
    align-items: left;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-left: auto;
    width: auto;
    align-self: flex-end;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0;
    padding: 0;
    border: 2px solid var(--light-gray);
    border-radius: 4px;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: var(--primary-yellow);
    border-color: var(--primary-yellow);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--dark-gray);
    font-size: 14px;
    font-weight: bold;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-align: center;
    margin-bottom: 2rem;
}

.page-logo {
    max-width: 40%;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

.footer-image {
    max-width: 40%;
    width: auto;
    height: auto;
    display: block;
    margin: 2rem 0 0 0;
    position: absolute;
    bottom: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.form-group label {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.form-group input {
    padding: 5px;
    border: 2px solid var(--light-gray);
    border-radius: 1rem;
    font-size: 1rem;
    font-family: 'Bangers', cursive;
    text-align: center;
    transition: all 0.3s ease;
    background: transparent;
    letter-spacing: 0.1em;
    font-size: x-large;
    color: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.form-group input::placeholder {
    text-align: center;
    font-family: 'Bangers', cursive;
    letter-spacing: 0.1em;
}

#phone {
   
}

.auth-footer {
    text-align: right;
    margin-top: 10px;
    color: white;
}

.auth-footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    text-align: center;
}

.alert-error {
    background: #FFE5E5;
    color: var(--dark-red);
    border: 2px solid #FFB3B3;
}

.alert-success {
    background: #E5FFE5;
    color: #006600;
    border: 2px solid #B3FFB3;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 0;
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 0 4px 15px var(--shadow);
    min-height: 44px; /* Taille minimale pour le touch sur mobile */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    background-color: transparent;
    background-image: url('/assets/bg_btn.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #ffbb2a;
    -webkit-text-stroke: 5px #e84a46;
    text-stroke: 5px #e84a46;
    paint-order: stroke fill;
    margin-left: auto;
    margin-right: 0;
    align-self: flex-end;
}

.btn-primary {
    background-image: url('/assets/bg_btn.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #ffbb2a;
    -webkit-text-stroke: 5px #9b322f;
    text-stroke: 5px #e84a46;
    paint-order: stroke fill;
}

.btn-primary:hover {
    background-image: url('/assets/bg_btn.png');
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-lg);
    opacity: 0.9;
}

.btn-secondary {
    background-image: url('/assets/bg_btn.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #ffbb2a;
    border: none;
    -webkit-text-stroke: 5px #e84a46;
    text-stroke: 5px #e84a46;
    paint-order: stroke fill;
}

.btn-secondary:hover {
    background-image: url('/assets/bg_btn.png');
    color: #ffbb2a;
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn-success {
    background-image: url('/assets/bg_btn.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #ffbb2a;
    -webkit-text-stroke: 5px #e84a46;
    text-stroke: 5px #e84a46;
    paint-order: stroke fill;
}

.btn-success:hover {
    background-image: url('/assets/bg_btn.png');
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn-block {
    width: fit-content;
}

/* Game Screen */
.game-screen {
    min-height: 100vh;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    background-image: url('/assets/bg_level.png');
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Game Top Bar */
.game-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0px;
    padding: 0;
}

.game-top-button {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
}

.game-top-button:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.game-top-button:active {
    transform: scale(0.95);
}

.game-top-icon {
    width: 50px;
    height: auto;
    display: block;
    object-fit: contain;
}

.game-level-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-level-image {
    max-width: 150px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.game-top-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sound-button {
    /* Styles spécifiques pour le bouton son si nécessaire */
}

.home-button {
    /* Styles spécifiques pour le bouton home si nécessaire */
}

.game-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 1.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 15px var(--shadow);
}

.game-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.level-badge {
    background: var(--primary-yellow);
    color: var(--dark-gray);
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 1.2rem;
}

.user-name {
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 1rem;
}

.moves-header {
    background: var(--primary-yellow);
    color: var(--dark-gray);
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 1.2rem;
    margin-left: auto;
    flex-shrink: 0;
}

.logout-link {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.logout-link:hover {
    text-decoration: underline;
}

.game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.start-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 2rem 0;
}

.start-game-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.start-game-button:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.start-game-button:active {
    transform: scale(0.98);
}

.start-button-image {
    max-width: 200px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.game-instructions {
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 15px var(--shadow);
}

.game-instructions p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-gray);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
}

/* Adjust grid for different card counts */
.game-board[data-cards="4"] {
    grid-template-columns: repeat(2, 1fr);
    max-width: 250px;
}

.game-board[data-cards="6"] {
    grid-template-columns: repeat(3, 1fr);
    max-width: 350px;
}

.game-board[data-cards="8"] {
    grid-template-columns: repeat(3, 1fr);
    max-width: 350px;
}

/* Center the last 2 cards in the third row (3-3-2 layout) */
.game-board[data-cards="8"] .game-card:nth-child(7) {
    grid-column: 1 / 2;
    justify-self: center;
}

.game-board[data-cards="8"] .game-card:nth-child(8) {
    grid-column: 2 / 3;
    justify-self: center;
}

.game-card {
    aspect-ratio: 1 / 1;
    background: transparent;
    border-radius: 1rem;
    cursor: pointer;
    position: relative;
    perspective: 1000px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 100px;
    width: 100%;
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 900;
    box-shadow: 0 4px 15px var(--shadow);
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-front {
    background: transparent;
    color: var(--text-gray);
    transform: rotateY(0deg);
    z-index: 2;
    padding: 0;
}

.card-front-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
}

.card-back {
    background: transparent;
    color: var(--dark-gray);
    transform: rotateY(180deg);
    border: none;
    padding: 0;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
}

.game-card.flipped .card-front {
    transform: rotateY(180deg);
}

.game-card.flipped .card-back {
    transform: rotateY(0deg);
}

.game-card.matched .card-back {
    background: #4CAF50;
    border-color: #45a049;
    color: var(--white);
}

.game-card:hover:not(.flipped):not(.matched) {
    transform: scale(1.05);
}

.game-card:active:not(.flipped):not(.matched) {
    transform: scale(0.95);
}

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

.game-status {
    text-align: center;
    min-height: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.status-message {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    text-shadow: 2px 2px 4px var(--shadow-lg);
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
}

.moves-info {
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    text-shadow: 2px 2px 4px var(--shadow-lg);
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
}

.moves-count {
    color: #000000;
    font-weight: 700;
}

.game-controls {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 350px;
}

.game-controls .btn {
    flex: 1;
}

/* Success Screen */
/* Timer Styles - Circular Progress Bar */
.timer-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.circular-progress {
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    background-image: url('/assets/bg_timer.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    padding: 5px;
    box-sizing: border-box;
    display: none; /* Hidden by default, shown when game starts */
}

.circular-progress.game-started {
    display: block;
}

.home-button {
    display: block; /* Visible by default */
}

.home-button.game-started {
    display: none; /* Hidden when game starts */
}

.progress-ring {
    transform: rotate(-90deg);
    position: absolute;
    top: 5px;
    left: 5px;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.5s linear;
    stroke-dasharray: 163.36;
    stroke-dashoffset: 163.36;
}

.progress-ring-circle-bg {
    display: none; /* Hide background circle, using bg_timer.png instead */
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffb13a;
    text-align: center;
    line-height: 1;
}

.success-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background-image: url('/assets/bg_level.png');
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Lose Screen - same style as information screen */
.lose-screen {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 100vh;
    max-height: 100vh;
    padding: 0;
    margin: 0;
    background-image: none;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.lose-content {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0;
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

.lose-link {
    width: 100%;
    display: block;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    margin: 0;
    padding: 0;
}

.lose-image {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    display: block;
    object-fit: cover;
}

/* Win Screen - same style as information screen */
.win-screen {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 100vh;
    max-height: 100vh;
    padding: 0;
    margin: 0;
    background-color: #FFBB29;
    background-image: none;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.win-content {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0;
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

.win-link {
    width: 100%;
    display: block;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    margin: 0;
    padding: 0;
}

.win-image {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    display: block;
    object-fit: cover;
}

.success-content,
.win-content,
.lose-content {
    text-align: center;
    padding: 0;
    width: 100%;
    max-width: 450px;
}

.win-icon,
.lose-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.win-icon-image {
    max-width: 200px;
    width: 100%;
    height: auto;
    display: block;
}

.win-title,
.lose-message-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-red);
    margin-bottom: 1rem;
}

.win-message,
.lose-message {
    font-size: 1.2rem;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.lose-submessage {
    font-size: 1rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
}

.win-buttons,
.lose-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.success-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.success-icon-image {
    max-width: 200px;
    width: 100%;
    height: auto;
    display: block;
}

.success-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-red);
    margin-bottom: 1rem;
}

.success-message {
    font-size: 1.2rem;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.success-submessage {
    font-size: 1rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
}

.success-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-text {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.social-buttons {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.social-btn {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background-image: url('/assets/bg_btn.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
}

.social-btn svg {
    width: 28px;
    height: 28px;
    fill: #ffbb2a;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-lg);
    opacity: 0.9;
}

.social-btn:active {
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .information-screen {
        padding: 0;
        margin: 0;
    }
    
    .information-content {
        padding: 0;
        gap: 0;
    }
    
    .information-link {
        width: 100%;
    }
    
    .information-image {
        width: 100%;
        max-width: 100%;
    }
    
    .welcome-screen {
        padding: 1.5rem 1rem;
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }
    
    .welcome-content {
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    .logo {
        max-width: 250px;
        margin-bottom: 1.5rem;
    }
    
    .game-title {
        font-size: 3rem;
    }
    
    .game-subtitle {
        font-size: 1.2rem;
        margin-bottom: 2rem;
    }
    
    .welcome-buttons {
        gap: 1rem;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .commencer-btn {
        max-width: 100%;
        width: 100%;
    }
    
    .btn-secondary {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .auth-content {
        padding: 2rem 1.5rem;
    }
    
    .game-board {
        max-width: 100%;
        gap: 2px;
    }
    
    .game-board[data-cards="4"] {
        max-width: 250 px;
    }
    
    .game-board[data-cards="6"] {
        max-width: 100%;
    }
    
    .game-board[data-cards="8"] {
        max-width: 90%;
    }
    
    .game-card {
        border-radius: 0.75rem;
    }
    
    .card-front,
    .card-back {
        font-size: 2rem;
    }
}

@media (max-width: 360px) {
    .information-screen {
        padding: 0;
        margin: 0;
    }
    
    .information-content {
        padding: 0;
        gap: 0;
    }
    
    .welcome-screen {
        padding: 1rem 0.75rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    
    .logo {
        max-width: 200px;
        margin-bottom: 1rem;
    }
    
    .game-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    
    .welcome-buttons {
        gap: 0.75rem;
        max-width: 100%;
    }
    
    .commencer-btn {
        max-width: 100%;
        width: 100%;
    }
    
    .btn {
        padding: 10px 30px;
        font-size: 1rem;
        min-height: 44px; /* Taille minimale pour le touch sur mobile */
    }
    
    .btn-secondary {
        width: 100%;
    }
}

/* Optimisation pour mode paysage mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .information-screen {
        padding: 0;
        margin: 0;
    }
    
    .information-content {
        padding: 0;
        gap: 0;
    }
    
    .welcome-screen {
        padding: 1rem;
    }
    
    .logo {
        max-width: 200px;
        margin-bottom: 1rem;
    }
    
    .game-subtitle {
        margin-bottom: 1.5rem;
    }
    
    .welcome-buttons {
        gap: 0.75rem;
        max-width: 300px;
    }
}

/* Optimisation pour très petits écrans (iPhone SE, etc.) */
@media (max-width: 320px) {
    .information-screen {
        padding: 0;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    
    .information-content {
        padding: 0;
        gap: 0;
    }
    
    .welcome-screen {
        padding: 0.75rem 0.5rem;
    }
    
    .logo {
        max-width: 200px;
        margin-bottom: 0.75rem;
    }
    
    .game-subtitle {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .welcome-buttons {
        gap: 0.5rem;
    }
}

/* Disable text selection on game cards */
.game-card {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Phone Mockup for Desktop */
@media (min-width: 769px) {
    body {
        background-image: url('/assets/desktop.jpg') !important;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        padding: 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        background-attachment: fixed !important;
    }
    
    .container {
        max-width: 390px;
        width: 100%;
        background: #000;
        border-radius: 50px;
        padding: 15px;
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
        position: relative;
        min-height: 844px; /* iPhone height */
    }
    
    /* Adjust all screens to fit mockup - preserve their backgrounds */
    .game-screen,
    .auth-screen,
    .success-screen,
    .home-screen,
    .win-screen,
    .lose-screen,
    .social-screen {
        border-radius: 40px;
        margin: 0;
        min-height: 814px;
        overflow: hidden;
        background-attachment: scroll !important;
    }
    
    .welcome-screen {
        border-radius: 40px;
        margin: 0;
        min-height: 814px;
        overflow: hidden;
        background-color: #FFBB29 !important;
    }
    
    .information-screen {
        border-radius: 40px;
        margin: 0;
        min-height: 814px;
        overflow: hidden;
        background-color: #FFBB29 !important;
    }
    
    /* Containers - same height for all pages */
    .information-content,
    .home-content,
    .auth-content,
    .success-content,
    .win-content,
    .lose-content,
    .social-content,
    .welcome-content {
        height: 814px !important;
        min-height: 814px !important;
    }
    
    .information-image,
    .win-image,
    .lose-image {
        height: 814px !important;
        min-height: 814px !important;
    }
    
    /* Ensure main content fits */
    .container > main {
        border-radius: 40px;
        overflow: hidden;
    }
}

