/* Bingo Smut - page /bingo-smut.html
   Design system aligne sur collections.html */

:root {
    --bg-deep: #F6DCDC;
    --bg-base: #F5EFEA;
    --bg-card: #ffffff;
    --gold: #C2787E;
    --primary: #A0565B;
    --primary-glow: rgba(160,86,91,0.35);
    --text: #1a1a2e;
    --text-secondary: #555;
    --text-muted: #999;
    --success: #10b981;
    --rose: #f43f5e;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.10);
    --radius: 12px;
    --radius-lg: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

.bingo-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 12px 96px;
}

.bingo-header { text-align: center; margin-bottom: 20px; }

.bingo-eyebrow {
    display: inline-block;
    font-family: 'Dancing Script', cursive;
    font-size: 22px;
    color: var(--primary);
    margin-bottom: 6px;
}

.bingo-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(30px, 6vw, 44px);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 10px;
}

.bingo-title .flame { color: var(--rose); }

.bingo-sub {
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 460px;
    margin: 0 auto 16px;
    padding: 0 8px;
}

/* ---------- Level picker (piments) ---------- */

.level-picker {
    display: inline-flex;
    background: #fff;
    border-radius: 100px;
    padding: 4px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
    gap: 2px;
}

.level-btn {
    border: none;
    background: transparent;
    padding: 8px 14px;
    border-radius: 100px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
    -webkit-tap-highlight-color: transparent;
}

.level-btn .pep {
    display: inline-block;
    margin-right: 4px;
    filter: grayscale(1) opacity(0.5);
}

.level-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--gold));
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.level-btn.active .pep { filter: none; }

.bingo-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 100px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform .15s ease, box-shadow .2s ease;
    text-decoration: none;
    color: var(--text);
    background: var(--bg-card);
    box-shadow: var(--shadow);
    -webkit-tap-highlight-color: transparent;
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--gold));
    color: #fff;
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(160,86,91,0.25);
}

/* ---------- Grid ---------- */

.bingo-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 10px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.bingo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 1fr;
    gap: 5px;
    aspect-ratio: 1 / 1;
}

.cell {
    background: #fff;
    border: 1.5px solid rgba(160,86,91,0.22);
    border-radius: 8px;
    padding: 4px 3px;
    font-size: clamp(9px, 2.1vw, 12px);
    line-height: 1.15;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    user-select: none;
    color: var(--text);
    transition: transform .1s ease, background .15s ease, border-color .15s ease;
    position: relative;
    overflow: hidden;
    hyphens: auto;
    word-break: break-word;
    box-shadow: inset 0 -2px 0 rgba(160,86,91,0.08);
    -webkit-tap-highlight-color: transparent;
}

.cell::before {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 8px;
    height: 8px;
    border: 1.5px solid rgba(160,86,91,0.35);
    border-radius: 50%;
    background: transparent;
    transition: opacity .2s ease;
}

.cell:hover { background: var(--bg-base); border-color: var(--primary); transform: scale(1.02); }
.cell:active { transform: scale(0.95); background: var(--bg-base); }

.cell.checked {
    background: linear-gradient(135deg, var(--primary), var(--gold));
    color: #fff;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 3px 10px var(--primary-glow);
}

.cell.checked::before { background: #fff; border-color: #fff; }

.cell.checked::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M8 12 L92 88 M92 12 L8 88' stroke='%23f43f5e' stroke-width='6' stroke-linecap='round' opacity='0.55' fill='none'/></svg>");
    background-size: 100% 100%;
    pointer-events: none;
}

.cell.free {
    background: linear-gradient(135deg, #C9A87C, #C2787E);
    color: #fff;
    font-family: 'Dancing Script', cursive;
    font-size: clamp(16px, 3.5vw, 22px);
    font-weight: 700;
    cursor: default;
    box-shadow: 0 3px 12px rgba(201,168,124,0.4);
}

.cell.free::before { display: none; }
.cell.free:hover { transform: none; }

/* ---------- Progress ---------- */

.bingo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 4px 0;
    font-size: 13px;
    color: var(--text-muted);
    gap: 8px;
    flex-wrap: wrap;
}

.bingo-meta strong { color: var(--primary); font-size: 15px; }

/* ---------- CTA card ---------- */

.cta-card {
    margin-top: 24px;
    background: linear-gradient(135deg, #1a1a2e, #2d1b3d);
    color: #fff;
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.cta-card h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    margin-bottom: 6px;
}

.cta-card p { opacity: .85; font-size: 14px; margin-bottom: 14px; }
.cta-card .btn { background: #fff; color: var(--text); }

/* ---------- Bingo modal ---------- */

.bingo-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999;
    animation: fadeIn .3s ease;
}

.bingo-modal.show { display: flex; }

.bingo-modal-content {
    background: var(--bg-card);
    padding: 32px 24px;
    border-radius: var(--radius-lg);
    max-width: 380px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: pop .4s cubic-bezier(.34,1.56,.64,1);
    position: relative;
}

.bingo-modal-emoji { font-size: 60px; line-height: 1; margin-bottom: 6px; }

.bingo-modal h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 8px;
}

.bingo-modal p { color: var(--text-secondary); margin-bottom: 18px; font-size: 15px; }

.bingo-modal .modal-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.bingo-modal .modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 6px 10px;
}

/* ---------- Confetti ---------- */

.confetti {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 14px;
    z-index: 998;
    animation: fall 3s linear forwards;
    pointer-events: none;
}

@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .6; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
    from { transform: scale(.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--text);
    color: #fff;
    padding: 10px 18px;
    border-radius: 100px;
    font-size: 14px;
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
    z-index: 1000;
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ---------- Footer note ---------- */

.bingo-footer {
    margin-top: 22px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.bingo-footer a { color: var(--primary); text-decoration: none; }

/* ---------- Screenshot wrap ---------- */

.capture-wrap {
    background: var(--bg-deep);
    padding: 12px;
    max-width: 480px;
    margin: 0 auto;
}

.capture-wrap .brand-mark { display: none; }

.capturing .capture-wrap .brand-mark {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    color: var(--primary);
    font-weight: 600;
}

.capturing .capture-wrap .brand-mark span {
    font-family: 'Dancing Script', cursive;
    font-size: 13px;
    display: block;
    color: var(--text-muted);
    font-weight: 400;
}

/* ---------- Fullscreen mode : la grille prend tout l ecran ---------- */

.btn-fs-only { display: none; }

.fs-exit {
    display: none;
    position: fixed;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 1500;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    -webkit-tap-highlight-color: transparent;
}

body.fullscreen { overflow: hidden; background: var(--bg-deep); }

body.fullscreen .bingo-header,
body.fullscreen .cta-card,
body.fullscreen .bingo-footer,
body.fullscreen .brand-mark {
    display: none !important;
}

body.fullscreen .bingo-wrap {
    padding: 0 !important;
    max-width: none;
}

body.fullscreen .capture-wrap {
    padding: 0;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

body.fullscreen .bingo-card {
    border-radius: 0;
    padding: 8px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    width: 100vw;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

body.fullscreen .bingo-grid {
    aspect-ratio: auto;
    flex: 1;
    min-height: 0;
    gap: 4px;
}

body.fullscreen .cell {
    font-size: clamp(11px, 2.6vw, 15px);
    padding: 4px 3px;
}

body.fullscreen .bingo-meta {
    flex-shrink: 0;
    padding: 8px 8px 6px;
    font-size: 12px;
}

body.fullscreen .fs-exit {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Mobile ---------- */

@media (max-width: 768px) {
    .btn-fs-only { display: inline-flex; }
}

@media (max-width: 480px) {
    .bingo-wrap { padding: 16px 8px 80px; }
    .bingo-card { padding: 8px; }
    .bingo-grid { gap: 4px; }
    .cell { padding: 3px 2px; font-size: 10px; }
    .cell::before { width: 7px; height: 7px; top: 2px; right: 2px; }
    .level-btn { padding: 7px 11px; font-size: 12px; }
    .btn { padding: 9px 15px; font-size: 13px; }
    .bingo-sub { font-size: 13px; }
}

@media (max-width: 360px) {
    .cell { font-size: 9px; }
}
