:root {
    color-scheme: dark;
    font-family: Georgia, serif;
    background: #102436;
    color: #fff4dd;
}

* { box-sizing: border-box; }

body { margin: 0; }

.game-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(1rem, 4vw, 4rem);
    max-width: 72rem;
    padding: clamp(1rem, 4vw, 3rem);
    margin-inline: auto;
}

.game-intro { max-width: 32rem; }
.sound-toggle { margin-top: .75rem; border: 1px solid #a7bdd0; background: #192f42; color: #fff4dd; }
.sound-toggle[aria-pressed="true"] { border-color: #ffd288; color: #ffd288; }
.sound-toggle[aria-pressed="true"]::after { content: " ✓"; }
.puzzle-shell { align-items: start; }
h1 { margin: 0; font-size: clamp(2.25rem, 5vw, 4rem); line-height: 1.02; }
p, small { line-height: 1.5; }
.eyebrow { color: #ffd288; }
.notice { border-inline-start: 3px solid #f1b961; padding-inline-start: .75rem; }
.calendar-art { display: block; width: 100%; height: auto; border-radius: .75rem; }

form { display: grid; gap: .55rem; margin-block: 1rem; }
label { font-weight: 700; }
input, button {
    min-height: 2.75rem;
    border-radius: .4rem;
    font: inherit;
    padding: .55rem .75rem;
}

input { width: 100%; border: 1px solid #a7bdd0; background: #192f42; color: inherit; }
button { border: 0; background: #ffd288; color: #332018; font-weight: 700; cursor: pointer; }
summary { cursor: pointer; padding-block: .55rem; }
:focus-visible { outline: 3px solid #fff4dd; outline-offset: 3px; }

.calendar-board { position: relative; }
.calendar-doors { position: absolute; inset: 0; padding: 0; margin: 0; list-style: none; }
.door { position: absolute; top: var(--top); left: var(--left); transform: translate(-50%, -50%); }
.door a, .door span {
    display: grid;
    place-items: center;
    min-width: max(2.75rem, 4.5vw);
    min-height: 2.75rem;
    border: 2px solid #edce93;
    border-radius: .65rem .65rem .2rem .2rem;
    background: #3d2927;
    color: #fff4dd;
    box-shadow: 0 2px 8px #111a;
    font: 700 1.15rem Georgia, serif;
    text-decoration: none;
}
.door a.door-ready { background: #ffd288; color: #332018; }
.door a.door-completed { background: #234b38; }
.door-1 { --left: 18%; --top: 23%; }
.door-2 { --left: 62%; --top: 27%; }
.door-3 { --left: 12%; --top: 56%; }
.door-4 { --left: 89%; --top: 35%; }
.door-5 { --left: 39%; --top: 42%; }
.door-6 { --left: 94%; --top: 49%; }
.door-7 { --left: 78%; --top: 81%; }
.door-8 { --left: 40%; --top: 58%; }
.door-9 { --left: 70%; --top: 52%; }
.door-10 { --left: 12%; --top: 76%; }
.door-11 { --left: 43%; --top: 78%; }
.door-12 { --left: 60%; --top: 67%; }

a { color: #ffdf9d; }
.primary-link, .calendar-back { display: inline-block; padding: .55rem .75rem; border-radius: .4rem; }
.primary-link { background: #ffd288; color: #332018; font-weight: 700; }
.calendar-back { margin-top: 1rem; border: 1px solid #a7bdd0; background: #192f42; color: #fff4dd; }
.tag-collection { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; padding: 0; }
.tag-collection li { padding: .35rem .55rem; background: #192f42; border-radius: .35rem; }
.achievement-collection { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; padding: 0; }
.achievement-collection li { padding: .35rem .55rem; border: 1px solid #9c7954; border-radius: 1rem; color: #ffe1ac; font-size: .9rem; }
[data-copy-link] { margin-top: .5rem; }

.parcel-shelf { width: min(100%, 25rem); justify-self: center; }
.parcel-shelf form { margin: 0; }
.parcel-shelf form > p { margin-block: 0 .35rem; }
.parcel-board {
    position: relative;
    aspect-ratio: 2 / 3;
    margin: 0 0 .55rem;
    padding: 0;
    list-style: none;
    border-radius: .55rem;
    background: #502812 url('../assets/images/twelve-days-christmas/parcel-shelf/cabinet.png') center / 100% 100%;
}
/* These bands sit inside the painted openings, above the wooden ledges. */
.parcel-board li { position: absolute; inset: var(--top) 9% auto; height: 13%; }
.parcel-board li:nth-child(1) { --top: 5.8%; }
.parcel-board li:nth-child(2) { --top: 20.8%; }
.parcel-board li:nth-child(3) { --top: 36%; }
.parcel-board li:nth-child(4) { --top: 50.8%; }
.parcel-board li:nth-child(5) { --top: 65.5%; }
.parcel-board li:nth-child(6) { --top: 82%; }
.parcel-board :is(button, .solved-parcel) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    background: transparent;
    color: #fff4dd;
}
.parcel-board img {
    width: 43%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 .2rem .2rem #2e130c);
}
.parcel-board button span {
    padding: .2rem .6rem;
    min-width: 4rem;
    background: #321a14c9;
    border-radius: .25rem;
}
.parcel-board button[aria-pressed="true"] { outline: 2px solid #ffd288; outline-offset: -2px; background: #ffd28826; }
.puzzle-clues { padding-inline-start: 1.35rem; line-height: 1.6; }
.earned-tag { font-size: 1.55rem; color: #ffd288; }

.memory-board {
    padding: 1rem;
    border-radius: .75rem;
    text-align: center;
    background: #102436;
}
.memory-scene {
    position: relative;
    aspect-ratio: 3 / 2;
    margin-inline: -1rem;
    background: url('../assets/images/twelve-days-christmas/day-02.png') center / 100% 100%;
}
.memory-circle {
    position: absolute;
    isolation: isolate;
    /* Register the wheel to the painted inner glass, in artwork coordinates. */
    inset: 14.2% 24.5% 14.2% 24.5%;
    overflow: hidden;
    border: clamp(3px, .65vw, 7px) solid #edce93;
    border-radius: 50%;
    background: #182a3e52;
}
.memory-circle button {
    position: absolute;
    inset: 0;
    padding: 0;
    background: color-mix(in srgb, var(--animal-color) 74%, transparent);
    color: #171324;
    clip-path: polygon(50% 50%, var(--wedge));
}
.memory-circle button span {
    position: absolute;
    left: var(--animal-x);
    top: var(--animal-y);
    transform: translate(-50%, -50%);
    width: 25%;
    height: 28%;
}
.memory-circle button img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 2px #38251b73); }
.memory-circle button { font-size: 0; }
.memory-circle button:disabled { cursor: default; }
.memory-circle button.lit, .memory-circle button:focus-visible, .memory-circle button:active {
    background: #fff7ce;
    filter: brightness(1.2);
}
.memory-circle button.lit span { transform: translate(-50%, -50%) scale(1.28); }
.memory-circle button:nth-child(1) { --wedge: 50% 0%, 100% 0%, 100% 21%; --animal-x: 66%; --animal-y: 23%; --animal-color: #f5d47a; }
.memory-circle button:nth-child(2) { --wedge: 100% 21%, 100% 79%; --animal-x: 82%; --animal-y: 50%; --animal-color: #ffad84; }
.memory-circle button:nth-child(3) { --wedge: 100% 79%, 100% 100%, 50% 100%; --animal-x: 66%; --animal-y: 77%; --animal-color: #c6b4ef; }
.memory-circle button:nth-child(4) { --wedge: 50% 100%, 0% 100%, 0% 79%; --animal-x: 34%; --animal-y: 77%; --animal-color: #f5a5b7; }
.memory-circle button:nth-child(5) { --wedge: 0% 79%, 0% 21%; --animal-x: 18%; --animal-y: 50%; --animal-color: #9adaba; }
.memory-circle button:nth-child(6) { --wedge: 0% 21%, 0% 0%, 50% 0%; --animal-x: 34%; --animal-y: 23%; --animal-color: #98cfe9; }
.memory-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }

.illustrated-board { padding: 1rem; background: #192f42; border-radius: .75rem; min-width: 0; }
.market-tools { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.market-tools button { min-width: 2.75rem; }
.market-scroll { overflow: auto; max-height: 65vh; border-radius: .45rem; background: #102436; }
.market-scene { position: relative; width: 100%; cursor: default; }
.market-scene img { display: block; width: 100%; height: auto; }
.market-target {
    cursor: inherit;
    position: absolute;
    top: var(--y);
    left: var(--x);
    transform: translate(-50%, -50%);
    width: max(2.75rem, 5%);
    min-height: 2.75rem;
    padding: 0;
    border-radius: 50%;
    background: transparent;
}
.market-target.found { background: #ffd288; border: 2px solid #332018; }
.clue-found { color: #b2e8c9; text-decoration: line-through; }
.cipher-scene {
    position: relative;
    aspect-ratio: 1672 / 941;
    border-radius: .45rem;
    background: url('../assets/images/twelve-days-christmas/day-04.png') center / 100% 100%;
}
.cipher-birds {
    position: absolute;
    inset: 52% 10% auto 21%;
    display: flex;
    justify-content: space-around;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cipher-bird { position: relative; text-align: center; width: 24%; }
.cipher-bird-picture {
    position: absolute;
    z-index: 1;
    bottom: calc(100% - 5px);
    left: 50%;
    width: 100%;
    max-height: 7rem;
    transform: translateX(-50%);
    object-fit: contain;
    object-position: center bottom;
}
.cipher-mark {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    width: min(75%, 2.2rem);
    height: calc(2.15rem + var(--scarf-length) * .55rem);
    margin: 0 auto;
    padding: .25rem .2rem;
    border-inline: 1px solid #eab67c;
    background: repeating-linear-gradient(90deg, #ffffff0c 0 1px, transparent 1px 3px), linear-gradient(90deg, #651e29, #a43743 55%, #6d202c);
    color: #fff0c5;
    box-shadow: 1px 3px 4px #10243666;
    transform: rotate(-5deg);
    transform-origin: top;
}
.cipher-bird:nth-child(even) .cipher-mark { transform: rotate(5deg); }
.cipher-mark::after {
    content: "";
    position: absolute;
    inset: auto 0 -.15rem;
    height: .22rem;
    background: repeating-linear-gradient(90deg, #eab67c 0 1px, transparent 1px 3px);
}
.cipher-mark strong { line-height: 1; }
.cipher-stripes { display: grid; gap: 2px; width: 78%; }
.cipher-stripes i { height: 2px; background: currentColor; }
.cipher-key { width: 100%; text-align: center; border-collapse: collapse; margin-top: 1rem; background: #122638aa; }
.cipher-key th, .cipher-key td { border: 1px solid #728b9f; padding: .35rem; }
.cipher-key caption { padding-bottom: .4rem; }
[hidden] { display: none !important; }

.jeweler-board {
    min-width: 0;
    padding: 1rem;
    border-radius: .75rem;
    background: #102436;
}
.jeweler-scene {
    position: relative;
    max-width: 38rem;
    min-height: 37rem;
    aspect-ratio: 2 / 3;
    margin-inline: auto;
    border-radius: .5rem;
    background: #542b17 url('../assets/images/twelve-days-christmas/jeweler-table.png') center / 100% 100% no-repeat;
    text-align: center;
}
.ring-tray {
    position: absolute;
    inset: 11% 7% auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .15rem;
}
.jeweler-scene [data-ring-selection],
.jeweler-scene [data-scale-result] {
    position: absolute;
    inset: 22% 8% auto;
    margin: 0;
    color: #fff0ce;
    font-size: .83rem;
    text-shadow: 0 1px 3px #1d1009, 0 0 6px #1d1009;
}
.jeweler-scene [data-scale-result] { top: 53.8%; }
.scale {
    position: absolute;
    bottom: 53%;
    left: 50%;
    width: min(65%, 18rem);
    height: 6.8rem;
    transform: translateX(-50%);
}
.scale-post {
    position: absolute;
    inset: .35rem auto 0 50%;
    width: .45rem;
    transform: translateX(-50%);
    border-radius: 50% 50% .2rem .2rem;
    background: linear-gradient(90deg, #754819, #ffe4a1, #a56926);
}
.scale-post::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 4.7rem;
    height: .55rem;
    transform: translateX(-50%);
    border-radius: 50% .4rem .2rem .2rem;
    background: linear-gradient(#ffe4a1, #8c5723);
    box-shadow: 0 .25rem .35rem #2b120ac9;
}
.scale-beam {
    position: absolute;
    inset: 1rem 9% auto;
    height: .35rem;
    border-radius: 50%;
    background: linear-gradient(#ffe4a1, #8c5723);
    transform: rotate(var(--scale-tilt, 0deg));
    transition: transform .28s ease;
}
.jeweler-board .scale [data-pan] {
    position: absolute;
    top: 2.2rem;
    width: 37%;
    transform: translateX(-50%) rotate(calc(-1 * var(--scale-tilt, 0deg)));
    transform-origin: 50% -2.2rem;
    transition: transform .28s ease;
    border-radius: .2rem .2rem 45% 45%;
    border-bottom: .3rem solid #e6b36a;
}
.scale [data-pan]::before {
    content: "";
    position: absolute;
    top: -2.2rem;
    width: 75%;
    height: 2.2rem;
    background: #dbb278;
    clip-path: polygon(50% 0, 100% 100%, 97% 100%, 50% 4%, 3% 100%, 0 100%);
    pointer-events: none;
}
.scale [data-pan="right"] { left: 100%; }
.pipes {
    position: absolute;
    inset: 64% 8% 1%;
    display: grid;
    grid-template-rows: repeat(3, 1fr);
}
.pipe { position: relative; align-self: end; }
.pipe [data-pipe-status] {
    display: block;
    font-size: .72rem;
    color: #fff1d3;
    text-shadow: 0 1px 3px #1d1009, 0 0 4px #1d1009;
}
.jeweler-notes { margin-top: .65rem; text-align: start; }
.jeweler-board :is(.ring-tray button, [data-pan], .pipe-hook) {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: .2rem;
    min-width: 0;
    padding: .25rem .1rem;
    background: transparent;
    color: #fff4dd;
    font-size: clamp(.65rem, 2.7vw, .8rem);
    text-shadow: 0 1px 3px #170c05, 0 0 5px #170c05;
}
.jeweler-board .ring-tray button { min-height: 2.75rem; }
.jeweler-board .scale [data-pan] {
    min-height: 2.5rem;
    background: linear-gradient(115deg, #754318, #c18b42 32%, #946028 73%, #673817);
    box-shadow: inset 0 2px #edc680, 0 .22rem .35rem #2b120a8a;
}
.jeweler-board .pipe-hook {
    min-height: 2.55rem;
    border: 1px dashed #ffe3ad;
    background: #522b1699;
}
.jeweler-board .pipe-hook:has(.ring-piece:not([hidden])) { border-color: transparent; background: transparent; }
.jeweler-board [aria-pressed="true"] { outline: 2px solid #ffda92; outline-offset: -2px; }
.ring-piece {
    display: block;
    width: 1.6rem;
    aspect-ratio: 1;
    border: .26rem solid #e9b958;
    border-top-color: #ffe9a0;
    border-bottom-color: #a86d2e;
    border-radius: 50%;
    box-shadow: 0 1px 3px #0008, inset 0 1px 2px #0009;
}
.ring-piece[data-ring-design="1"] { border-style: double; }
.ring-piece[data-ring-design="2"] { border-top-width: .42rem; }
.ring-piece[data-ring-design="3"] { transform: scaleX(.82); }
.ring-piece[data-ring-design="4"] { border-width: .34rem; }
.pipe-fixed { display: grid; justify-items: center; align-content: center; gap: .2rem; color: #fff4dd; font-size: .8rem; }
.pipe-fixed .ring-piece { border-color: #b5bac1; border-top-color: #f1f4f9; border-bottom-color: #727b85; }
.pipe-apparatus { position: relative; padding-bottom: .65rem; }
.pipe-beam {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(2.75rem, .9fr) repeat(3, minmax(0, 1fr));
    gap: .18rem;
    padding: 0 .2rem .12rem;
    border-bottom: .48rem solid #b87540;
    border-radius: .2rem;
    box-shadow: 0 2px #563016, inset 0 -2px #efb977;
    transform: rotate(var(--tilt, 0deg));
    transform-origin: 50% 100%;
    transition: transform .28s ease;
}
.pipe-beam > :nth-child(3) { grid-column: 4; }
.pipe-beam, .pipe-pivot { --pivot-x: 42%; }
.pipe-beam { transform-origin: var(--pivot-x) 100%; }
.pipe-pivot {
    position: absolute;
    bottom: .35rem;
    left: var(--pivot-x);
    transform: translateX(-50%);
    display: grid;
    justify-items: center;
    min-width: 2.65rem;
    padding: .22rem .15rem;
    border: 1px solid #e8b76f;
    border-radius: .3rem;
    background: #39251d;
    color: #ffe3ad;
    font-size: .63rem;
    line-height: 1.15;
    pointer-events: none;
}
.pipe-pivot::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 55% -.45rem -.55rem;
    background: #815235;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.pipe-pivot strong { font-size: 1.25rem; }
.pipe.balanced .pipe-pivot { background: #264331; border-color: #ffdf93; box-shadow: 0 0 .6rem #ffcf6380; }
@media (prefers-reduced-motion: reduce) { .pipe-beam, .scale-beam, .jeweler-board .scale [data-pan] { transition: none; } }

.winter-board { min-width: 0; padding: 1rem; border-radius: .75rem; background-color: #192f42; }
.winter-6 {
    container-type: inline-size;
    background: #192f42;
    padding: 0;
}
.snowflake-matches {
    position: relative;
    min-height: max(30rem, 66.667cqw);
    display: flow-root;
    box-sizing: border-box;
    padding-top: max(.4rem, 1.2cqw);
    padding-bottom: 1rem;
    border-radius: inherit;
    background: url('../assets/images/twelve-days-christmas/day-06.png') center top / cover no-repeat;
    text-align: center;
}
.snowflake-instructions {
    position: relative;
    z-index: 1;
    width: fit-content;
    margin: 0 auto .4rem;
    padding: .16rem .45rem;
    border-radius: .35rem;
    background: #172b38e8;
    color: #fff2d6;
    font-weight: 700;
    font-size: .82rem;
}
.folded-sheets, .snowflake-options { display: grid; gap: .65rem; text-align: center; }
.folded-sheets {
    position: relative;
    margin: 0 auto 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0;
    width: min(90%, max(50cqw, 22.5rem));
}
.snowflake-options {
    position: relative;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 78%;
    max-width: 31rem;
    margin: clamp(2.5rem, 7cqw, 3.5rem) auto 0;
}
.snowflake-matches :is([data-snowflake-target], [data-snowflake-design]) {
    position: relative;
    z-index: 1;
    justify-self: center;
    width: 100%;
    max-width: 7rem;
    padding: .32rem;
    border: 2px solid transparent;
    background: #fff2d6e8;
    color: #392315;
    box-shadow: 0 2px 4px #4c2b2466;
    font-size: clamp(.68rem, 2.6vw, .9rem);
}
.snowflake-matches [aria-pressed="true"] { outline: 3px solid #442a19; outline-offset: 2px; }
.snowflake-matches [data-snowflake-target] { max-width: 4.6rem; min-height: 8rem; }
.snowflake-matches .paper-grid.folded { max-width: 2.5rem; }
.snowflake-matches :is([data-snowflake-target="a"], .matched-a) { border-color: #963531; }
.snowflake-matches :is([data-snowflake-target="b"], .matched-b) { border-color: #29614e; }
.snowflake-match-label { display: block; font-weight: 500; }
.snowflake-lights { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.snowflake-lights path { fill: none; stroke: #28503d; stroke-width: 2; }
.snowflake-lights circle { stroke: #fff4c4; stroke-width: .8; filter: drop-shadow(0 0 2px #fff1a2); }
.snowflake-bulb-a { fill: #dd4639; }
.snowflake-bulb-b { fill: #76ddaa; }
[data-snowflake-check] { position: relative; margin-top: 1rem; }
.snowflake-results { padding: 0 1rem 1rem; }
.snowflake-results [data-winter-status]:empty { display: none; }
.paper-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px;
    max-width: 6.25rem;
    margin: .3rem auto;
    border: .2rem solid #f7e7c5;
    background: #a59580;
}
.paper-grid.folded { grid-template-columns: repeat(3, 1fr); max-width: 4.25rem; }
.paper-grid span { aspect-ratio: 1; background: #fff4dd; }
.paper-grid .hole { background: #3c6077; border-radius: 50%; }
.snowflake-matches .paper-grid { position: relative; }
.snowflake-matches .paper-grid::before,
.snowflake-matches .paper-grid::after {
    content: "";
    position: absolute;
    pointer-events: none;
}
.snowflake-matches .paper-grid::before {
    inset: 0 auto 0 50%;
    border-left: 1px dashed #795134;
}
.snowflake-matches .paper-grid::after {
    inset: 50% 0 auto;
    border-top: 1px dashed #795134;
}
.snowflake-matches .paper-grid.folded::before { left: 0; }
.snowflake-matches .paper-grid.folded::after { top: 100%; }
.pond-scene {
    position: relative;
    isolation: isolate;
    aspect-ratio: 3 / 2;
    border-radius: .45rem;
    overflow: hidden;
}
.pond-scene::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url('../assets/images/twelve-days-christmas/day-07.png') center / cover;
}
.pond-scene.mirrored::before { transform: scaleX(-1); }
.pond-grid {
    position: absolute;
    inset: 7% 15%;
    display: grid;
    grid-template: repeat(8, minmax(0, 1fr)) / repeat(8, minmax(0, 1fr));
}
.pond-tile {
    display: grid;
    place-items: center;
    line-height: 1;
    font-size: clamp(1.2rem, 3.5vw, 2.6rem);
}
.pond-controls { display: flex; flex-wrap: wrap; gap: .4rem; }
.winter-8 { background: linear-gradient(#10243640, #10243685), url('../assets/images/twelve-days-christmas/day-08.png') center / cover; }
.winter-9 { background: linear-gradient(#10243635, #10243675), url('../assets/images/twelve-days-christmas/day-09.png') center / cover; }
.cocoa-jugs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.jug { display: grid; grid-template-rows: auto 7rem auto repeat(3, auto); gap: .4rem; justify-items: stretch; text-align: center; background: #142c3b7a; border-radius: .5rem; padding: .5rem; }
.jug h3, .jug p { margin: .3rem 0; }
.jug-glass { display: flex; align-items: end; justify-self: center; height: 7rem; width: 65%; background: #90d8ed35; border: 2px solid #add6e0; border-radius: .3rem .3rem 1rem 1rem; overflow: hidden; }
.jug-glass span { height: var(--fill); width: 100%; background: #fff4dd; transition: height .28s ease; }
.jug-glass { align-self: end; }
.jug-glass[data-capacity="3"] { height: 5.6rem; width: 52%; }
.dance-stage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; width: 100%; max-width: 36rem; margin-inline: auto; }
.dance-stage button {
    aspect-ratio: 1;
    min-width: 0;
    padding: .18rem;
    border: 1px solid #fff0d47a;
    background: transparent;
}
.dance-stage button.standing { border-color: #ffd288; }
.dance-stage button.dancer-hint { outline: 3px solid #fff0b2; outline-offset: 2px; box-shadow: 0 0 .7rem #ffcf77; }
.dance-stage button:hover, .dance-stage button:focus-visible {
    outline: 2px solid #ffd288;
    outline-offset: 2px;
}
.dancer-pose {
    display: block;
    width: 100%;
    height: 100%;
    background: url('../assets/images/twelve-days-christmas/dancer-poses.png') right bottom / 200% 100% no-repeat;
    filter: drop-shadow(0 2px 2px #23170db8);
}
.standing .dancer-pose { background-position-x: left; }
.winter-10 { padding: 0 0 1rem; }
.winter-10 > [data-tune] {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    min-height: 25rem;
    box-sizing: border-box;
    padding: 6.5rem clamp(.35rem, 1.5vw, 1rem) 6.6rem;
    background: url('../assets/images/twelve-days-christmas/day-10.png') center / cover no-repeat;
    border-radius: .75rem;
}
.winter-10 > :is([data-winter-status], [data-winter-earned]) { margin-inline: 1rem; }
.tune-score {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: repeat(4, minmax(2.5rem, auto));
    column-gap: clamp(.2rem, 1vw, .5rem);
}
.courtyard-scene {
    position: relative;
    aspect-ratio: 1;
    border-radius: .45rem;
    background: url('../assets/images/twelve-days-christmas/day-11.png') center / cover;
}
.beat-grid { grid-area: 1 / 2 / 5 / 3; display: grid; grid-template-columns: max-content repeat(10, minmax(0, 1fr)); gap: 2px; }
.beat-grid span, .beat-grid strong { display: grid; place-items: center; min-height: 2.5rem; background: #fff0ceae; color: #49301f; font-size: clamp(.75rem, 2.3vw, 1rem); }
.beat-grid strong { padding-inline: .3rem; white-space: nowrap; }
.beat-grid span.note { color: #843627; }
.beat-grid span.current-beat { background: #875137; color: #fff4dd; }
.tune-shift { grid-row: var(--track-row); align-self: center; min-width: 2rem; min-height: 2rem; padding: 0; }
.tune-shift-left { grid-column: 1; }
.tune-shift-right { grid-column: 3; }
.tune-actions { justify-content: center; }
.tune-actions button { font-size: clamp(.72rem, 2.5vw, 1rem); padding-inline: .5rem; }
.courtyard-grid {
    position: absolute;
    inset: 18% 20% 25% 20%;
    display: grid;
    grid-template: repeat(4, minmax(0, 1fr)) / repeat(4, minmax(0, 1fr));
}
.courtyard-grid button {
    min-width: 0;
    min-height: 0;
    padding: 0;
    font-size: clamp(2rem, 6vw, 3.6rem);
    background: transparent;
}
.courtyard-grid .crown { background: #efcb8455; }
.courtyard-grid .legal-landing { box-shadow: inset 0 0 0 3px #317651; background: #c3e6c666; }
.courtyard-grid .suggested, .courtyard-grid [aria-pressed="true"] {
    box-shadow: inset 0 0 0 3px #fff4dd;
    background: #ffd28899;
}
.courtyard-grid .occupied::before {
    content: "";
    display: block;
    width: 86%;
    height: 86%;
    margin: auto;
    background: url('../assets/images/twelve-days-christmas/leaping-lord.png') center / contain no-repeat;
}
.courtyard-hint-action { min-height: 2.75rem; margin-top: .4rem; }
.winter-11 > [data-winter-status] { min-height: 3em; margin: .25rem 0 .75rem; }
.departure-map { position: relative; }
.calendar-replay-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .5rem; }
.calendar-replay-actions [data-copy-link] { margin-top: 0; }
.calendar-replay-actions form { display: contents; }
.departure-fireworks {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    border-radius: .75rem;
    pointer-events: none;
}
.departure-fireworks span {
    position: absolute;
    width: clamp(3px, 1vw, 7px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    opacity: 0;
}
.departure-sleigh { position: absolute; left: 0; top: 2%; height: auto; max-width: none; filter: drop-shadow(0 0 5px #ffe5a580); }
.departure-route { position: absolute; inset: 0; padding: 0; margin: 0; list-style: none; }
.departure-route li {
    position: absolute; top: var(--y); left: var(--x); transform: translate(-50%, -50%);
    display: grid; place-items: center; min-width: 2.5rem; min-height: 2.5rem;
    border: 2px solid #ffdc9e; border-radius: .45rem; background: #172b38; color: #fff4dd;
}
.departure-route.route-2 li { background: #244b39; }
.departure-route.route-3 li { background: #613842; }
.route-step { font-size: .75rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ring-bell {
    position: absolute;
    z-index: 1;
    left: 50%;
    top: 50.9%;
    transform: translate(-50%, -50%);
    width: max(44px, 12%);
    height: max(44px, 9%);
    padding: 0;
    border-radius: 50%;
    background: radial-gradient(ellipse, #ffcf6a33, transparent 72%);
}
.ring-bell:hover, .ring-bell:focus-visible { outline: 2px solid #ffe4a0; outline-offset: 3px; }
.bell-sparkles { position: absolute; inset: 0; pointer-events: none; }
.bell-sparkles i {
    position: absolute;
    color: #fff5c2;
    font-size: clamp(.75rem, 2vw, 1.3rem);
    font-style: normal;
    line-height: 1;
    text-shadow: 0 0 .35rem #ffad34, 0 0 .7rem #ffb438;
    animation: bell-twinkle 1.8s ease-in-out infinite alternate;
}
.bell-sparkles i:nth-child(1) { left: 2%; top: 10%; }
.bell-sparkles i:nth-child(2) { right: 1%; top: 14%; animation-delay: -.7s; }
.bell-sparkles i:nth-child(3) { right: 5%; bottom: 3%; animation-delay: -1.3s; }
.bell-sparkles i:nth-child(4) { left: 7%; bottom: 8%; animation-delay: -.9s; }
.ring-bell.ringing .bell-sparkles { animation: bell-ring .5s ease infinite; }
.ring-bell.ringing { animation: bell-glow .55s ease-in-out infinite alternate; }
@keyframes bell-glow { from { box-shadow: 0 0 .3rem #ffd27880; } to { box-shadow: 0 0 1.5rem .5rem #ffd278bb; } }
@keyframes bell-twinkle { from { opacity: .55; transform: scale(.7); } to { opacity: 1; transform: scale(1.25); } }
@keyframes bell-ring { 50% { transform: scale(1.65); } }
.reward-coupon { padding: clamp(1rem, 4vw, 2rem); border: 3px dashed #8e633b; outline: 4px solid #f5e0ba; border-radius: .65rem; background: #fff4dd; color: #32251c; text-align: center; overflow-wrap: anywhere; }
.coupon-venue { font-weight: 700; color: #674b33; }
.coupon-code { padding: .65rem; border: 1px solid #a28358; font: 700 clamp(1.1rem, 4vw, 1.8rem) monospace; }
.coupon-image { display: block; max-width: 100%; max-height: 14rem; object-fit: contain; margin: 0 auto; }
.coupon-terms { white-space: pre-wrap; }

.puzzle-shell :is(.game-intro, .memory-board, .illustrated-board, .jeweler-board, .winter-board,
    .departure-board, .snowflake-results, [data-illustrated-earned], [data-winter-earned]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .85rem;
}
.puzzle-shell :is(.game-intro, .memory-board, .illustrated-board, .jeweler-board, .winter-board,
    .departure-board, .snowflake-results, [data-illustrated-earned], [data-winter-earned])
    > :is(p, h2, ul, form, .sound-toggle, .calendar-back, .market-tools, .cipher-key, .jeweler-notes) {
    margin-block: 0;
}
.puzzle-shell :is(.sound-toggle, .calendar-back, .primary-link, [data-jeweler-new]) { justify-self: start; }
.memory-board > .primary-link { justify-self: center; }
.puzzle-shell p[role="status"]:empty { display: none; }
.puzzle-shell .winter-11 > [data-winter-status] { display: block; }
.puzzle-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; }
.snowflake-results:not(:has([data-winter-status]:not(:empty), [data-winter-earned]:not([hidden]))),
.courtyard-hint-action:not(:has(button:not([hidden]))) { display: none; }
.game-intro > .reward-coupon { margin-block: 1.25rem; }
@media (prefers-reduced-motion: reduce) { .jug-glass span { transition: none; } }
@media (prefers-reduced-motion: reduce) {
    .bell-sparkles i, .ring-bell.ringing, .ring-bell.ringing .bell-sparkles { animation: none; }
}

@media (min-width: 47.01rem) {
    .puzzle-shell:is([data-day="2"], [data-day="3"], [data-day="7"], [data-day="9"], [data-day="10"], [data-day="11"]) {
        max-width: 88rem;
        grid-template-columns: minmax(16rem, .7fr) minmax(0, 1.3fr);
        gap: clamp(1.25rem, 3vw, 3rem);
    }
}
@media (max-width: 47rem) {
    .game-shell { grid-template-columns: 1fr; max-width: 34rem; }
    /* Crop the decorative sides while keeping the wheel on the painted glass. */
    .memory-scene { aspect-ratio: 1; background-size: 150% 100%; }
    .memory-circle { inset: 14.2% 11.75%; }
    .door-6 { --left: 92%; }
}
