:root {
    --elp-bg: #071018;
    --elp-panel: rgba(14, 29, 41, .86);
    --elp-line: rgba(255, 255, 255, .13);
    --elp-text: #f5f7f9;
    --elp-muted: #aab7c1;
    --elp-accent: #ff7a23;
    --elp-success: #60d394;
    --elp-error: #ff5b66;
}

body.elmp-puzzle-page {
    margin: 0;
    color: var(--elp-text);
    background:
        radial-gradient(circle at 80% 5%, rgba(22, 126, 156, .22), transparent 34rem),
        radial-gradient(circle at 8% 32%, rgba(255, 122, 35, .12), transparent 28rem),
        var(--elp-bg);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    min-height: 100vh;
}

.elmp-puzzle-page * { box-sizing: border-box; }
.elmp-puzzle-page button { font: inherit; }
.elmp-puzzle-skip { position: fixed; left: 1rem; top: -5rem; z-index: 9999; padding: .8rem 1rem; color: #111; background: #fff; border-radius: .5rem; }
.elmp-puzzle-skip:focus { top: 1rem; }

.elmp-puzzle-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 76px;
    padding: .8rem clamp(1rem, 3vw, 3.2rem);
    background: rgba(5, 13, 20, .82);
    border-bottom: 1px solid var(--elp-line);
    backdrop-filter: blur(18px);
}

.elmp-puzzle-brand { display: flex; align-items: center; gap: .8rem; color: inherit; text-decoration: none; }
.elmp-puzzle-brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border: 2px solid var(--elp-accent); border-radius: 14px; color: var(--elp-accent); font-weight: 900; letter-spacing: -.08em; }
.elmp-puzzle-brand-copy { display: grid; gap: .12rem; }
.elmp-puzzle-brand-copy strong { font-size: .98rem; }
.elmp-puzzle-brand-copy small { color: var(--elp-muted); font-size: .78rem; }
.elmp-puzzle-info-toggle, .elmp-puzzle-reset, .elmp-puzzle-complete button {
    border: 1px solid var(--elp-line);
    border-radius: 999px;
    color: var(--elp-text);
    background: rgba(255,255,255,.06);
    padding: .65rem 1rem;
    cursor: pointer;
}
.elmp-puzzle-info-toggle:hover, .elmp-puzzle-reset:hover, .elmp-puzzle-complete button:hover { border-color: var(--elp-accent); background: rgba(255,122,35,.12); }

.elmp-puzzle-main { width: min(1500px, 100%); margin: 0 auto; padding: clamp(2rem, 5vw, 5.5rem) clamp(1rem, 3vw, 3rem) 4rem; }
.elmp-puzzle-hero { max-width: 900px; margin-bottom: 2rem; }
.elmp-puzzle-kicker { margin: 0 0 .7rem; color: var(--elp-accent); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; }
.elmp-puzzle-hero h1 { margin: 0; font-size: clamp(2.1rem, 5vw, 5.2rem); line-height: .98; letter-spacing: -.055em; }
.elmp-puzzle-hero > p:last-child { max-width: 760px; margin: 1.3rem 0 0; color: var(--elp-muted); font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.65; }

.elmp-puzzle-instructions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0; }
.elmp-puzzle-instructions > div { display: flex; align-items: center; gap: .9rem; min-height: 76px; padding: 1rem; border: 1px solid var(--elp-line); border-radius: 18px; background: rgba(255,255,255,.035); }
.elmp-puzzle-instructions span { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 50%; color: #111; background: var(--elp-accent); font-weight: 900; }
.elmp-puzzle-instructions p { margin: 0; color: #d9e0e5; line-height: 1.45; }

.elmp-puzzle-experience { overflow: hidden; border: 1px solid var(--elp-line); border-radius: 28px; background: linear-gradient(145deg, rgba(255,255,255,.05), rgba(255,255,255,.018)); box-shadow: 0 30px 80px rgba(0,0,0,.34); }
.elmp-puzzle-status { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--elp-line); background: rgba(0,0,0,.18); }
.elmp-puzzle-progress-copy { font-weight: 800; white-space: nowrap; }
.elmp-puzzle-progress-track { overflow: hidden; height: 8px; border-radius: 999px; background: rgba(255,255,255,.1); }
.elmp-puzzle-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--elp-accent), #ffd166); transition: width .4s ease; }

.elmp-puzzle-layout { display: grid; grid-template-columns: minmax(260px, 380px) minmax(580px, 1fr); gap: clamp(1rem, 3vw, 3rem); padding: clamp(1rem, 2.5vw, 2.5rem); }
.elmp-puzzle-pieces-panel { align-self: start; padding: 1rem; border: 1px solid var(--elp-line); border-radius: 22px; background: rgba(0,0,0,.18); }
.elmp-puzzle-panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.elmp-puzzle-panel-heading span { font-size: 1.1rem; font-weight: 900; }
.elmp-puzzle-panel-heading small { color: var(--elp-muted); text-align: right; }
.elmp-puzzle-piece-bank { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.elmp-puzzle-piece { position: relative; aspect-ratio: 1.08; border: 0; padding: 0; background: transparent; cursor: grab; filter: drop-shadow(0 10px 12px rgba(0,0,0,.28)); transition: transform .18s ease, filter .18s ease, opacity .25s ease; }
.elmp-puzzle-piece:hover { transform: translateY(-5px) rotate(-1deg); filter: drop-shadow(0 16px 18px rgba(0,0,0,.36)); }
.elmp-puzzle-piece:active { cursor: grabbing; }
.elmp-puzzle-piece.is-selected { transform: translateY(-7px) scale(1.035); filter: drop-shadow(0 0 0 rgba(0,0,0,0)) drop-shadow(0 0 12px rgba(255,122,35,.8)); }
.elmp-puzzle-piece.is-solved { opacity: .16; transform: scale(.9); pointer-events: none; }
.elmp-puzzle-piece img { width: 100%; height: 100%; object-fit: contain; display: block; }
.elmp-puzzle-piece span { position: absolute; inset: 22% 17% 17%; display: grid; place-items: center; color: #fff; font-size: clamp(.66rem, 1vw, .9rem); font-weight: 800; line-height: 1.18; text-align: center; text-shadow: 0 1px 4px rgba(0,0,0,.5); }

.elmp-puzzle-board-wrap { min-width: 0; }
.elmp-puzzle-board {
    position: relative;
    width: min(100%, 880px);
    aspect-ratio: 1.42;
    margin: 0 auto;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    background: #737b81;
    box-shadow: inset 0 0 45px rgba(0,0,0,.18);
}
.elmp-puzzle-final-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    visibility: hidden;
    filter: saturate(.96) contrast(1.02);
    pointer-events: none;
}
.elmp-puzzle-slots { position: absolute; inset: 0; z-index: 3; }
.elmp-puzzle-center-fixed { position: absolute; left: 39.2%; top: 31.2%; z-index: 2; width: 21.6%; height: 35.5%; background: #687178; clip-path: polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%); box-shadow: inset 0 0 0 2px rgba(255,255,255,.24); transition: background .45s ease, box-shadow .45s ease; }
.elmp-puzzle-center-fixed.is-revealed {
    background-color: transparent;
    background-image: var(--puzzle-final-image);
    background-repeat: no-repeat;
    background-size: 462.96% 281.69%;
    background-position: 50% 48.4%;
    box-shadow: none;
}
.elmp-puzzle-slot {
    --piece-mask: none;
    position: absolute;
    width: 25.5%;
    aspect-ratio: 1.08;
    border: 0;
    padding: 0;
    color: #eef3f6;
    background: rgba(91,100,107,.98);
    -webkit-mask-image: var(--piece-mask);
    mask-image: var(--piece-mask);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    cursor: pointer;
    transition: transform .2s ease, background .35s ease, opacity .35s ease, filter .2s ease;
}
.elmp-puzzle-slot::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 38%, rgba(255,255,255,.16), transparent 66%); transition: opacity .35s ease; }
.elmp-puzzle-slot-answer { position: absolute; inset: 24% 17% 18%; z-index: 2; display: grid; place-items: center; font-size: clamp(.62rem, 1.1vw, 1rem); font-weight: 800; line-height: 1.18; text-align: center; }
.elmp-puzzle-slot-check { position: absolute; right: 17%; bottom: 17%; z-index: 3; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #062015; background: var(--elp-success); font-weight: 900; opacity: 0; transform: scale(.5); transition: .25s ease; }
.elmp-puzzle-slot:hover, .elmp-puzzle-slot.is-dragover { filter: drop-shadow(0 0 14px rgba(255,122,35,.8)); transform: scale(1.025); }
.elmp-puzzle-slot.is-wrong { animation: elmpPuzzleWrong .45s ease; background: rgba(120,10,20,.92); }
.elmp-puzzle-slot.is-solved {
    background-color: transparent;
    background-image: var(--puzzle-final-image);
    background-repeat: no-repeat;
    background-size: 392.16% 298.3%;
    background-position: var(--reveal-x, 50%) var(--reveal-y, 50%);
    cursor: default;
    filter: none;
}
.elmp-puzzle-slot.is-solved::before { opacity: 0; }
.elmp-puzzle-slot.is-solved .elmp-puzzle-slot-answer { opacity: 0; }
.elmp-puzzle-slot.is-solved .elmp-puzzle-slot-check { opacity: 0; transform: scale(.5); }
.elmp-puzzle-slot--top { left: 37.25%; top: 0; --reveal-x: 50%; --reveal-y: 0%; }
.elmp-puzzle-slot--upper-left { left: 18.6%; top: 15.6%; --reveal-x: 25%; --reveal-y: 23.5%; }
.elmp-puzzle-slot--upper-right { right: 18.6%; top: 15.6%; --reveal-x: 75%; --reveal-y: 23.5%; }
.elmp-puzzle-slot--left { left: 0; top: 31.2%; --reveal-x: 0%; --reveal-y: 46.9%; }
.elmp-puzzle-slot--right { right: 0; top: 31.2%; --reveal-x: 100%; --reveal-y: 46.9%; }
.elmp-puzzle-slot--lower-left { left: 18.6%; top: 47%; --reveal-x: 25%; --reveal-y: 70.7%; }
.elmp-puzzle-slot--lower-right { right: 18.6%; top: 47%; --reveal-x: 75%; --reveal-y: 70.7%; }
.elmp-puzzle-slot--bottom { left: 37.25%; top: 62.5%; --reveal-x: 50%; --reveal-y: 94%; }

.elmp-puzzle-feedback { min-height: 1.8em; margin: 1rem 0 0; color: var(--elp-muted); text-align: center; font-weight: 750; }
.elmp-puzzle-feedback[data-state="success"] { color: var(--elp-success); }
.elmp-puzzle-feedback[data-state="error"] { color: var(--elp-error); }

.elmp-puzzle-complete { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(3,9,14,.12); opacity: 0; backdrop-filter: blur(0); transition: opacity .35s ease, backdrop-filter .35s ease; }
.elmp-puzzle-complete.is-visible { opacity: 1; backdrop-filter: none; }
.elmp-puzzle-complete-card { width: min(430px, 86%); padding: 2rem; border: 1px solid rgba(255,255,255,.22); border-radius: 24px; background: rgba(5,15,22,.92); box-shadow: 0 30px 60px rgba(0,0,0,.45); text-align: center; }
.elmp-puzzle-complete-icon { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 1rem; border-radius: 50%; color: #062015; background: var(--elp-success); font-size: 2rem; font-weight: 900; }
.elmp-puzzle-complete p { margin: 0; color: var(--elp-muted); }
.elmp-puzzle-complete h2 { margin: .45rem 0 1.2rem; font-size: clamp(1.7rem, 4vw, 3rem); line-height: .95; }

.elmp-puzzle-concept { display: grid; grid-template-columns: .8fr 1.2fr; gap: 2rem; margin: 4rem 0 0; padding: clamp(1.5rem, 4vw, 3rem); border-top: 1px solid var(--elp-line); border-bottom: 1px solid var(--elp-line); }
.elmp-puzzle-concept h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.8rem); line-height: 1.08; }
.elmp-puzzle-concept > p { margin: 0; color: var(--elp-muted); font-size: 1.08rem; line-height: 1.75; }
.elmp-puzzle-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.4rem clamp(1rem, 3vw, 3rem); color: var(--elp-muted); border-top: 1px solid var(--elp-line); font-size: .86rem; }
.elmp-puzzle-footer a { color: var(--elp-accent); text-decoration: none; font-weight: 800; }

@keyframes elmpPuzzleWrong { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

@media (max-width: 1050px) {
    .elmp-puzzle-layout { grid-template-columns: 1fr; }
    .elmp-puzzle-pieces-panel { order: 2; }
    .elmp-puzzle-board-wrap { order: 1; }
    .elmp-puzzle-piece-bank { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

@media (max-width: 700px) {
    .elmp-puzzle-brand-copy small { display: none; }
    .elmp-puzzle-main { padding-top: 2.5rem; }
    .elmp-puzzle-instructions { grid-template-columns: 1fr; display: none; }
    .elmp-puzzle-instructions.is-open { display: grid; }
    .elmp-puzzle-status { grid-template-columns: 1fr auto; }
    .elmp-puzzle-progress-track { grid-column: 1 / -1; grid-row: 2; }
    .elmp-puzzle-layout { padding: .7rem; }
    .elmp-puzzle-piece-bank { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .elmp-puzzle-board { width: 112%; margin-left: -6%; }
    .elmp-puzzle-slot-answer { font-size: clamp(.52rem, 2.1vw, .72rem); }
    .elmp-puzzle-slot-check { width: 20px; height: 20px; font-size: .75rem; }
    .elmp-puzzle-concept { grid-template-columns: 1fr; }
    .elmp-puzzle-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .elmp-puzzle-page *, .elmp-puzzle-page *::before, .elmp-puzzle-page *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* v210 — minimal chrome and lower completion label */

body.elmp-puzzle-page {
    background: radial-gradient(circle at 80% 5%, rgba(22, 126, 156, .16), transparent 34rem),
                radial-gradient(circle at 8% 32%, rgba(255, 122, 35, .09), transparent 28rem),
                var(--elp-bg);
}
.elmp-puzzle-main--minimal {
    max-width: none;
    padding: 12px 18px 18px;
}
.elmp-puzzle-main--minimal .elmp-puzzle-experience {
    margin-top: 0;
}
.elmp-puzzle-main--minimal .elmp-puzzle-layout {
    align-items: start;
}
.elmp-puzzle-complete {
    place-items: end center;
    padding-bottom: 24px;
    background: linear-gradient(to top, rgba(3,9,14,.10), rgba(3,9,14,0) 36%);
}
.elmp-puzzle-complete-card {
    width: min(720px, 88%);
    padding: .9rem 1.15rem;
    border-radius: 16px;
    background: rgba(5,15,22,.76);
    box-shadow: 0 18px 40px rgba(0,0,0,.28);
}
.elmp-puzzle-complete h2 {
    margin: 0;
    font-size: clamp(1.05rem, 2.4vw, 1.65rem);
    line-height: 1.25;
    color: #ffffff;
}
.elmp-puzzle-feedback:empty {
    min-height: 0;
    margin-top: .35rem;
}
@media (max-width: 700px) {
    .elmp-puzzle-main--minimal { padding: 8px 8px 12px; }
    .elmp-puzzle-complete { padding-bottom: 14px; }
    .elmp-puzzle-complete-card { width: min(94%, 520px); padding: .75rem .9rem; }
    .elmp-puzzle-complete h2 { font-size: clamp(.95rem, 4vw, 1.18rem); }
}


/* v211 — completion message without blurring the revealed image */
.elmp-puzzle-complete,
.elmp-puzzle-complete.is-visible {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
