:root {
  font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  color: #f7f1ff;
  background: #100d25;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow: hidden; }
body { min-height: 100svh; background: radial-gradient(circle at 50% -10%, #54416c, #100d25 70%); }
button { font: inherit; }
.shell { min-height: 100svh; display: grid; place-items: center; }
.game { position: relative; width: min(100vw, 460px); height: min(100svh, 800px); overflow: hidden; background: linear-gradient(#2a1f43, #15132d); box-shadow: 0 22px 80px #05030eaa; }
.game:before { content: ""; position: absolute; inset: 0; opacity: .22; background-image: radial-gradient(#e6c8dd 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; }
header, .stats, .progress, #instruction, .board, footer { position: relative; z-index: 1; }
header { display: flex; justify-content: space-between; padding: 23px 22px 0; color: #fff7ff; font-size: .75rem; letter-spacing: .17em; }
header b span { color: #ffb8c7; }
nav { display: flex; gap: 8px; }
nav button { width: 32px; height: 32px; border: 1px solid #a87b9d; border-radius: 11px; background: #3b2b55; color: #f4cde0; cursor: pointer; transition: transform .14s, opacity .14s, background .14s; }
nav button:hover:not(:disabled), nav button:focus-visible:not(:disabled) { transform: translateY(-2px); background: #563b62; }
nav button:disabled { cursor: not-allowed; opacity: .34; }
.stats { display: flex; justify-content: space-between; padding: 32px 26px 12px; }
.stats div { display: flex; flex-direction: column; gap: 4px; }
.stats div:nth-child(2) { text-align: center; }
.stats div:last-child { text-align: right; }
.stats small, footer, header + section small { color: #c19ab8; font-size: .59rem; font-weight: 800; letter-spacing: .18em; }
.stats strong { font-size: 1.48rem; }
.stats div:nth-child(2) strong { color: #ffb6c8; }
.progress { height: 4px; margin: 0 26px; background: #4a3459; border-radius: 9px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: #9be8cd; transition: width .4s; }
.game > p { margin: 21px 26px 0; color: #d2b6d2; font-size: .85rem; }
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px 17px; padding: 40px 29px 23px; align-items: end; }
.wrap { position: relative; height: 166px; display: grid; place-items: end center; transition: transform .18s ease; }
.wrap.invalid { animation: invalid-tube .32s ease-in-out; }
.wrap:after { content: ""; position: absolute; bottom: 0; width: 67px; height: 7px; border-radius: 50%; background: #08051088; }
.tube { position: relative; width: 57px; height: 145px; padding: 10px 6px 7px; border: 2px solid #c08fae; border-top: 0; border-radius: 0 0 28px 28px; background: #fff8ff08; cursor: pointer; transition: .18s; }
.tube:before { content: ""; position: absolute; top: -7px; left: -4px; width: 61px; height: 10px; border: 2px solid #e4b8ca; border-radius: 6px; background: #825976; }
.selected .tube { transform: translateY(-12px); filter: drop-shadow(0 0 13px #ffb6c880); }
.locked .tube { opacity: 0; transform: scale(.85); }
.label { position: absolute; bottom: -22px; color: #a77fa4; font-size: .58rem; letter-spacing: .16em; }
.stack { height: 100%; display: flex; flex-direction: column-reverse; gap: 1px; overflow: hidden; border-radius: 0 0 21px 21px; }
.layer { position: relative; min-height: 24px; flex: 1; border-radius: 3px; }
.layer { animation: sample-settle .24s cubic-bezier(.2, .9, .35, 1.2) both; }
.layer:first-child { border-radius: 3px 3px 20px 20px; }
.serum { background: linear-gradient(90deg, #d85a76, #f39aab, #bd3f66); }
.cytology { background: linear-gradient(90deg, #b879d7, #e1a7ed, #8c57b6); }
.buffer { background: linear-gradient(90deg, #45c4a8, #a0ebcd, #3aa990); }
.stain { background: linear-gradient(90deg, #eaa95e, #ffe19d, #cf8640); }
.empty { display: grid; place-items: center; color: #a77fa4; font-size: 1.15rem; }
footer { display: flex; justify-content: space-between; align-items: center; margin: 0 25px; padding: 16px 0; border-top: 1px solid #503863; color: #a783a5; font-size: .58rem; }
footer button { border: 0; background: transparent; color: #edbed5; font-size: .72rem; cursor: pointer; }
.overlay, .guide { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; padding: 24px; background: #150d25c9; backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.overlay.show, .guide:not([hidden]) { opacity: 1; pointer-events: auto; }
.card { width: min(100%, 346px); padding: 36px 27px 28px; border: 1px solid #b57f9e; border-radius: 25px; background: linear-gradient(145deg, #4b315c, #241a3e); box-shadow: 0 22px 65px #05030e99; text-align: center; }
.hero { position: relative; width: 74px; height: 74px; margin: 0 auto 25px; border: 2px solid #d7a8bd; border-radius: 23px; display: flex; align-items: flex-end; justify-content: center; gap: 5px; padding-bottom: 10px; color: #ffd0de; }
.hero > span { position: absolute; transform: translateY(-22px); color: #ffd0de; }
.hero i { display: block; width: 10px; height: 27px; border-radius: 5px; background: #75dbc0; }
.hero i:nth-of-type(2) { height: 38px; background: #ed7f9b; }
.hero i:nth-of-type(3) { height: 21px; background: #f2c274; }
.card > small { color: #9be8cd; letter-spacing: .2em; font-weight: 900; font-size: .62rem; }
.card h1, .card h2 { margin: 10px 0 0; color: #fff8ff; font-size: 3.1rem; letter-spacing: -.08em; }
.card h1 em { color: #ffb6c8; font-style: normal; }
.card h2 { font-size: 2.7rem; }
.card p { margin: 20px auto 26px; max-width: 270px; color: #dfc5dc; font-size: .9rem; line-height: 1.55; }
.primary { width: 100%; min-height: 53px; border: 0; border-radius: 15px; background: linear-gradient(135deg, #9be8cd, #5bc2a7); color: #18132d; font-weight: 950; cursor: pointer; box-shadow: 0 5px 0 #277b70; }
.card label { display: block; margin-top: 17px; color: #af8dac; font-size: .67rem; }
.seal { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 22px; border: 2px solid #9be8cd; border-radius: 50%; color: #aaf1d6; font-size: 2rem; }
.result { display: flex; justify-content: center; gap: 35px; margin: 24px 0; }
.result div { display: flex; flex-direction: column; gap: 5px; color: #bd9bb8; font-size: .58rem; font-weight: 900; letter-spacing: .16em; }
.result strong { color: #fff8ff; font-size: 1.35rem; }
.guide .card { position: relative; text-align: left; }
.guide .card h2 { font-size: 2.4rem; }
.guide button { position: absolute; right: 17px; top: 12px; border: 0; background: transparent; color: #f0cfe1; font-size: 1.7rem; }
.guide ol { margin: 23px 0 0; color: #dcc2d9; line-height: 1.9; font-size: .87rem; }
.hub-link { display: inline-block; margin-top: 18px; color: #f0c6dc; font-size: .72rem; font-weight: 800; text-decoration: none; }
.hub-link:hover, .hub-link:focus-visible { color: #fff3f8; text-decoration: underline; }
@keyframes sample-settle { from { opacity: 0; transform: translateY(-8px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes invalid-tube { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (max-height: 660px) { .stats { padding-top: 20px; } .game > p { margin-top: 14px; } .board { padding-top: 24px; gap: 16px; } .wrap { height: 145px; } .tube { height: 128px; } }
