/* Arrow Maze v2 — cream paper + chocolate maze theme */

.ap-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 1rem;
    -webkit-tap-highlight-color: transparent;
    background: #f6f0e1;
    border-radius: 20px;
}

.ap-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    text-align: center;
    color: #6b4a2f;
}

.ap-sub {
    margin: 0 0 1rem;
    color: #8a6d4b;
    line-height: 1.55;
    text-align: center;
    font-size: 0.95rem;
}

.ap-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.ap-hud-stats {
    display: flex;
    gap: 0.9rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: #8a5a2b;
    align-items: center;
}

.am-drop { font-size: 1.25rem; }
.am-drop.am-lost { filter: grayscale(1); opacity: 0.3; }

.ap-hud-btns { display: flex; gap: 0.4rem; align-items: center; }

.ap-icon-btn {
    border: 1px solid #e0d5bd;
    background: #fffdf6;
    border-radius: 10px;
    font-size: 1.05rem;
    padding: 0.25rem 0.55rem;
    cursor: pointer;
    line-height: 1.4;
    color: #6b4a2f;
}

.ap-icon-btn:hover { border-color: #c9b896; }

#ap-hints b {
    font-size: 0.8rem;
    vertical-align: super;
    margin-left: 0.1rem;
}

/* ---------- maze board ---------- */

.ap-board { padding: 0; position: relative; }

#am-svg {
    display: block;
    width: 100%;
    height: auto;
    background: #f6f0e1;
    border-radius: 14px;
    touch-action: manipulation;
    user-select: none;
}

.am-path {
    fill: none;
    stroke: #6f4e2e;
    stroke-width: 11;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.25s ease, stroke 0.2s ease;
}

.am-hit {
    fill: none;
    stroke: rgba(0, 0, 0, 0);
    stroke-width: 30;
    stroke-linecap: round;
    pointer-events: stroke;
    cursor: pointer;
}

.am-arrowhead { fill: #6f4e2e; }

.am-pathg { cursor: pointer; }
.am-pathg.am-cleared { opacity: 0; }
.am-pathg.am-cleared .am-hit { pointer-events: none; }

.am-pathg.am-wrong .am-path { stroke: #dc2626; }
.am-pathg.am-wrong .am-arrowhead { fill: #dc2626; }

.am-pathg.am-hinted .am-path {
    stroke: #84cc16;
    filter: drop-shadow(0 0 6px #a3e635);
}
.am-pathg.am-hinted .am-arrowhead { fill: #65a30d; }

.am-traveler { fill: #6f4e2e; }

/* ---------- overlays ---------- */

.ap-overlay {
    position: absolute;
    inset: 0;
    background: rgba(80, 58, 34, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 5;
    padding: 1rem;
}

.ap-overlay[hidden] { display: none; }

.ap-card {
    background: #fffdf6;
    border: 2px solid #e0d5bd;
    border-radius: 16px;
    padding: 1.4rem 1.2rem;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 24px rgba(107, 74, 47, 0.25);
}

.ap-card h3 { margin: 0 0 0.5rem; color: #6b4a2f; }
.ap-card p { color: #8a6d4b; font-size: 0.92rem; line-height: 1.5; }

.ap-win-emoji { font-size: 2.4rem; margin-bottom: 0.3rem; }

.ap-stars { font-size: 1.7rem; color: #f5a623; letter-spacing: 0.15rem; margin: 0.3rem 0; }
.ap-stars-off { color: #ddd0b8; }

.ap-help { text-align: left; margin: 0.4rem 0; font-size: 0.92rem; color: #6b5844; }

.ap-btn-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.9rem;
}

.ap-btn {
    border: 1px solid #d8c9a8;
    background: #fffdf6;
    color: #6b4a2f;
    border-radius: 10px;
    padding: 0.55rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.ap-btn:hover { border-color: #b89b6a; }

.ap-btn.ap-primary, .ap-btn.ap-blue {
    background: #6f4e2e;
    border-color: #6f4e2e;
    color: #fff;
}

.ap-btn.ap-blue { margin-top: 0.8rem; width: 100%; }

.ap-level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
    margin-top: 0.8rem;
    max-height: 300px;
    overflow-y: auto;
}

.ap-lvl {
    border: 1px solid #d8c9a8;
    background: #fffdf6;
    border-radius: 10px;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #6b4a2f;
    cursor: pointer;
}

.ap-lvl.ap-locked { opacity: 0.4; cursor: default; }

.ap-lvl-stars {
    display: block;
    font-size: 0.6rem;
    color: #f5a623;
    letter-spacing: 0.05rem;
}

.ap-toast {
    position: absolute;
    left: 50%;
    top: 14%;
    transform: translateX(-50%) translateY(-6px);
    background: #4a3220;
    color: #fff;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 6;
    white-space: nowrap;
}

.ap-toast.ap-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- SEO article ---------- */

.ap-article { margin-top: 1.6rem; color: #374151; line-height: 1.7; }
.ap-article h2 { font-size: 1.15rem; margin: 1.2rem 0 0.4rem; }
.ap-article p, .ap-article li { font-size: 0.95rem; }
