/* The jewelry box. One color scheme, no dark mode switch (her standing rule). Plain shapes until her pictures arrive. */
:root { --wall: #2a0a14; --velvet: #4e1230; --gold: #c9a24b; --cream: #f2e2c4; --ink: #2a1c2e; --pink: #c4477a; --teal: #4fb3a9; --foxglove: #d8508f; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--wall); color: var(--cream); font-family: Georgia, "Times New Roman", serif; }
main { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 28px 16px 120px; max-width: 980px; margin: 0 auto; }
.quiet { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.back { position: fixed; left: 14px; top: 14px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--gold); background: var(--velvet); z-index: 5; }
.back::after { content: ""; position: absolute; left: 12px; top: 10px; width: 9px; height: 9px; border-left: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg); }
.back:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

/* the box */
.jbox { position: relative; width: min(100%, 560px); padding: 150px 18px 18px; border-radius: 10px 10px 14px 14px; background: linear-gradient(180deg, #8d2353, var(--velvet)); border: 4px solid var(--gold); box-shadow: 0 24px 50px #000c; }
.lid { position: absolute; left: -4px; right: -4px; top: -118px; height: 150px; border: 4px solid var(--gold); border-bottom: 0; border-radius: 12px 12px 0 0; background: linear-gradient(180deg, #c4477a, #8d2353); transform-origin: 50% 100%; transform: perspective(700px) rotateX(-28deg); }
.lid .mirror { position: absolute; left: 10%; right: 10%; top: 18px; bottom: 16px; border-radius: 8px; background: linear-gradient(160deg, #e8f1f3, #b9d3d9 60%, #8fb3bb); border: 3px solid var(--gold); }
.dancer { position: absolute; left: 50%; top: 44px; width: 44px; height: 96px; margin-left: -22px; transform-origin: 50% 100%; animation: turn 6s linear infinite; }
.dancer i { position: absolute; display: block; }
.dancer .head { left: 12px; top: 0; width: 20px; height: 20px; border-radius: 50%; background: #f2c9a3; border: 2px solid var(--ink); }
.dancer .tutu { left: 0; top: 26px; width: 44px; height: 30px; border-radius: 50% 50% 60% 60% / 30% 30% 70% 70%; background: #fffdf6; border: 2px solid var(--ink); }
.dancer .legs { left: 17px; top: 54px; width: 10px; height: 42px; background: #f2c9a3; border: 2px solid var(--ink); border-top: 0; }
@keyframes turn { to { transform: rotateY(360deg); } }
.drawers { display: flex; flex-direction: column; gap: 10px; }
.drawer { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 14px 8px 54px; border: 3px solid var(--gold); border-radius: 6px; background: linear-gradient(180deg, #5e1a3a, #3a0e24); color: var(--cream); font: italic 15px Georgia, serif; text-align: left; cursor: pointer; transition: transform .25s cubic-bezier(.2, 1.3, .4, 1); }
.drawer::before { content: ""; position: absolute; left: 18px; top: 50%; width: 22px; height: 8px; margin-top: -4px; border-radius: 4px; background: var(--gold); box-shadow: 0 2px 2px #0008; }
.drawer .mark { display: inline-block; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--gold); background: var(--mark, var(--pink)); }
.drawer .mark.parcel { border-radius: 3px; background: repeating-linear-gradient(45deg, #e2b06a 0 5px, #c4477a 5px 10px); }
.drawer .mark.file { border-radius: 3px 3px 6px 6px; background: var(--cream); }
.drawer .mark.other { background: var(--teal); }
.drawer:hover, .drawer:focus-visible { transform: translateX(10px); outline: none; }
.drawer:focus-visible { box-shadow: 0 0 0 3px var(--teal); }
.drawer[aria-expanded="true"] { transform: translateX(26px); background: linear-gradient(180deg, #8d2353, #5e1a3a); }
.drawer .count { margin-left: auto; opacity: .7; font-style: normal; font-size: 13px; }
.drawer .word { font: italic 15px Georgia, serif; color: #ffe9a8; letter-spacing: .02em; }
.wheel .sign { position: absolute; left: 50%; top: 6px; transform: translateX(-50%) rotate(-1.5deg); max-width: 92%; padding: 5px 12px; border-radius: 4px; background: var(--cream); color: var(--ink); border: 2px solid var(--gold); font: italic 13px Georgia, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 8px #0008; }
.wheel .car b { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); padding: 1px 6px; border-radius: 8px; background: var(--ink); color: #ffe9a8; font: 9px/1.3 Georgia, serif; letter-spacing: .04em; white-space: nowrap; }
.wheel .car.other i { display: grid; place-items: center; background: var(--teal); color: var(--ink); font: bold 22px Georgia, serif; }

/* the tray that slides out under the box, with the wheels in it */
.tray { width: min(100%, 560px); padding: 18px 10px 24px; border-radius: 0 0 14px 14px; background: #1a0610; border: 4px solid var(--gold); border-top: 0; margin-top: -26px; }
.tray[hidden] { display: none; }
.wheels { display: flex; flex-direction: column; gap: 26px; }
.wheel { position: relative; width: 100%; height: 300px; }
.wheel .ring { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border: 5px double var(--gold); border-radius: 50%; }
.wheel .ring::before { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--gold); }
.wheel .legs { position: absolute; left: 50%; top: 50%; width: 190px; height: 160px; margin-left: -95px; border-left: 5px solid var(--gold); border-right: 5px solid var(--gold); transform: skewX(0); clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%); background: linear-gradient(90deg, var(--gold) 0 5px, transparent 5px calc(100% - 5px), var(--gold) calc(100% - 5px)); opacity: .55; }
.wheel .cars { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--turn, 0deg)); transition: transform .5s cubic-bezier(.2, 1.1, .4, 1); }
.wheel .car { position: absolute; left: 0; top: 0; width: 58px; height: 58px; margin: -29px 0 0 -29px; padding: 0; border: 0; background: none; cursor: pointer; transform: rotate(var(--a)) translateY(-110px) rotate(calc(var(--a) * -1 - var(--turn, 0deg))); transition: transform .5s cubic-bezier(.2, 1.1, .4, 1); }
.wheel .car i { display: block; width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--gold); background-size: cover; background-position: center; box-shadow: 0 6px 10px #000a; transition: transform .2s ease; }
.wheel .car:hover i, .wheel .car:focus-visible i { transform: scale(1.18); outline: none; }
.wheel .car:focus-visible i { box-shadow: 0 0 0 3px var(--teal), 0 6px 10px #000a; }
.wheel .car.parcel i { border-radius: 4px; background: repeating-linear-gradient(45deg, #e2b06a 0 6px, #c4477a 6px 12px); }
.wheel .car.parcel i::after { content: ""; display: block; width: 100%; height: 100%; background: linear-gradient(90deg, transparent 44%, #2a0a14 44% 56%, transparent 56%), linear-gradient(180deg, transparent 44%, #2a0a14 44% 56%, transparent 56%); }
.wheel .car.file i { border-radius: 4px 4px 8px 8px; }
.wheel .turnbtn { position: absolute; top: 50%; width: 38px; height: 38px; margin-top: -19px; border-radius: 50%; border: 2px solid var(--gold); background: var(--velvet); color: var(--gold); font: bold 18px Georgia, serif; cursor: pointer; }
.wheel .turnbtn.l { left: 4px; } .wheel .turnbtn.r { right: 4px; }
.wheel .turnbtn:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.tray .links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 6px 4px 0; }
.tray .links a { color: var(--cream); background: #3a0e24; border: 2px solid var(--gold); border-radius: 6px; padding: 6px 10px; font: 14px Georgia, serif; text-decoration: none; }
.tray .links a:hover, .tray .links a:focus-visible { background: var(--velvet); outline: none; box-shadow: 0 0 0 3px var(--teal); }

/* the card that pops up when a trinket is touched */
.card-veil { position: fixed; inset: 0; z-index: 70; background: #0d0710cc; display: grid; place-items: center; padding: 14px; }
.card { position: relative; width: min(520px, 100%); max-height: 92vh; overflow: auto; padding: 16px 16px 18px; border-radius: 12px; background: var(--cream); color: var(--ink); border: 3px solid var(--gold); box-shadow: 0 18px 40px #000c; transform: rotate(-.6deg); }
.card .x { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ink); background: var(--cream); color: var(--ink); font: bold 20px/1 Georgia, serif; cursor: pointer; }
.card .x:focus-visible { outline: 3px solid var(--teal); }
.card img { display: block; width: 100%; max-height: 46vh; object-fit: contain; background: #1a0610; border: 3px solid var(--ink); border-radius: 6px; }
.card h2 { margin: 12px 0 2px; font: bold 22px Georgia, serif; }
.card .made { margin: 0 0 8px; font: italic 14px Georgia, serif; opacity: .8; }
.card .story { margin: 0 0 12px; font: 15px/1.45 Georgia, serif; }
.card .choose { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.card .choose button { padding: 6px 10px; border: 2px solid var(--ink); border-radius: 6px; background: #fffdf6; color: var(--ink); font: 14px Georgia, serif; cursor: pointer; }
.card .choose button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.card .choose button:focus-visible { outline: 3px solid var(--teal); }
.card .plain { margin: 8px 0; padding: 10px 12px; border-left: 4px solid var(--gold); background: #fffdf6; font: 15px/1.45 Georgia, serif; }
.card .plain b { color: #7a2e55; }
.card .till { display: block; width: 100%; margin: 10px 0 6px; padding: 12px; border: 3px solid var(--ink); border-radius: 8px; background: var(--ink); color: #ffe9a8; font: bold 17px Georgia, serif; cursor: pointer; }
.card .till:hover, .card .till:focus-visible { background: var(--velvet); outline: none; box-shadow: 0 0 0 3px var(--teal); }
.card .elsewhere { margin: 0; font: 13px/1.5 Georgia, serif; opacity: .85; }
.card .elsewhere a { color: #7a2e55; }
.card .got { font: bold 17px Georgia, serif; color: #7a2e55; }

.doors { display: flex; gap: 34px; }
.door { position: relative; display: block; width: 46px; height: 72px; border-radius: 23px 23px 3px 3px; border: 3px solid var(--gold); background: linear-gradient(180deg, #c4501f, #6a2509); transition: transform .3s ease, box-shadow .3s ease; }
.door:hover, .door:focus-visible { transform: translateY(-4px) rotate(-1.5deg); box-shadow: 0 0 28px #c9a24b66; outline: none; }
.knob { position: absolute; right: 7px; top: 58%; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

@media (prefers-reduced-motion: reduce) { .dancer { animation: none; } .wheel .cars, .wheel .car, .drawer { transition: none; } }
/* phones: bigger words and numbers (her finding, 2026-10-08), the wheel a little tighter */
@media (max-width: 480px) {
  .wheel { height: 290px; } .wheel .ring { width: 200px; height: 200px; margin: -100px 0 0 -100px; } .wheel .car { transform: rotate(var(--a)) translateY(-100px) rotate(calc(var(--a) * -1 - var(--turn, 0deg))); }
  .drawer { min-height: 60px; } .drawer .word { font-size: 18px; } .drawer .count { font-size: 16px; }
  .wheel .sign { font-size: 15px; padding: 6px 14px; } .wheel .car b { font-size: 11px; padding: 2px 8px; }
  .card h2 { font-size: 24px; } .card .story, .card .plain { font-size: 17px; } .card .choose button { font-size: 16px; padding: 8px 12px; } .card .elsewhere { font-size: 15px; } .card .till { font-size: 19px; }
}
