/* ===============================
   CELEBRITY HANGMAN - STYLE 2026
   =============================== */

:root {
    --bg: #1a1f27;
    --panel: #222834;
    --panel2: #2a3140;
    --text: #f2f6ff;
    --muted: #b6c2d9;
    --accent: #4fb3ff;
    --accent-hover: #78c6ff;
    --yellow: #ffd95c;
    --border: rgba(255,255,255,0.12);
    --link: #89c9ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ===============================
   LAYOUT
   =============================== */

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Top section */
.top {
    display: grid;
    grid-template-columns: 4fr 1fr;
    gap: 12px;
    align-items: stretch;
}

.masked {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 2px;
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.timerBox {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.timerLabel {
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 12px;
}

.timer {
    font-size: 36px;
    font-weight: 900;
    color: var(--accent);
}

    .timer.danger {
        color: #ff5c5c;
    }

/* ===============================
   HINTS
   =============================== */

.hints {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.hint {
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
}

/* ===============================
   MAIN GRID
   =============================== */

.main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    min-height: 520px;
}

.left {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding-bottom: 90px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.right {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.cardTitle {
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--muted);
}

/* ===============================
   INPUTS & BUTTONS
   =============================== */

input {
    width: 100%;
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text);
    outline: none;
}

    input:focus {
        border-color: var(--accent);
    }

button {
    background: var(--accent);
    border: none;
    color: white;
    font-weight: 800;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    button:hover {
        background: var(--accent-hover);
        transform: translateY(-1px);
    }

    button.secondary {
        background: transparent;
        border: 1px solid var(--border);
        color: var(--text);
    }

        button.secondary:hover {
            background: rgba(255,255,255,0.05);
        }

/* ===============================
   LINKS
   =============================== */

a {
    color: var(--link);
    text-decoration: none;
    font-weight: 600;
}

    a:hover {
        color: var(--accent-hover);
        text-decoration: underline;
    }

/* ===============================
   CHAT
   =============================== */

.chat {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    border-radius: 14px;
}

.msg {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    margin-bottom: 8px;
}

    .msg .meta {
        color: var(--muted);
        font-size: 12px;
        margin-bottom: 4px;
    }

    .msg .text {
        font-size: 14px;
        line-height: 1.4;
    }

/* ===============================
   INPUT BAR FIXED
   =============================== */

.inputRow {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    padding: 12px 16px;
    background: var(--panel);
    border-top: 1px solid var(--border);
    z-index: 1000;
}

/* ===============================
   SCORES
   =============================== */

.score-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 6px 0;
}

    .score-row .pos {
        width: 40px;
        font-weight: 700;
    }

    .score-row .nick {
        flex: 1;
    }

    .score-row .pts {
        width: 60px;
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

.yellow {
    color: var(--yellow);
    font-weight: 900;
}

.muted {
    opacity: .7;
}

/* ===============================
   MODE SELECT - FULL WIDTH 3 COL
   =============================== */

.modeGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonne uguali */
    gap: 16px;
    width: 100%;
    margin-top: 12px;
}

.modeCard {
    position: relative;
    width: 100%;
}

    .modeCard input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

/* BOX ora prende tutta la colonna */
.modeContent {
    width: 100%;
    aspect-ratio: 1 / 1; /* mantiene quadrato */

    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* Icona */
.modeIcon {
    font-size: 28px;
}

/* Testo */
.modeText {
    font-size: 11px;
    font-weight: 800;
    margin-top: 6px;
    text-align: center;
}

/* Hover */
.modeCard:hover .modeContent {
    transform: translateY(-4px);
    border-color: var(--accent);
}

/* Selected */
.modeCard input:checked + .modeContent {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 8px 22px rgba(79,179,255,0.35);
}
/* ===============================
   HOME (hero + how) RESPONSIVE
   =============================== */

/* HERO */
.hero {
    padding: 14px 0;
}

.heroCard {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.28);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--muted);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .6px;
}

/* Headings */
.heroCard h1 {
    margin: 12px 0 8px;
    font-size: 44px;
    line-height: 1.05;
    letter-spacing: -0.5px;
}

.lead {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.5;
    max-width: 58ch;
}

/* CTA */
.ctaRow {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

/* Buttons (anchored buttons too) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    font-weight: 900;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all .2s ease;
    user-select: none;
}

    .btn:hover {
        background: var(--accent-hover);
        transform: translateY(-1px);
    }

    .btn.secondary {
        background: transparent;
        border-color: var(--border);
        color: var(--text);
    }

        .btn.secondary:hover {
            background: rgba(255,255,255,0.05);
        }

/* Mini note */
.miniNote {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
}

/* HOW SECTION */
.howGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.howItem {
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
}

.howNum {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 900;
    background: rgba(79,179,255,0.18);
    border: 1px solid rgba(79,179,255,0.35);
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.howTitle {
    font-weight: 900;
    margin-bottom: 4px;
}

.howText {
    color: var(--muted);
    line-height: 1.45;
    font-size: 14px;
}

/* Footer */
.footer {
    padding: 14px 0 8px;
    text-align: center;
}

/* ===============================
   RESPONSIVE BREAKPOINTS
   =============================== */

/* Tablet */
@media (max-width: 900px) {
    .heroCard h1 {
        font-size: 38px;
    }

    .howGrid {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 520px) {
    .page {
        padding: 12px;
    }

    .heroCard {
        padding: 14px;
        border-radius: 16px;
    }

        .heroCard h1 {
            font-size: 30px;
            line-height: 1.1;
        }

    .lead {
        font-size: 15px;
    }

    .ctaRow {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        padding: 12px 14px;
    }

    .howItem {
        padding: 12px;
    }
}
/* ===============================
   ROUND END OVERLAY
   =============================== */

.roundOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    animation: fadeIn .4s ease;
}

    .roundOverlay.hidden {
        display: none;
    }

.roundCard {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 50px;
    text-align: center;
    animation: popIn .4s ease;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}

.roundTitle {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 15px;
    color: var(--muted);
}

.roundWord {
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 15px;
    color: var(--accent);
    letter-spacing: 2px;
}

.roundWinner {
    font-size: 20px;
    font-weight: 800;
    color: var(--yellow);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes popIn {
    from {
        transform: scale(.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Confetti canvas */
.confettiCanvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 6000;
    display: none;
}

/* Screen shake */
@keyframes cdp_shake {
    0% {
        transform: translate3d(0,0,0) rotate(0deg);
    }

    10% {
        transform: translate3d(-2px, 1px, 0) rotate(-0.2deg);
    }

    20% {
        transform: translate3d(3px, -1px, 0) rotate(0.2deg);
    }

    30% {
        transform: translate3d(-4px, 2px, 0) rotate(-0.3deg);
    }

    40% {
        transform: translate3d(4px, -2px, 0) rotate(0.3deg);
    }

    50% {
        transform: translate3d(-3px, 1px, 0) rotate(-0.2deg);
    }

    60% {
        transform: translate3d(3px, -1px, 0) rotate(0.2deg);
    }

    70% {
        transform: translate3d(-2px, 1px, 0) rotate(-0.15deg);
    }

    80% {
        transform: translate3d(2px, -1px, 0) rotate(0.15deg);
    }

    90% {
        transform: translate3d(-1px, 0px, 0) rotate(-0.05deg);
    }

    100% {
        transform: translate3d(0,0,0) rotate(0deg);
    }
}

body.shake {
    animation: cdp_shake 420ms ease both;
}

/* Top1 highlight */
.top1 {
    position: relative;
    border-color: rgba(255,217,92,0.55) !important;
    background: rgba(255,217,92,0.10) !important;
    box-shadow: 0 10px 22px rgba(255,217,92,0.18);
}

    .top1::before {
        content: "🏆";
        position: absolute;
        left: -6px;
        top: 50%;
        transform: translateY(-50%);
        filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
    }

@keyframes cdp_pulseOnce {
    0% {
        transform: scale(1);
    }

    35% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.pulseOnce {
    animation: cdp_pulseOnce 520ms ease both;
}

/* Timer pulse + danger (works with your existing .timer styles) */
@keyframes cdp_timerPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }

    100% {
        transform: scale(1);
    }
}

.timer.pulse, #timer.pulse {
    animation: cdp_timerPulse 900ms ease-in-out infinite;
}

.timer.danger, #timer.danger {
    text-shadow: 0 0 18px rgba(255,92,92,0.35);
}

/* Masked word reveal pop */
@keyframes cdp_revealPop {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.04);
    }

    100% {
        transform: scale(1);
    }
}

.revealPop {
    animation: cdp_revealPop 420ms ease both;
}

/* Optional: make links match your theme if not already */
a {
    color: var(--link, #89c9ff);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }


/* ===============================
   MOBILE TABS SYSTEM
   =============================== */

.mHide {
    display: none !important;
}

/* Tabs visibili sempre */
.mTabs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.mTab {
    flex: 1;
    border-radius: 12px;
    padding: 10px 8px;
    font-weight: 900;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
}

    .mTab.active {
        background: var(--accent);
        border-color: var(--accent);
        color: white;
        box-shadow: 0 8px 22px rgba(79,179,255,0.25);
    }

/* Settings */
.settingsRow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.settingsLabel {
    font-weight: 700;
    color: var(--muted);
}

.settingsValue {
    font-weight: 900;
}

/* ===============================
   MOBILE BEHAVIOUR
   =============================== */
/* Tabs hidden by default (desktop) */
.mTabs {
    display: none;
}

.mHide {
    display: none !important;
}

/* MOBILE ONLY */
@media (max-width: 900px) {
    .mTabs {
        display: flex;
        gap: 8px;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 74px;
        padding: 8px 10px;
        background: var(--panel);
        border-top: 1px solid var(--border);
        z-index: 1100;
    }

    .mTab {
        flex: 1;
        border-radius: 12px;
        padding: 10px 8px;
        font-weight: 900;
        background: rgba(255,255,255,0.05);
        border: 1px solid var(--border);
        color: var(--text);
        cursor: pointer;
    }

        .mTab.active {
            background: var(--accent);
            border-color: var(--accent);
            color: white;
            box-shadow: 0 8px 22px rgba(79,179,255,0.25);
        }

    /* Space for tabs + inputRow */
    .left,
    .right {
        padding-bottom: 160px;
    }

    /* Chat scroll area */
    .chat {
        max-height: calc(100dvh - 260px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}