.activity-dialog.hatch-dialog { box-sizing: border-box; width: min(980px,calc(100vw - 1rem)); max-width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); overflow-y: auto; padding: clamp(.75rem,3vw,1.8rem); overscroll-behavior: contain; }
.activity-dialog.hatch-dialog .dialog-close { min-width: 44px; min-height: 44px; }
.hatch-game { padding: clamp(.5rem,2vw,1rem); background: #edf2f1; border-radius: 1rem; border: 1px solid #b8c8cb; }
.hatch-game .game-progress { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .9rem; font-size: .9rem; font-weight: 700; }
.hatch-console { position: relative; padding: clamp(.7rem,2vw,1.3rem); border: 3px solid #8ca3a9; border-radius: .8rem; background: linear-gradient(135deg,#395b6b,#153747); color: #f3faf9; box-shadow: inset 0 0 0 4px #254754; overflow: hidden; }
.hatch-console .eyebrow { color: #ffe3a2; }
.hatch-console h3 { font-family: Georgia,serif; color: #fff; margin: .6rem 0; }
.hatch-console > p { line-height: 1.5; }
.hatch-clue { background: #edf7f4; color: #193d4b; padding: .75rem; border-radius: .4rem; }
.hatch-illustration { position: relative; height: 98px; overflow: hidden; border: 1px solid #809da4; border-radius: .6rem; background: repeating-linear-gradient(90deg,#284d5e 0,#284d5e 25%,#466575 25.5%,#284d5e 26%); }
.hatch-door { position: absolute; width: 112px; height: 86px; top: 4px; left: calc(50% - 56px); border: 5px solid #acc0bf; border-radius: 17px; box-sizing: border-box; background: linear-gradient(130deg,#7b949a,#496b77); box-shadow: 5px 0 0 #142f3e; }
.hatch-window { position: absolute; width: 27px; height: 27px; top: 6px; left: 36px; border: 3px solid #d4c39a; border-radius: 50%; overflow: hidden; background: #87cad5; }
.hatch-window i { display: block; height: 34px; width: 65px; margin: 13px 0 0 -20px; border-radius: 50%; background: #285e78; animation: hatch-swell 3s ease-in-out infinite alternate; }
.hatch-wheel { position: absolute; font: 44px/1 Georgia,serif; left: 28px; top: 33px; color: #f5da98; transform-origin: center; transition: transform .8s ease; }
.hatch-hinge { position: absolute; right: -11px; top: 10px; width: 13px; height: 20px; background: #c8c4ad; border: 2px solid #3a5260; border-radius: 3px; }
.hatch-hinge + .hatch-hinge { top: 51px; }
.hatch-latches { position: absolute; right: clamp(.4rem,5vw,2rem); top: 15px; display: grid; gap: 6px; }
.hatch-latches i { display: block; width: 17px; height: 14px; border: 2px solid #f3d997; border-radius: 4px; background: #af8145; transition: transform .3s,opacity .3s; }
.hatch-latches i.is-used { opacity: .4; transform: rotate(-25deg); }
.hatch-illustration > span { position: absolute; left: 9px; bottom: 7px; max-width: 33%; padding: 4px; font-size: .7rem; background: #16394b; border-radius: .2rem; }
.hatch-console.is-sealed .hatch-wheel { transform: rotate(180deg); }
.hatch-console.is-sealed .hatch-door { border-color: #9be0c7; }
.hatch-console.is-sealed .hatch-illustration > span { color: #b6ffda; }
.hatch-brackets { display: grid; grid-template-columns: 1fr; gap: .8rem; }
.hatch-brackets section { min-width: 0; padding: .65rem; border: 2px solid #a3cbd9; border-radius: .6rem; background: #20465a; }
.hatch-brackets section:last-child { border-color: #efcc85; }
.hatch-brackets h4 { margin: .2rem 0 .65rem; color: #d5f2ff; font-size: 1rem; }
.hatch-brackets section:last-child h4 { color: #ffe1a0; }
.hatch-brackets [role="group"] { display: grid; gap: .5rem; }
.hatch-brackets button { box-sizing: border-box; min-height: 48px; min-width: 44px; width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem; padding: .6rem .7rem; border: 2px solid #a2c3d1; border-radius: .4rem; background: #e6f3f6; color: #173b4d; text-align: left; touch-action: manipulation; cursor: pointer; }
.hatch-brackets button strong { font: 800 clamp(1.1rem,2vw,1.25rem)/1.3 Georgia,serif; overflow-wrap: anywhere; }
.hatch-brackets button small { font-size: .75rem; font-weight: 800; }
.hatch-brackets button.is-selected { background: #00689d; color: #fff; border-color: #a5ddff; }
.hatch-brackets section:last-child button.is-selected { background: #fecd60; color: #173b4d; border-color: #ffe3a3; }
.hatch-brackets button.is-answer { background: #c8f5e0; color: #174c43; border-color: #70bea5; opacity: 1; }
.hatch-brackets button:focus-visible { outline: 3px solid #ffdf93; outline-offset: 2px; }
.hatch-assembly { padding: .75rem; border: 1px dashed #b1cbd2; border-radius: .4rem; font-weight: 800; overflow-wrap: anywhere; margin-bottom: 0; min-height: 3.2rem; box-sizing: border-box; }
.hatch-console.is-sealed .hatch-assembly { background: #245b50; border-color: #a7e4c8; }
.hatch-hint { padding: .75rem; border-left: 4px solid #cc9546; background: #fff0d5; line-height: 1.5; }
.hatch-log { padding: 1rem; background: #fffaf0; border-left: 4px solid #2f8a7e; margin: 1rem 0; line-height: 1.55; animation: hatch-log-open .25s ease; }
.hatch-log h4 { margin: .4rem 0 .6rem; color: #174a56; font-size: 1.3rem; overflow-wrap: anywhere; }
.hatch-spelling { font-weight: 700; overflow-wrap: anywhere; }
.hatch-word-note { border-top: 1px dashed #a8c2c4; padding-top: .8rem; }
.hatch-controls { display: flex; flex-wrap: wrap; gap: .6rem; padding-bottom: max(.2rem,env(safe-area-inset-bottom)); }
.hatch-controls button { min-width: 44px; min-height: 44px; flex: 1 1 150px; }
.hatch-result { padding: 1rem; background: #edf5f2; border-radius: .8rem; line-height: 1.55; }
.hatch-result li { margin: .75rem 0; overflow-wrap: anywhere; }
.hatch-result small { display: inline-block; margin-left: .4rem; font-weight: 700; }
.hatch-result button { min-height: 44px; }
@keyframes hatch-swell { to { transform: translateX(14px) translateY(3px); } }
@keyframes hatch-log-open { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 540px) { .hatch-brackets { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (prefers-reduced-motion: reduce) { .hatch-game *, .hatch-game *::before, .hatch-game *::after { animation: none !important; transition: none !important; } }
