:root {
    --primary: #7C3AED;
    --secondary: #2EC4B6;
    --accent: #FFD93D;
    --rouge: #E63946;
    --vert: #2EC4B6;
    --fond: #FFFEF0;
    --texte: #2D2D2D;
    --noir: #2D2D2D;
}

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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--fond);
    min-height: 100vh;
    color: var(--texte);
}

/* Header */
header {
    background: linear-gradient(135deg, #9B59B6 0%, #7C3AED 50%, #2EC4B6 100%);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 999999;
}

header::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(circle at 10% 20%, #FFD93D 2px, transparent 2px),
        radial-gradient(circle at 90% 80%, #FFD93D 2px, transparent 2px),
        radial-gradient(circle at 50% 10%, #FFD93D 1.5px, transparent 1.5px);
    background-size: 100px 100px;
    opacity: 0.3;
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.logo-link { text-decoration: none; }

.logo {
    font-family: "Trebuchet MS", "Segoe UI Rounded", sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 4px 4px 0 var(--noir), -2px -2px 0 var(--noir), 2px -2px 0 var(--noir), -2px 2px 0 var(--noir);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tagline {
    font-size: 1.3rem;
    color: white;
    margin-top: 8px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

nav a {
    color: var(--noir);
    background: var(--accent);
    text-decoration: none;
    padding: 10px 25px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    border-radius: 5px;
    border: 3px solid var(--noir);
    transition: all 0.2s;
    box-shadow: 4px 4px 0 var(--noir);
}

nav a:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--noir);
}

/* Main */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.container {
    padding: 40px 20px;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, #1BA39C 100%);
    border-radius: 20px;
    padding: 40px;
    margin: 40px 20px 30px;
    border: 5px solid var(--noir);
    box-shadow: 10px 10px 0 var(--noir);
    position: relative;
}

.hero::before {
    content: "?";
    position: absolute;
    font-size: 200px;
    font-weight: 900;
    top: -30px;
    right: 20px;
    color: rgba(255,255,255,0.15);
    line-height: 1;
    pointer-events: none;
}

.hero h1, .section-title {
    font-size: 2.2rem;
    color: white;
    margin-bottom: 25px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.dice {
    font-size: 2rem;
    animation: roll 1s ease-in-out infinite;
}

@keyframes roll {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
}

/* Charade box */
.charade-box {
    background: white;
    border-radius: 15px;
    padding: 30px;
    border: 4px solid var(--noir);
    position: relative;
}

.charade-number {
    position: absolute;
    top: -20px;
    left: 20px;
    background: var(--rouge);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    border: 3px solid var(--noir);
}

.charade-line {
    font-size: 1.4rem;
    margin: 15px 0;
    padding-left: 40px;
    position: relative;
    font-weight: 500;
}

.charade-line::before {
    content: "▶";
    position: absolute;
    left: 10px;
    color: var(--rouge);
    font-size: 1rem;
}

/* Reveal button */
.btn-reveal {
    display: block;
    margin: 30px auto 0;
    background: linear-gradient(135deg, var(--accent), #FFC107);
    color: var(--noir);
    border: 4px solid var(--noir);
    padding: 18px 50px;
    font-size: 1.3rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 5px 5px 0 var(--noir);
    transition: all 0.2s;
}

.btn-reveal:hover {
    transform: translate(3px, 3px);
    box-shadow: 2px 2px 0 var(--noir);
}

.answer {
    text-align: center;
    margin-top: 25px;
    padding: 20px;
    background: var(--secondary);
    border-radius: 10px;
    color: white;
    font-size: 1.6rem;
    font-weight: bold;
    text-transform: uppercase;
    border: 3px solid var(--noir);
    display: none;
}

.answer.visible { display: block; }

.explication {
    margin-top: 15px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 8px;
    font-size: 1rem;
    color: #555;
    font-style: italic;
}

/* Hasard button */
.hasard-btn-wrapper {
    text-align: center;
    margin: 0 20px 40px;
}

.hasard-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, #FFC107 100%);
    color: var(--noir);
    padding: 18px 40px;
    border-radius: 50px;
    font-family: "Baloo 2", sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 6px 0 #cc9900, 0 10px 25px rgba(0,0,0,0.2);
    transition: all 0.15s ease;
    letter-spacing: 0.02em;
}

.hasard-btn:hover {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #cc9900, 0 6px 15px rgba(0,0,0,0.2);
}

/* Categories grid */
.categories-section {
    padding: 40px 20px;
}

.section-title.dark {
    color: var(--rouge);
}

.section-title::before,
.section-title::after {
    content: "";
    width: 50px;
    height: 5px;
    background: var(--accent);
    border-radius: 3px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.category-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    border: 4px solid var(--noir);
    box-shadow: 6px 6px 0 var(--noir);
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow: visible;
    text-decoration: none;
    display: block;
}

.category-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 8px;
    border-radius: 11px 11px 0 0;
}

.category-card:nth-child(1)::before { background: var(--rouge); }
.category-card:nth-child(2)::before { background: var(--secondary); }
.category-card:nth-child(3)::before { background: var(--accent); }
.category-card:nth-child(4)::before { background: var(--primary); }
.category-card:nth-child(5)::before { background: var(--rouge); }
.category-card:nth-child(6)::before { background: var(--secondary); }
.category-card:nth-child(7)::before { background: var(--accent); }
.category-card:nth-child(8)::before { background: var(--primary); }
.category-card:nth-child(9)::before { background: var(--rouge); }
.category-card:nth-child(10)::before { background: var(--secondary); }
.category-card:nth-child(11)::before { background: var(--accent); }
.category-card:nth-child(12)::before { background: var(--primary); }

.category-card:hover {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 var(--noir);
}

.category-icon { font-size: 3.5rem; margin-bottom: 15px; }
.category-name { font-size: 1.3rem; font-weight: bold; text-transform: uppercase; color: var(--noir); }
.category-count { font-size: 0.95rem; color: #666; margin-top: 8px; font-weight: 500; }

/* Charade cards grid */
.charades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    padding: 0 20px 40px;
}

.charade-card {
    background: white;
    border: 3px solid var(--noir);
    border-radius: 12px;
    box-shadow: 5px 5px 0 var(--noir);
    padding: 25px;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.charade-card:hover {
    transform: translateY(-3px);
    box-shadow: 8px 8px 0 var(--noir);
}

.charade-card h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.charade-card .preview {
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
}

.charade-card .meta {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-facile { background: #d4edda; color: #155724; }
.badge-moyen { background: #fff3cd; color: #856404; }
.badge-difficile { background: #f8d7da; color: #721c24; }
.badge-enfant { background: #cce5ff; color: #004085; }
.badge-adulte { background: #e2d5f1; color: #5a2d82; }
.badge-tous { background: #e0e0e0; color: #333; }

/* Daily section */
.daily-section {
    background: var(--accent);
    border-radius: 20px;
    padding: 40px;
    margin: 40px 20px;
    border: 5px solid var(--noir);
    box-shadow: 10px 10px 0 var(--noir);
    position: relative;
}

.daily-badge {
    position: absolute;
    top: -15px;
    left: 30px;
    background: var(--rouge);
    color: white;
    padding: 8px 25px;
    border-radius: 25px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    border: 3px solid var(--noir);
}

.daily-section .section-title { color: var(--noir); margin-top: 10px; }
.daily-section .btn-reveal { background: var(--rouge); color: white; }

/* Breadcrumb */
.breadcrumb {
    padding: 20px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: #888; margin: 0 8px; }

/* Search */
.search-section {
    padding: 40px 20px;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto 30px;
}

.search-box input {
    width: 100%;
    padding: 18px 25px;
    font-size: 1.2rem;
    border: 4px solid var(--noir);
    border-radius: 50px;
    outline: none;
    box-shadow: 5px 5px 0 var(--noir);
}

.search-box input:focus {
    border-color: var(--primary);
}

#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 3px solid var(--noir);
    border-radius: 15px;
    margin-top: 10px;
    box-shadow: 5px 5px 0 var(--noir);
    display: none;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.search-item {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--noir);
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.search-item:hover { background: #f8f8f8; }
.search-item:last-child { border-bottom: none; }
.search-item .cat { color: #888; font-size: 0.85rem; margin-left: 10px; }
.no-result { padding: 20px; text-align: center; color: #888; }

/* Single charade page */
.charade-single {
    padding: 40px 20px;
}

.charade-single .charade-box {
    max-width: 800px;
    margin: 0 auto;
}

.charade-single h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 30px;
    font-size: 2rem;
}

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

.share-btn {
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }

/* Related */
.related-section {
    padding: 40px 20px;
}

/* Footer */
footer {
    background: var(--noir);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

footer .logo { font-size: 2rem; margin-bottom: 20px; }
.footer-icons { font-size: 2.5rem; margin: 25px 0; letter-spacing: 10px; }

.footer-links { margin: 20px 0; }
.footer-links a {
    color: var(--accent);
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
}
.footer-links a:hover { text-decoration: underline; }
.copyright { margin-top: 25px; opacity: 0.7; }

/* Legal pages */
.legal-page {
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.legal-page h1 {
    color: var(--primary);
    margin-bottom: 30px;
}

.legal-page img {
    max-width: 100%;
    height: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .logo { font-size: 2.5rem; }
    .hero h1, .section-title { font-size: 1.6rem; }
    .charade-line { font-size: 1.1rem; }
    nav { gap: 8px; }
    nav a { padding: 8px 15px; font-size: 0.8rem; }
    .hero, .daily-section { margin: 20px 10px; padding: 25px; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .charades-grid { grid-template-columns: 1fr; padding: 0 10px 30px; }
}
