.compose-instructions,
.ignite-panel .compose-instructions,
.compose-panel .compose-instructions,
.text-panel .compose-instructions,
.mmodal .compose-instructions,
.mmodal-content .compose-instructions,
#igniteModal .compose-instructions,
.step .compose-instructions {
    margin: 0 0 1rem 1.2rem !important;
    padding: 0 !important;
    list-style: disc !important;
    color: rgba(248, 240, 230, 0.95);
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.compose-instructions li,
.ignite-panel .compose-instructions li,
.compose-panel .compose-instructions li,
.text-panel .compose-instructions li,
.mmodal .compose-instructions li,
.mmodal-content .compose-instructions li,
#igniteModal .compose-instructions li,
.step .compose-instructions li {
    margin-bottom: .35rem !important;
    color: rgba(248, 240, 230, 0.95);
}

/* Muistomaisema – Kynttilä 1.20.0
   - Profiilikohtainen tausta (fit vaihtuu)
   - Admin-esikatselupalkki fronttiin
*/

@font-face {
    font-family: 'UnifrakturCook';
    src: url('../assets/UnifrakturCook-Bold.ttf') format('truetype');
    font-display: swap;
}

/* Google Fonts - Lato modernille sans-serifille */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;600;700;900&display=swap');

:root {
    --candle-min-scale: .7;
    --candle-max-scale: 1.6;
    --brand: #f5c8d6;
    --ui-text: #fff;
    --modal-bg: rgba(20, 22, 26, 0.88);
    --modal-fg: rgba(248, 240, 230, 0.95);
    --modal-muted: rgba(232, 221, 208, 0.75);
    --flare-top: 14%;
}

html,
body {
    background: #000;
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Koko näytön tila plugin-sivulle */
body.mmk-candle-page,
body.mm-candle-page {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

body.mmk-candle-page #page,
body.mm-candle-page #page,
body.mmk-candle-page .site,
body.mm-candle-page .site,
body.mmk-candle-page .site-content,
body.mm-candle-page .site-content,
body.mmk-candle-page main,
body.mm-candle-page main {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.wp-muistomaisema-kynttila {
    position: relative;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: visible;
    /* MUUTOS: sallitaan kuplan mennä yli reunoista */
    font-family: 'UnifrakturCook', serif;
    background: #000;
}

/* Scene */
#scene {
    position: relative;
    width: 100%;
    overflow: visible;
    /* MUUTOS: estää puhekuplan leikkautumisen */
    margin: 0 auto;
    cursor: url('../assets/cursor-kyyhky.png') 16 16, auto;
    /* CLS-ongelman korjaus: kiinteä aspect-ratio estää layout shiftin */
    aspect-ratio: 3 / 2;
    min-height: 50vh;
}

#scene>img#scene-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* profiili voi muuttaa JS:llä */
    display: block;
    z-index: 0;
    user-select: none;
    pointer-events: none;
    /* CLS-ongelman korjaus: kiinteä koko estää layout shiftin */
    min-height: 50vh;
}

/* Kynttilä */
.candle {
    position: absolute;
    width: 64px;
    transform: translate(-50%, -100%);
    cursor: grab;
    z-index: 2;
    outline: none;
}

.candle.locked {
    cursor: default;
}

.candle.active-bubble {
    z-index: 12000 !important;
}

.candle:hover {
    z-index: 12000;
}

.candle .scale-wrap {
    position: relative;
    z-index: 1;
    transform-origin: center bottom;
    transform: scale(var(--scale, 1));
    will-change: transform;
    overflow: visible;
}

.candle .scale-wrap img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    pointer-events: none;
}

/* Liekki & hehku */
.candle.lit .scale-wrap img {
    animation: lively-flicker 1.15s ease-in-out infinite, sway 2.6s ease-in-out infinite;
    transform-origin: 50% 95%;
}

@keyframes lively-flicker {

    0%,
    100% {
        filter: brightness(1)
    }

    50% {
        filter: brightness(1.08)
    }
}

@keyframes sway {

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

    50% {
        transform: rotate(-0.4deg)
    }
}

.candle.lit .scale-wrap::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -60%);
    width: var(--mmk-glow-size, 150px);
    height: var(--mmk-glow-size, 150px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 235, 170, calc(var(--mmk-glow-intensity, 0.6) * 0.55)) 0%, rgba(255, 200, 100, calc(var(--mmk-glow-intensity, 0.6) * 0.2)) 42%, transparent 68%);
    filter: blur(var(--mmk-glow-blur, 15px));
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: screen;
    animation: glow-breathe var(--glow-dur, 1.9s) ease-in-out infinite;
    animation-delay: var(--glow-delay, 0s);
}

/* Kultakynttilöiden hehku - sama kuin maksuttomissa */
.candle-premium.lit .scale-wrap::after {
    width: var(--mmk-glow-size, 150px);
    height: var(--mmk-glow-size, 150px);
    background: radial-gradient(circle, rgba(255, 235, 170, calc(var(--mmk-glow-intensity, 0.6) * 0.55)) 0%, rgba(255, 200, 100, calc(var(--mmk-glow-intensity, 0.6) * 0.2)) 42%, transparent 68%);
    filter: blur(var(--mmk-glow-blur, 15px));
    animation: glow-breathe var(--glow-dur, 1.9s) ease-in-out infinite;
    animation-delay: var(--glow-delay, 0s);
}

/* Glitteri poistettu kokonaan */
.candle-premium.lit .scale-wrap::before {
    display: none;
}

@keyframes gold-sparkle {

    0%,
    100% {
        opacity: .85;
        transform: translate(-50%, -60%) scale(1) rotate(0deg);
    }

    25% {
        opacity: 1;
        transform: translate(-50%, -62%) scale(1.05) rotate(2deg);
    }

    50% {
        opacity: .9;
        transform: translate(-50%, -58%) scale(1.02) rotate(-1deg);
    }

    75% {
        opacity: .95;
        transform: translate(-50%, -61%) scale(1.03) rotate(1deg);
    }
}

@keyframes gold-sparkle-move-slow {

    0%,
    100% {
        background-position: 0 0;
        transform: translate(-50%, -60%) rotate(0deg);
    }

    25% {
        background-position: 2px 1px;
        transform: translate(-50%, -60%) rotate(1deg);
    }

    50% {
        background-position: -1px 2px;
        transform: translate(-50%, -60%) rotate(-0.5deg);
    }

    75% {
        background-position: 1px -1px;
        transform: translate(-50%, -60%) rotate(0.5deg);
    }
}

@keyframes gold-sparkle-twinkle-individual {

    0%,
    100% {
        opacity: 0;
        filter: brightness(0);
    }

    10% {
        opacity: 1;
        filter: brightness(1.5);
    }

    20% {
        opacity: .3;
        filter: brightness(0.5);
    }

    30% {
        opacity: 1;
        filter: brightness(1.8);
    }

    40% {
        opacity: 0;
        filter: brightness(0);
    }

    50% {
        opacity: .8;
        filter: brightness(1.3);
    }

    60% {
        opacity: 0;
        filter: brightness(0);
    }

    70% {
        opacity: 1;
        filter: brightness(1.6);
    }

    80% {
        opacity: .2;
        filter: brightness(0.4);
    }

    90% {
        opacity: 1;
        filter: brightness(1.7);
    }
}

@keyframes glow-breathe {
    0% {
        opacity: .78;
        transform: translate(-50%, -60%) scale(1)
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -62%) scale(1.06)
    }

    100% {
        opacity: .78;
        transform: translate(-50%, -60%) scale(1)
    }
}

/* Posahdus */
.candle.just-lit .scale-wrap::before {
    content: '';
    position: absolute;
    left: 50%;
    top: var(--flare-top);
    transform: translate(-50%, -50%) scale(.6);
    width: 110px;
    height: 140px;
    border-radius: 52% 52% 56% 56% / 60% 60% 46% 46%;
    background:
        radial-gradient(60% 55% at 50% 42%, rgba(255, 247, 210, .95), rgba(255, 215, 140, 0) 68%),
        radial-gradient(70% 62% at 50% 55%, rgba(255, 208, 140, .55), rgba(255, 208, 140, 0) 74%),
        radial-gradient(40% 45% at 50% 55%, rgba(255, 255, 230, .35), rgba(255, 255, 230, 0) 70%);
    filter: blur(.8px);
    pointer-events: none;
    z-index: 2;
    animation: flare-teardrop 1.4s ease-out forwards;
}

@keyframes flare-teardrop {
    0% {
        opacity: .9;
        transform: translate(-50%, -50%) scale(.6)
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -66%) scale(1.1)
    }
}

/* Opasterengas */
.candle.just-born {
    animation: pop-in .28s ease-out both;
}

@keyframes pop-in {
    0% {
        opacity: 0;
        transform: translate(-50%, -116%) scale(.9)
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -100%) scale(1)
    }
}

.candle .place-halo {
    position: absolute;
    left: 50%;
    bottom: 50%;
    transform: translate(-50%, 50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, .9);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, .1), 0 0 20px rgba(255, 200, 100, .3);
    pointer-events: none;
    z-index: 13001;
    opacity: .95;
    animation: halo-blink 1s ease-in-out infinite;
}

@keyframes halo-blink {

    0%,
    100% {
        opacity: .85;
        filter: drop-shadow(0 0 12px rgba(255, 255, 255, .4)) drop-shadow(0 0 20px rgba(255, 200, 100, .3));
        transform: translate(-50%, 50%) scale(1);
    }

    50% {
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, .8)) drop-shadow(0 0 30px rgba(255, 200, 100, .6));
        transform: translate(-50%, 50%) scale(1.08);
    }
}

/* Kipinät */
.candle .scale-wrap .sparks {
    position: absolute;
    left: 50%;
    top: var(--flare-top);
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 3
}

.candle:not(.lit) .scale-wrap .sparks {
    display: none
}

.candle .scale-wrap .sparks i {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 240, 180, .98);
    box-shadow: 0 0 6px rgba(255, 220, 140, .9);
    opacity: 0;
    transform: translate(-2px, 0) scale(.7);
}

@keyframes spark {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(.6)
    }

    10% {
        opacity: 1
    }

    60% {
        opacity: .95
    }

    100% {
        opacity: 0;
        transform: translate(var(--sx, -6px), var(--sy, -28px)) scale(1)
    }
}

/* Kupla – a11y apuluokka */
.candle .engrave {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

/* Puhekupla – oletus: YLÄPUOLELLE */
.memo-bubble {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    /* kupla kynttilän yläpuolelle */
    top: auto;
    transform: translateX(-50%) scale(.98);
    max-width: min(90vw, 560px);
    min-width: 120px;
    width: max-content;
    /* skaalautuu näytön mukaan */
    padding: 18px 18px 16px;
    color: #141518;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
    font-family: 'UnifrakturCook', serif;
    font-size: 16px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    z-index: 13000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, max-width .16s ease, min-width .16s ease;
}

.memo-bubble--short {
    max-width: min(90vw, 320px);
    min-width: 140px;
}

.memo-bubble--medium {
    max-width: min(92vw, 460px);
    min-width: 240px;
}

.memo-bubble--long {
    max-width: min(94vw, 620px);
    min-width: 320px;
}

.memo-bubble--xlong {
    max-width: min(96vw, 760px);
    min-width: 400px;
}

/* Kuplan nuoli – oletus */
.memo-bubble::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    /* nuoli alareunassa, osoittaa kynttilään */
    top: auto;
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: #fff;
    border-left: 1px solid rgba(0, 0, 0, .06);
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 2px 2px 12px rgba(0, 0, 0, .08);
    border-bottom-left-radius: 3px;
}

/* Näytä kupla */
.candle:hover .memo-bubble,
.candle.active-bubble .memo-bubble {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* FLIP: jos tila ylhäällä ei riitä, käännä kupla ALAS */
.candle.flip-bubble .memo-bubble {
    top: calc(100% + 10px);
    /* kupla kynttilän alapuolelle */
    bottom: auto;
}

.candle.flip-bubble .memo-bubble::after {
    top: -8px;
    /* nuoli kuplan yläreunassa */
    bottom: auto;
    transform: translateX(-50%) rotate(225deg);
}

/* ==== Alavalikko ==== */
.bottom-menu {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 20px) + 50px);
    left: 50%;
    transform: translateX(-50%) translateY(calc(50% + 15px));
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(22, 26, 29, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 10px 18px;
    border-radius: 24px;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    font-family: 'Lato', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--ui-text);
    z-index: 23000;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 0.5px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    /* CLS-ongelman korjaus: kiinteä min-height estää layout shiftin */
    min-height: 44px;
    box-sizing: border-box;
    /* Varmista että elementti varataan tilaa heti */
    content-visibility: auto;
    contain-intrinsic-size: auto 44px;
}

/* Piilota-nappi oikeaan reunaan */
.bottom-menu #hideBtn {
    margin-left: auto;
}

/* Etusivu-nappi ei mene oikeaan reunaan */
.bottom-menu a.bm-btn[href*="/"] {
    margin-left: 0;
}

.bm-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 0.5px solid rgba(255, 255, 255, 0.08) !important;
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 1);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease !important;
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
    will-change: auto !important;
    backface-visibility: hidden !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    contain: layout style paint;
    isolation: isolate;
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(251, 191, 36, 0.3);
}

.bm-btn:hover,
.bm-btn:active,
.bm-btn:focus {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.4);
    color: rgba(255, 255, 255, 1);
    transform: translateY(-1px) !important;
    box-shadow:
        0 4px 12px rgba(251, 191, 36, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease !important;
}

.bm-btn svg.feather {
    width: 18px;
    height: 18px;
    display: inline-block;
    flex: 0 0 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2px;
}

.bm-btn .candle-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    flex: 0 0 18px;
    fill: currentColor;
    stroke: none;
}

.bm-btn span {
    white-space: nowrap;
}

.bm-btn[aria-pressed="true"],
.bm-btn.is-active {
    background: rgba(251, 191, 36, 0.25);
    border-color: rgba(251, 191, 36, 0.5);
    color: rgba(255, 255, 255, 1);
    box-shadow:
        0 2px 8px rgba(251, 191, 36, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ==== InfoBox ==== */
/* InfoBox käyttää nyt mmodal-rakennetta, joten se perii automaattisesti mmodal-tyylit */
/* Varmistetaan että infoBox käyttää samoja tyylejä kuin mmodal */

/* Kun InfoBox auki, estä maisema */
body.infobox-open .wp-muistomaisema-kynttila #scene {
    pointer-events: none;
}

/* MenuReopen */
.menu-reopen {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 20px) + 50px);
    left: 50%;
    transform: translateX(-50%) translateY(50%);
    z-index: 24500;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Sama tyyli kuin bottom-menu */
    background: rgba(22, 26, 29, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    pointer-events: auto;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body.ui-hidden .menu-reopen {
    left: calc(env(safe-area-inset-left, 0px) + 20px);
    right: auto;
    bottom: calc(env(safe-area-inset-bottom, 20px) + 50px);
    transform: translateY(50%);
}

.menu-reopen[hidden] {
    display: none !important;
}

.menu-reopen svg {
    width: 22px;
    height: 22px;
}

/* Mobiilissa */
@media (max-width:768px) {
    #scene {
        width: 100vw;
        height: 100vh;
        aspect-ratio: auto !important;
    }

    #scene>img#scene-bg {
        object-fit: cover !important;
    }

    /* JS voi yliajaa profiilin mukaan */

    .bottom-menu {
        bottom: calc(env(safe-area-inset-bottom, 20px) + 50px);
        left: 12px;
        right: auto;
        transform: translateY(calc(50% + 15px));
        gap: 8px;
        padding: 8px 12px;
        flex-wrap: nowrap;
        width: auto;
        max-width: none;
        justify-content: flex-start;
        overflow: hidden;
    }

    /* Piilota-nappi oikeaan reunaan myös mobiilissa */
    .bottom-menu #hideBtn {
        margin-left: auto;
    }

    .bm-btn {
        padding: 8px 10px !important;
        min-width: auto;
    }

    .bm-btn svg,
    .bm-btn .candle-icon {
        width: 20px !important;
        height: 20px !important;
    }

    .bm-btn span {
        display: none;
    }

    /* Näytä ohjeteksti mobiilissa - poistettu display: none */
    #placeBar {
        max-width: calc(100vw - 40px);
        padding: 12px 16px;
    }

    #placeBar .placeBar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    #placeBar .hint {
        font-size: 13px;
        line-height: 1.5;
        max-width: 100%;
        flex: 1;
    }

    #placeBar .mmodal-btn {
        width: 100%;
        justify-content: center;
    }

    .candle {
        width: 48px;
    }

    /* Mobiilin kuplan hienosäätö */
    .memo-bubble {
        max-width: 85vw;
        /* MUUTOS: tiukempi leveysraja mobiilissa */
        line-height: 1.55;
        /* perii nyt font-size:16px ylemmästä säännöstä */
    }
}

/* Laskurit yms. */
#counterBox {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 20px) + 35px);
    right: 20px;
    transform: translateY(calc(50% + 15px));
    background: rgba(0, 0, 0, .58);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
    min-height: 0;
    box-sizing: border-box;
    padding: 5px 10px;
    border-radius: 10px;
    font-family: 'UnifrakturCook', serif;
    font-size: 10px;
    line-height: 1.2;
    z-index: 3100;
    width: max-content;
    max-width: none;
    white-space: nowrap;
}

#counterBox .counter-line {
    margin: 0;
    padding: 0;
    line-height: 1.2;
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0.4em;
    white-space: nowrap;
}

#counterBox .counter-single-line {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0.4em;
    white-space: nowrap;
}

#counterBox .counter-segment {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3em;
    white-space: nowrap;
    flex-shrink: 0;
}

#counterBox .counter-sep {
    opacity: 0.75;
    flex-shrink: 0;
}

/* Varmista että kaikki laskurin elementit käyttävät samaa fonttikokoa */
#counterBox,
#counterBox .label,
#counterBox .total-label,
#counterBox .counter-value,
#counterBox .counter-segment,
#counterBox .counter-mobile,
#counterBox #candleActiveCount,
#counterBox #candleTotalCount,
#counterBox #candleActiveCountMobile,
#counterBox #candleTotalCountMobile {
    font-size: 10px;
}

.mmk-payment-success {
    margin: 0 0 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    background: rgba(72, 140, 88, 0.35);
    border: 1px solid rgba(140, 210, 155, 0.55);
    color: #e8f8ec;
    font-size: 0.95em;
    line-height: 1.4;
}

.mmk-payment-success[hidden] {
    display: none !important;
}

/* Hide mobile version on desktop */
.counter-mobile {
    display: none;
}

/*
 * On narrow screens the site's global navigation plugin may overlap the candle
 * counter. To ensure the navigation remains on top, lower the counter's
 * stacking order on mobile by overriding its z-index. Without this rule the
 * counter (z-index:1100) sits above many mobile nav menus and becomes
 * unreadable or blocks interaction. Reducing the z-index does not affect its
 * visibility because the counter has its own background.
 */
@media (max-width: 768px) {
    #counterBox {
        bottom: calc(env(safe-area-inset-bottom, 20px) + 35px);
        transform: translateY(calc(50% + 25px));
        z-index: 3100;
        /* Korkeampi kuin kynttilöiden maksimi z-index (noin 3000) */
    }

    .menu-reopen {
        bottom: calc(env(safe-area-inset-bottom, 20px) + 50px);
        transform: translateX(-50%) translateY(50%);
        width: 36px;
        height: 36px;
    }

    .menu-reopen svg {
        width: 18px;
        height: 18px;
    }

    body.ui-hidden .menu-reopen {
        bottom: calc(env(safe-area-inset-bottom, 20px) + 50px);
        transform: translateY(50%);
    }

    /* Korjaa hopeisen kortin z-index mobiilissa - varmista että se on ilmaisen yläpuolella */
    .mmodal-choice-card.is-silver.is-primary {
        z-index: 15 !important;
        position: relative;
    }

    /* Varmista että kortit eivät mene päällekkäin mobiilissa */
    .mmodal-choices,
    .mmodal-choice-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    .mmodal-choice-card {
        position: relative !important;
        width: 100% !important;
        transform: none !important;
    }

    .mmodal-choice-card.is-silver.is-primary {
        transform: translateY(0) scale(1) !important;
        z-index: 15 !important;
    }

    /* Korjaa ilmaisen kynttilän napin keskitetty asettelu mobiilissa */
    .mmodal-choice-card .mmodal-choice-form {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
    }

    /* Ilmaisen kynttilän nappi on suoraan kortin sisällä, ei formin sisällä */
    .mmodal-choice-card.is-free .choice-btn,
    .mmodal-choice-card.is-free #mmodalChooseFree,
    .mmodal-choice-card.is-free .mmodal-btn.choice-btn,
    .mmodal-choice-card.is-free button.mmodal-btn.choice-btn,
    .mmodal-choice-card .choice-btn {
        margin-left: auto !important;
        margin-right: auto !important;
        margin-top: auto !important;
        margin-bottom: 0 !important;
        display: block !important;
        width: 100% !important;
        max-width: 260px !important;
    }

    /* Varmista että kortti käyttää flexboxia keskitettyyn asetteluun */
    .mmodal-choice-card.is-free {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    /* Hide desktop version on mobile, show mobile version */
    .counter-desktop {
        display: none;
    }

    .counter-mobile {
        display: inline;
    }
}

/* Share */
.share-sheet[hidden] {
    display: none;
}

.share-sheet {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(0, 0, 0, .35);
    backdrop-filter: none;
}

.share-sheet .sheet {
    width: min(380px, 92vw);
    background: #161a1d;
    color: #e9eef1;
    border-radius: 16px;
    padding: 14px 12px 10px;
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.share-sheet .sheet-title {
    font-weight: 800;
    font-size: 14px;
    margin: 4px 8px 8px;
}

.share-sheet .sheet-btn {
    width: 100%;
    text-align: left;
    background: #1b2125;
    border: none;
    color: #e9eef1;
    padding: 10px 12px;
    border-radius: 12px;
    margin: 6px 6px;
    cursor: pointer;
}

.share-sheet .sheet-btn:hover {
    background: #222a2f;
}

.share-sheet .sheet-close {
    width: 100%;
    background: #c9a882;
    color: #1a1612;
    border: none;
    border-radius: 12px;
    padding: 10px 12px;
    margin: 8px 6px 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background .15s ease, transform .1s ease;
}

.share-sheet .sheet-close:hover {
    background: #b8966f;
    transform: translateY(-1px);
}

/* Modal & Busy & PlaceBar */
.mmodal {
    position: fixed;
    inset: 0;
    z-index: 1300;
}

.mmodal[hidden] {
    display: none;
}

.mmodal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.mmodal-content {
    position: relative;
    z-index: 1;
    width: min(980px, 94vw);
    max-width: 1020px;
    margin: 8vh auto 0;
    /* Glassmorphism: hiukan vähemmän läpinäkyvä -> tekstit helpompi lukea (erityisesti Ohje) */
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    color: var(--modal-fg);
    border-radius: 32px;
    padding: 32px 28px 28px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 0.5px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    font-family: 'Lato', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    border: 0.5px solid rgba(255, 255, 255, 0.14);
    left: auto;
    right: auto;
    margin-left: auto;
    margin-right: auto;
}

.mmodal-content .eyebrow {
    text-transform: none;
    letter-spacing: normal;
    font-size: 12px;
    font-weight: 600;
    color: var(--modal-muted);
    margin-bottom: 6px;
}

/* Suurin otsikko: Sytytä muistokynttilä ja Kultaiset kynttilät */
.compose-panel .eyebrow,
.premium-panel .eyebrow {
    font-size: 28px !important;
    /* Suurin otsikko */
    font-weight: 800 !important;
    letter-spacing: .2px !important;
    color: var(--modal-fg, #e9eef1);
    margin-bottom: 20px !important;
    line-height: 1.2 !important;
}

/* Pääotsikot pop-upissa - Lato modernille designille */
.compose-main-title,
.premium-main-title {
    margin: 0 0 12px;
    font-size: 28px;
    font-family: 'Lato', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    color: var(--modal-fg);
    line-height: 1.2;
    letter-spacing: -.01em;
}

.compose-title-centered {
    text-align: center;
    margin-bottom: 8px;
}

.compose-subtitle {
    margin: 0 0 32px;
    font-size: 15px;
    font-weight: 600;
    color: var(--modal-fg);
    line-height: 1.4;
}

.compose-subtitle-centered {
    text-align: center;
    color: var(--modal-muted, #b8a890);
    font-weight: 500;
    margin-bottom: 32px;
}

.ignite-header {
    text-align: center;
    margin-bottom: 20px;
}

.ignite-header .lede {
    color: var(--modal-muted);
    font-size: 15px;
    margin: 6px auto 0;
    max-width: 420px;
}

.ignite-grid {
    display: grid;
    gap: 24px;
    margin-top: 10px;
    /* YKSI kolumni: ilmainen kynttilä ylhäällä, kultainen laatikko alla */
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width:900px) {
    .ignite-grid {
        /* Pidetään silti yhtenä kolumnina myös leveillä näytöillä */
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }
}

.ignite-panel {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 28px 32px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.compose-panel h3,
.compose-panel h4,
.ignite-panel h3,
.ignite-panel h4 {
    margin: 0 0 16px;
    font-size: 18px;
    /* Pienempi kuin pääotsikko */
    font-weight: 600;
    color: var(--modal-fg);
    line-height: 1.3;
}

.compose-panel .eyebrow {
    margin-bottom: 8px;
}

/* Poistettu compose-free-note, teksti on nyt osa ohjelistaa */

.ignite-panel .hint.small {
    font-size: 13px;
    color: var(--modal-muted);
}

.ignite-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.mmodal-btn.ghost {
    background: rgba(255, 255, 255, 0.08);
    border: none !important;
    color: rgba(246, 248, 249, 0.96);
}

.mmodal-btn.ghost:hover,
.mmodal-btn.ghost:active,
.mmodal-btn.ghost:focus {
    background: rgba(255, 255, 255, 0.14);
    border: none !important;
    box-shadow:
        0 10px 22px rgba(251, 191, 36, 0.26),
        0 18px 44px rgba(251, 191, 36, 0.16);
}


.premium-panel {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    margin-top: 12px;
    border-radius: 24px;
}

/* Premium-osion visuaalinen ankkuri - kultainen viiva otsikon yläpuolella */
.premium-panel::before {
    content: none !important;
    display: none !important;
}


/* Sticky shadow -efekti premium-osiolle scrollatessa */
.premium-panel {
    position: relative;
}

/* Näytä shadow kun scrollataan premium-osiota */
.mmodal-content.scrolling .premium-panel::after {
    opacity: 1;
}

.premium-panel .lead {
    margin-top: .2rem;
    margin-bottom: 1.25rem;
    color: #d8cdc0;
    font-size: 13px;
    line-height: 1.6;
    letter-spacing: .01em;
}

/* Premium-paluu: moderni, rauhallinen lomakekortti - sama tyyli kuin text-panel */
.premium-return {
    display: none;
    /* Sama glassmorphism-tyyli kuin text-panel */
    background: rgba(245, 238, 226, 0.14) !important;
    backdrop-filter: blur(40px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
    border: 0.5px solid rgba(245, 238, 226, 0.14) !important;
    border-radius: 24px;
    padding: 26px 28px;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Maksun jälkeinen kuittaus: ei omaa laatikkoa, vain hillitty rivi */
.premium-return-note {
    margin: 0 0 8px;
    /* Sama väri kuin text-panel tekstit */
    color: var(--modal-fg, #e9eef1) !important;
    font-size: 14px;
    line-height: 1.5;
}


.premium-return h3 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    /* Sama väri kuin text-panel-title */
    color: var(--modal-fg, #e9eef1) !important;
    letter-spacing: -.01em;
    display: flex;
    align-items: center;
    /* Estetään tekstin hyppiminen */
    min-height: 32px;
    line-height: 1.2;
}

.premium-candle-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    /* Estetään SVG-ikonin hyppiminen */
    min-width: 24px;
    min-height: 24px;
    margin-right: 8px;
}

/* (Vanha laatikkovahvistus poistettu käytöstä; jätetään luokat varmuuden vuoksi, mutta ei korosteta) */
.premium-return-confirmation,
.premium-return-confirmation-text,
.premium-candle-icon {
    display: none;
}

.premium-return-thanks {
    /* Sama väri kuin text-panel tekstit */
    color: var(--modal-fg, #e9eef1) !important;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 24px;
    /* Estetään tekstin hyppiminen */
    min-height: 24px;
}

.premium-return-subtitle {
    margin: 0 0 16px;
    font-size: 28px;
    font-weight: 800;
    /* Sama väri kuin text-panel-title */
    color: var(--modal-fg, #e9eef1) !important;
    letter-spacing: .2px;
    line-height: 1.2;
    /* Estetään tekstin hyppiminen */
    min-height: 34px;
}

.premium-return-instruction {
    /* Sama väri kuin text-panel tekstit */
    color: var(--modal-fg, #e9eef1) !important;
    font-size: 14px;
    line-height: 1.6;
    margin: 20px 0 16px;
    /* Estetään tekstin hyppiminen */
    min-height: 44px;
}

.premium-return .mmodal-btn {
    align-self: flex-start;
    margin-top: 0;
    /* Estetään napin hyppiminen */
    min-height: 48px;
    min-width: 200px;
}

.premium-return-text-section {
    margin: 6px 0 0;
}

.premium-return-text-label {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 650;
    /* Sama väri kuin text-panel-title */
    color: var(--modal-fg, #e9eef1) !important;
    letter-spacing: -.01em;

}

.premium-return-text-section textarea {
    width: 100%;
    border-radius: 14px;
    border: 0.5px solid rgba(255, 255, 255, .15) !important;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    color: rgba(255, 255, 255, 0.95);
    padding: 14px 16px;
    font: 15px/1.6 'Lato', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    resize: vertical;
    min-height: 120px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.premium-return-text-section textarea::placeholder,
.premium-return-text-section textarea::-webkit-input-placeholder,
.premium-return-text-section textarea::-moz-placeholder {
    color: #1a1612;
    opacity: 1 !important;
}

.premium-return-text-section textarea:focus {
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow:
        0 0 0 3px rgba(251, 191, 36, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    background: rgba(245, 238, 226, 0.14);
}

.premium-return .return-slot {
    margin: 20px 0;
    /* Varaa tila compose-paneelille etukäteen */
    min-height: 120px;
}

/* Varmista että ohjeistusteksti on nappin yläpuolella (ei kirjoitusikkunan yläpuolella) */
/* Tämä on yhdistetty ylempään .premium-return-instruction -sääntöön */

/* Paluutilassa näytetään premium-return */
body.mmk-premium-return .premium-return {
    display: flex;
    /* Smooth transition kun paneeli avautuu */
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Compose-panel sisällä ilman omaa laatikkokehystä premium-returnin sisällä */
.premium-return .compose-panel {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    /* Estetään layout shift kun compose-panel lisätään */
    min-height: 100px;
    transition: opacity 0.2s ease-in-out;
}

/* Premium-return compose-panel muotoilu */
.premium-return .compose-panel .eyebrow {
    display: none;
}

.premium-return .compose-panel h3 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    /* Sama väri kuin text-panel-title */
    color: var(--modal-fg, #e9eef1) !important;
    /* Estetään tekstin hyppiminen */
    min-height: 22px;
    line-height: 1.3;
}

.premium-return .compose-panel textarea {
    margin-bottom: 0;
    border: 0.5px solid rgba(255, 255, 255, .15) !important;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    color: rgba(255, 255, 255, 0.95);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    /* Estetään textarea:n hyppiminen */
    min-height: 80px;
    transition: all 0.2s ease;
}

.premium-return .compose-panel textarea::placeholder,
.premium-return .compose-panel textarea::-webkit-input-placeholder,
.premium-return .compose-panel textarea::-moz-placeholder {
    color: #1a1612;
    opacity: 1 !important;
}

.premium-return .compose-panel textarea:focus {
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow:
        0 0 0 3px rgba(251, 191, 36, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    background: rgba(245, 238, 226, 0.14);
}

.premium-return .compose-panel .compose-instructions {
    display: none;
}

.premium-return .compose-panel .ignite-actions {
    display: none;
}

/* Erillinen "premium-thanks" piiloon – teksti tulee nyt otsikon alla */
.premium-thanks {
    display: none !important;
}

/* Selkeä ohjerivi premium-paluuun (lisätään HTML:ssä luokalla .mmk-premium-return-instruction) */
.mmk-premium-return-instruction {
    margin-top: 6px;
    /* Sama väri kuin text-panel tekstit */
    color: var(--modal-fg, #e9eef1) !important;
    font-size: 14px;
    line-height: 1.55;
}

/* Premium-valinnat listana - yhtenäinen lista */
.mmodal-premium-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid rgba(180, 165, 140, .12);
    border-bottom: 1px solid rgba(180, 165, 140, .12);
}

/* Premium-vaihtoehdot: elegantti lista-tyyli */
.mmodal-premium-grid {
    margin-top: 10px;
    /* Ekstra-tyhjää tilaa yläpuolelle */
}

.mmodal-premium-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: none;
    border-left: 0.5px solid rgba(255, 255, 255, .1);
    border-bottom: 0.5px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 18px 16px 18px 16px;
    margin: 8px 0;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    cursor: default;
    transition: all 0.3s ease;
}

.mmodal-premium-card:first-child {
    border-top: 1px solid rgba(180, 165, 140, .08);
    /* Ylin viiva himpun tummempi */
}

.mmodal-premium-card:last-child {
    border-bottom: none;
}

.mmodal-premium-card:hover {
    background: rgba(25, 22, 18, .4);
    transform: none;
    border-color: rgba(200, 185, 160, .15);
    box-shadow: none;
}

.premium-chip {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #d0c0a8;
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 3px;
    letter-spacing: .01em;
}

.premium-desc {
    color: #b8a890;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: .005em;
}

.premium-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.premium-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #f8e8d3;
    margin-bottom: .25rem;
}

.premium-list li::before {
    content: '✦';
    color: #ffd28e;
    font-size: 12px;
    margin-top: 2px;
}

.mmodal-content h3 {
    margin: 0 0 18px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: .2px;
}

.mmodal-steps {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mmodal-steps .step {
    display: none;
    margin: 0 0 14px;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.mmodal-steps .step:first-child {
    border-top: none;
    padding-top: 0;
}

/* Remove decorative border from step-2 (text-panel) and step-3 */
.mmodal-steps .step.step-2,
.mmodal-steps .step.step-3 {
    border-top: none !important;
    padding-top: 0;
}

/* Also remove any decorative lines from text-panel itself */
.text-panel::before,
.text-panel::after,
.ignite-panel.text-panel::before,
.ignite-panel.text-panel::after,
.compose-panel.text-panel::before,
.compose-panel.text-panel::after {
    content: none !important;
    display: none !important;
}

.mmodal-steps .step.active {
    display: block;
}

/* Step-2: Muistosanojen kirjoitus */
.text-panel {
    /* Sama glassmorphism-tyyli kuin päämodaalissa */
    background: rgba(245, 238, 226, 0.14);
    backdrop-filter: blur(40px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
    border: 0.5px solid rgba(245, 238, 226, 0.14) !important;
    border-radius: 24px;
    padding: 26px 28px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Step-2: varaa tilaa sulje-napille, ettei se mene textarea-alueen päälle */
#igniteModal .step-2 .text-panel {
    padding-top: 64px;
}

/* Tiivistä ohjetekstien väliä (kaksi peräkkäistä riviä) */
#igniteModal .mmk-compose-help {
    margin: 10px 0;
}

#igniteModal .mmk-compose-help+.mmk-compose-help {
    margin-top: 4px;
}

.text-panel-title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 650;
    color: var(--modal-fg, #e9eef1);
    text-align: left;
    letter-spacing: -.01em;
}

.text-panel textarea {
    margin-bottom: 14px;
    border: 0.5px solid rgba(255, 255, 255, .15) !important;
    background: rgba(36, 48, 52, 0.72);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: rgba(255, 255, 255, 0.95);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.text-panel textarea::placeholder,
.text-panel textarea::-webkit-input-placeholder,
.text-panel textarea::-moz-placeholder,
#engraveInputModalStep2::placeholder,
#engraveInputModalStep2::-webkit-input-placeholder,
#engraveInputModalStep2::-moz-placeholder,
#engraveInputModalReturn::placeholder,
#engraveInputModalReturn::-webkit-input-placeholder,
#engraveInputModalReturn::-moz-placeholder {
    color: #000;
    opacity: 1 !important;
}

.text-panel textarea:focus {
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow:
        0 0 0 3px rgba(251, 191, 36, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    background: rgba(245, 238, 226, 0.14);
}

/* Pop-up button system (single source of truth)
   - One button style for all modal/placebar actions
   - No !important for colors (cascade handles it)
*/
.mmodal-btn,
#placeBar .mmodal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    /* Ei erillistä reunusta */
    border: none;
    border-radius: 9999px;
    padding: 12px 24px;

    cursor: pointer;

    /* A-vaihtoehto: hillitty tumma teal, sopii maisemaan */
    background: rgba(45, 72, 78, 0.86);
    color: rgba(246, 248, 249, 0.96);

    font-family: 'Lato', system-ui, -apple-system, sans-serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .01em;

    text-shadow: none;

    /* Ei vaaleaa "reunaa" (poistetaan inset-highlight) */
    box-shadow:
        0 10px 26px rgba(0, 0, 0, 0.26);

    transition:
        background-color .22s ease,
        box-shadow .22s ease,
        transform .12s ease,
        color .22s ease;
}

.mmodal-btn:hover,
#placeBar .mmodal-btn:hover,
.mmodal-btn:active,
#placeBar .mmodal-btn:active,
.mmodal-btn:focus,
#placeBar .mmodal-btn:focus {
    background: rgba(58, 90, 96, 0.92);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.30),
        /* pieni kultainen hehku napin alla */
        0 10px 22px rgba(251, 191, 36, 0.30),
        0 18px 44px rgba(251, 191, 36, 0.18);
    transform: translateY(-1px);
}

/* Varmista ettei mikään perintö-tyyli piirä vaaleaa reunusta */
.mmodal-btn,
#placeBar .mmodal-btn {
    outline: none;
}

/* Joissain vaiheissa käytössä on vielä bm-btn: normalisoidaan se samaan tyyliin */
.bm-btn {
    border: none !important;
    outline: none;
    border-radius: 9999px;
    box-shadow: none;
}

.bm-btn:hover,
.bm-btn:active,
.bm-btn:focus {
    /* jos bm-btn:ää käytetään toimintanappina, anna sama hover-hehku */
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.30),
        0 10px 22px rgba(251, 191, 36, 0.30),
        0 18px 44px rgba(251, 191, 36, 0.18);
}

.mmodal-btn:active,
#placeBar .mmodal-btn:active {
    transform: translateY(0);
}

/* Keep semantic classes but do not change colors */
.mmodal-btn.primary,
.mmodal-btn.choice-btn,
.mmodal-btn.gold {
    background: inherit;
    color: inherit;
}

/* Choice card buttons: same size + centered */
.mmodal-choice-card .mmodal-btn.choice-btn,
.mmodal-choice-card button.mmodal-btn.choice-btn {
    width: 100%;
    max-width: 260px;
    margin: 16px auto 0;
    display: block;
}

.mmodal-choice-form {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Text-step & premium-return action buttons: same size + centered */
.text-panel .mmodal-btn,
.premium-return .mmodal-btn {
    width: 100%;
    max-width: 260px;
    margin: 16px auto 0;
    display: block;
}

/* --- end button system --- */

.mmodal-steps p {
    margin: .35rem 0 .8rem;
    color: var(--modal-fg, #e9eef1);
    /* MUUTOS 2.11.2025: Kirkastettu teksti (oli --modal-muted) */
    font-size: 15px;
    line-height: 1.55;
}

/* Sytytysvaiheen ohjeteksti */
.place-instruction {
    margin: 0 0 24px;
    padding: 18px 24px;
    background: rgba(11, 13, 17, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.place-instruction-text {
    margin: 0;
    color: var(--modal-fg, #e9eef1);
    font-size: 15px;
    line-height: 1.7;
    font-weight: 500;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100%;
    display: block;
    overflow: visible;
}

.place-instruction-note {
    margin: 8px 0 0;
    color: var(--modal-muted, #b8a890);
    font-size: 13px;
    line-height: 1.6;
    font-style: italic;
}

.mmodal label {
    display: block;
    margin: .25rem 0 .5rem;
    font-weight: 600;
    color: #f0f3f5;
}

.mmodal textarea {
    width: 100%;
    border-radius: 12px;
    border: 0.5px solid rgba(255, 255, 255, .15) !important;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    color: rgba(255, 255, 255, 0.95);
    padding: 16px 18px;
    font: 15px/1.6 'Lato', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    outline: none;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.mmodal textarea::placeholder,
.mmodal textarea::-webkit-input-placeholder,
.mmodal textarea::-moz-placeholder {
    color: #1a1612;
    opacity: 1 !important;
}

.mmodal textarea:focus {
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow:
        0 0 0 3px rgba(251, 191, 36, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    background: rgba(245, 238, 226, 0.14);
}


.mmodal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    z-index: 10000 !important;
    /* Varmistetaan että nappi on näkyvissä ja viivojen yläpuolella */
    pointer-events: auto !important;
    /* Varmistetaan että nappi on klikattavissa */
    user-select: none;
    -webkit-user-select: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    /* Varmistetaan että nappi on helposti klikattavissa */
    min-width: 40px;
    min-height: 40px;
}

.busy {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: none;
}

.busy[hidden] {
    display: none;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .9s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.busy-text {
    color: #fff;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#placeBar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    top: 50%;
    z-index: 15000;
    /* Sama glassmorphism-tyyli kuin päämodaalissa */
    background: rgba(245, 238, 226, 0.14);
    backdrop-filter: blur(40px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
    color: rgba(255, 255, 255, 1);
    border-radius: 24px;
    padding: 16px 20px;
    font-family: 'Lato', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 0.5px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
}

#placeBar[hidden] {
    display: none;
}

#placeBar .placeBar-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

#placeBar .hint {
    opacity: .95;
    font-size: 14px;
    line-height: 1.45;
    max-width: min(720px, 76vw);
    white-space: normal;
    overflow: visible;
    text-align: center;
}

/* UI piilossa */
body.ui-hidden .bottom-menu {
    display: none !important;
}

body.mmodal-open .wp-muistomaisema-kynttila #scene {
    pointer-events: none;
    /* Ei blurria: yhdessä backdrop-filterin kanssa aiheuttaa välkkymistä kirjoituksen aikana */
    filter: none;
    opacity: 0.94;
}

/* Liikeherkkyys */
@media (prefers-reduced-motion: reduce) {

    .candle.lit .scale-wrap img,
    .candle .place-halo,
    .candle .scale-wrap::after {
        animation: none;
    }
}

/*
 * Force candle flames to animate even when the user has enabled reduced motion.
 * Some mobile operating systems default to prefers-reduced-motion, which stops
 * our flicker and sway animations completely. To ensure the memorial scene
 * remains lively, override the reduced motion setting for our flame images.
 * Some mobile environments set this flag by default, which stopped the
 * candle flames and halo animations completely.
 */
@media (prefers-reduced-motion: reduce) {

    /* Liekkianimaatio */
    .candle.lit .scale-wrap img {
        animation: lively-flicker 1.15s ease-in-out infinite, sway 2.6s ease-in-out infinite !important;
    }

    /* Hehku */
    .candle.lit .scale-wrap::after {
        animation: glow-breathe var(--glow-dur, 1.9s) ease-in-out infinite !important;
    }

    /* Halorengas */
    .candle .place-halo {
        animation: halo-blink 1.4s ease-in-out infinite !important;
    }
}

/* Vanhat infoBox-säännöt poistettu - käytetään myöhempiä, selkeämpiä sääntöjä */

/* MUUTOS 2.11.2025: Kirkastettu hint-teksti modaalissa */
.mmodal .hint {
    color: var(--modal-fg, #e9eef1);
}

.candle.auto-placed .scale-wrap {
    animation: auto-placed-pulse .8s ease-in-out 1;
}

@keyframes auto-placed-pulse {
    0% {
        transform: scale(var(--scale, 1));
        filter: brightness(1);
    }

    50% {
        transform: scale(calc(var(--scale, 1)*1.04));
        filter: brightness(1.06);
    }

    100% {
        transform: scale(var(--scale, 1));
        filter: brightness(1);
    }
}

.candle .place-halo.fade-out {
    animation: halo-fade .9s ease forwards;
}

@keyframes halo-fade {
    to {
        opacity: 0;
        transform: translate(-50%, 50%) scale(1.08);
    }
}

/* ===== Frontti-esikatselupalkki (vain adminille HTML:ssä) ===== */
#mm-preview-bar {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 26000;
    background: #161a1d;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .18);
    padding: 8px 10px;
    border-radius: 12px;
    font: 13px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === UI Parannukset ===
 *  - Piilota tekstikenttien oletuksena näkyvät kulmakahvat (Chrome) poistamalla resize.
 */
textarea {
    resize: none !important;
}

#mm-preview-bar select,
#mm-preview-bar button {
    background: #1b2125;
    color: #e9eef1;
    border: 1px solid rgba(255, 255, 255, .15);
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
}

#mm-preview-bar button[data-reset] {
    background: #c9a882;
    color: #1a1612;
    border: none;
    font-weight: 600;
}



/* === Muistomaisema – Kontrasti- ja saavutettavuusparannukset === */
/* HUOM: Nämä säännöt (rivit 530-684) eivät näytä vastaavan HTML:n ID:itä/luokkia */
/* (esim. .mm-modal vs .mmodal) ja ne on ylikirjoitettu joka tapauksessa. */
/* Jätetään ne kuitenkin tiedostoon, jos niillä on jokin muu tarkoitus. */

/* InfoBox, tekstikuplat ja modaalien tekstit: varmista väh. AA-kontrasti */
.mmk-infobox,
.mmk-infobox *,
.mm-engrave-bubble,
.mm-engrave-bubble *,
.mm-toast,
.mm-modal,
.mm-modal *,
.mm-bottom-menu,
.mm-bottom-menu * {
    color: #0B0B0C;
    /* lähes musta */
}

.mmk-infobox,
.mm-engrave-bubble,
.mm-toast,
.mm-modal {
    background: rgba(245, 238, 226, 0.14);
    /* Sama glassmorphism-tyyli kuin päämodaalissa */
    backdrop-filter: blur(40px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
    border: 0.5px solid rgba(245, 238, 226, 0.14) !important;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 0.5px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Painikkeet (CTA) */
.mmk-btn,
.mm-action-btn,
.mm-bottom-menu .mmk-btn {
    /* Muistomaisema: hillitty kynttilänhehku (ei "mainos-CTA") */
    background: rgba(230, 200, 160, 0.85);
    color: #1c1c1c;
    border: 2px solid rgba(210, 175, 130, 0.90) !important;
    transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.mmk-btn:focus,
.mmk-btn:hover,
.mm-action-btn:focus,
.mm-action-btn:hover {
    background: rgba(240, 215, 175, 0.95);
    border-color: rgba(220, 185, 140, 0.95);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    outline: 3px solid #FEBB2A !important;
    /* selkeä focus-tila */
    outline-offset: 2px;
}

/* Sekundaaripainike */
.mmk-btn--secondary,
.mm-action-btn--ghost {
    background: #FFFFFF;
    color: #0B0B0C;
    border: 2px solid #6A6D75 !important;
}

/* Input-kentät kuplassa */
.mm-engrave-bubble input[type="text"],
.mm-engrave-bubble textarea,
.mm-modal input[type="text"],
.mm-modal textarea {
    background: #FFFFFF;
    color: #0B0B0C;
    border: 2px solid #6A6D75 !important;
}

.mm-engrave-bubble input::placeholder,
.mm-engrave-bubble textarea::placeholder {
    color: #545760;
}

/* Vahvat varjot tekstien taakse kun tausta on kirkas */
.mm-landscape .mm-overlay-text,
.mm-landscape .mm-overlay-label {
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

/* Skip-link näkyvyys fokuksessa */
.skip-link:focus,
.screen-reader-text:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    clip-path: none !important;
    padding: .5rem 1rem;
    border: 2px solid #0B5FFF;
    z-index: 100000;
    background: #fff;
    color: #0B0B0C;
}

/* Bottom menu tausta riittävällä kontrastilla */
.mm-bottom-menu {
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(0, 0, 0, .12);
}

/* Ohjenappi / piilota-nappi ikonikontrasti */
.mm-bottom-menu .mm-icon-btn svg,
.mm-bottom-menu .mm-icon-btn {
    color: #0B0B0C;
    fill: currentColor !important;
}

/* === Muistomaisema – Hover pinkki & kontrasti (AA) === */

/* Primaari: sininen perus, valkoinen teksti */
.mmk-btn,
.mm-action-btn,
.mm-bottom-menu .mmk-btn {
    background: #0B5FFF;
    color: #FFFFFF;
    border: 2px solid #0847C6 !important;
}

/* Hover: tumma vaaleanpunainen */
.mmk-btn:hover,
.mm-action-btn:hover,
.mm-bottom-menu .mmk-btn:hover {
    background: #B0004E;
    /* pink hover */
    border-color: #8C0040;
    color: #FFFFFF;
}

/* Focus-tila selkeästi erottuva */
.mmk-btn:focus,
.mm-action-btn:focus,
.mm-bottom-menu .mmk-btn:focus {
    outline: 3px solid #FEBB2A !important;
    outline-offset: 2px;
}

/* Sekundaaripainike */
.mmk-btn--secondary,
.mm-action-btn--ghost {
    background: #FFFFFF;
    color: #0B0B0C;
    border: 2px solid #6A6D75 !important;
}

.mmk-btn--secondary:hover,
.mm-action-btn--ghost:hover {
    background: #F6F7F9;
    border-color: #545760;
}

/* Tekstikuplat / modaalit: tumma teksti vaalealla */
.mmk-infobox,
.mm-engrave-bubble,
.mm-toast,
.mm-modal {
    background: #FFFFFFE6;
    color: #0B0B0C;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}

.mmk-infobox *,
.mm-engrave-bubble *,
.mm-toast *,
.mm-modal * {
    color: #0B0B0C;
}

/* Syötekentät */
.mm-engrave-bubble input[type="text"],
.mm-engrave-bubble textarea,
.mm-modal input[type="text"],
.mm-modal textarea {
    background: #FFFFFF;
    color: #0B0B0C;
    border: 2px solid #6A6D75 !important;
}

.mm-engrave-bubble input::placeholder,
.mm-engrave-bubble textarea::placeholder {
    color: #545760;
}

/* Skip-link fokusvarmistus */
.skip-link:focus,
.screen-reader-text:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    clip-path: none !important;
    padding: .5rem 1rem;
    border: 2px solid #0B5FFF;
    z-index: 100000;
    background: #fff;
    color: #0B0B0C;
}

/* Alavalikon tausta */
.mm-bottom-menu {
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(0, 0, 0, .12);
}

/* Ikonit tummiksi */
.mm-bottom-menu .mm-icon-btn svg,
.mm-bottom-menu .mm-icon-btn {
    color: #0B0B0C;
    fill: currentColor !important;
}


/* A11y: screen-reader-only heading */
.screen-reader-text {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
}

/* Hide theme footer when candle UI is present */
body.mmk-candle-page #colophon,
body.mmk-candle-page footer.site-footer,
body.mmk-candle-page .site-footer,
body.mmk-candle-page nav[role="navigation"][aria-label*="Footer"],
body.mmk-candle-page .footer-widgets {
    display: none !important;
}

/* Laskuri: yksi rivi, kiinteä pieni fontti (ei clamp-skaalausta) */
body.mmk-candle-page #counterBox,
body.mmk-candle-page #counterBox .label,
body.mmk-candle-page #counterBox .total-label,
body.mmk-candle-page #counterBox .counter-value,
body.mmk-candle-page #counterBox .counter-segment,
body.mmk-candle-page #counterBox .counter-line,
body.mmk-candle-page #counterBox #candleActiveCount,
body.mmk-candle-page #counterBox #candleTotalCount {
    font-size: 10px;
    white-space: nowrap;
}

body.mmk-candle-page #counterBox {
    width: max-content;
    max-width: none;
}

body.mmk-candle-page #counterBox .counter-line {
    display: flex;
    flex-wrap: nowrap;
}

/* Slightly larger speech bubble text */
.speech-bubble,
.speech-bubble p,
.bubble-text,
.mm-bubble {
    font-size: clamp(14px, 2vw, 18px);
    line-height: 1.45;
}

/* Hide visual page title on candle page; accessible H1 is injected separately */
body.mmk-candle-page .entry-title,
body.mmk-candle-page .page-title,
body.mmk-candle-page header.entry-header {
    display: none !important;
}

/* Piilota headerit koko näytön tilassa */
body.mmk-candle-page header.site-header,
body.mmk-candle-page .site-header,
body.mmk-candle-page header[role="banner"],
body.mmk-candle-page .wp-block-site-header,
body.mmk-candle-page nav[role="navigation"]:not([aria-label*="Footer"]),
body.mmk-candle-page .main-navigation,
body.mmk-candle-page .site-navigation,
body.mmk-candle-page .site-branding,
body.mmk-candle-page .site-title,
body.mmk-candle-page .site-description,
body.mmk-candle-page .main-header,
body.mmk-candle-page .header-main,
body.mmk-candle-page .site-header-wrapper,
body.mmk-candle-page .header-wrapper,
body.mmk-candle-page .navbar,
body.mmk-candle-page .navigation,
body.mmk-candle-page .primary-menu,
body.mmk-candle-page .menu-primary,
body.mmk-candle-page .main-menu,
body.mmk-candle-page #masthead,
body.mmk-candle-page #header,
body.mmk-candle-page .header,
body.mmk-candle-page .top-bar,
body.mmk-candle-page .topbar,
body.mmk-candle-page .admin-bar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Varmista että scene täyttää koko näytön */
body.mmk-candle-page #scene {
    height: 100vh;
    min-height: 100vh;
}

/* Ordered step list styling */
.ignite-steps {
    margin: 0 0 1rem 1.25rem;
    padding: 0;
}

.ignite-steps li {
    margin: 0.25rem 0;
}

/* Kynttiläsymboli ohjetekstissä */
.ignite-steps li svg {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    width: 18px;
    height: 18px;
}


/* === InfoBox (uusi rakenteellinen versio käyttää mmodal-tyylejä) === */
/* InfoBox käyttää nyt mmodal-rakennetta, joten se perii automaattisesti mmodal-tyylit */
/* Varmistetaan että kaikki tekstit ovat valkoisia ja valittavissa */
#infoBox.mmodal .mmodal-content,
#infoBox.mmodal .mmodal-content * {
    color: var(--modal-fg, #ffffff);
    user-select: text !important;
    -webkit-user-select: text !important;
    pointer-events: auto !important;
    /* Varmistetaan terävä teksti mobiilissa */
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    transform: translateZ(0) !important;
    /* Hardware acceleration ilman blur-efektiä */
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
}

#infoBox.mmodal .mmodal-content p,
#infoBox.mmodal .mmodal-content li,
#infoBox.mmodal .mmodal-content .hint,
#infoBox.mmodal .mmodal-content .ignite-steps,
#infoBox.mmodal .mmodal-content .ignite-steps li {
    color: var(--modal-fg, #ffffff);
    font-size: 15px !important;
    line-height: 1.65 !important;
}

#infoBox.mmodal .mmodal-content p:first-child strong {
    font-size: 18px !important;
    font-weight: 700 !important;
    margin-bottom: 1em !important;
    display: block !important;
}

/* Varmistetaan että infoBox käyttää samoja tyylejä kuin "Sytytä"-modaali */
#infoBox.mmodal .mmodal-content {
    /* Varmistetaan että ei blur-efektiä */
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-filter: none !important;
}

/* Desktopissa infoBoxin sijainti - sama kuin "Sytytä"-modaali */
@media (min-width: 601px) {
    #infoBox.mmodal .mmodal-content {
        margin: 8vh auto 0 !important;
        /* Sama kuin "Sytytä"-modaali */
    }
}

/* Palautetaan maiseman ja alavalikon kirkkaus infoBoxin ollessa auki */
body.infobox-open #scene,
body.infobox-open .bottom-menu {
    opacity: 1 !important;
    filter: none !important;
    backdrop-filter: none !important;
}

/*
 * ===== Modaalien z-index override =====
 * Nostetaan modaalin ja overlay-elementtien tasoja, jotta ne pysyvät aina kynttilöiden ja alavalikon yläpuolella.
 */
/* Sytytä-modaali */
.mmodal {
    z-index: 26000 !important;
}

/* Busy overlay (tallennusruutu) */
.busy {
    z-index: 27000 !important;
}

/* Share-sheet (jakovalinta) */
.share-sheet {
    z-index: 26000 !important;
}

/*
 * ===============================================
 *  Korjaukset 3.11.2025
 *  - Parannetaan InfoBoxin kontrastia ja luettavuutta
 *  - Siirretään navigaatiovalikon silmä-kuvake korkeammalle
 *  - Poistetaan harmaat kolmio-efektit (textarea resize) 
 * ===============================================
 */

/* Vanhat infoBox-säännöt poistettu - käytetään nyt mmodal-rakennetta */

/* MenuReopen (silmä-ikoni) – override height to better align with bottom controls */
.menu-reopen {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 20px) !important;
}

body.ui-hidden .menu-reopen {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 20px) !important;
    left: calc(env(safe-area-inset-left, 0px) + 20px) !important;
    right: auto !important;
    transform: none !important;
}

/* Estä tekstikentän nurkkakahvat (poistaa harmaat kolmiot) */
textarea {
    resize: none;
}

/* Muuta mahdolliset pinkit napit pronssiksi kynttiläsivulla */
body.mm-candle-page button[style*="#f5c8d6"],
body.mm-candle-page button[style*="f5c8d6"],
body.mm-candle-page .button[style*="#f5c8d6"],
body.mm-candle-page .button[style*="f5c8d6"],
body.mm-candle-page .notice button,
body.mm-candle-page .notice .button,
body.mm-candle-page .wp-notice button,
body.mm-candle-page .wp-notice .button {
    background: #c9a882;
    color: #1a1612;
    border-color: #b8966f;
}

body.mm-candle-page button[style*="#f5c8d6"]:hover,
body.mm-candle-page button[style*="f5c8d6"]:hover,
body.mm-candle-page .button[style*="#f5c8d6"]:hover,
body.mm-candle-page .button[style*="f5c8d6"]:hover,
body.mm-candle-page .notice button:hover,
body.mm-candle-page .notice .button:hover,
body.mm-candle-page .wp-notice button:hover,
body.mm-candle-page .wp-notice .button:hover {
    background: #b8966f;
}

/*
 * Takaa, että muistomaisema-sivun tausta on yhtenäisen musta ja
 * peittää selaimen oletustaustan. Joissakin selaimissa ja teemoissa
 * pohja- ja kehyselementit voivat paistaa läpi ruudun alakulmissa
 * muodostaen harmaita kolmioita. Kun body:lle asetetaan täysi
 * taustaväri ja min-height, nämä kolmiot eivät enää näy. Rajoitetaan
 * sääntö vain kynttiläsivulle (mm-candle-page), jotta se ei vaikuta
 * muihin sivuihin.
 */
body.mm-candle-page {
    background-color: #000;
    min-height: 100vh;
}

/* Premium-paneeli (kehysteksti) - elegantti muotoilu */
.premium-panel {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    border-radius: 18px;
    padding: 20px 24px;
}

.premium-panel .lead {
    margin-top: .2rem;
    margin-bottom: 1.25rem;
    color: #d8cdc0;
    font-size: 13px;
    line-height: 1.6;
    letter-spacing: .01em;
}

/* Premium-vaihtoehdot listana - yhtenäinen lista */
.mmodal-premium-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid rgba(180, 165, 140, .12);
    border-bottom: 1px solid rgba(180, 165, 140, .12);
}

/* Yksittäinen kultainen kynttilä -kortti - elegantti lista-tyyli */
.mmodal-premium-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(180, 165, 140, .1);
    border-radius: 0;
    padding: 16px 0;
    box-shadow: none;
    cursor: default;
    transition: background .2s ease;
}

.mmodal-premium-card:last-child {
    border-bottom: none;
}

.mmodal-premium-card:hover {
    background: rgba(25, 22, 18, .4);
    transform: none;
    border-color: rgba(200, 185, 160, .15);
    box-shadow: none;
}

/* Poistetaan radiobutton-pallot kokonaan */
.mmodal-premium-card::before,
.mmodal-premium-card.is-selected::before {
    content: none !important;
}

/* Tekstit kortin vasemmalle puolelle */
.mmodal-premium-card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Jos HTML:ssä ei ole .mmodal-premium-card-text konttia,
   käytetään pelkkää korttia: chip + desc pinoutuvat vierekkäin */
.mmodal-premium-card .premium-chip,
.mmodal-premium-card .premium-desc {
    margin: 0;
}

/* "Kultainen kynttilä 3€" -teksti - elegantti typografia */
.premium-chip {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #d0c0a8;
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 3px;
    letter-spacing: .01em;
}

/* "Palaa kolme vuorokautta" -teksti */
.premium-desc {
    color: #b8a890;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: .005em;
}

/* Mahdollinen bullet-lista (jos käytät) */
.premium-list {
    list-style: none;
    padding: 0;
    margin: .15rem 0 0;
}

.premium-list li {
    font-size: 13px;
    color: #f8e8d3;
    margin-bottom: .15rem;
}

/* Ostonappi kortin oikealle puolelle */
.mmodal-premium-card form {
    margin-left: auto;
}

/* Premium-korttien napit: käytä samaa mmodal-btn -järjestelmää (ei omia värejä/bordereita) */
.mmodal-premium-card .mmodal-btn,
.mmodal-premium-card button.mmodal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-height: 44px;
    min-width: 44px;
    padding: 10px 20px;
}

/* ===== TABLET RESPONSIIVISUUS (768-1024px) ===== */
@media (max-width: 1024px) {
    .mmodal-content {
        margin: 1.5rem 1rem;
        max-height: calc(100vh - 3rem);
    }
}

/* Kultaisten kynttilöiden rivit tabletilla */
@media (max-width: 900px) {
    .mmodal-premium-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .mmodal-premium-card form {
        margin-left: 0;
        align-self: flex-end;
    }
}

/* ===== MOBIILI RESPONSIIVISUUS (alle 768px) ===== */
/* Täysleveä modali mobiilissa */
@media (max-width: 600px) {
    .mmodal-content {
        width: calc(100% - 16px) !important;
        max-width: calc(100% - 16px) !important;
        max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 80px) !important;
        /* Jätä tilaa ylä- ja alareunalle + safe area */
        margin: 0 auto !important;
        /* Keskittää vaakasuunnassa, ei yläreunan marginaalia */
        border-radius: 20px !important;
        overflow-y: auto !important;
        /* Varmista scrollaus */
        -webkit-overflow-scrolling: touch !important;
        /* iOS scrollaus */
        padding: 56px 20px 100px !important;
        /* Lisätty yläreunan padding X-nappia varten, alareunan padding sticky-nappia varten */
        /* Varmista valkoinen teksti mobiilissa */
        color: #ffffff;
        /* Varmistetaan terävä teksti mobiilissa */
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
        text-rendering: optimizeLegibility !important;
        transform: translateZ(0) !important;
        will-change: auto !important;
        /* Varmistetaan että modaali on keskitetty */
        left: auto !important;
        right: auto !important;
    }

    /* Muistosanojen kirjoitus -moodaaleissa poistetaan ulompi glass-tausta mobiilissa
       -> ei kaksinkertaista kehystä/taustaa (mmodal-content + text-panel) */
    #engraveInputModalStep2.mmodal .mmodal-content,
    #engraveInputModalReturn.mmodal .mmodal-content {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        padding: 0 !important;
    }

    /* Varmistetaan että ignite-panel käyttää samoja padding-asetuksia mobiilissa */
    .ignite-panel {
        padding: 24px 20px !important;
        /* Sama kuin mmodal-content padding mobiilissa */
    }

    /* Premium-return mobiilioptimointi */
    .premium-return {
        padding: 20px 16px !important;
        min-height: auto;
        border-radius: 16px;
    }

    .premium-return h3 {
        font-size: 20px !important;
        min-height: 28px;
        margin-bottom: 6px !important;
    }

    .premium-return-thanks {
        font-size: 14px !important;
        margin-bottom: 18px !important;
        min-height: 22px;
    }

    .premium-return-subtitle {
        font-size: 22px !important;
        margin-bottom: 12px !important;
        min-height: 28px;
    }

    .premium-return-instruction {
        font-size: 13px !important;
        margin: 16px 0 12px !important;
        min-height: 60px;
        line-height: 1.5;
    }

    .premium-return .return-slot {
        margin: 16px 0 !important;
        min-height: 100px;
    }

    .premium-return .mmodal-btn {
        min-width: 100% !important;
        width: 100% !important;
    }

    .premium-candle-icon {
        width: 20px !important;
        height: 20px !important;
        min-width: 20px !important;
        min-height: 20px !important;
        margin-right: 6px !important;
    }

    /* Varmistetaan että infoBoxin tekstit ovat teräviä mobiilissa */
    #infoBox.mmodal .mmodal-content,
    #infoBox.mmodal .mmodal-content * {
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
        text-rendering: optimizeLegibility !important;
        transform: translateZ(0) !important;
        filter: none !important;
        -webkit-filter: none !important;
        backdrop-filter: none !important;
        will-change: auto !important;
    }

    /* Tekstin tiivistäminen mobiilissa */
    .mmodal-steps p {
        line-height: 1.5;
        /* Pienennetty riviväli */
        font-size: 14px;
        /* Pienennetty fontti */
    }

    .mmodal-steps .step {
        margin: 0 0 12px;
        padding: 12px 0;
    }

    /* Bullet-lista pienemmällä fontilla */
    .compose-instructions {
        font-size: 13px;
        line-height: 1.5;
    }

    /* Kultaisten kynttilöiden lista mobiilissa */
    .mmodal-premium-card {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        /* Parempi väli tekstin ja napin väliin */
        padding: 16px 0;
    }

    .mmodal-premium-card-text {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .mmodal-premium-card form {
        margin-left: 0;
        width: 100%;
        margin-top: 0.5rem;
    }

    .mmodal-premium-card button,
    .mmodal-premium-card .mmodal-btn {
        width: 100%;
        text-align: center;
        padding: 12px 18px;
    }

    /* Nappi modalin alaosassa - ei sticky, jotta se ei kellu tekstin päällä */
    .ignite-actions {
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }

    .mmodal-btn,
    #placeBar .mmodal-btn {
        width: 100%;
        padding: 12px 20px;
    }

    /* Varmistetaan että modaali ei mene alamenun päälle */
    .mmodal-content {
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 20px));
        /* Tila alamenulle */
    }
}

/* Piilota "Koko näyttö" nappi mobiilissa */
@media (max-width: 600px) {
    #fsBtn {
        display: none !important;
    }
}

/* Alavalikko kapeimmilla näytöillä */
@media (max-width: 450px) {
    .bottom-menu {
        flex-wrap: wrap;
        row-gap: 0.5rem;
        justify-content: center;
        padding: 8px 12px;
    }

    .bm-btn {
        font-size: 12px;
        padding: 6px 8px;
    }

    .bm-btn svg.feather {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 600px) {}

/* ===== SAAVUTETTAVUUS ===== */
/* Nappien kosketusalue - WCAG-suositus */
.mmodal-btn,
#placeBar .mmodal-btn,
.mmodal-premium-card button,
.mmodal-premium-card .mmodal-btn,
.confirm-btn {
    min-height: 44px;
    /* WCAG-suositus kosketusalueelle */
    min-width: 44px;
}


/* Focus-tilat näppäimistölle */
.mmodal-btn:focus-visible,
#placeBar .mmodal-btn:focus-visible,
.mmodal-premium-card button:focus-visible,
.mmodal-premium-card .mmodal-btn:focus-visible,
.confirm-btn:focus-visible {
    outline: 2px solid rgba(201, 168, 130, .6);
    outline-offset: 2px;
}

/* ===== VIIMEISTELYT ===== */
/* Global atmospheric overlay */
#mm-global-atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.035);
    backdrop-filter: saturate(105%);
    z-index: 50;
}

/* Kynttilöiden hehku: käytä admin-asetuksia suoraan */
.candle.lit .scale-wrap::after,
.candle-premium.lit .scale-wrap::after {
    filter: blur(var(--mmk-glow-blur, 15px));
}

/* Nappien hover-efekti: pehmeä glow pulse */
/* Poistettu - aiheutti välkkymistä */

/* Popupien avautumiselle fade + scale animaatio (vain kerran avattaessa, ei kirjoituksen aikana) */
.mmodal-content.mmk-modal-enter {
    animation: modalFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
    .mmodal-content.mmk-modal-enter {
        animation: none;
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

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

/* Alavalikon max-width leveille näytöille */
.bottom-menu {
    max-width: 1000px;
    /* Rajoitettu leveys (900-1100px) */
    margin: 0 auto;
}

/* "Sytytä" -nappi korostettu alavalikossa */
.bottom-menu #igniteBtn {
    color: rgba(255, 255, 255, 1);
    /* WCAG AA: täysi kontrasti */
    font-weight: 500;
    /* Hieman korostettu */
}

/* Muut napit neutraalimpia */
.bottom-menu .bm-btn:not(#igniteBtn) {
    color: rgba(255, 255, 255, 0.9);
    /* WCAG AA: parannettu kontrasti */
}

/* Pieni "moon glow" taustalla */
#moon {
    filter: drop-shadow(0 0 12px rgba(255, 255, 220, 0.08));
}

/* Alamenuriviin 5% vahvempi fontin valkoinen */
.bottom-menu {
    color: rgba(255, 255, 255, 0.9);
    /* WCAG AA: parannettu kontrasti */
}

/* NOTE: Removed legacy "gold microgradient" overrides.
   Button colors are controlled by the single-source button system above. */

/* Kynttilän siirtovaiheen ympyrä: pehmennys */
.candle .place-halo {
    border: 2px dashed rgba(255, 255, 255, 0.35) !important;
    /* Pehmennetty reunaviiva */
    animation: halo-blink 1.4s ease-in-out infinite !important;
    /* Varmista vilkkumis-animaatio */
}

/* WCAG AA kontrasti-korjaukset */
.mmk-premium-box {
    /* CLS-ongelman korjaus: kiinteä korkeus ja content-visibility estää layout shiftin */
    min-height: 400px;
    box-sizing: border-box;
    /* Estää layout shiftin optimoimalla renderöinnin */
    content-visibility: auto;
    contain-intrinsic-size: auto 400px;
}

.mmk-premium-box h2 {
    color: #ffffff;
    /* WCAG AA: täysi kontrasti mustaan taustaan */
}

.mmk-premium-item h3 {
    color: #ffffff;
    /* WCAG AA: täysi kontrasti mustaan taustaan */
}

.mmk-premium-box .hint {
    color: rgba(255, 255, 255, 0.9);
    /* WCAG AA: parannettu kontrasti */
}

.ignite-panel .hint.small {
    color: rgba(233, 238, 241, 0.95);
    /* WCAG AA: parannettu kontrasti */
}

.mmodal .hint {
    color: rgba(233, 238, 241, 0.95);
    /* WCAG AA: parannettu kontrasti */
}

/* Kuvaelementin koko CLS-ongelman korjaus - korjattu inline-tyylissä */


/* ------------------------------------------------------
   Kynttilävalinnat (uusi myyntiflow: 0€ / 3€ / 5€)
------------------------------------------------------ */
.mmodal-choice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 28px;
}

@media (min-width: 820px) {
    .mmodal-choice-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.mmodal-choice-card {
    position: relative;
    border-radius: 28px;
    padding: 20px 18px 18px;
    /* Glassmorphism: läpikuultava tausta */
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 0.5px solid rgba(255, 255, 255, .12);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, .3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    align-items: center;
    min-height: 300px;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Valoefekti kynttiläkorteille - hienovarainen glow */
.mmodal-choice-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    animation: candleGlow 4s ease-in-out infinite;
}

@keyframes candleGlow {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 0.3;
    }
}

.mmodal-choice-card:hover::before {
    opacity: 0.4;
}

.mmodal-choice-card.is-gold {
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(212, 166, 72, .25) 0%, rgba(255, 255, 255, 0.1) 55%),
        rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-color: rgba(220, 180, 90, .25);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, .3),
        0 0 30px rgba(212, 166, 72, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Hopeakortti: ohut hopeareunus + satunnainen "välähdys" reunalla */
.mmodal-choice-card.is-silver {
    border-color: rgba(220, 232, 244, 0.28);
}

.mmodal-choice-card.is-silver::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(110deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(225, 240, 255, 0.0) 20%,
            rgba(235, 245, 255, 0.75) 50%,
            rgba(225, 240, 255, 0.0) 80%,
            rgba(255, 255, 255, 0) 100%);
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transform: translateX(-60%);
    pointer-events: none;
    animation: silverEdgeGlint 9s ease-in-out infinite;
}

@keyframes silverEdgeGlint {

    0%,
    68% {
        opacity: 0;
        transform: translateX(-60%);
    }

    72% {
        opacity: 0.55;
    }

    80% {
        opacity: 0.55;
        transform: translateX(60%);
    }

    84%,
    100% {
        opacity: 0;
        transform: translateX(60%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mmodal-choice-card.is-silver::after {
        animation: none;
    }
}

.mmodal-choice-img {
    width: 88px;
    height: auto;
    margin: 8px 0 16px;
    filter:
        drop-shadow(0 16px 32px rgba(0, 0, 0, .6)) drop-shadow(0 0 20px rgba(255, 255, 200, 0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
    position: relative;
    z-index: 1;
}

.mmodal-choice-card:hover .mmodal-choice-img {
    transform: scale(1.05);
    filter:
        drop-shadow(0 20px 40px rgba(0, 0, 0, .7)) drop-shadow(0 0 30px rgba(255, 255, 200, 0.4));
}

.mmodal-choice-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-family: 'Lato', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    color: var(--modal-text, #f3f3f3);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.mmodal-choice-meta {
    margin: 0 0 18px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, .95);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.9;
}

.mmodal-choice-desc {
    margin: 0 0 16px;
    max-width: 30ch;
    color: rgba(255, 255, 255, .75);
    font-size: 13px;
    line-height: 1.5;
    min-height: 1.6em;
    /* yleensä 1 rivi */
}

.mmodal-choice-form {
    width: 100%;
    margin-top: auto;
    display: flex;
    justify-content: center;
}

.mmodal-choice-form {
    width: 100%;
    margin-top: auto;
    display: flex;
    justify-content: center;
}

/* Choice card CTA buttons are centered and consistent (colors come from .mmodal-btn) */
.mmodal-choice-card .choice-btn,
.mmodal-choice-card .mmodal-btn.choice-btn,
.mmodal-choice-card button.mmodal-btn.choice-btn {
    width: 100%;
    max-width: 260px;
    margin: 16px auto 0;
    display: block;
}

.mmodal-stripe-note {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 20px;
    border: 0.5px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    color: rgba(255, 255, 255, .95);
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mmodal-stripe-note .lock {
    opacity: .9;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    line-height: 1.5;
    font-size: 1em;
}


/* Primary (7 päivän) valinta - pehmeämmät kehykset */
.mmodal-choice-card.is-primary {
    transform: translateY(-8px) scale(1.03);
    border-color: rgba(255, 200, 120, .35);
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(255, 200, 120, .2) 0%, rgba(255, 255, 255, 0.12) 55%),
        rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, .4),
        0 0 40px rgba(255, 180, 80, .2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mmodal-choice-card.is-primary::before {
    opacity: 0.5;
    background: radial-gradient(circle, rgba(255, 200, 120, 0.15) 0%, transparent 70%);
}


/* Ohjetekstit muistotekstikentän alle (ilmainen + maksullinen) */
.mmk-compose-help {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1.55;
}

.mmk-compose-help+.mmk-compose-help {
    margin-top: 6px;
}


/* --- Modern v9 tweaks: narrower memory text popups + stable close button --- */
.mm-modal .mm-modal-inner,
#mmModal .mm-modal-inner,
#mmRememberModal .mm-modal-inner,
#mmMemoryModal .mm-modal-inner,
.mm-remember-modal .mm-modal-inner {
    max-width: 640px;
    width: calc(100% - 48px);
    /* Sama glassmorphism-tyyli kuin päämodaalissa */
    background: rgba(245, 238, 226, 0.14);
    backdrop-filter: blur(40px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
    border: 0.5px solid rgba(245, 238, 226, 0.14) !important;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 0.5px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.mm-modal textarea,
#mmModal textarea,
#mmRememberModal textarea,
#mmMemoryModal textarea,
.mm-remember-modal textarea {
    width: 100%;
    max-width: 100%;
    min-height: 96px;
}

/* Free-memory popup: remove decorative top line if any */
.mm-modal .mm-modal-inner::before,
.mm-modal .mm-modal-inner::after,
#mmRememberModal .mm-modal-inner::before,
#mmRememberModal .mm-modal-inner::after,
.mm-remember-modal .mm-modal-inner::before,
.mm-remember-modal .mm-modal-inner::after {
    content: none !important;
}

/* Ensure the X is clickable */
.mm-modal .mm-close,
.mm-modal [data-mm-close],
#mmModal .mm-close,
#mmRememberModal .mm-close,
#mmMemoryModal .mm-close {
    cursor: pointer;
    pointer-events: auto;
}


/* v10: narrow memory textarea + calmer layout */
#engraveInputModalStep2,
#engraveInputModalReturn,
#engraveInputModalFree,
.mmk-engrave textarea {
    width: 100%;
    max-width: 100%;
    min-height: 96px;
}

/* remove any accidental top decorative rule in free compose panel */
.compose-panel.text-panel::before,
.compose-panel.text-panel::after,
.text-panel::before,
.text-panel::after,
.ignite-panel.text-panel::before,
.ignite-panel.text-panel::after {
    content: none !important;
}


/* --- v11: keep candle selection wide; narrow only memory/placement steps --- */
/* When premium-return is shown in step-1, use same narrow size as text-panel in step-2 */
body.mmk-premium-return #igniteModal.mmk-step1 .mmodal-content,
#igniteModal.mmk-step2 .mmodal-content,
#igniteModal.mmk-step3 .mmodal-content {
    width: min(720px, 92vw);
    max-width: 720px;
}

/* Make textarea reasonable and not overly wide */
#igniteModal textarea,
#engraveInputModalReturn,
#engraveInputModalStep2 {
    width: 100%;
    max-width: 100%;
    min-height: 96px;
}

/* Ensure close button is clickable */
#igniteModal .mmodal-close {
    cursor: pointer;
    pointer-events: auto;
    z-index: 3;
}

/* Prevent primary button wrapping */
#mmodalLock,
#mmodalToPlace,
#mmodalPlaceReturn,
#mmodalChooseFree {
    white-space: nowrap;
    min-width: 220px;
    padding-left: 26px;
    padding-right: 26px;
}



/* --- v12 tweaks: button width + consistent memory modal sizing --- */

/* "Sytytä kynttilä" button in placement bar: keep on one line and give it room */
#placeBar button,
#placeBar .mm-btn,
#placeBar .btn,
#placeBar .place-btn {
    min-width: 180px;
    padding-left: 26px;
    padding-right: 26px;
    white-space: nowrap;
}

/* ------------------------------------------------------------------
   v6b UI polish: unify all primary action buttons to the same palette
   Background of the site is cold/teal; warm beige buttons clash.
   Apply one calm dark-teal button style everywhere (selection cards,
   memory modals, placement bar).
------------------------------------------------------------------- */

/* Base button look (slightly lighter than previous attempt) */
:is(.mmodal-choice-card .choice-btn,
    .mmodal-choice-card .mmodal-btn.choice-btn,
    .mmodal-choice-card button.mmodal-btn.choice-btn,
    #mmodalChooseFree,
    #mmodalLock,
    #mmodalToPlace,
    #mmodalPlaceReturn,
    #mmodalChooseFree,
    #placeBar button,
    #placeBar .mm-btn,
    #placeBar .btn,
    #placeBar .place-btn) {
    background: rgba(55, 86, 92, 0.86);
    color: rgba(240, 245, 247, 0.96);
    border: none !important;
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
    text-shadow: none !important;
}

/* Hover / focus (calm, no jump) */
:is(.mmodal-choice-card .choice-btn,
    .mmodal-choice-card .mmodal-btn.choice-btn,
    .mmodal-choice-card button.mmodal-btn.choice-btn,
    #mmodalChooseFree,
    #mmodalLock,
    #mmodalToPlace,
    #mmodalPlaceReturn,
    #placeBar button,
    #placeBar .mm-btn,
    #placeBar .btn,
    #placeBar .place-btn):is(:hover, :focus, :focus-visible) {
    background: rgba(68, 105, 112, 0.94);
    border: none !important;
    box-shadow:
        0 10px 26px rgba(0, 0, 0, 0.22),
        0 10px 22px rgba(251, 191, 36, 0.26),
        0 18px 44px rgba(251, 191, 36, 0.16);
    transform: translateY(-1px) !important;
}

/* Ensure all candle-choice buttons are identical size & centered */
.mmodal-choice-card .choice-btn,
.mmodal-choice-card .mmodal-btn.choice-btn,
.mmodal-choice-card button.mmodal-btn.choice-btn {
    width: 100% !important;
    max-width: 260px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Override old warm premium styles (gold / silver) */


/* Memory text modals (free + paid return) should be narrower than the selection popup */
.mmodal.memory-modal .mmodal-content,
.mmodal#mmMemoryModal .mmodal-content,
.mmodal#mmRememberModal .mmodal-content,
.mmodal[data-mm-modal="memory"] .mmodal-content,
.mmodal .mmodal-content.mm-memory {
    max-width: 720px;
    width: calc(100% - 56px);
    /* Sama glassmorphism-tyyli kuin päämodaalissa */
    background: rgba(245, 238, 226, 0.14);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 0.5px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Ensure textarea doesn't force width */
.mmodal.memory-modal textarea,
.mmodal#mmMemoryModal textarea,
.mmodal#mmRememberModal textarea,
.mmodal textarea.mm-memory-text {
    max-width: 100%;
    width: 100%;
    border: 0.5px solid rgba(255, 255, 255, .15) !important;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    color: rgba(255, 255, 255, 0.95);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mmodal.memory-modal textarea:focus,
.mmodal#mmMemoryModal textarea:focus,
.mmodal#mmRememberModal textarea:focus,
.mmodal textarea.mm-memory-text:focus {
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow:
        0 0 0 3px rgba(251, 191, 36, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    background: rgba(245, 238, 226, 0.14);
}

/* Remove any top decorative rules inside memory modals */
.mmodal.memory-modal .mmodal-content:before,
.mmodal.memory-modal .mmodal-content:after,
.mmodal#mmMemoryModal .mmodal-content:before,
.mmodal#mmMemoryModal .mmodal-content:after,
.mmodal#mmRememberModal .mmodal-content:before,
.mmodal#mmRememberModal .mmodal-content:after {
    content: none !important;
}



/* --- v13 fixes: placement bar button label not clipped --- */
#placeBar {
    overflow: visible;
}

#placeBar .place-btn,
#placeBar button {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    overflow: visible;
}



/* v13: explicit memory modal IDs (free + paid return) */
#engraveInputModalStep2.memory-modal .mmodal-content,
#engraveInputModalReturn.memory-modal .mmodal-content {
    max-width: 720px;
    width: calc(100% - 56px);
    /* Sama glassmorphism-tyyli kuin päämodaalissa */
    background: rgba(245, 238, 226, 0.14);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 0.5px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}



/* --- v15: make memory-text popups (free + paid return) compact and consistent --- */
/* When premium-return panel is visible in step-1, make modal same size as step-2 */
body.mmk-premium-return #igniteModal.mmk-step1 .mmodal-content {
    max-width: 720px !important;
    width: min(720px, calc(100% - 56px)) !important;
}

#engraveInputModalStep2 textarea,
#engraveInputModalReturn textarea,
#engraveInputModalStep2,
#engraveInputModalReturn {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 96px;
    border: 0.5px solid rgba(255, 255, 255, .15) !important;
    background: rgba(36, 48, 52, 0.72);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: rgba(255, 255, 255, 0.95);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#engraveInputModalStep2 textarea:focus,
#engraveInputModalReturn textarea:focus,
#engraveInputModalStep2:focus,
#engraveInputModalReturn:focus {
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow:
        0 0 0 3px rgba(251, 191, 36, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    background: rgba(245, 238, 226, 0.14);
}

/* Placeholder-tyylit suoraan ID:ille */
#engraveInputModalStep2::placeholder,
#engraveInputModalStep2::-webkit-input-placeholder,
#engraveInputModalStep2::-moz-placeholder,
#engraveInputModalReturn::placeholder,
#engraveInputModalReturn::-webkit-input-placeholder,
#engraveInputModalReturn::-moz-placeholder,
.text-panel #engraveInputModalStep2::placeholder,
.text-panel #engraveInputModalStep2::-webkit-input-placeholder,
.text-panel #engraveInputModalStep2::-moz-placeholder,
.ignite-panel #engraveInputModalStep2::placeholder,
.ignite-panel #engraveInputModalStep2::-webkit-input-placeholder,
.ignite-panel #engraveInputModalStep2::-moz-placeholder {
    color: #000;
    opacity: 1 !important;
    /* Safari/iOS: make placeholder obey the color */
    -webkit-text-fill-color: #000;
}

/* Edge/IE legacy placeholder hooks (harmless elsewhere) */
#engraveInputModalStep2:-ms-input-placeholder,
#engraveInputModalReturn:-ms-input-placeholder,
.text-panel textarea:-ms-input-placeholder,
.mmodal textarea:-ms-input-placeholder {
    color: #000;
}

#engraveInputModalStep2::-ms-input-placeholder,
#engraveInputModalReturn::-ms-input-placeholder,
.text-panel textarea::-ms-input-placeholder,
.mmodal textarea::-ms-input-placeholder {
    color: #000;
}

/* Remove any top decorative rules if present */
#engraveInputModalStep2 .mmodal-content::before,
#engraveInputModalStep2 .mmodal-content::after,
#engraveInputModalReturn .mmodal-content::before,
#engraveInputModalReturn .mmodal-content::after {
    content: none !important;
}


/* Silver tier styling */
.mmodal-choice-card.is-silver {
    border-color: rgba(192, 192, 192, .2);
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(192, 192, 192, .15) 0%, rgba(255, 255, 255, 0.1) 55%),
        rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
}

.mmodal-choice-card.is-silver.is-primary {
    transform: translateY(-10px) scale(1.05);
    border-color: rgba(192, 192, 192, 0.5);
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(192, 192, 192, .3) 0%, rgba(255, 255, 255, 0.15) 55%),
        rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, .5),
        0 0 50px rgba(192, 192, 192, .3),
        0 0 80px rgba(192, 192, 192, .15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 10;
    position: relative;
}

/* --- Hotfix 2026-01-04: muistosanat placeholder mustaksi + ilmaisen napin keskitys mobiilissa --- */
@media (max-width: 768px) {

    /* Free candle "Sytytä kynttilä" button was forced left via align-self:flex-start in shared button rules */
    .mmodal-choice-card.is-free #mmodalChooseFree,
    #mmodalChooseFree.mmodal-btn.choice-btn {
        align-self: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: block !important;
        width: 100% !important;
        max-width: 260px !important;
    }
}


/* FIX: Muistosanat ohjeteksti mustaksi */
.compose-instructions,
.compose-instructions * {
    color: #000;
}

/* --- Hotfix v4: muistosanat kentän (itse textarea) tekstiväri mustaksi --- */
#engraveInputModalStep2,
#engraveInputModalReturn {
    color: #000;
    caret-color: #000;
    -webkit-text-fill-color: #000;
    /* Safari/iOS */
}

#engraveInputModalStep2::placeholder,
#engraveInputModalStep2::-webkit-input-placeholder,
#engraveInputModalStep2::-moz-placeholder,
#engraveInputModalReturn::placeholder,
#engraveInputModalReturn::-webkit-input-placeholder,
#engraveInputModalReturn::-moz-placeholder {
    color: #000;
    opacity: 1 !important;
    -webkit-text-fill-color: #000;
}



/* --- Desktop: remove the outermost modal frame (keep inner panels) --- */
@media (min-width: 900px) {

    #igniteModal.mmodal .mmodal-content,
    #engraveInputModalStep2.mmodal .mmodal-content,
    #engraveInputModalReturn.mmodal .mmodal-content {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* --- Silver card: subtle animated silver border --- */
.mmodal-choice-card.is-silver {
    position: relative;
    overflow: hidden;
}

.mmodal-choice-card.is-silver::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(120deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(235, 240, 245, 0.0) 35%,
            rgba(235, 240, 245, 0.55) 50%,
            rgba(235, 240, 245, 0.0) 65%,
            rgba(255, 255, 255, 0) 100%);
    opacity: 0.55;
    transform: translateX(-60%);
}

@media (hover: hover) and (pointer: fine) {
    .mmodal-choice-card.is-silver:hover::after {
        animation: mmk-silver-sheen 2.8s ease-in-out infinite;
    }
}

@keyframes mmk-silver-sheen {
    0% {
        transform: translateX(-60%);
        opacity: 0.35;
    }

    40% {
        opacity: 0.65;
    }

    100% {
        transform: translateX(60%);
        opacity: 0.35;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mmodal-choice-card.is-silver:hover::after {
        animation: none;
    }
}

/* ===============================
   UI CLEANUP v12 (single hover logic)
   - One hover behavior for POPUP action buttons only
   - Bottom menu buttons: no glow, no big outlines
   - Remove leftover white borders on modal buttons
   - Mobile: avoid double glass on text panels
   =============================== */

/* 1) Bottom menu: give space on mobile (icons were too tight) */
@media (max-width:768px) {
    .bottom-menu {
        gap: 10px;
    }
}

/* 2) Bottom menu buttons: remove glow/halo and strong focus outline (single hover logic lives in popups) */
.bm-btn:hover,
.bm-btn:active,
.bm-btn:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 1);
    transform: none;
    box-shadow: none;
    outline: none;
}

/* 3) One button style + one hover for all modal actions */
:root {
    --mmk-btn-bg: rgba(45, 72, 78, 0.86);
    --mmk-btn-bg-hover: rgba(58, 90, 96, 0.92);
    --mmk-btn-fg: rgba(246, 248, 249, 0.96);
    --mmk-btn-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
    --mmk-btn-glow: 0 10px 20px rgba(251, 191, 36, 0.22);
}

.mmodal-btn,
#placeBar .mmodal-btn,
.confirm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none !important;
    outline: none;
    border-radius: 9999px;
    padding: 12px 24px;
    min-height: 44px;
    min-width: 44px;
    cursor: pointer;
    background: var(--mmk-btn-bg);
    color: var(--mmk-btn-fg);
    box-shadow: var(--mmk-btn-shadow);
    text-shadow: none;
    transition: background-color .22s ease, box-shadow .22s ease, transform .12s ease;
}

/* SINGLE HOVER LOGIC (modal actions only) */
.mmodal-btn:hover,
#placeBar .mmodal-btn:hover,
.confirm-btn:hover,
.mmodal-btn:focus-visible,
#placeBar .mmodal-btn:focus-visible,
.confirm-btn:focus-visible {
    background: var(--mmk-btn-bg-hover);
    box-shadow: var(--mmk-btn-shadow), var(--mmk-btn-glow);
    transform: translateY(-1px);
}

.mmodal-btn:active,
#placeBar .mmodal-btn:active,
.confirm-btn:active {
    transform: translateY(0);
}

/* Kill any leftover "white border" look on modal buttons */
.mmodal-btn,
.confirm-btn {
    border-color: transparent;
    box-sizing: border-box;
}

/* 4) Confirm dialog: remove old gradients/borders so it matches modal buttons */
.confirm-btn.ok,
.confirm-btn.cancel {
    background: var(--mmk-btn-bg);
    color: var(--mmk-btn-fg);
    border: none;
}

/* 5) Mobile: remove the OUTER glass frame to avoid double backgrounds
      (inner panels like .text-panel / .premium-return already have their own glass) */
@media (max-width:600px) {
    #igniteModal .mmodal-content {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* 6) Remove silver sheen effect (user wanted one hover logic only) */
.mmodal-choice-card.is-silver::after {
    display: none;
    content: none;
}



/* ===== Muistomaisema – UI siivous v13 ===== */

/* 1) Modal centering (fix "too high") */
.mmodal {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* Mobile: ensure modals are not too high and have safe area spacing */
@media (max-width: 768px) {
    .mmodal {
        align-items: flex-start;
        padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
        padding-left: 8px;
        padding-right: 8px;
        overflow-y: auto;
    }
}

.mmodal-content {
    margin: 0 !important;
    /* override earlier top margin */
}

/* 2) Close button always inside the modal frame */
.mmodal-content {
    position: relative;
    padding-top: 48px;
    /* Make room for close button on mobile */
}

.mmodal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
}

/* Ensure close button stays inside modal content on mobile */
@media (max-width: 768px) {
    .mmodal-content {
        padding-top: 56px;
        padding-right: 56px;
        /* Ensure modal doesn't go too high */
        margin-top: 0 !important;
        max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 80px) !important;
    }

    .mmodal-close {
        /* Position from top of modal content, not viewport */
        top: 16px;
        right: 16px;
        /* Make close button easier to tap on mobile */
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        font-size: 32px !important;
        /* Increase touch target */
        padding: 8px;
        /* Better visibility */
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        /* Ensure it's always clickable */
        z-index: 100;
        pointer-events: auto !important;
    }

    /* Ensure step panels also have room for close button */
    #igniteModal .step .mmodal-content {
        position: relative;
        padding-top: 56px;
        padding-right: 56px;
    }

    /* Text panels in step-2 and step-3 need room for close button */
    #igniteModal .step-2 .text-panel,
    #igniteModal .step-3 .text-panel,
    #igniteModal .premium-return-panel {
        position: relative;
        padding-top: 56px;
        padding-right: 56px;
    }

    /* Ensure close button is inside the panel on mobile */
    #igniteModal .step-2 .mmodal-close,
    #igniteModal .step-3 .mmodal-close,
    #igniteModal .mmodal-close {
        position: absolute;
        top: 16px;
        right: 16px;
        z-index: 100;
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        font-size: 32px !important;
        padding: 8px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        pointer-events: auto !important;
    }
}

/* Ensure content has room for the close button */
.mmodal-content>h2,
.mmodal-content>.mmodal-title {
    padding-right: 44px;
}

/* 3) Single button style + single hover logic INSIDE modals only */
.mmodal-content .mmodal-btn,
.mmodal-content button.mmodal-btn,
.mmodal-btn,
#placeBar .mmodal-btn,
.confirm-btn,
.mmodal-choice-card .choice-btn,
.mmodal-choice-card .mmodal-btn.choice-btn,
#mmodalChooseFree,
#mmodalLock,
#mmodalToPlace,
#mmodalPlaceReturn,
#mmodalToPlaceFromText {
    border: none !important;
    outline: none !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
    border-radius: 9999px;
}

/* Remove any legacy borders/inset highlights inside modals */
.mmodal-content .mmodal-btn,
.mmodal-content .mmodal-btn * {
    -webkit-tap-highlight-color: transparent;
}

.mmodal-content .mmodal-btn:focus,
.mmodal-content .mmodal-btn:active {
    outline: none;
}

/* ONE hover for all modal buttons - golden glow */
.mmodal-content .mmodal-btn:hover,
.mmodal-content .mmodal-btn:active,
.mmodal-content .mmodal-btn:focus,
.mmodal-btn:hover,
#placeBar .mmodal-btn:hover,
.confirm-btn:hover,
.mmodal-choice-card .choice-btn:hover,
.mmodal-choice-card .mmodal-btn.choice-btn:hover,
#mmodalChooseFree:hover,
#mmodalLock:hover,
#mmodalToPlace:hover,
#mmodalPlaceReturn:hover,
#mmodalToPlaceFromText:hover {
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.30),
        0 10px 22px rgba(251, 191, 36, 0.26),
        0 18px 44px rgba(251, 191, 36, 0.16);
    transform: translateY(-1px);
}

/* Explicitly prevent glow on bottom menu / navigation buttons */
.bottom-menu .bm-btn,
.bottom-menu .bm-btn:hover,
.bottom-menu .bm-btn:active,
.bottom-menu .bm-btn:focus {
    box-shadow: none !important;
    transform: none !important;
}

/* 4) Mobile: bottom menu forced to one row and left-aligned - REMOVED DUPLICATE, handled above */

/* Single glass layer on mobile: outer content becomes transparent */
@media (max-width: 600px) {
    .mmodal-content {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* 5) Remove any remaining "white line" borders on all buttons */
.mmodal-content .mmodal-premium-card button,
.mmodal-content .mmodal-premium-card .mmodal-btn,
.mmodal-content button,
.mmodal-content .btn,
.mmodal-content .card-btn,
.mmodal-btn,
.mmodal-content .mmodal-btn,
button.mmodal-btn {
    border: none !important;
    outline: none !important;
    box-shadow: none;
}


/* === TARGETED FIXES === */
/* NOTE: Mobile menu fix moved to main mobile section above */
/* NOTE: Modal close button fix moved to main .mmodal-close section above */
/* NOTE: Button border removal moved to section 5 above */

/* Muistotekstin kirjoitus: vähennä backdrop-filter-kerroksia (estää välkkymisen) */
#igniteModal.mmk-step2 .text-panel,
body.mmk-premium-return #igniteModal.mmk-step1 .premium-return-text-section,
#igniteModal .premium-return-text-section {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(36, 48, 52, 0.55);
}

#igniteModal .mmodal-content {
    isolation: isolate;
}