/* ========================================
   SORTIR DU BUS - Styles
   ======================================== */

/* CSS Variables */
:root {
    --color-primary: #ff6b35;
    --color-primary-dark: #e55a2b;
    --color-secondary: #004e89;
    --color-secondary-light: #1a6fb0;
    --color-accent: #ffc857;
    --color-accent-dark: #e6b44e;
    --color-success: #2ecc71;
    --color-success-dark: #27ae60;
    --color-danger: #e74c3c;
    --color-bg-dark: #1a1a2e;
    --color-bg-medium: #16213e;
    --color-bg-light: #0f3460;
    --color-text: #ffffff;
    --color-text-muted: #a0a0b0;
    --color-card-bg: rgba(255, 255, 255, 0.08);
    --color-card-border: rgba(255, 255, 255, 0.15);
    
    --font-display: 'Fredoka', sans-serif;
    --font-body: 'Quicksand', sans-serif;
    
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(255, 107, 53, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg-dark);
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Animation */
.bus-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: linear-gradient(
        135deg,
        var(--color-bg-dark) 0%,
        var(--color-bg-medium) 50%,
        var(--color-bg-light) 100%
    );
    overflow: hidden;
}

.road {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #2c2c2c;
}

.road::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        var(--color-accent) 0px,
        var(--color-accent) 30px,
        transparent 30px,
        transparent 60px
    );
    animation: roadMove 1s linear infinite;
}

@keyframes roadMove {
    from { transform: translateX(0); }
    to { transform: translateX(-60px); }
}

.bus-decoration {
    position: absolute;
    bottom: 5px;
    right: -200px;
    font-size: 100px;
    animation: busPass 15s linear infinite;
    opacity: 0.1;
}

@keyframes busPass {
    0% { right: -200px; opacity: 0; }
    5% { opacity: 0.1; }
    95% { opacity: 0.1; }
    100% { right: 120%; opacity: 0; }
}

.bus-decoration::before {
    content: '🚌';
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 80px);
}

/* Header */
.header {
    text-align: center;
    padding: 20px 0 30px;
}

.title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 7vw, 3.5rem);
    color: var(--color-accent);
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    text-shadow: 3px 3px 0 var(--color-primary);
}

.bus-icon {
    font-size: 1.2em;
    animation: bounce 2s ease infinite;
}

.bus-icon.flip {
    transform: scaleX(-1);
    animation-delay: 0.5s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.bus-icon.flip {
    animation-name: bounceFlip;
}

@keyframes bounceFlip {
    0%, 100% { transform: scaleX(-1) translateY(0); }
    50% { transform: scaleX(-1) translateY(-10px); }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    margin-top: 10px;
    font-weight: 600;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.4s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Screen */
.welcome-card {
    background: var(--color-card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-xl);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.welcome-card h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-accent);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.rules-intro {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.rules-list {
    list-style: none;
    text-align: left;
    max-width: 350px;
    margin: 0 auto 30px;
}

.rules-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-card-border);
    font-weight: 600;
}

.rules-list li:last-child {
    border-bottom: none;
}

.rule-icon {
    font-size: 1.4rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-icon {
    font-size: 1.2em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-accent {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    color: var(--color-bg-dark);
    box-shadow: 0 4px 15px rgba(255, 200, 87, 0.4);
}

.btn-accent:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 200, 87, 0.5);
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading Screen */
.loading-card {
    text-align: center;
    padding: 60px 30px;
}

.bus-loader {
    margin-bottom: 30px;
}

.loader-bus {
    font-size: 4rem;
    animation: busShake 0.5s ease infinite;
}

@keyframes busShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-5px) rotate(-2deg); }
    75% { transform: translateX(5px) rotate(2deg); }
}

.loader-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.loader-dots span {
    width: 12px;
    height: 12px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: dotPulse 1.4s ease infinite;
}

.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.loading-card p {
    font-size: 1.3rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

/* Game Screen */
.cards-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 700px) {
    .cards-container {
        grid-template-columns: 1fr;
    }
}

.constraint-card {
    background: var(--color-card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    border: 2px solid transparent;
    transition: all var(--transition-medium);
}

.constraint-card:hover {
    transform: translateY(-5px);
}

.attitude-card {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 107, 53, 0.05));
}

.speech-card {
    border-color: var(--color-secondary-light);
    background: linear-gradient(135deg, rgba(0, 78, 137, 0.2), rgba(0, 78, 137, 0.05));
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.card-icon {
    font-size: 1.8rem;
}

.card-header h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 1px;
    color: var(--color-accent);
}

.card-content {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text);
}

/* Timer Section */
.timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.timer-display {
    margin-bottom: 20px;
}

.timer-circle {
    position: relative;
    width: 120px;
    height: 120px;
}

.timer-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: var(--color-card-border);
    stroke-width: 8;
}

.timer-progress {
    fill: none;
    stroke: var(--color-accent);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.timer-progress.warning {
    stroke: var(--color-primary);
}

.timer-progress.danger {
    stroke: var(--color-danger);
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--color-accent);
    transition: color 0.3s ease;
}

.timer-text.warning {
    color: var(--color-primary);
}

.timer-text.danger {
    color: var(--color-danger);
    animation: timerPulse 0.5s ease infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

/* Words Section */
.words-section {
    background: var(--color-card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-card);
}

.words-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-accent);
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.word-card {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-light));
    border: none;
    border-radius: var(--radius-md);
    padding: 16px 12px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(0, 78, 137, 0.3);
    position: relative;
    overflow: hidden;
}

.word-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.word-card:hover:not(.found):not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 78, 137, 0.4);
}

.word-card:hover::before {
    left: 100%;
}

.word-card.found {
    background: linear-gradient(135deg, var(--color-success), var(--color-success-dark));
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
    cursor: default;
    animation: wordFound 0.4s ease;
}

@keyframes wordFound {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.word-card.found::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 0.9rem;
}

.word-card:disabled:not(.found) {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Results Screen */
.results-card {
    background: var(--color-card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-xl);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow-card);
    animation: resultsAppear 0.5s ease;
}

@keyframes resultsAppear {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.results-header {
    margin-bottom: 30px;
}

.confetti {
    font-size: 3rem;
    animation: confettiDance 1s ease infinite;
}

@keyframes confettiDance {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

.results-header h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-accent);
    margin-top: 15px;
    letter-spacing: 1px;
}

.score-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.score-label {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

.score-value {
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--color-success);
    line-height: 1;
}

.score-total {
    font-size: 1.5rem;
    color: var(--color-text-muted);
}

.score-message {
    font-size: 1.2rem;
    color: var(--color-text);
    margin-bottom: 30px;
    font-weight: 600;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Error Screen */
.error-card {
    background: var(--color-card-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--color-danger);
    border-radius: var(--radius-xl);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-card h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--color-danger);
    margin-bottom: 15px;
}

.error-card p {
    color: var(--color-text-muted);
    margin-bottom: 25px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 15px 0 20px;
    }
    
    .title {
        font-size: 2rem;
        gap: 10px;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .welcome-card,
    .results-card,
    .error-card {
        padding: 30px 20px;
    }
    
    .welcome-icon,
    .error-icon {
        font-size: 3rem;
    }
    
    .welcome-card h2,
    .results-header h2,
    .error-card h2 {
        font-size: 1.5rem;
    }
    
    .constraint-card {
        padding: 15px;
    }
    
    .card-header h3 {
        font-size: 1rem;
    }
    
    .card-content {
        font-size: 0.9rem;
    }
    
    .timer-circle {
        width: 100px;
        height: 100px;
    }
    
    .timer-text {
        font-size: 2rem;
    }
    
    .words-section {
        padding: 20px 15px;
    }
    
    .words-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .word-card {
        padding: 14px 10px;
        font-size: 0.9rem;
    }
    
    .btn-large {
        padding: 15px 25px;
        font-size: 1rem;
    }
    
    .score-value {
        font-size: 3rem;
    }
}

@media (max-width: 400px) {
    .words-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .bus-icon {
        font-size: 0.7em;
    }
}

/* Animations pour les mots */
.word-card {
    animation: wordAppear 0.3s ease backwards;
}

.word-card:nth-child(1) { animation-delay: 0.05s; }
.word-card:nth-child(2) { animation-delay: 0.1s; }
.word-card:nth-child(3) { animation-delay: 0.15s; }
.word-card:nth-child(4) { animation-delay: 0.2s; }
.word-card:nth-child(5) { animation-delay: 0.25s; }
.word-card:nth-child(6) { animation-delay: 0.3s; }
.word-card:nth-child(7) { animation-delay: 0.35s; }
.word-card:nth-child(8) { animation-delay: 0.4s; }
.word-card:nth-child(9) { animation-delay: 0.45s; }
.word-card:nth-child(10) { animation-delay: 0.5s; }

@keyframes wordAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

