/* ============================================
   CITROËN HIDDEN LOGO GAME - STYLES
   Optimized for tablet landscape mode
   ============================================ */

:root {
    --primary: #1a1a2e;
    --primary-light: #16213e;
    --accent: #0f3460;
    --citroen-red: #e63946;
    --citroen-gold: #d4a843;
    --success: #2ecc71;
    --danger: #e74c3c;
    --text: #ffffff;
    --text-muted: #a0a0a0;
    --bg-dark: #0d0d1a;
    --radius: 8px;
    --transition: 0.3s ease;
}

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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* --- Top Bar --- */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--primary);
    border-bottom: 2px solid var(--accent);
    height: 60px;
    position: relative;
    z-index: 10;
}

.timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 2.3rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 160px;
    color: var(--citroen-gold);
}

.timer-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    opacity: 0.85;
}

.timer.warning {
    color: var(--danger);
    animation: pulse 0.5s ease infinite;
}

.title {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    flex: 1;
    letter-spacing: 0.5px;
}

.score {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    transition: transform 0.2s ease;
}

.score-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.score-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--citroen-gold);
    line-height: 1;
}

.score.bump .score-value {
    animation: scoreBump 0.4s ease-out;
}

@keyframes scoreBump {
    0% { transform: scale(1); }
    40% { transform: scale(1.5); color: var(--success); }
    100% { transform: scale(1); }
}

/* --- Main Game Container --- */
.game-container {
    height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    position: relative;
}

.image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

#gameImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Single click overlay */
.click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 5;
}

/* --- Hidden Logos (camouflaged) --- */
.hidden-logo {
    position: absolute;
    pointer-events: none;
    z-index: 4;
    transition: opacity 0.25s ease;
}

/* Radial glow on collect — gold */
.collect-glow {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.65) 0%, rgba(212, 168, 67, 0.2) 50%, transparent 70%);
    pointer-events: none;
    animation: glowPulse 0.5s ease-out forwards;
}

/* --- Flying Logo (collect animation) --- */
.flying-logo {
    width: 40px;
    height: 40px;
    pointer-events: none;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

/* --- Wrong Click Feedback --- */
.feedback-wrong {
    position: absolute;
    pointer-events: none;
    z-index: 20;
    animation: feedbackFade 0.8s ease-out forwards;
}

.feedback-wrong .x-mark {
    font-size: 2.5rem;
    color: var(--danger);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.8);
    line-height: 1;
}

.feedback-wrong .time-penalty {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--danger);
    white-space: nowrap;
    animation: floatUp 0.8s ease-out forwards;
}

/* ============================================
   COLLECTION DOCK (Bottom Bar)
   ============================================ */
.collection-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(22, 33, 62, 0.97) 0%, rgba(13, 13, 26, 0.99) 100%);
    border-top: 1px solid rgba(212, 168, 67, 0.2);
    padding: 12px 20px 14px;
    z-index: 10;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

/* Slot trays — left and right halves */
.dock-tray {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex: 1;
    flex-wrap: nowrap;
}

/* Label centered between the two tray halves */
.dock-label {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--citroen-gold);
    white-space: nowrap;
    flex-shrink: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Individual collection slot — clearly visible */
.dock-slot {
    width: calc((100% - 70px) / 8);
    max-width: 72px;
    min-width: 48px;
    height: 64px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
}

/* Empty state — grey logo visible */
.dock-slot.empty {
    border-color: rgba(255, 255, 255, 0.1);
}

.dock-slot.empty img {
    width: 55%;
    height: 55%;
    object-fit: contain;
    display: block;
    opacity: 0.18;
    filter: grayscale(1) brightness(0.7);
}

/* Filled state — bright with glow */
.dock-slot.filled {
    border-color: rgba(212, 168, 67, 0.5);
    background: rgba(212, 168, 67, 0.08);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.15),
        0 0 16px rgba(212, 168, 67, 0.2);
}

.dock-slot.filled img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    display: block;
    opacity: 1;
    filter: none;
}

/* Pop animation on fill */
.dock-slot.pop {
    animation: slotPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slotPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.18); border-color: rgba(212, 168, 67, 0.8); }
    100% { transform: scale(1); }
}

/* --- Game Over Overlay --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    backdrop-filter: blur(5px);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    background: var(--primary);
    border: 2px solid var(--citroen-gold);
    border-radius: 16px;
    padding: 40px 60px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: transform 0.4s ease;
}

.overlay.active .overlay-content {
    transform: scale(1);
}

.overlay-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: bounce 0.6s ease;
}

.overlay-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--citroen-gold);
    margin-bottom: 10px;
}

.overlay-message {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.overlay-time {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 30px;
}

.btn-continue {
    background: var(--citroen-gold);
    color: var(--primary);
    border: none;
    border-radius: var(--radius);
    padding: 14px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-continue:hover,
.btn-continue:active {
    background: #e6bc55;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(212, 168, 67, 0.4);
}

/* --- Animations --- */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes feedbackFade {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.8); }
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-40px); }
}

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

@keyframes glowPulse {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    30% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* --- Responsive: Tablet Landscape --- */
@media (max-width: 1024px) {
    .top-bar { padding: 10px 16px; height: auto; min-height: 50px; }
    .timer { font-size: 2rem; min-width: 130px; }
    .timer-icon { width: 28px; height: 28px; }
    .title { font-size: 1.1rem; }
    .score-value { font-size: 2rem; }
    .game-container { height: calc(100vh - 140px); }
    .collection-dock { padding: 10px 12px 12px; gap: 12px; }
    .dock-label { font-size: 1.15rem; }
    .dock-tray { gap: 6px; }
    .dock-slot { height: 56px; min-width: 40px; max-width: 60px; }
}

@media (max-width: 768px) {
    .overlay-content { padding: 30px 40px; }
    .overlay-title { font-size: 2rem; }
    .collection-dock { padding: 8px 8px 10px; gap: 8px; }
    .dock-label { font-size: 1rem; }
    .dock-tray { gap: 5px; }
    .dock-slot { height: 50px; min-width: 34px; max-width: 52px; border-radius: 10px; }
}
