/* ── Header position override (app page only) ───────────── */
.header--relative {
    position: relative;
}

/* ── Header controls group (clock + buttons) ────────────── */
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* ── Right-content position override (app page only) ────── */
.right-content--relative {
    position: relative;
}

/* ── Run bar position context ───────────────────────────── */
#runBar {
    position: relative;
}

/* ── UI Guide Panel ──────────────────────────────────────── */
#uiGuidePanel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: rgba(4, 8, 28, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: guideFadeIn 0.4s ease;
    border-radius: 4px;
}

@keyframes guideFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#uiGuidePanel.hidden {
    display: none;
}

.guide-card {
    background: linear-gradient(145deg, #080d22 0%, #0f1530 100%);
    border: 1.5px solid rgba(0, 255, 136, 0.3);
    border-radius: 14px;
    padding: 36px 32px 36px;
    max-width: 520px;
    width: 92%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 60px rgba(0, 255, 136, 0.1), 0 20px 60px rgba(0, 0, 0, 0.7);
    animation: guideCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 136, 0.3) transparent;
}

.guide-card::-webkit-scrollbar { width: 5px; }
.guide-card::-webkit-scrollbar-track { background: transparent; }
.guide-card::-webkit-scrollbar-thumb { background: rgba(0, 255, 136, 0.3); border-radius: 3px; }

@keyframes guideCardIn {
    from { opacity: 0; transform: scale(0.88) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.guide-title {
    font-family: 'Jersey 15', sans-serif;
    font-size: 1.6rem;
    color: #00ffff;
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(0, 255, 255, 0.4);
    margin-bottom: 6px;
}

.guide-subtitle {
    font-family: 'Oxanium', monospace;
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(245, 166, 35, 0.7);
    margin-bottom: 28px;
}

.guide-sections {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 28px;
}

.guide-section {
    background: rgba(0, 255, 136, 0.04);
    border: 1px solid rgba(0, 255, 136, 0.15);
    border-radius: 9px;
    padding: 16px 14px;
}

.guide-section-title {
    font-family: 'Oxanium', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #f5a623;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.guide-items {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.guide-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-family: 'Oxanium', sans-serif;
    font-size: 0.82rem;
    color: rgba(200, 240, 255, 0.8);
    line-height: 1.6;
}

.guide-item .gi-key {
    font-family: 'Oxanium', monospace;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.gi-key.green {
    background: rgba(0, 255, 136, 0.12);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.gi-key.orange {
    background: rgba(245, 166, 35, 0.12);
    color: #f5a623;
    border: 1px solid rgba(245, 166, 35, 0.3);
}

.gi-key.blue {
    background: rgba(78, 168, 212, 0.12);
    color: #4ea8d4;
    border: 1px solid rgba(78, 168, 212, 0.3);
}

.gi-key.pink {
    background: rgba(255, 0, 110, 0.1);
    color: #ff6ea0;
    border: 1px solid rgba(255, 0, 110, 0.3);
}

.guide-tip-box {
    background: rgba(245, 166, 35, 0.06);
    border: 1px solid rgba(245, 166, 35, 0.25);
    border-left: 3px solid #f5a623;
    border-radius: 7px;
    padding: 14px 14px;
    font-family: 'Oxanium', sans-serif;
    font-size: 0.82rem;
    color: rgba(255, 240, 200, 0.85);
    line-height: 1.65;
    margin-bottom: 18px;
}

.guide-tip-box code {
    font-family: 'Oxanium', monospace;
    font-size: 0.78rem;
    background: rgba(245, 166, 35, 0.15);
    color: #f5a623;
    padding: 1px 5px;
    border-radius: 3px;
}

.guide-btn-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.guide-start-btn {
    font-family: 'Oxanium', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: #00ff88;
    color: #040e12;
    box-shadow: 0 0 16px rgba(0, 255, 136, 0.4);
    transition: all 0.15s;
}

.guide-start-btn:hover {
    background: #33ffaa;
    box-shadow: 0 0 28px rgba(0, 255, 136, 0.65);
    transform: translateY(-1px);
}

.guide-no-show {
    font-family: 'Oxanium', monospace;
    font-size: 0.72rem;
    color: rgba(0, 255, 136, 0.3);
    background: transparent;
    border: 1px solid rgba(0, 255, 136, 0.15);
    padding: 8px 14px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s;
}

.guide-no-show:hover {
    color: rgba(0, 255, 136, 0.6);
    border-color: rgba(0, 255, 136, 0.35);
}

/* ── Guide toggle button ────────────────────────────────── */
#btnGuide {
    font-family: 'Oxanium', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 5px 12px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: rgba(0, 255, 136, 0.5);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

#btnGuide:hover {
    color: #00ff88;
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.08);
}

/* ── Clear Code button ──────────────────────────────────── */
.btn-clear-code {
    background: transparent !important;
    color: #4ea8d4 !important;
    border: 1px solid rgba(78, 168, 212, 0.45) !important;
}

.btn-clear-code:hover {
    background: rgba(78, 168, 212, 0.1) !important;
    box-shadow: 0 0 10px rgba(78, 168, 212, 0.25) !important;
}

/* ── Confirm dialogs (shared base) ─────────────────────── */
.confirm-popup {
    display: none;
    position: absolute;
    bottom: 52px;
    z-index: 200;
    background: #080d22;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
    font-family: 'Oxanium', monospace;
    font-size: 0.78rem;
    color: rgba(200, 240, 255, 0.8);
    white-space: nowrap;
    animation: popIn 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    from { opacity: 0; transform: translateY(6px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.confirm-popup.visible {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Clear Code — blue accent */
#clearCodeConfirm {
    left: 10px;
    border: 1px solid rgba(78, 168, 212, 0.4);
}

/* Clear Map — red/pink accent */
#clearMapConfirm {
    right: 10px;
    border: 1px solid rgba(255, 80, 100, 0.4);
}

#clearMapConfirm span {
    color: rgba(255, 200, 210, 0.85);
}

.cc-btn {
    font-family: 'Oxanium', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.12s;
}

/* Blue variant (code) */
.cc-btn-yes {
    background: rgba(78, 168, 212, 0.2);
    color: #4ea8d4;
    border: 1px solid rgba(78, 168, 212, 0.4);
}

.cc-btn-yes:hover { background: rgba(78, 168, 212, 0.38); }

/* Red variant (map) */
.cc-btn-yes-red {
    background: rgba(255, 80, 100, 0.18);
    color: #ff6070;
    border: 1px solid rgba(255, 80, 100, 0.4);
}

.cc-btn-yes-red:hover { background: rgba(255, 80, 100, 0.35); }

/* Cancel shared */
.cc-btn-no {
    background: transparent;
    color: rgba(200, 240, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cc-btn-no:hover { color: rgba(200, 240, 255, 0.7); }

/* ── Reset Game button ──────────────────────────────────── */
#btnResetGame {
    font-family: 'Oxanium', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 5px 12px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid rgba(255, 96, 80, 0.35);
    color: rgba(255, 96, 80, 0.55);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

#btnResetGame:hover {
    color: #ff6050;
    border-color: #ff6050;
    background: rgba(255, 96, 80, 0.08);
}