/* ─── START / CONTINUE BUTTON ────────────────────────── */
.quest-start-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px auto 0;
    padding: 16px 36px;
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: #c8860a;
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(200,134,10,0.4);
    transition: background 0.2s, transform 0.15s;
}
.quest-start-btn:hover  { background: #a86d06; transform: translateY(-2px); }
.quest-start-btn:active { transform: translateY(0); }

.quest-continue-btn {
    background: #1a5c3a;
    box-shadow: 0 4px 18px rgba(26,92,58,0.4);
}
.quest-continue-btn:hover { background: #144a2e; }

/* ─── OVERLAY ────────────────────────────────────────── */
.quest-overlay {
    width: 100vw;
    height: 100vh;
    background: #0f1e1b;
    color: #f0ece4;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;          /* prevent horizontal scroll */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── HEADER ─────────────────────────────────────────── */
.quest-overlay-header {
    flex-shrink: 0;
    padding: 16px 20px 10px;
    background: #0f1e1b;
    position: sticky;
    top: 0;
    z-index: 2;
}

.quest-progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.12);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
}

.quest-progress-fill {
    height: 100%;
    background: #c8860a;
    border-radius: 99px;

    width: 0%;
}

.quest-progress-text {
    font-size: 0.72em;
    color: rgba(255,255,255,0.45);
    text-align: right;
    letter-spacing: 0.08em;
}

/* ─── STEP SLOT ──────────────────────────────────────── */
.quest-step-slot {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    min-width: 0;                /* prevent flex children from overflowing */
}

/* ─── STEPS ─────────────────────────────────────────── */
.quest-step {
    display: none;
    flex-direction: column;
    flex: 1;
    padding: 0 0 16px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    box-sizing: border-box;
    color: #f0ece4;
    overflow-x: hidden;
    min-width: 0;
}

/* Step image — edge to edge, breaks out of the 20px padding */
.quest-step-image {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.quest-step-title {
    font-size: 1.35em;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
    color: #f0ece4;
    padding: 0 20px;
    word-break: break-word;
    overflow-wrap: break-word;
}


.quest-step-task {
    margin-bottom: 20px;
    color: #f0ece4;
    line-height: 1.7;
    font-size: 0.97em;
    font-weight: 600;
    padding: 12px 20px;
    background: rgba(200,134,10,0.08);
    border-left: 3px solid #c8860a;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.quest-step-description {
    margin-bottom: 20px;
    color: rgba(240,236,228,0.75);
    line-height: 1.7;
    font-size: 0.97em;
    padding: 0 20px;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* Padded inner elements */
.quest-step-choices,
.quest-input,
.quest-btn,
.quest-clue,
.quest-feedback {
    margin-left: 20px;
    margin-right: 20px;
}

/* ─── CHOICES ────────────────────────────────────────── */
.quest-step-choices {
    list-style: none;
    padding: 0;
    margin-bottom: 12px;
    width: calc(100% - 40px);
}

.quest-choice {
    padding: 14px 16px;
    border: 2px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    color: #f0ece4;
    transition: border-color 0.2s, background 0.2s;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
}
.quest-choice:hover    { border-color: rgba(200,134,10,0.6); background: rgba(200,134,10,0.08); }
.quest-choice.selected { border-color: #c8860a; background: rgba(200,134,10,0.18); }

/* ─── INPUT ──────────────────────────────────────────── */
.quest-input {
    width: calc(100% - 40px);
    padding: 14px 16px;
    font-size: 1em;
    border: 2px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    margin-bottom: 12px;
    box-sizing: border-box;
    background: rgba(255,255,255,0.06);
    color: #f0ece4;
}
.quest-input::placeholder { color: rgba(240,236,228,0.3); }
.quest-input:focus { border-color: #c8860a; outline: none; background: rgba(200,134,10,0.07); }

/* ─── SHARED BUTTONS ─────────────────────────────────── */
.quest-btn {
    display: block;
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    text-decoration: none;
    transition: background 0.2s;
    box-sizing: border-box;
    text-align: center;
}

.quest-submit-btn {
    background: #c8860a;
    color: #fff;
    width: calc(100% - 40px);
    padding: 14px;
    font-size: 1em;
    border-radius: 10px;
}
.quest-submit-btn:hover { background: #a86d06; }

.quest-hint-btn {
    background: rgba(255,255,255,0.07);
    color: rgba(240,236,228,0.65);
    border: 1px solid rgba(255,255,255,0.12);
    width: calc(100% - 40px);
}
.quest-hint-btn:hover { background: rgba(255,255,255,0.12); }

.quest-map-btn {
    background: #2a7a4a;
    color: #fff;
    width: calc(100% - 40px);
    border-radius: 10px;
}
.quest-map-btn:hover { background: #226040; }

/* Map button between image and title */
.quest-map-btn--step {
    width: calc(100% - 40px);
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: 16px;
    margin-top: 0;
}

/* ─── HINT ───────────────────────────────────────────── */
.quest-clue {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(200,134,10,0.1);
    border-left: 4px solid #c8860a;
    border-radius: 6px;
    color: #e8c97a;
    font-style: italic;
    line-height: 1.5;
    width: calc(100% - 40px);
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ─── FEEDBACK ───────────────────────────────────────── */
.quest-feedback {
    margin-top: 10px;
    font-weight: 600;
    min-height: 24px;
    font-size: 0.95em;
    width: calc(100% - 40px);
    word-break: break-word;
    overflow-wrap: break-word;
}
.quest-feedback--success { color: #5dba7d; }
.quest-feedback--error   { color: #e07070; }

/* ─── FOOTER ─────────────────────────────────────────── */
.quest-overlay-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 36px;
    background: #0f1e1b;
    position: sticky;
    bottom: 0;
}

.quest-nav-btn {
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: rgba(240,236,228,0.75);
    transition: background 0.2s, color 0.2s;
}
.quest-nav-btn:hover { background: rgba(255,255,255,0.14); color: #f0ece4; }

/* ─── TRANSITION SCREEN ──────────────────────────────── */
.quest-transition {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    box-sizing: border-box;
    color: #f0ece4;
    padding-bottom: 16px;
    overflow-x: hidden;
    min-width: 0;
}

.quest-transition-image {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.quest-transition-title {
    font-size: 1.4em;
    font-weight: 700;
    color: #c8860a;
    margin: 0 20px 12px;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.quest-transition-desc {
    font-size: 0.97em;
    color: rgba(240,236,228,0.75);
    line-height: 1.7;
    margin: 0 20px 20px;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Location navigation button on transition screen */
.quest-transition-location-btn {
    margin: 0 20px 12px !important;
    width: calc(100% - 40px) !important;
}

/* Continue + location buttons on transition */
.quest-transition .quest-btn {
    margin-left: 20px;
    margin-right: 20px;
    width: calc(100% - 40px);
}

/* ─── COMPLETION ─────────────────────────────────────── */
.quest-complete {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 30px;
    color: #f0ece4;
    min-height: 100vh;
}
.quest-complete-icon { font-size: 4em; margin-bottom: 20px; }
.quest-complete h2   { font-size: 2em; margin-bottom: 12px; color: #c8860a; }
.quest-complete p    { font-size: 1.1em; color: rgba(240,236,228,0.65); }