.adventure-screen[hidden], .adventure-screen [hidden] { display: none !important; }
body.adventure-active > #top-bar, body.adventure-active > #game-stage,
body.adventure-active > #buttons-bar, body.adventure-active > .controls-wrapper { visibility: hidden; pointer-events: none; }
.adventure-screen {
    position: fixed; inset: 0; z-index: 30; box-sizing: border-box; color: #eff8f2;
    height: 100vh; height: 100dvh; background: #13241f; overflow: hidden;
    padding: var(--adventure-safe-top, 96px) var(--adventure-safe-right, 16px)
        max(var(--adventure-safe-bottom, 16px), env(safe-area-inset-bottom)) var(--adventure-safe-left, 16px);
    display: flex; flex-direction: column; touch-action: pan-y;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.adventure-header { flex-shrink: 0; max-width: 640px; width: 100%; margin: 0 auto 10px; }
.adventure-header strong { display: block; font-size: 20px; line-height: 1.3; }
.adventure-map { width: 100%; max-width: 640px; margin: 0 auto; overflow-y: auto; min-height: 0; padding-bottom: 20px; overscroll-behavior: contain; }
.adventure-intro { position: relative; padding: 24px; border: 1px solid #507451; border-radius: 20px; background: radial-gradient(ellipse at 100% 0, #426335, transparent 70%), #22392d; }
.adventure-tag { font-size: 9px; letter-spacing: .12em; color: #d8e3a5; font-weight: 700; }
.adventure-intro h1 { font-size: clamp(28px, 6vw, 42px); line-height: 1.05; margin: 14px 0; letter-spacing: -.04em; }
.adventure-intro p { font-size: 13px; line-height: 1.5; color: #b9d0be; max-width: 360px; margin-bottom: 20px; }
.adventure-progress { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; }
.adventure-progress span:first-child { color: #f7d67b; }
.adventure-progress-track { height: 5px; border-radius: 8px; background: #14271e; margin-top: 10px; overflow: hidden; }
.adventure-progress-track i { display: block; height: 100%; background: #d4df86; border-radius: inherit; }
.adventure-reward-note { font-size: 11px; color: #aec3b7; text-align: center; margin: 16px 0 24px; line-height: 1.5; }
.adventure-map-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.adventure-map-actions button { padding: 12px 8px; min-height: 44px; border: 1px solid #3c5a48; border-radius: 12px; background: #20392e; color: #e3efdf; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.adventure-chapter-reward { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; margin: 0 0 10px; border: 1px solid #596648; border-radius: 12px; background: #2a3c2b; color: #f2d68d; font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.adventure-chapter-reward small { display: block; color: #b9ccbb; font-size: 10px; line-height: 1.4; margin-top: 5px; }
.adventure-chapter { margin-top: 22px; }
.adventure-chapter h2 { margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; }
.adventure-chapter h2 small { font-size: 10px; font-weight: 400; color: #8ca899; }
.adventure-level-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.adventure-level { padding: 13px 10px 11px; min-height: 130px; text-align: left; border: 1px solid #3c5a48; border-radius: 14px; color: #eff8f2; background: #20392e; cursor: pointer; }
.adventure-level:disabled { color: #93a69b; background: #192c24; border-color: #2a3f32; cursor: default; }
.adventure-level.completed { border-color: #939959; }
.adventure-level-number { display: block; font-size: 22px; font-weight: 800; color: #b9d993; margin-bottom: 10px; }
.adventure-level:disabled .adventure-level-number { font-size: 17px; }
.adventure-level strong { display: block; font-size: 11px; min-height: 30px; line-height: 1.3; }
.adventure-level-mechanic { display: block; font-size: 9px; color: #98b6a4; margin-top: 7px; }
.adventure-level-stars { display: block; font-size: 18px; letter-spacing: 2px; color: #e9cc71; margin-top: 7px; }
.adventure-complete-note { padding: 16px; background: #314735; border-radius: 12px; color: #f7dc83; text-align: center; font-size: 13px; }
.adventure-loading, .adventure-empty { text-align: center; padding: 36px 16px; color: #c1d4c8; }
.adventure-empty h2 { font-size: 20px; }
.adventure-game { flex: 1; min-height: 0; display: flex; flex-direction: column; max-width: 540px; width: 100%; margin: 0 auto; touch-action: none; }
.adventure-hud { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-shrink: 0; padding: 9px 10px; background: #20392e; border-radius: 12px; font-size: 12px; font-weight: 700; }
.adventure-hud span:last-child { color: #edcc77; }
.adventure-goal { font-size: 11px; text-align: center; color: #b6cdbc; margin: 6px 0; flex-shrink: 0; }
.adventure-board { position: relative; flex: 1; min-height: 0; width: calc(100% + 12px); margin: 0 -6px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
#adventure-canvas { display: block; border: 1px solid #416751; border-radius: 10px; box-sizing: border-box; touch-action: none; }
.adventure-utility-row { flex: 0 0 44px; width: var(--adventure-field-size, 100%); max-width: 100%; margin-top: 10px; display: flex; justify-content: flex-end; }
#adventure-pause { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #5c8157; padding: 0; font-size: 22px; background: #20392e; color: #ecfff3; cursor: pointer; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
#adventure-pause[hidden] { display: flex !important; visibility: hidden; pointer-events: none; }
.adventure-controls { flex-shrink: 0; width: min(300px, 100%); margin: 20px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 70px); gap: 12px; }
.adventure-controls button { padding: 0; height: 70px; border: 2px solid #5c8157; border-radius: 14px; background: #1d3829; color: #ecfff3; font-size: 28px; touch-action: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.adventure-controls button:active { background: #53764b; }
.adventure-controls [data-direction=up] { grid-column: 2; }
.adventure-controls [data-direction=left] { grid-column: 1; grid-row: 2; }
.adventure-controls [data-direction=down] { grid-column: 2; grid-row: 2; }
.adventure-controls [data-direction=right] { grid-column: 3; grid-row: 2; }
.adventure-dialog { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #0b1716ba; backdrop-filter: blur(5px); border-radius: 12px; padding: 12px; overflow-y: auto; }
.adventure-dialog-card { width: min(100%, 330px); box-sizing: border-box; padding: 20px; background: #243a2e; border: 1px solid #587557; border-radius: 18px; box-shadow: 0 15px 50px #0005; text-align: center; max-height: 100%; overflow-y: auto; }
.adventure-dialog-card h2 { font-size: 21px; margin: 0 0 10px; }
.adventure-dialog-card p { white-space: pre-line; font-size: 12px; line-height: 1.55; color: #cbd8c4; margin: 0 0 14px; }
.adventure-action { display: block; width: 100%; border: 0; border-radius: 10px; margin: 8px 0 0; padding: 12px; background: #b9d993; color: #172b1d; font-weight: 800; cursor: pointer; }
.adventure-action.secondary { background: #ffffff0c; color: #e3efdf; border: 1px solid #ffffff20; }
@media(max-width: 460px) { .adventure-level-grid { grid-template-columns: repeat(2, 1fr); } .adventure-level { min-height: 115px; } }
@media(max-height: 700px) { .adventure-header { margin-bottom: 8px; } .adventure-controls { margin-top: 10px; grid-template-rows: repeat(2, 60px); gap: 10px; } .adventure-controls button { height: 60px; } }
@media(max-height: 480px) { .adventure-screen { overflow-y: auto; } .adventure-game { flex: 0 0 auto; } .adventure-board { flex: 0 0 220px; } .adventure-controls { grid-template-rows: repeat(2, 50px); gap: 8px; } .adventure-controls button { height: 50px; } }
