/* Bubble Blast: vibrant twilight arcade bubble shooter inspired by Bentomino's layout, Allo typography & glossy 3D pills. */
:root {
    --ink: #291852;
    --cream: #fff9f2;
    --gold: #ffcf33;
    --green-top: #65ef52;
    --green-bot: #1ab32e;
    --green-lip: #0f7a1e;
    --blue-top: #52c6ff;
    --blue-bot: #1978f0;
    --blue-lip: #104ea8;
    --round: "ROND" 100;
    --font: "Allo", system-ui, sans-serif;
    --top: max(10px, env(safe-area-inset-top));
    --bottom: max(12px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: #1c0c46;
    color: var(--ink);
    font-family: var(--font);
    font-variation-settings: var(--round);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body { touch-action: none; overscroll-behavior: none; }

button {
    font: inherit;
    color: inherit;
    border: 0;
    padding: 0;
    background: none;
    cursor: pointer;
    touch-action: manipulation;
}

svg { display: block; }

/* ---------------------------------------------------------------- loader */

#loader {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 24px;
    background: radial-gradient(ellipse at 50% 38%, #471f96, #18093d);
    transition: opacity 0.35s;
}

#loader img { width: min(74vw, 350px); animation: breathe-logo 1.5s ease-in-out infinite alternate; }
#loader i { width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.28); border-top-color: #ffe248; animation: spin 0.85s linear infinite; }
#loader.gone { opacity: 0; pointer-events: none; }

@keyframes breathe-logo { to { transform: scale(1.04); } }
@keyframes spin { to { transform: rotate(1turn); } }

/* ---------------------------------------------------------------- drifting world backdrop */

#bg { position: fixed; inset: 0; overflow: hidden; background: #1d0c48; }

#bg i {
    position: absolute;
    inset: -12%;
    background: var(--back, url(media/back-candy.jpg)) center / cover;
    animation: drift 46s ease-in-out infinite alternate;
    will-change: transform;
    transition: background-image 0.9s ease;
}

#bg i + i {
    transform: scaleX(-1);
    animation: drift2 38s ease-in-out infinite alternate, breathe 22s ease-in-out infinite alternate;
    opacity: 0.45;
}

#bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 42%, rgba(45, 16, 108, 0.12) 25%, rgba(12, 4, 34, 0.62) 100%);
}

@keyframes drift {
    from { transform: scale(1.06) translate(-2.5%, -2%) rotate(-1.5deg); }
    to { transform: scale(1.16) translate(2.5%, 2.5%) rotate(2deg); }
}

@keyframes drift2 {
    from { transform: scaleX(-1) scale(1.18) translate(3%, 2%) rotate(3deg); }
    to { transform: scaleX(-1) scale(1.08) translate(-2.5%, -3%) rotate(-2deg); }
}

@keyframes breathe { from { opacity: 0.18; } to { opacity: 0.62; } }

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

#home, #game { position: fixed; inset: 0; display: none; }
body[data-screen="home"] #home, body[data-screen="game"] #game { display: block; }

/* ---------------------------------------------------------------- glossy Bentomino buttons */

.key, .big {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    color: var(--ink);
    background: linear-gradient(#ffffff, #ebe0fa);
    box-shadow: 0 5px 0 #b09acc, 0 8px 0 rgba(12, 4, 38, 0.35);
    transition: transform 0.08s, box-shadow 0.08s, opacity 0.2s;
}

.key svg, .big svg { width: 24px; height: 24px; fill: currentColor; }
.key:active, .big:active { transform: translateY(4px); box-shadow: 0 1px 0 #b09acc, 0 3px 0 rgba(12, 4, 38, 0.35); }

.key.round { width: 46px; height: 46px; }
.key.round svg { width: 22px; height: 22px; }

.key.small-gear {
    width: 44px;
    height: 44px;
    color: #fff;
    background: rgba(56, 28, 120, 0.65);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 0 rgba(16, 6, 48, 0.6);
}
.key.small-gear:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(16, 6, 48, 0.6); }

.big { position: relative; width: 72px; height: 72px; }
.big svg { width: 32px; height: 32px; }
.big.plain { color: var(--ink); background: linear-gradient(#ffffff, #ede4fa); box-shadow: 0 5px 0 #b09acc, 0 8px 0 rgba(12, 4, 38, 0.26); }
.big.green { color: #fff; background: linear-gradient(var(--green-top), var(--green-bot)); box-shadow: 0 5px 0 var(--green-lip), 0 8px 0 rgba(12, 4, 38, 0.28); }
.big.green:active { box-shadow: 0 1px 0 var(--green-lip), 0 3px 0 rgba(12, 4, 38, 0.28); }
.big.gold { color: #fff; background: linear-gradient(#ffdf58, #ffa21a); box-shadow: 0 5px 0 #c66a06, 0 8px 0 rgba(12, 4, 38, 0.28); }
.big.gold b { font-size: 26px; font-weight: 900; text-shadow: 0 2px 0 rgba(140, 62, 0, 0.45); }
.big[hidden] { display: none; }

.big .count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: 13px;
    font-style: normal;
    font-size: 14px;
    font-weight: 850;
    line-height: 26px;
    color: #fff;
    background: #ef2e48;
    box-shadow: 0 0 0 3px #fff;
}

/* ---------------------------------------------------------------- home / world map */

#mapview { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

#scroller {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    overscroll-behavior: contain;
    scrollbar-width: none;
}

#scroller::-webkit-scrollbar { display: none; }
@media (pointer: fine) { #scroller { cursor: grab; } #scroller.dragging { cursor: grabbing; } }

.bar-top {
    position: absolute;
    top: var(--top);
    left: 14px;
    right: 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    pointer-events: none;
    z-index: 5;
}

.bar-top > * { pointer-events: auto; }

#logo {
    width: min(56vw, 260px);
    margin-top: -4px;
    filter: drop-shadow(0 5px 0 rgba(24, 6, 64, 0.48));
    pointer-events: none;
}

.pill-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 14px;
    border-radius: 22px;
    color: #fff;
    font-size: 16px;
    font-weight: 850;
    background: linear-gradient(#6a44cc, #402096);
    border: 2px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 4px 0 #240f62, 0 7px 0 rgba(12, 4, 38, 0.35);
    font-feature-settings: "tnum";
}

.pill-btn svg { width: 20px; height: 20px; fill: #ffe148; }
.pill-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #240f62; }

.bar-foot {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(var(--bottom) + 6px);
    display: flex;
    justify-content: center;
    gap: 12px;
    pointer-events: none;
    z-index: 5;
}

.play {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 64px;
    padding: 0 24px;
    border-radius: 32px;
    color: #fff;
    font-size: clamp(19px, 4.8vw, 24px);
    font-weight: 900;
    letter-spacing: 0.02em;
    border: 2.5px solid rgba(255, 255, 255, 0.52);
    transition: transform 0.08s, box-shadow 0.08s;
}

.play.green {
    background: linear-gradient(var(--green-top), var(--green-bot));
    box-shadow: 0 6px 0 var(--green-lip), 0 11px 0 rgba(12, 4, 38, 0.36);
    text-shadow: 0 2px 0 rgba(10, 88, 22, 0.55);
    animation: pulse-play 1.8s ease-in-out infinite;
}

.play.green:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--green-lip), 0 4px 0 rgba(12, 4, 38, 0.36); animation: none; }

.play.blue {
    background: linear-gradient(var(--blue-top), var(--blue-bot));
    box-shadow: 0 6px 0 var(--blue-lip), 0 11px 0 rgba(12, 4, 38, 0.36);
    text-shadow: 0 2px 0 rgba(8, 52, 128, 0.55);
}

.play.blue:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--blue-lip), 0 4px 0 rgba(12, 4, 38, 0.36); }

.play svg { width: 24px; height: 24px; flex: none; }
.play b { font-feature-settings: "tnum"; }

@keyframes pulse-play { 50% { transform: scale(1.035); } }

/* ---------------------------------------------------------------- game screen */

#view, #fxview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

#fxview { pointer-events: none; z-index: 2; }

#top {
    position: absolute;
    top: var(--top);
    left: 10px;
    right: 10px;
    max-width: 540px;
    margin: 0 auto;
    height: 62px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 10;
}

#top > * { pointer-events: auto; }
.top-left, .top-right { display: flex; align-items: center; gap: 8px; }

#center-hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

#mode-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 14px 5px;
    border-radius: 18px;
    background: rgba(24, 11, 62, 0.72);
    border: 2px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    box-shadow: 0 3px 0 rgba(10, 4, 32, 0.45);
}

#mode-label {
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.08em;
    color: #ffd858;
}

#mode-pill.endless #mode-label { color: #5ce6ff; }

#score-val {
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    font-feature-settings: "tnum";
}

#star-bar {
    position: relative;
    width: min(148px, 90%);
    height: 18px;
    display: flex;
    align-items: center;
}

#star-bar[hidden] { display: none; }

#star-bar .track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(16, 6, 46, 0.72);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

#star-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    background: linear-gradient(90deg, #ff9624, #ffe848);
    transition: width 0.22s ease-out;
}

.mini-stars {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2px 0 34%;
    pointer-events: none;
}

.mini-stars img {
    width: 17px;
    height: 17px;
    filter: grayscale(1) brightness(0.65);
    transition: transform 0.25s cubic-bezier(0.2, 1.6, 0.4, 1), filter 0.2s;
}

.mini-stars img.lit {
    filter: drop-shadow(0 0 4px rgba(255, 224, 72, 0.85));
    transform: scale(1.22);
}

#star-goal, #endless-best-row {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #ffe65c;
    font-size: 14px;
    font-weight: 850;
    font-feature-settings: "tnum";
    text-shadow: 0 2px 0 rgba(16, 6, 48, 0.65);
}

#star-goal[hidden], #endless-best-row[hidden] { display: none; }
#star-goal img { width: 19px; height: 19px; }
#endless-best-row svg { width: 16px; height: 16px; fill: #ffe04c; }

#shots {
    min-width: 54px;
    height: 52px;
    padding: 0 8px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    color: var(--ink);
    background: linear-gradient(#fffdf8, #efe4d4);
    box-shadow: 0 4px 0 #c2ad90, 0 7px 0 rgba(12, 4, 38, 0.34);
}

#shots b { font-size: 24px; font-weight: 900; line-height: 1; font-feature-settings: "tnum"; }
#shots small { font-size: 8.5px; font-weight: 800; letter-spacing: 0.08em; opacity: 0.6; }
#shots.endless { color: #fff; background: linear-gradient(#4dbfff, #1b72e8); box-shadow: 0 4px 0 #1049a2, 0 7px 0 rgba(12, 4, 38, 0.34); }
#shots.endless small { opacity: 0.85; }
#shots.low { color: #fff; background: linear-gradient(#ff7a58, #eb3838); box-shadow: 0 4px 0 #9c1a24, 0 7px 0 rgba(12, 4, 38, 0.34); }
#shots.low small { opacity: 0.88; }
#shots.bump { animation: bump 0.28s; }

@keyframes bump { 40% { transform: scale(1.16); } }

/* ---------------------------------------------------------------- 5 big glossy booster buttons */

#boosters {
    position: absolute;
    left: 50%;
    bottom: var(--bottom);
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2.8vw, 16px);
    padding: 8px 14px;
    border-radius: 36px;
    background: rgba(24, 10, 64, 0.72);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 0 rgba(10, 4, 34, 0.55);
    z-index: 11;
}

.booster {
    position: relative;
    width: clamp(54px, 14vw, 66px);
    height: clamp(54px, 14vw, 66px);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 35% 30%, #6334c2, #2c1268);
    border: 3px solid rgba(226, 204, 255, 0.55);
    box-shadow: 0 4px 0 #190842, 0 7px 0 rgba(8, 2, 26, 0.45);
    transition: transform 0.12s cubic-bezier(0.2, 1.5, 0.4, 1), border-color 0.15s, box-shadow 0.15s, opacity 0.2s;
}

.booster img {
    width: 78%;
    height: 78%;
    object-fit: contain;
    pointer-events: none;
    transition: transform 0.15s;
}

.booster:hover { transform: translateY(-3px) scale(1.05); }
.booster:active { transform: translateY(3px) scale(0.95); }

.booster.active {
    transform: translateY(-7px) scale(1.12);
    border-color: #ffe848;
    background: radial-gradient(circle at 35% 30%, #ffcf38, #c442ff);
    box-shadow: 0 6px 0 #7014a8, 0 0 18px rgba(255, 224, 68, 0.85);
}

.booster.active img { transform: scale(1.08); }
.booster.empty { opacity: 0.44; filter: saturate(0.4); }
.booster.pop { animation: booster-pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }

@keyframes booster-pop { 45% { transform: scale(1.25); } }

.booster .count {
    position: absolute;
    bottom: -4px;
    right: -4px;
    min-width: 23px;
    height: 23px;
    padding: 0 5px;
    border-radius: 12px;
    font-style: normal;
    font-size: 13px;
    font-weight: 900;
    line-height: 23px;
    text-align: center;
    color: #fff;
    background: linear-gradient(#ff6482, #dc1c44);
    border: 2px solid #fff;
    box-shadow: 0 2px 0 rgba(40, 4, 24, 0.45);
    font-feature-settings: "tnum";
}

.booster.active .count { background: linear-gradient(#ffd948, #ff8c12); color: #361600; }

.booster-flyer {
    position: fixed;
    top: 0;
    left: 0;
    width: 52px;
    height: 52px;
    object-fit: contain;
    z-index: 30;
    pointer-events: none;
    filter: drop-shadow(0 0 10px rgba(255, 228, 72, 0.9));
}

/* ---------------------------------------------------------------- modal cards (Bentomino craft) */

.sheet {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(18, 8, 46, 0.58);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    animation: fade 0.26s both;
    z-index: 25;
}

.sheet[hidden] { display: none; }

.card {
    position: relative;
    width: min(340px, 100%);
    padding: 30px 24px 26px;
    border-radius: 30px;
    text-align: center;
    color: var(--ink);
    background: linear-gradient(#fffdf9, #f5ecf9);
    box-shadow: 0 8px 0 #b8a3cf, 0 16px 0 rgba(12, 4, 38, 0.36);
    animation: rise 0.42s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.card h2 { margin: 4px 0 12px; font-size: 32px; font-weight: 900; line-height: 1.05; }
.card .row { display: flex; justify-content: center; gap: 14px; margin-top: 12px; }

.score-big {
    margin: 0 0 14px;
    font-size: 36px;
    font-weight: 900;
    color: #5b2cc8;
    font-feature-settings: "tnum";
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 8px 0 16px;
    padding: 12px 8px;
    border-radius: 18px;
    background: rgba(91, 44, 200, 0.08);
}

.stats[hidden] { display: none; }
.stats small { display: block; font-size: 11px; font-weight: 800; opacity: 0.55; letter-spacing: 0.08em; }
.stats b { display: block; font-size: 22px; font-weight: 900; color: var(--ink); font-feature-settings: "tnum"; margin-top: 2px; }

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: -4px auto 12px;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 850;
    color: #fff;
    background: linear-gradient(#ffd752, #ff9d1c);
    box-shadow: 0 3px 0 #c66a06;
    text-shadow: 0 1px 0 rgba(130, 55, 0, 0.4);
    animation: pop 0.45s 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.chip[hidden] { display: none; }

.stars { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin: -64px 0 10px; }
.card.has-host { padding-top: 22px; margin-top: 56px; }
.card.has-host .stars { margin: 10px 0 10px; }
.card.has-host .stars img { width: 64px; }
.card.has-host .stars img:nth-child(2) { width: 82px; margin-bottom: 10px; }

/* ---------------------------------------------------------------- Pip animated side host & modal medallion */

#host-side {
    position: fixed;
    left: -12px;
    bottom: calc(var(--bottom) + 96px);
    z-index: 12;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    pointer-events: none;
    transform: translateX(-130%) rotate(-8deg);
    transform-origin: 0% 85%;
    transition: transform 0.42s cubic-bezier(0.2, 1.38, 0.38, 1), opacity 0.25s;
}

#host-side.docked {
    left: max(10px, calc(50% - 434px));
    bottom: -10px;
    transform: translateX(0) rotate(0deg);
    transform-origin: 50% 100%;
}

#host-side.docked.speaking {
    transform: translateY(-10px) scale(1.03);
}

#host-side.peeking {
    transform: translateX(0) rotate(8deg);
}

#host-side.hidden-side {
    transform: translateX(-140%) !important;
    opacity: 0;
}

#host-canvas {
    width: clamp(164px, 16vw, 206px);
    height: auto;
    aspect-ratio: 216 / 224;
    display: block;
    pointer-events: auto;
    cursor: pointer;
    filter: drop-shadow(0 8px 14px rgba(10, 4, 34, 0.55));
}

@media (max-width: 779px) {
    #host-canvas { width: 118px; height: 124px; }
}

#host-bubble {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 -14px 36px;
    padding: 7px 14px;
    border-radius: 20px;
    background: linear-gradient(#ffffff, #f7f1ff);
    border: 3px solid #351c6e;
    box-shadow: 0 4px 0 #351c6e, 0 8px 16px rgba(10, 4, 32, 0.42);
    color: var(--ink);
    font-size: 19px;
    font-weight: 900;
    letter-spacing: 0.02em;
    white-space: nowrap;
    opacity: 0;
    transform: scale(0.4) translateY(14px);
    transform-origin: 24px 100%;
    transition: opacity 0.18s, transform 0.34s cubic-bezier(0.2, 1.55, 0.35, 1);
}

#host-bubble.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

#host-side.peeking #host-bubble.show {
    transform: scale(1) translateY(0) rotate(-8deg);
}

#host-bubble::after {
    content: "";
    position: absolute;
    left: 18px;
    bottom: -10px;
    width: 14px;
    height: 14px;
    background: #f7f1ff;
    border-right: 3px solid #351c6e;
    border-bottom: 3px solid #351c6e;
    transform: rotate(45deg);
    border-bottom-right-radius: 3px;
}

#host-bubble[data-accent="gold"] { background: linear-gradient(#fffbe0, #ffe680); }
#host-bubble[data-accent="gold"]::after { background: #ffe680; }
#host-bubble[data-accent="coral"] { background: linear-gradient(#fff0f3, #ffc4d0); color: #8c122e; }
#host-bubble[data-accent="coral"]::after { background: #ffc4d0; }
#host-bubble[data-accent="cyan"] { background: linear-gradient(#ecfeff, #b8f6ff); color: #0e3d62; }
#host-bubble[data-accent="cyan"]::after { background: #b8f6ff; }
#host-bubble[data-accent="pink"] { background: linear-gradient(#fff0fc, #f4c4ff); color: #5c147a; }
#host-bubble[data-accent="pink"]::after { background: #f4c4ff; }

#host-bubble-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex: none;
}

#host-bubble-icon[hidden] { display: none; }

/* Modal circular portrait medallion hosting Win & Lose cards (inspired by reference bunny!) */
.modal-host-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: -104px auto 12px;
    width: 148px;
    height: 148px;
}

.modal-host-wrap.compact {
    margin: -94px auto 12px;
    width: 132px;
    height: 132px;
}

.host-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 50% 35%, #55c8ff, #2758cc 72%, #1d2882);
    border: 5px solid #ffffff;
    box-shadow: 0 0 0 4px #ffb828, 0 8px 0 rgba(36, 16, 86, 0.35), 0 12px 24px rgba(12, 4, 42, 0.45);
    overflow: hidden;
}

.host-ring canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.modal-speech {
    position: absolute;
    right: -66px;
    top: 10px;
    padding: 6px 13px;
    border-radius: 18px;
    background: linear-gradient(#fffbe0, #ffe680);
    border: 3px solid #351c6e;
    box-shadow: 0 3px 0 #351c6e, 0 6px 12px rgba(16, 6, 48, 0.3);
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
    white-space: nowrap;
    animation: pop 0.45s 0.25s cubic-bezier(0.2, 1.55, 0.35, 1) both;
}

.modal-speech::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #fff1aa;
    border-left: 3px solid #351c6e;
    border-bottom: 3px solid #351c6e;
    transform: translateY(-50%) rotate(45deg);
    border-bottom-left-radius: 2px;
}
.stars img { width: 74px; height: auto; filter: grayscale(1) contrast(0.45) brightness(1.15); }
.stars img:nth-child(2) { width: 96px; margin-bottom: 14px; }
.stars img.on { filter: drop-shadow(0 4px 0 rgba(150, 70, 0, 0.35)); animation: star-in 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.stars img.on:nth-child(2) { animation-delay: 0.18s; }
.stars img.on:nth-child(3) { animation-delay: 0.36s; }

.glint {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--s);
    height: var(--s);
    pointer-events: none;
    opacity: 0;
    filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 5px rgba(255, 180, 30, 0.95));
}

.glint::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, #fff 30%, #fff6c8 60%, #ffd75a);
    clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
}

.stars.full .glint { animation: twinkle 1.5s ease-in-out var(--d) infinite; }

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.1) rotate(0deg); }
    30% { opacity: 1; transform: scale(1.2) rotate(30deg); }
    60% { opacity: 0; transform: scale(0.2) rotate(80deg); }
}

@keyframes star-in {
    0% { transform: scale(0) rotate(-40deg); }
    55% { transform: scale(1.3) rotate(10deg); }
    75% { transform: scale(0.92) rotate(-3deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes pop { from { transform: scale(0); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(38px) scale(0.9); opacity: 0; } }

/* ---------------------------------------------------------------- settings */

.close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(41, 24, 82, 0.08);
}

.close svg { width: 18px; height: 18px; fill: var(--ink); opacity: 0.72; }

.card.form { text-align: left; padding: 26px 22px 18px; }
.card.form h2 { text-align: center; }

.line {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    font-size: 18px;
    font-weight: 800;
}

.line > svg { width: 24px; height: 24px; fill: var(--ink); opacity: 0.75; flex: none; }
.line > span { flex: 1; }

.switch {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 54px;
    height: 32px;
    margin: 0;
    border-radius: 16px;
    background: #d8cceb;
    transition: background 0.2s;
    cursor: pointer;
    flex: none;
}

.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 0 rgba(20, 12, 50, 0.2);
    transition: transform 0.2s;
}

.switch:checked { background: linear-gradient(var(--green-top), var(--green-bot)); }
.switch:checked::after { transform: translateX(22px); }

.form input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: calc(100% - 36px);
    margin: 0 0 8px 36px;
    height: 26px;
    background: none;
}

.form input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: #d8cceb; }
.form input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: #d8cceb; }
.form input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: linear-gradient(#ffd752, #ff9d1c); box-shadow: 0 2px 0 #c66a06; }
.form input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: linear-gradient(#ffd752, #ff9d1c); }
.form input[type="range"]:disabled { opacity: 0.35; }

.credit { margin: 14px 0 0; text-align: center; font-size: 12px; font-weight: 700; opacity: 0.45; }
