/*
 * Color Puzzle landing page (layout: color_puzzle). Matches the game and its Play Store art (HardArtcore casual style):
 * grape violet gradient, Nunito, white tubes with glossy blocks, one gold highlighter per heading.
 * Everything is scoped under .cp.
 */

@font-face { font-family: Nunito; font-weight: 400; font-display: swap; src: url(../fonts/Nunito-Regular.ttf) format("truetype"); }
@font-face { font-family: Nunito; font-weight: 700; font-display: swap; src: url(../fonts/Nunito-Bold.ttf) format("truetype"); }

.layout-color_puzzle { overflow-x: hidden; background: #FAF6FF; }

.cp {
    --cp-primary: #9B3FE0;
    --cp-deep: #3D1466;
    --cp-muted: #7A6E9A;
    --cp-tint: #F3E9FF;
    --cp-tint2: #E6D6FA;
    --cp-gold: #FFC233;
    --cp-coral: #FF7657;
    --cp-coral-text: #D9532F;
    --cp-correct: #2EB872;
    --cp-shadow: 0 24px 50px rgba(61, 20, 102, .18);
    --cp-grad: linear-gradient(180deg, #9B3FE0 0%, #B87AF2 42%, #D9BCFA 78%, #EEDBFF 100%);
    /* block colours: the game's ColorPalette */
    --red: #F0505A; --blue: #3D8BF2; --green: #2EB872; --yellow: #FFC233; --purple: #9D5CF5; --orange: #FF8A3D; --pink: #FF6FB1; --cyan: #16C3D6;

    font-family: Nunito, system-ui, sans-serif;
    color: var(--cp-deep);
    padding-bottom: 6rem; /* room for the fixed navigation bar */
}

.cp *, .cp *::before, .cp *::after { box-sizing: border-box; }
.cp ::selection { color: #fff; background: var(--cp-primary); }
.cp h1, .cp h2, .cp h3 { font-family: inherit; font-weight: 700; color: inherit; letter-spacing: -.02em; text-transform: none; margin: 0; }
.cp p { margin: 0; }
.cp ul { list-style: none; margin: 0; padding: 0; }
.cp svg { width: 1em; height: 1em; flex: none; }

.cp-wrap { max-width: 1160px; margin: 0 auto; padding: 0 1.25rem; }
.cp-bleed { position: relative; width: 100vw; margin-left: calc(50% - 50vw); overflow: hidden; }
.cp-section { padding-top: 6rem; }

/* The game's own wallpaper tile: white tubes, blocks, stars and drops */
.cp-pattern { position: absolute; inset: 0; background: var(--cp-pattern) 0 0 / 360px auto repeat; opacity: .13; pointer-events: none; }

/* Highlight, chips, buttons */
.cp-hl {
    display: inline-block; color: var(--cp-deep); background: var(--cp-gold); padding: 0 .28em .06em;
    border-radius: .3em; transform: rotate(-2deg); text-shadow: none;
}
.cp-chip {
    display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .9rem; border-radius: 999px;
    background: var(--cp-tint); color: var(--cp-primary); font-weight: 700; font-size: .92rem; white-space: nowrap;
}
.cp-chip.gold { background: #FFF3D1; color: #9A6A00; }
.cp-chip.coral { background: #FFE9E3; color: var(--cp-coral-text); }
.cp-chip.solid { background: var(--cp-primary); color: #fff; }
.cp-muted { color: var(--cp-muted); font-weight: 700; font-size: .92rem; }

.cp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem; padding: .95rem 1.6rem; border-radius: 999px;
    font: 700 1.05rem/1 Nunito, sans-serif; text-decoration: none; border: 0; cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
a.cp-btn:hover, button.cp-btn:hover { transform: translateY(-2px); }
.cp-btn:focus-visible, .cp-tube:focus-visible { outline: 3px solid var(--cp-gold); outline-offset: 4px; }
.cp-btn-play { background: var(--cp-deep); color: #fff; box-shadow: 0 14px 30px rgba(61, 20, 102, .35); }
.cp-btn-play:hover { color: #fff; box-shadow: 0 18px 36px rgba(61, 20, 102, .45); }
.cp-btn-soon { background: rgba(255, 255, 255, .28); color: #fff; cursor: default; }
.cp-btn-ghost { background: rgba(255, 255, 255, .92); color: var(--cp-deep); }
.cp-btn-ghost:hover { color: var(--cp-deep); background: #fff; }
.cp-btn-primary { background: var(--cp-primary); color: #fff; box-shadow: 0 6px 0 rgba(61, 20, 102, .2); }
.cp-btn-primary:hover { color: #fff; }
.cp-btn-light { background: var(--cp-tint); color: var(--cp-deep); }
.cp-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.cp-card { background: #fff; border-radius: 28px; box-shadow: var(--cp-shadow); padding: 1.75rem; position: relative; }

/* Tubes and blocks, drawn like the game: white tubes, blocks with a darker lip and a gloss */
.cp-tube {
    position: relative; width: var(--w, 64px); height: calc(var(--cap, 4) * var(--bh, 40px) + (var(--cap, 4) - 1) * 6px + 18px);
    padding: 8px; border: 0; border-radius: 22px; background: #fff; display: flex; flex-direction: column-reverse; gap: 6px;
    box-shadow: 0 8px 0 rgba(61, 20, 102, .12), 0 16px 28px rgba(61, 20, 102, .14); transition: transform .18s ease, box-shadow .18s ease;
}
.cp-b {
    position: relative; flex: none; height: var(--bh, 40px); border-radius: 11px; background: var(--c);
    box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 78%, #000);
}
.cp-b::after { content: ""; position: absolute; left: 12%; top: 14%; width: 30%; height: 15%; border-radius: 99px; background: rgba(255, 255, 255, .45); }
.cp-b.q { --c: #525670; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.3em; }
.cp-b.rb { background: linear-gradient(100deg, #FFD23F, #6BE36B 22%, #2EC5E8 42%, #5B6CFF 62%, #D35BFF 80%, #FF5C8A); box-shadow: 0 4px 0 rgba(61, 20, 102, .25); }
.cp-b.q::after, .cp-b.rb::after { display: none; }
.cp-b.lock { display: grid; place-items: center; color: #fff; }
.cp-b.lock svg { width: 45%; height: 60%; }

/* ---- Hero ------------------------------------------------------------- */

.cp-hero { background: var(--cp-grad); border-radius: 0 0 48px 48px; padding: 2rem 0 5rem; color: #fff; }
.cp-hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.cp-crumbs { font-size: .85rem; opacity: .85; margin-bottom: 2.2rem; }
.cp-crumbs a { color: inherit; text-decoration: none; }
.cp-crumbs a:hover { text-decoration: underline; color: inherit; }
.cp-crumbs span { margin: 0 .45rem; opacity: .7; }
.cp-brand { display: flex; align-items: center; gap: .9rem; font-size: 1.6rem; font-weight: 700; margin-bottom: 1.5rem; }
.cp-brand img { width: 88px; height: 88px; border-radius: 24px; box-shadow: 0 10px 24px rgba(61, 20, 102, .3); transform: rotate(-4deg); }
.cp-hero h1 { font-size: clamp(2.8rem, 6.4vw, 5rem); line-height: 1.04; text-shadow: 0 6px 24px rgba(61, 20, 102, .25); }
.cp-lead { font-size: 1.3rem; line-height: 1.45; max-width: 32rem; margin: 1.5rem 0 2rem !important; opacity: .95; }
.cp-chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.8rem !important; }
.cp-chips li {
    display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .95rem; border-radius: 999px;
    background: rgba(255, 255, 255, .92); color: var(--cp-deep); font-weight: 700; font-size: .92rem;
}
.cp-chips svg { width: 1.1rem; height: 1.1rem; color: var(--cp-primary); }

/* Playable demo */
.cp-hero-demo { position: relative; max-width: 460px; width: 100%; justify-self: center; }
.cp-demo { color: var(--cp-deep); transform: rotate(1.2deg); }
.cp-demo.cp-pop { animation: cp-pop .35s ease; }
.cp-demo-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.6rem; }
.cp-board { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 14px; padding: 2.2rem .5rem .6rem; min-height: 250px; }
.cp-board .cp-tube { cursor: pointer; background: #fff; box-shadow: 0 8px 0 var(--cp-tint2), 0 16px 28px rgba(61, 20, 102, .14), inset 0 0 0 2px var(--cp-tint); }
.cp-board .cp-tube:hover { transform: translateY(-3px); }
.cp-board .cp-tube.sel { transform: translateY(-26px); box-shadow: 0 0 0 6px rgba(155, 63, 224, .35), 0 0 0 14px rgba(155, 63, 224, .12), 0 16px 28px rgba(61, 20, 102, .14); }
.cp-board .cp-tube.bad { animation: cp-shake .35s ease; }
.cp-board .cp-tube.done { box-shadow: 0 0 0 5px var(--cp-gold), 0 16px 28px rgba(61, 20, 102, .14); }
.cp-board .cp-b.new { animation: cp-drop .25s ease both; }
.cp-bubble {
    position: absolute; z-index: 2; left: -26px; top: -30px; width: 76px; height: 76px; border-radius: 22px;
    background: #fff; display: grid; place-items: center; transform: rotate(-12deg);
    box-shadow: 0 12px 24px rgba(61, 20, 102, .3); animation: cp-float 4s ease-in-out infinite;
}
.cp-bubble .cp-b { width: 48px; --bh: 30px; }
.cp-demo-hint { text-align: center; margin-top: 1.4rem !important; font-weight: 700; opacity: .95; }
.cp-result { text-align: center; padding: .5rem 0; }
.cp-result .cp-muted { margin: .4rem 0 1.2rem !important; line-height: 1.45; }
.cp-result .cp-actions { justify-content: center; }

/* Stars and the moves/par boxes */
.cp-stars { display: flex; justify-content: center; align-items: flex-end; gap: .3rem; color: var(--cp-gold); }
.cp-stars svg { width: 3.4rem; height: 3.4rem; color: var(--cp-tint2); }
.cp-stars svg:nth-child(2) { width: 4.4rem; height: 4.4rem; }
.cp-stars svg.on { color: var(--cp-gold); animation: cp-pop .5s ease both; }
.cp-stars svg.on:nth-child(2) { animation-delay: .1s; }
.cp-stars svg.on:nth-child(3) { animation-delay: .2s; }
.cp-result-title { font-size: 2.4rem; font-weight: 700; margin: .4rem 0 1.2rem !important; }
.cp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1.2rem; text-align: left; }
.cp-stats > div { background: var(--cp-tint); border-radius: 18px; padding: .8rem 1.1rem; }
.cp-stats small { display: block; color: var(--cp-muted); font-size: .9rem; }
.cp-stats b { font-size: 1.9rem; }
.cp-stats .win { background: #E3F6EB; }
.cp-stats .win b { color: var(--cp-correct); }

/* ---- Section headers ---------------------------------------------------- */

.cp-head { text-align: center; max-width: 46rem; margin: 0 auto 3rem; }
.cp-head h2, .cp-copy h2, .cp-cta h2 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); line-height: 1.1; }
.cp-head p, .cp-copy p { font-size: 1.2rem; line-height: 1.5; margin-top: 1rem !important; color: var(--cp-muted); }
.cp-head-light { color: #fff; }
.cp-head-light p { color: #fff; opacity: .95; }

/* ---- How it works ------------------------------------------------------- */

.cp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.cp-step { padding: 2rem; text-align: center; }
.cp-step:nth-child(2) { transform: translateY(1.5rem); }
.cp-step-n {
    position: absolute; top: -16px; left: -10px; width: 44px; height: 44px; border-radius: 50%; background: var(--cp-gold);
    display: grid; place-items: center; font-weight: 700; font-size: 1.2rem; transform: rotate(-8deg);
}
.cp-mini { height: 150px; display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin-bottom: 1.4rem; --w: 44px; --bh: 22px; --cap: 4; }
.cp-mini .cp-tube { padding: 5px; gap: 4px; border-radius: 14px; background: var(--cp-tint); box-shadow: none; height: calc(var(--cap) * var(--bh) + (var(--cap) - 1) * 4px + 10px); }
.cp-mini .cp-b { border-radius: 7px; }
.cp-mini .cp-tube.up { transform: translateY(-18px); box-shadow: 0 0 0 4px rgba(155, 63, 224, .3); }
.cp-mini .cp-tube.done { box-shadow: 0 0 0 4px var(--cp-gold); }
.cp-step h3, .cp-perk h3 { font-size: 1.6rem; margin-bottom: .6rem; }
.cp-step p, .cp-perk p { color: var(--cp-muted); font-size: 1.05rem; line-height: 1.5; }

/* ---- Split sections (twists, daily) ------------------------------------ */

.cp-split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 4rem; align-items: center; }
.cp-flip .cp-copy { order: 2; }
.cp-stack { display: flex; flex-direction: column; gap: 1.2rem; max-width: 500px; width: 100%; justify-self: center; }
.cp-stack > .cp-card { transform: rotate(var(--r, 0)) translateX(var(--x, 0)); }
.cp-twist { display: flex; align-items: center; gap: 1.4rem; padding: 1.3rem 1.5rem; }
.cp-twist > div:first-child { width: 96px; flex: none; background: var(--cp-tint); border-radius: 22px; padding: 22px 16px 26px; }
.cp-twist .cp-b { --bh: 44px; border-radius: 12px; }
.cp-twist h3 { font-size: 1.35rem; }
.cp-twist p { color: var(--cp-muted); line-height: 1.45; margin-top: .25rem !important; }

.cp-cal { padding: 1.6rem 1.6rem 1.8rem; }
.cp-cal-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.cp-cal-top b { font-size: 1.5rem; }
.cp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cp-days small { color: var(--cp-muted); font-weight: 700; font-size: .8rem; padding-bottom: .2rem; }
.cp-days i {
    font-style: normal; font-weight: 700; aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; position: relative;
    background: var(--cp-tint); color: var(--cp-muted); font-size: .95rem;
}
.cp-days i.p { background: var(--cp-gold); color: var(--cp-deep); }
.cp-days i.p::after { content: "★"; position: absolute; top: -1px; right: 3px; font-size: .62rem; color: #fff; }
.cp-days i.m { background: #E8606A; color: #fff; }
.cp-days i.t { background: var(--cp-primary); color: #fff; }
.cp-days i.e { background: none; }
.cp-bar { position: relative; height: 36px; margin: 1.4rem 18px 0; }
.cp-bar::before, .cp-bar span { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 14px; border-radius: 99px; background: var(--cp-tint); }
.cp-bar span { right: auto; width: 48%; background: var(--cp-primary); }
.cp-bar b {
    position: absolute; top: 0; width: 36px; height: 36px; margin-left: -18px; border-radius: 50%; background: var(--cp-tint);
    display: grid; place-items: center; font-size: .8rem;
}
.cp-bar b.on { background: var(--cp-gold); }

/* ---- Modes --------------------------------------------------------------- */

.cp-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.cp-mode { padding: 2rem; }
.cp-mode-ico { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; color: #fff; margin-bottom: 1.2rem; box-shadow: 0 6px 0 rgba(61, 20, 102, .15); }
.cp-mode-ico svg { width: 38px; height: 38px; }
.cp-mode h3 { font-size: 1.6rem; margin-bottom: .5rem; }
.cp-mode p { color: var(--cp-muted); font-size: 1.05rem; line-height: 1.5; margin-bottom: 1.1rem !important; }
.cp-mode .cp-actions { gap: .5rem; }

/* ---- Themes ------------------------------------------------------------- */

.cp-themes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.1rem; }
.cp-theme { background: #fff; border-radius: 26px; padding: .6rem .6rem .9rem; box-shadow: 0 14px 30px rgba(61, 20, 102, .1); text-align: center; font-weight: 700; transition: transform .2s ease; }
.cp-theme:hover { transform: translateY(-4px) rotate(-1deg); }
.cp-theme > div { height: 150px; border-radius: 20px; background: var(--g); display: flex; justify-content: center; align-items: center; gap: 6px; margin-bottom: .7rem; --w: 30px; --bh: 16px; --cap: 3; }
.cp-theme .cp-tube { padding: 4px; gap: 3px; border-radius: 10px; box-shadow: none; height: calc(3 * 16px + 2 * 3px + 8px); }
.cp-theme .cp-b { border-radius: 5px; box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 78%, #000); }
.cp-theme .cp-b::after { display: none; }

/* ---- Screenshots -------------------------------------------------------- */

.cp-gallery { background: var(--cp-grad); margin-top: 7rem; padding: 5rem 0 4rem; border-radius: 48px; }
.cp-gallery .cp-head { position: relative; margin-bottom: 2.5rem; }
.cp-shots {
    position: relative; display: flex; gap: 1.4rem; overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 1rem max(1.25rem, calc((100vw - 1160px) / 2 + 1.25rem)) 2rem; scrollbar-width: thin;
}
.cp-shots a { flex: none; scroll-snap-align: center; }
.cp-shots img { display: block; width: 240px; height: auto; border-radius: 26px; box-shadow: 0 20px 40px rgba(61, 20, 102, .3); transition: transform .2s ease; }
.cp-shots a:nth-child(odd) img { transform: rotate(-1.5deg); }
.cp-shots a:nth-child(even) img { transform: rotate(1.5deg) translateY(14px); }
.cp-shots a:hover img { transform: rotate(0) translateY(-6px) scale(1.03); }

/* ---- Perks -------------------------------------------------------------- */

.cp-perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.3rem; }
.cp-perk { padding: 1.7rem; }
.cp-perk-ico { width: 60px; height: 60px; border-radius: 50%; background: var(--cp-tint); color: var(--cp-primary); display: grid; place-items: center; margin-bottom: 1.1rem; }
.cp-perk-ico svg { width: 30px; height: 30px; }

/* ---- Final call to action ---------------------------------------------- */

.cp-cta {
    position: relative; overflow: hidden; text-align: center; color: #fff; background: var(--cp-grad);
    border-radius: 40px; padding: 4rem 1.5rem; box-shadow: var(--cp-shadow);
}
.cp-cta > *:not(.cp-pattern) { position: relative; }
.cp-cta img { width: 96px; height: 96px; border-radius: 26px; box-shadow: 0 14px 30px rgba(61, 20, 102, .3); margin-bottom: 1.5rem; }
.cp-cta h2 { text-shadow: 0 6px 24px rgba(61, 20, 102, .25); }
.cp-cta > p { font-size: 1.25rem; margin: 1rem 0 2rem !important; }
.cp-cta .cp-actions { justify-content: center; }
.cp-cta-links { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1.8rem !important; font-size: .95rem; }
.cp-cta-links a { color: #fff; opacity: .9; }
.cp-cta-links a:hover { color: #fff; opacity: 1; }

/* ---- Motion ------------------------------------------------------------- */

.cp-anim .cp-reveal { opacity: 0; translate: 0 28px; transition: opacity .6s ease, translate .6s ease; transition-delay: calc(var(--d, 0) * 80ms); }
.cp-anim .cp-reveal.in { opacity: 1; translate: 0 0; }
@keyframes cp-float { 50% { translate: 0 -8px; } }
@keyframes cp-pop { from { scale: .9; opacity: .4; } }
@keyframes cp-drop { from { translate: 0 -16px; opacity: .3; } }
@keyframes cp-shake { 25% { translate: -6px 0; } 75% { translate: 6px 0; } }
@media (prefers-reduced-motion: reduce) {
    .cp *, .cp *::before { animation: none !important; transition: none !important; }
}

/* ---- Small screens ------------------------------------------------------ */

@media (max-width: 991px) {
    .cp-hero-grid, .cp-split { grid-template-columns: 1fr; gap: 3rem; }
    .cp-flip .cp-copy { order: 0; }
    .cp-copy { text-align: center; }
    .cp-steps, .cp-modes { grid-template-columns: 1fr; gap: 2rem; max-width: 480px; margin: 0 auto; }
    .cp-step:nth-child(2) { transform: none; }
    .cp-themes { grid-template-columns: repeat(3, 1fr); }
    .cp-perks { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .cp-section { padding-top: 4.5rem; }
    .cp-hero { border-radius: 0 0 32px 32px; }
    .cp-demo, .cp-stack > .cp-card { transform: none; }
    .cp-card { padding: 1.3rem; }
    .cp-board { gap: 10px; }
    .cp-themes { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
    .cp-perks { grid-template-columns: 1fr; }
    .cp-bubble { left: -8px; }
    .cp-shots img { width: 200px; }
    .cp-gallery { border-radius: 32px; }
}
