﻿/* CakeWord - Minimal & Clean Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Custom properties for glassmorphism effect */
@property --angle-1 { 
    syntax: "<angle>"; 
    inherits: false; 
    initial-value: -75deg; 
}

@property --angle-2 { 
    syntax: "<angle>"; 
    inherits: false; 
    initial-value: -45deg; 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --text-light: #6b7280;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --success: #059669;
    --error: #dc2626;
    --radius: 12px;
    --border-width: 2px;
    --anim-hover-time: 400ms;
    --anim-hover-ease: cubic-bezier(0.25, 1, 0.5, 1);
}

body.dark-mode {
    --bg: #0f172a;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --text-secondary: #94a3b8;
    --border: #1e293b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.2s, color 0.2s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -1;
    opacity: 0.6;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.10) 0%, transparent 40%),
        radial-gradient(circle at 40% 80%, rgba(37, 99, 235, 0.08) 0%, transparent 40%);
    animation: backgroundMove 25s ease-in-out infinite;
}

body.dark-mode::before {
    opacity: 0.4;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(96, 165, 250, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 40% 80%, rgba(59, 130, 246, 0.10) 0%, transparent 40%);
}

@keyframes backgroundMove {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(2%, 2%) rotate(1deg);
    }
    50% {
        transform: translate(-1%, 3%) rotate(-1deg);
    }
    75% {
        transform: translate(3%, -2%) rotate(0.5deg);
    }
}

/* Floating dots pattern */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        radial-gradient(circle, rgba(37, 99, 235, 0.15) 2.5px, transparent 1.5px),
        radial-gradient(circle, rgba(37, 99, 235, 0.10) 2px, transparent 1px);
    background-size: 60px 60px, 40px 40px;
    background-position: 0 0, 20px 20px;
    animation: floatingDots 40s linear infinite;
}

body.dark-mode::after {
    background-image: 
        radial-gradient(circle, rgba(96, 165, 250, 0.12) 1.5px, transparent 1.5px),
        radial-gradient(circle, rgba(96, 165, 250, 0.08) 1px, transparent 1px);
    background-size: 60px 60px, 40px 40px;
    background-position: 0 0, 20px 20px;
}

@keyframes floatingDots {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(60px, 60px);
    }
}

/* Header */
.header {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    transition: all var(--anim-hover-time) var(--anim-hover-ease);
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    background: linear-gradient(-75deg, 
                rgba(255,255,255,0.1), 
                rgba(255,255,255,0.3), 
                rgba(255,255,255,0.1));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05),
                inset 0 -1px 2px rgba(255,255,255,0.5),
                0 2px 4px -1px rgba(0,0,0,0.1),
                0 0 0 1px inset rgba(255,255,255,0.3);
    overflow: hidden;
}

body.dark-mode .logo {
    background: linear-gradient(-75deg, 
                rgba(255,255,255,0.05), 
                rgba(255,255,255,0.12), 
                rgba(255,255,255,0.05));
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1),
                inset 0 -1px 2px rgba(255,255,255,0.1),
                0 2px 4px -1px rgba(0,0,0,0.2),
                0 0 0 1px inset rgba(255,255,255,0.15);
}

.logo::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: conic-gradient(from var(--angle-1) at 50% 50%, 
                rgba(37, 99, 235, 0.4), rgba(37, 99, 235, 0) 5% 40%, 
                rgba(37, 99, 235, 0.4) 50%, rgba(37, 99, 235, 0) 60% 95%, 
                rgba(37, 99, 235, 0.4)),
                linear-gradient(180deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    transition: all var(--anim-hover-time) var(--anim-hover-ease), --angle-1 500ms ease;
}

body.dark-mode .logo::before {
    background: conic-gradient(from var(--angle-1) at 50% 50%, 
                rgba(59, 130, 246, 0.5), rgba(59, 130, 246, 0) 5% 40%, 
                rgba(59, 130, 246, 0.5) 50%, rgba(59, 130, 246, 0) 60% 95%, 
                rgba(59, 130, 246, 0.5)),
                linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
}

.logo::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: var(--radius);
    background: linear-gradient(var(--angle-2), 
                rgba(255,255,255,0) 0%, 
                rgba(255,255,255,0.4) 40% 50%, 
                rgba(255,255,255,0) 55%);
    mix-blend-mode: screen;
    pointer-events: none;
    background-size: 200% 200%;
    background-position: 0% 50%;
    background-repeat: no-repeat;
    transition: background-position calc(var(--anim-hover-time)*1.25) var(--anim-hover-ease), 
                --angle-2 calc(var(--anim-hover-time)*1.25) var(--anim-hover-ease);
}

.logo:hover {
    transform: scale(1.05);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05),
                inset 0 -1px 2px rgba(255,255,255,0.5),
                0 4px 8px -2px rgba(37, 99, 235, 0.2),
                0 0 0 1px inset rgba(255,255,255,0.5);
}

body.dark-mode .logo:hover {
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1),
                inset 0 -1px 2px rgba(255,255,255,0.15),
                0 4px 8px -2px rgba(59, 130, 246, 0.3),
                0 0 0 1px inset rgba(255,255,255,0.25);
}

.logo:hover::before {
    --angle-1: -125deg;
}

.logo:hover::after {
    background-position: 25% 50%;
}

.logo span {
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Theme Toggle - Minimal */
.theme-toggle {
    width: 48px;
    height: 26px;
    background: var(--border);
    border-radius: 13px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: var(--text-light);
}

.theme-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--bg);
    border-radius: 50%;
    transition: left 0.2s;
}

body.dark-mode .theme-toggle::after {
    left: 25px;
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.lang-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Main Container */
.main-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    flex: 1;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Welcome Screen */
.welcome-content {
    text-align: center;
    padding: 3rem 0;
}

.game-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    position: relative;
    background: linear-gradient(-75deg,
                var(--accent),
                rgba(59, 130, 246, 0.9),
                var(--accent));
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all var(--anim-hover-time) var(--anim-hover-ease);
    text-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

body.dark-mode .game-title {
    background: linear-gradient(-75deg,
                rgba(59, 130, 246, 0.9),
                rgba(96, 165, 250, 0.95),
                rgba(59, 130, 246, 0.9));
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 25px rgba(59, 130, 246, 0.4);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.game-title:hover {
    background-position: 25% 50%;
    text-shadow: 0 0 30px rgba(37, 99, 235, 0.5);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

body.dark-mode .game-title:hover {
    text-shadow: 0 0 35px rgba(59, 130, 246, 0.6);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.game-description {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 3rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature {
    text-align: center;
}

.feature h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.feature p {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Buttons with glassmorphism effect */
.btn {
    position: relative;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    background: linear-gradient(-75deg, rgba(255,255,255,0.1), rgba(255,255,255,0.3), rgba(255,255,255,0.1));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: inset 0 2px 2px rgba(0,0,0,0.05),
                inset 0 -2px 2px rgba(255,255,255,0.5),
                0 4px 8px -2px rgba(0,0,0,0.15),
                0 0 0 var(--border-width) inset rgba(255,255,255,0.3);
    transition: all var(--anim-hover-time) var(--anim-hover-ease);
    overflow: hidden;
}

.btn::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: var(--radius);
    padding: var(--border-width);
    background: conic-gradient(from var(--angle-1) at 50% 50%, 
                rgba(0,0,0,0.3), rgba(0,0,0,0) 5% 40%, 
                rgba(0,0,0,0.3) 50%, rgba(0,0,0,0) 60% 95%, 
                rgba(0,0,0,0.3)),
                linear-gradient(180deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    transition: all var(--anim-hover-time) var(--anim-hover-ease), --angle-1 500ms ease;
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: linear-gradient(var(--angle-2), 
                rgba(255,255,255,0) 0%, 
                rgba(255,255,255,0.1) 40% 50%, 
                rgba(255,255,255,0) 55%);
    mix-blend-mode: screen;
    pointer-events: none;
    background-size: 200% 200%;
    background-position: 0% 50%;
    background-repeat: no-repeat;
    transition: background-position calc(var(--anim-hover-time)*1.25) var(--anim-hover-ease), 
                --angle-2 calc(var(--anim-hover-time)*1.25) var(--anim-hover-ease);
}

.btn:hover {
    transform: scale(0.98);
    box-shadow: inset 0 2px 2px rgba(0,0,0,0.05),
                inset 0 -2px 2px rgba(255,255,255,0.5),
                0 2px 4px -2px rgba(0,0,0,0.2),
                0 0 0 calc(var(--border-width)/2) inset rgba(255,255,255,0.5);
}

.btn:hover::before {
    --angle-1: -125deg;
}

.btn:hover::after {
    background-position: 10% 50%;
}

.btn:active::before {
    --angle-1: -75deg;
}

.btn:active::after {
    background-position: 50% 15%;
    --angle-2: -15deg;
}

.btn-primary {
    background: linear-gradient(-75deg, 
                rgba(37, 99, 235, 0.8), 
                rgba(59, 130, 246, 0.9), 
                rgba(37, 99, 235, 0.8));
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

body.dark-mode .btn-primary {
    background: linear-gradient(-75deg, 
                rgba(59, 130, 246, 0.7), 
                rgba(96, 165, 250, 0.8), 
                rgba(59, 130, 246, 0.7));
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

.btn-secondary {
    background: linear-gradient(-75deg, 
                rgba(255,255,255,0.05), 
                rgba(255,255,255,0.15), 
                rgba(255,255,255,0.05));
    color: var(--text);
}

body.dark-mode .btn-secondary {
    background: linear-gradient(-75deg, 
                rgba(255,255,255,0.02), 
                rgba(255,255,255,0.08), 
                rgba(255,255,255,0.02));
}

.mlops-badge {
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.mlops-badge a {
    color: var(--accent);
    text-decoration: none;
}

.mlops-badge a:hover {
    text-decoration: underline;
}

/* Score Panel */
.score-panel {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

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

.score-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.score-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

/* Question */
.question-container {
    text-align: center;
}

.question-title {
    font-size: 1.5rem;
    font-weight: 600;
    font-style: italic;
    margin-bottom: 2.5rem;
    color: var(--text);
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
}

.question-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.6;
}

.words-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.word-card {
    flex: 1;
    max-width: 350px;
    min-width: 280px;
    width: 350px; /* Largeur fixe pour éviter les sauts */
    padding: 1rem 2.5rem;
    border-radius: 100px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(-75deg, 
                rgba(255,255,255,0.3), 
                rgba(255,255,255,0.5), 
                rgba(255,255,255,0.3));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05),
                inset 0 -2px 4px rgba(255,255,255,0.6),
                0 8px 16px -4px rgba(37, 99, 235, 0.1),
                0 0 0 var(--border-width) inset rgba(255,255,255,0.4);
    transition: all var(--anim-hover-time) var(--anim-hover-ease);
}

body.dark-mode .word-card {
    color:white;
    background: linear-gradient(-75deg, 
                rgba(255,255,255,0.05), 
                rgba(255,255,255,0.12), 
                rgba(255,255,255,0.05));
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1),
                inset 0 -2px 4px rgba(255,255,255,0.1),
                0 8px 16px -4px rgba(59, 130, 246, 0.2),
                0 0 0 var(--border-width) inset rgba(255,255,255,0.15);
}

.word-card::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: var(--radius);
    padding: var(--border-width);
    background: conic-gradient(from var(--angle-1) at 50% 50%, 
                rgba(37, 99, 235, 0.5), rgba(37, 99, 235, 0) 5% 40%, 
                rgba(37, 99, 235, 0.5) 50%, rgba(37, 99, 235, 0) 60% 95%, 
                rgba(37, 99, 235, 0.5)),
                linear-gradient(180deg, rgba(255,255,255,0.4), rgba(255,255,255,0.2));
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    transition: all var(--anim-hover-time) var(--anim-hover-ease), --angle-1 500ms ease, border-radius 0.6s ease;
}

body.dark-mode .word-card::before {
    background: conic-gradient(from var(--angle-1) at 50% 50%, 
                rgba(59, 130, 246, 0.6), rgba(59, 130, 246, 0) 5% 40%, 
                rgba(59, 130, 246, 0.6) 50%, rgba(59, 130, 246, 0) 60% 95%, 
                rgba(59, 130, 246, 0.6)),
                linear-gradient(180deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
}

.word-card.revealed::before {
    border-radius: 14px;
}

.word-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: var(--radius);
    background: linear-gradient(var(--angle-2), 
                rgba(255,255,255,0) 0%, 
                rgba(255,255,255,0.15) 40% 50%, 
                rgba(255,255,255,0) 55%);
    mix-blend-mode: screen;
    pointer-events: none;
    background-size: 200% 200%;
    background-position: 0% 50%;
    background-repeat: no-repeat;
    transition: background-position calc(var(--anim-hover-time)*1.25) var(--anim-hover-ease), 
                --angle-2 calc(var(--anim-hover-time)*1.25) var(--anim-hover-ease),
                border-radius 0.6s ease;
}

.word-card.revealed::after {
    border-radius: 14px;
}

.word-card:hover:not(:disabled) {
    transform: translateY(-6px) scale(1.02);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05),
                inset 0 -2px 4px rgba(255,255,255,0.6),
                0 12px 24px -4px rgba(37, 99, 235, 0.25),
                0 0 0 calc(var(--border-width)/2) inset rgba(255,255,255,0.6);
}

body.dark-mode .word-card:hover:not(:disabled) {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1),
                inset 0 -2px 4px rgba(255,255,255,0.15),
                0 12px 24px -4px rgba(59, 130, 246, 0.4),
                0 0 0 calc(var(--border-width)/2) inset rgba(255,255,255,0.25);
}

.word-card:hover:not(:disabled)::before {
    --angle-1: -125deg;
}

.word-card:hover:not(:disabled)::after {
    background-position: 10% 50%;
}

.word-card:disabled {
    opacity: 0.9;
    cursor: default; /* Curseur normal au lieu de not-allowed */
}

.word-card.selected {
    background: linear-gradient(-75deg, 
                rgba(37, 99, 235, 0.7), 
                rgba(59, 130, 246, 0.8), 
                rgba(37, 99, 235, 0.7));
}

body.dark-mode .word-card.selected {
    background: linear-gradient(-75deg, 
                rgba(59, 130, 246, 0.6), 
                rgba(96, 165, 250, 0.7), 
                rgba(59, 130, 246, 0.6));
}

.word-card.selected .word-text {
    color: white;
}

.word-card.correct::before {
    background: conic-gradient(from var(--angle-1) at 50% 50%, 
                rgba(5, 150, 105, 0.8), rgba(5, 150, 105, 0) 5% 40%, 
                rgba(5, 150, 105, 0.8) 50%, rgba(5, 150, 105, 0) 60% 95%, 
                rgba(5, 150, 105, 0.8));
}

.word-card.incorrect::before {
    background: conic-gradient(from var(--angle-1) at 50% 50%, 
                rgba(220, 38, 38, 0.8), rgba(220, 38, 38, 0) 5% 40%, 
                rgba(220, 38, 38, 0.8) 50%, rgba(220, 38, 38, 0) 60% 95%, 
                rgba(220, 38, 38, 0.8));
}

/* Transform to result state */
.word-card.revealed {
    padding: 2rem 1.5rem;
    border-radius: 14px;
}

.word-card.revealed.correct {
    background: linear-gradient(-75deg, 
                rgba(5, 150, 105, 0.25), 
                rgba(5, 150, 105, 0.35), 
                rgba(5, 150, 105, 0.25));
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05),
                inset 0 -2px 4px rgba(255,255,255,0.4),
                0 8px 16px -4px rgba(5, 150, 105, 0.2),
                0 0 0 3px inset rgba(5, 150, 105, 0.3);
}

body.dark-mode .word-card.revealed.correct {
    background: linear-gradient(-75deg, 
                rgba(5, 150, 105, 0.2), 
                rgba(5, 150, 105, 0.3), 
                rgba(5, 150, 105, 0.2));
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1),
                inset 0 -2px 4px rgba(255,255,255,0.1),
                0 8px 16px -4px rgba(5, 150, 105, 0.3),
                0 0 0 3px inset rgba(5, 150, 105, 0.4);
}

.word-card.revealed.incorrect {
    background: linear-gradient(-75deg, 
                rgba(220, 38, 38, 0.25), 
                rgba(220, 38, 38, 0.35), 
                rgba(220, 38, 38, 0.25));
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05),
                inset 0 -2px 4px rgba(255,255,255,0.4),
                0 8px 16px -4px rgba(220, 38, 38, 0.2),
                0 0 0 3px inset rgba(220, 38, 38, 0.3);
}

body.dark-mode .word-card.revealed.incorrect {
    background: linear-gradient(-75deg, 
                rgba(220, 38, 38, 0.2), 
                rgba(220, 38, 38, 0.3), 
                rgba(220, 38, 38, 0.2));
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1),
                inset 0 -2px 4px rgba(255,255,255,0.1),
                0 8px 16px -4px rgba(220, 38, 38, 0.3),
                0 0 0 3px inset rgba(220, 38, 38, 0.4);
}

.word-card.revealed .word-text {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.word-card.revealed.correct .word-text {
    color: var(--success);
    filter: brightness(0.9);
}

body.dark-mode .word-card.revealed.correct .word-text {
    filter: brightness(1.2);
}

.word-card.revealed.incorrect .word-text {
    color: var(--error);
    filter: brightness(0.9);
}

body.dark-mode .word-card.revealed.incorrect .word-text {
    filter: brightness(1.2);
}

/* Card Definition (hidden by default) */
.card-definition {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
    font-style: italic;
    text-align: left;
    position: relative;
    z-index: 2;
    user-select: text; /* Permettre la sélection de texte */
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    transition: max-height 0.6s ease, opacity 0.6s ease, margin-top 0.6s ease;
}

.word-card.revealed .card-definition {
    max-height: 500px;
    opacity: 1;
    margin-top: 1rem;
}

.vs-separator {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    transition: opacity 0.3s ease;
}

.vs-separator.hidden {
    opacity: 0;
}

.word-text {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text);
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    user-select: text; /* Permettre la sélection de texte */
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    transition: all 0.6s ease;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.loading.active {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Continue Button Container */
.continue-button-container {
    display: none;
    text-align: center;
    margin-top: 2rem;
}

.continue-button-container.active {
    display: block;
}

/* Stats Screen */
.stats-content {
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: calc(100vh - 12rem);
    overflow-y: auto;
}

.stats-content::-webkit-scrollbar {
    width: 6px;
}

.stats-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: var(--accent);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

.stats-subtitle, .history-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
}

.history-table {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.history-table table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th, .history-table td {
    padding: 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    font-weight: 600;
    background: var(--bg);
}

.history-table .badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge.success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.badge.error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--error);
}

.button-group {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

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

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .game-title {
        font-size: 2.5rem;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .words-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .word-card {
        max-width: 100%;
        width: 100%; /* Pleine largeur sur mobile */
    }
    
    .vs-separator {
        transform: rotate(90deg);
    }
    
    .result-cards-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .result-card {
        max-width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .score-panel {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 2rem 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .game-title {
        font-size: 2rem;
    }
}
