/* Click Mania — thème moderne (mockup 2026) */

:root {
    --cm-bg-deep: #060d18;
    --cm-cyan: #00d4ff;
    --cm-violet: #7c3aed;
    --cm-glass-border: rgba(255, 255, 255, 0.28);
    --cm-glass-bg: rgba(255, 255, 255, 0.08);
    --cm-text-muted: rgba(255, 255, 255, 0.72);
    --cm-accent: #009fe3;
    --cm-accent-light: #00d4ff;
    --cm-accent-mid: #009fe3;
    --cm-accent-deep: #0088aa;
    --cm-button-gradient: linear-gradient(135deg, #00d4ff 0%, #009fe3 52%, #0088aa 100%);
    --cm-ring-start: #00d4ff;
    --cm-ring-end: #0088aa;
    --cm-radius-lg: 20px;
    --ring-pct: 0;
    --ring-width: 12px;
}

/* ── Fond & layout page ── */
html {
    background-color: var(--cm-bg-deep, #060d18);
}

body.cm-modern {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background-color: var(--cm-bg-deep) !important;
    background-image: radial-gradient(ellipse 130% 90% at 50% -15%, #132a4a 0%, var(--cm-bg-deep) 50%, #000 100%) !important;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    color: #fff;
    overflow-x: hidden;
    position: relative;
    isolation: isolate;
}

.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.22;
    animation: floatOrb 16s ease-in-out infinite;
}

.ambient-orb--1 {
    width: 240px;
    height: 240px;
    background: var(--cm-cyan);
    top: 2%;
    left: -12%;
}

.ambient-orb--2 {
    width: 200px;
    height: 200px;
    background: var(--cm-violet);
    top: 55%;
    right: -14%;
    animation-delay: -5s;
    opacity: 0.15;
}

.ambient-orb--3 {
    width: 160px;
    height: 160px;
    background: #009fe3;
    bottom: 8%;
    left: -10%;
    animation-delay: -9s;
    opacity: 0.12;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10px, -12px); }
}

@keyframes logoIn {
    from { opacity: 0; transform: scale(0.94) translateY(-6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Header ── */
.app-header,
#mainMenu {
    position: relative;
    z-index: 1000;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    box-sizing: border-box;
}

#logoHeadMenu {
    height: 48px;
    margin: 6px 0 6px 2px;
    width: auto;
}

.online-counter {
    margin-left: auto;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(0, 212, 255, 0.28) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ── Contenu principal ── */
.app-main {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px 28px;
    box-sizing: border-box;
}

.hero-logo {
    text-align: center;
    margin: 0 0 8px;
}

#logoClickMania {
    height: clamp(88px, 20vw, 128px);
    width: auto;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.3));
    animation: logoIn 0.45s ease-out both;
}

.game-panel,
#containerSub {
    width: 100% !important;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
    z-index: 1;
}

/* ── Réservoir ── */
@property --ring-pct {
    syntax: '<number>';
    inherits: true;
    initial-value: 0;
}

.reservoir-stack,
#containerGlass {
    position: relative;
    width: min(280px, 84vw);
    min-height: clamp(250px, 42vh, 310px);
    margin: 4px auto 20px;
    display: flex;
    justify-content: center;
    align-items: stretch;
    isolation: isolate;
    --ring-pct: 0;
    --ring-deg: calc(var(--ring-pct, 0) * 3.6deg);
    transition: --ring-pct 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.reservoir-stack.ring-intro,
#containerGlass.ring-intro {
    transition: --ring-pct 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Anneau : départ bas (180deg), remplissage horaire sur 360° */
.reservoir-stack::before {
    content: '';
    position: absolute;
    inset: calc(-1 * var(--ring-width, 12px) - 2px);
    border-radius: 140px / 48px;
    padding: var(--ring-width, 12px);
    background: conic-gradient(
        from 180deg,
        var(--cm-ring-start, #00d4ff) 0deg,
        var(--cm-ring-end, #0088aa) var(--ring-deg, 0deg),
        rgba(255, 255, 255, 0.16) var(--ring-deg, 0deg),
        rgba(255, 255, 255, 0.16) 360deg
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    z-index: 0;
    pointer-events: none;
    opacity: calc(0.55 + var(--ring-pct, 0) / 150);
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.25));
    transition: opacity 0.45s ease;
}

.reservoir-stack.ring-intro::before,
#containerGlass.ring-intro::before {
    transition: opacity 1.5s ease;
}

.reservoir-stack::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 130px / 46px;
    background: radial-gradient(ellipse at 50% 30%, rgba(0, 212, 255, 0.06) 0%, transparent 65%);
    z-index: 0;
    pointer-events: none;
}

.cm-modern .glass {
    position: relative;
    z-index: 2;
    width: 100% !important;
    height: clamp(250px, 42vh, 310px) !important;
    min-height: 250px;
    border-radius: 140px / 48px !important;
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.22) 0%,
        rgba(255, 255, 255, 0.07) 40%,
        rgba(0, 25, 45, 0.18) 100%
    ) !important;
    border: 2px solid var(--cm-glass-border) !important;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 28px rgba(0, 212, 255, 0.1),
        inset 0 2px 16px rgba(255, 255, 255, 0.2),
        inset 0 -10px 28px rgba(0, 0, 0, 0.28) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    overflow: hidden !important;
    clip-path: inset(0 round 140px / 48px);
    transform: translateZ(0);
}

.cm-modern .water {
    z-index: 2;
    left: 0;
    right: 0;
    width: 100% !important;
    border-radius: 140px / 48px !important;
    transform-origin: bottom center;
    overflow: hidden;
    box-shadow: inset 0 10px 28px rgba(255, 255, 255, 0.2);
}

.cm-modern .water::before,
.cm-modern .water::after {
    opacity: 0.5;
}

/* ── Prochain succès (sous le réservoir) ── */
.goal-block,
.cm-modern .nextWin {
    position: relative !important;
    z-index: 2;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 2px 0 8px !important;
    padding: 8px 12px !important;
    background: #0b1524 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-left: 4px solid var(--cm-accent-mid, var(--cm-accent)) !important;
    border-radius: 12px !important;
    box-sizing: border-box;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.nextWinText--label {
    font-size: 0.7rem !important;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    text-decoration: none !important;
    color: var(--cm-text-muted) !important;
    margin: 0 0 2px !important;
}

.nextWinText--tier {
    font-family: garetheavy, Arial, Helvetica, sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 !important;
}

.nextWinText--meta {
    font-size: 0.75rem !important;
    color: var(--cm-accent-light, var(--cm-cyan)) !important;
    margin: 2px 0 0 !important;
}

#nextWinText,
#innerGain,
#amountNeeded {
    opacity: 0;
}

.nextWin.nextWin--finished {
    background: rgba(255, 255, 255, 0.94) !important;
    border-left-color: var(--cm-accent, #00ff22) !important;
}

.nextWin.nextWin--finished .nextWinText--tier,
.nextWin.nextWin--finished #innerGain {
    color: #0a1520 !important;
}

/* ── Compteur ── */
.stats-block {
    text-align: center;
    margin: 0 0 8px;
    width: 100%;
}

.stats-block__label {
    font-family: garetbook, Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
    color: var(--cm-text-muted);
    margin: 0 0 2px;
}

.stats-block__value {
    font-family: garetheavy, Arial, Helvetica, sans-serif;
    font-size: clamp(2.2rem, 9vw, 3rem);
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
}

#clickCount {
    display: inline-block;
    transform-origin: center center;
    color: #fff;
    background: linear-gradient(180deg, #ffffff 20%, var(--cm-accent-light, var(--cm-cyan)) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@supports not (background-clip: text) {
    #clickCount {
        color: #fff;
        -webkit-text-fill-color: #fff;
    }
}

.stats-block__unit {
    font-size: 0.42em;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    -webkit-text-fill-color: rgba(255, 255, 255, 0.5);
}

/* ── Bouton ── */
@keyframes cmBtnTap {
    0% {
        transform: scale(1) translateZ(0);
        box-shadow:
            0 10px 32px rgba(0, 157, 227, 0.35),
            0 0 24px rgba(124, 58, 237, 0.18),
            inset 0 1px 0 rgba(255, 255, 255, 0.22);
    }
    35% {
        transform: scale(0.95) translateZ(0);
        box-shadow:
            0 6px 20px rgba(0, 157, 227, 0.28),
            0 0 16px rgba(124, 58, 237, 0.14),
            inset 0 1px 0 rgba(255, 255, 255, 0.18);
    }
    100% {
        transform: scale(1) translateZ(0);
        box-shadow:
            0 10px 32px rgba(0, 157, 227, 0.35),
            0 0 24px rgba(124, 58, 237, 0.18),
            inset 0 1px 0 rgba(255, 255, 255, 0.22);
    }
}

.cta-reservoir,
#reservoirButton {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 64px !important;
    height: auto !important;
    max-height: none !important;
    padding: 18px 20px !important;
    margin-top: 12px !important;
    border-radius: var(--cm-radius-lg) !important;
    font-size: 1.05rem !important;
    line-height: 1.2 !important;
    letter-spacing: 0.05em !important;
    background: var(--cm-button-gradient) !important;
    box-shadow:
        0 10px 32px color-mix(in srgb, var(--cm-accent-mid, #009fe3) 35%, transparent),
        0 0 24px color-mix(in srgb, var(--cm-accent-deep, #0088aa) 22%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: none !important;
    transform: translateZ(0);
    backface-visibility: hidden;
    user-select: none;
    border: none !important;
    touch-action: manipulation;
    pointer-events: auto !important;
}

#reservoirButton.btn-tap,
.cm-modern #reservoirButton.btn-tap {
    animation: cmBtnTap 160ms cubic-bezier(0.34, 1.4, 0.64, 1) !important;
    transition: none !important;
    pointer-events: auto !important;
}

.cm-modern #reservoirButton::before,
.cm-modern #reservoirButton::after {
    display: none !important;
    content: none !important;
}

.cm-modern #reservoirButton:active,
.cm-modern #reservoirButton:focus {
    filter: none !important;
    outline: none !important;
}

@media (hover: hover) and (pointer: fine) {
    .cm-modern #reservoirButton {
        transition: transform 0.15s ease, box-shadow 0.2s ease !important;
    }

    .cm-modern #reservoirButton:active {
        transform: scale(0.98) translateZ(0) !important;
    }

    .cm-modern #reservoirButton:hover {
        transform: translateY(-2px) scale(1.02) translateZ(0) !important;
        animation: none !important;
    }
}

/* ── Succès ── */
.tier-achievements {
    width: 100%;
    margin-top: 20px !important;
    gap: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    position: relative;
    z-index: 1;
}

.tier-achievements__title {
    font-size: 1.2rem !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    text-align: center;
    background: transparent !important;
    position: relative;
    z-index: 2;
}

.tier-achievements__list {
    margin: 0 !important;
    padding: 12px !important;
    gap: 8px !important;
    background: #0b1524 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: var(--cm-radius-lg) !important;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.WinnedGain,
.tier-card {
    text-align: left !important;
    padding: 12px 14px 12px 18px !important;
    margin: 0 !important;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--tier-accent-light, var(--tier-accent)) 14%, #121f33) 0%,
        #121f33 50%,
        color-mix(in srgb, var(--tier-accent-deep, var(--tier-accent)) 12%, #121f33) 100%
    ) !important;
    border: 1px solid color-mix(in srgb, var(--tier-accent, var(--cm-accent-mid)) 28%, rgba(255, 255, 255, 0.1)) !important;
    border-radius: 12px !important;
    border-left: 4px solid var(--tier-accent-light, var(--tier-accent, var(--cm-accent-mid))) !important;
    box-shadow: none !important;
}

.tier-card__meta {
    font-size: 0.78rem !important;
    color: color-mix(in srgb, var(--tier-accent-light, var(--cm-text-muted)) 75%, var(--cm-text-muted)) !important;
    margin: 2px 0 0 !important;
}

.WinnedGain::before {
    display: none !important;
}

.TextWinnedGain:first-child {
    font-family: garetheavy, Arial, Helvetica, sans-serif;
    font-size: 0.95rem !important;
}

/* ── Popup ── */
.popup-content {
    background: linear-gradient(145deg, rgba(12, 26, 46, 0.96), rgba(6, 13, 24, 0.98)) !important;
    border: 1px solid rgba(0, 212, 255, 0.25) !important;
}

/* ── Transitions ciblées ── */
.drop,
.drop-splash,
.cm-modern .water,
#clickCount {
    transition: transform 0.3s ease, opacity 0.3s ease, height 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), background 0.5s ease, filter 0.3s ease;
}

.reservoir-stack::before {
    transition: opacity 0.6s ease;
}

/* ── Responsive ── */
@media screen and (max-width: 380px) {
    #logoHeadMenu { height: 40px; }
    .online-label { display: none; }
    .online-counter { padding: 6px 10px; }
}

@media screen and (min-width: 600px) {
    .app-main {
        padding-top: 8px;
        justify-content: flex-start;
    }

    .cm-modern .glass {
        height: 300px !important;
        min-height: 300px;
    }

    .reservoir-stack,
    #containerGlass {
        min-height: 300px;
    }
}
