/* Compact encounters share the existing portrait reader and its type scale. */
.encounter-panel { display: flex; flex-direction: column; gap: 6px; width: 100%; max-height: 230px; margin: 0; font-family: var(--sans); }
.encounter-panel p { margin: 0; }
.encounter-caption, .encounter-feedback, .glass-help { color: #f4dfb4; font-size: 12px; line-height: 1.25; text-align: center; text-wrap: balance; }
.encounter-feedback { color: #e5edca; }
.encounter-panel button { min-height: 44px; margin: 0; padding: 7px 9px; line-height: 1.2; font-size: 12px; touch-action: manipulation; }
.encounter-panel button:focus-visible { outline: 3px solid #ffedb6; outline-offset: 2px; }
.encounter-choices { display: flex; justify-content: center; gap: 7px; width: 100%; }
.encounter-choice { display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; border: 1px solid #c09e66; border-radius: 8px; background: linear-gradient(145deg, #314c3edc, #123127f2); color: #f3d49b; }
.encounter-choice svg, .encounter-melody svg, .encounter-cue svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.encounter-choice span { pointer-events: none; }
.encounter-panel .encounter-back { flex: 0 0 auto; width: 100%; min-height: 32px; padding: 5px 8px; color: #e6d8bd; font-size: 11px; text-decoration: underline; background: transparent; border: 0; box-shadow: none; }
.encounter-cue { display: flex; align-items: center; justify-content: center; gap: 8px; height: 34px; color: #ffdda0; }
.encounter-cue strong { font-size: 18px; }
.encounter-shields .encounter-choice { flex-direction: row; }
.encounter-shields .encounter-choice svg { width: 25px; height: 25px; }
.encounter-maze { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 3px; width: 176px; height: 176px; margin: 0 auto; padding: 3px; border: 1px solid #b29060; border-radius: 7px; background: #071f22; touch-action: none; }
.encounter-panel .encounter-tile { display: grid; place-items: center; min-width: 0; min-height: 0; width: 100%; height: 100%; padding: 0; border: 1px solid #62725766; border-radius: 3px; font-size: 22px; box-shadow: none; }
.encounter-tile.is-water { background: #0a2d36; color: #72949b; }
.encounter-tile.is-ledge { background: linear-gradient(135deg, #b39058, #5c4934); color: #ffe6ab; border-color: #edc98c; }
.encounter-tile.is-traced { background: #53836b; border-color: #d5e8b0; }
.encounter-tile.is-current { box-shadow: inset 0 0 0 2px #fff0c1; color: #fff4ca; }
.encounter-tile:disabled { opacity: 1; filter: none; cursor: default; }
.encounter-panel[data-challenge='maze'] { gap: 4px; }
.encounter-panel[data-challenge='maze'] .encounter-back { min-height: 26px; padding: 3px; }
.encounter-still { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.encounter-panel .encounter-hold { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; min-height: 76px; border-radius: 10px; border: 1px solid #bfaa79; color: #fae4b7; background: #173a31d9; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.encounter-breath { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: 2px solid #a7c4ac; box-shadow: 0 0 0 5px #98be9c1f; }
.encounter-hold.is-holding .encounter-breath, .encounter-hold:active .encounter-breath, .encounter-still.is-waiting .encounter-breath { animation: encounter-breath 2s linear both; }
.encounter-still > .text-button { padding: 4px; min-height: 34px; font-size: 11px; }
.encounter-melody { display: flex; justify-content: space-around; gap: 12px; padding: 3px 15px; margin: 0; list-style: none; counter-reset: notes; color: #f5d79f; }
.encounter-melody li { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; }
.encounter-melody li::before { counter-increment: notes; content: counter(notes); font-size: 10px; color: #c7bd9d; }
.encounter-start { width: 100%; }
.encounter-melody-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.encounter-note-progress { display: flex; justify-content: center; gap: 16px; font-size: 20px; line-height: 1; color: #d4ecc7; }
.encounter-outcome { color: #ffe8b4; text-align: center; font-size: 18px; }
.encounter-result { padding: 15px 0; gap: 12px; }
.glass-panel { gap: 5px; }
.glass-window { position: relative; isolation: isolate; width: 100%; height: 175px; flex: 0 0 175px; border: 3px solid #8e794c; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 2px #d9c598, 0 3px 10px #001b18; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab; }
.glass-window:active { cursor: grabbing; }
.glass-window > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; pointer-events: none; }
.glass-grime { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.glass-window.is-clean .glass-grime { opacity: 0; transition: opacity .5s ease; }
.glass-keyboard-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(6, 1fr); }
.glass-keyboard-grid > button { min-width: 0; min-height: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 3px; background: transparent; box-shadow: none; color: transparent; touch-action: none; }
.glass-keyboard-grid > button:hover, .glass-keyboard-grid > button:active { background: transparent; }
.glass-keyboard-grid > button:focus-visible { outline: 2px solid #ffedb6; outline-offset: -2px; background: #d9b87430; }
.glass-help { font-size: 10px; color: #ddd0b8; }
@keyframes encounter-breath { from { background: #b4d3b51a; transform: scale(.85); } to { background: #b4d3b5; transform: scale(1); } }
@media (max-width: 360px), (max-height: 620px) {
  .encounter-panel { gap: 5px; }
  .encounter-caption, .encounter-feedback { font-size: 11px; }
  .encounter-choice svg, .encounter-melody svg { width: 30px; height: 30px; }
  .encounter-panel button { font-size: 11px; }
  .encounter-maze { width: 166px; height: 166px; }
  .glass-window { height: 157px; flex-basis: 157px; }
}
@media (orientation: landscape) and (max-height: 430px) {
  .encounter-maze { width: 146px; height: 146px; }
  .encounter-panel { max-height: 220px; }
  .glass-window { height: 135px; flex-basis: 135px; }
}
@media (prefers-reduced-motion: reduce) {
  .encounter-hold.is-holding .encounter-breath, .encounter-hold:active .encounter-breath, .encounter-still.is-waiting .encounter-breath { animation: none; background: #b4d3b5; }
  .glass-window.is-clean .glass-grime { transition: none; }
}
