:root {
    --bg:#0f1220;
    --panel:#171a2b;
    --text:#eef2ff;
    --muted:#aab1d6;
    --good:#46d38a;
    --bad:#ff5c7a;
    --warn:#ffd166;
    --elite:#c084fc;
    --boss:#f97316;
    --select:#60a5fa;
}

* { box-sizing: border-box; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

body {
    margin:0;
    background: radial-gradient(1200px 800px at 30% 10%, #23295a 0%, var(--bg) 55%);
    color:var(--text);
}

.wrap { max-width: 1180px; margin: 18px auto; padding: 0 14px 18px; }

h1 { margin: 10px 0 6px; font-size: 22px; letter-spacing: 0.2px; }
.sub { color: var(--muted); margin: 0 0 14px; }

.grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 12px;
}

.panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    padding: 12px;
    backdrop-filter: blur(6px);
}

.row { display:flex; gap:10px; align-items:center; flex-wrap: wrap; }
.spacer { flex:1; }

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    color: var(--text);
    font-size: 12px;
}

.badge.gold {
    background: rgba(255, 209, 102, 0.12);
    border-color: rgba(255, 209, 102, 0.35);
    color: #ffe6a3;
}

.badge.node-fight {
    background: rgba(70,211,138,0.12);
    border-color: rgba(70,211,138,0.35);
}

.badge.node-campfire {
    background: rgba(255, 140, 60, 0.12);
    border-color: rgba(255, 140, 60, 0.35);
}

.badge.node-shop {
    background: rgba(255,209,102,0.12);
    border-color: rgba(255,209,102,0.35);
}

.badge.node-elite {
    background: rgba(192,132,252,0.14);
    border-color: rgba(192,132,252,0.35);
}

.badge.node-boss {
    background: rgba(249,115,22,0.16);
    border-color: rgba(249,115,22,0.38);
}

.btn {
    cursor:pointer;
    user-select:none;
    border:none;
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 700;
    background: linear-gradient(180deg, rgba(255,255,255,0.13), rgba(255,255,255,0.06));
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.12);
    transition: transform 0.05s ease, filter 0.15s ease;
}

.btn:active { transform: translateY(1px); }
.btn:hover { filter: brightness(1.08); }

.btn.primary {
    background: linear-gradient(180deg, rgba(70,211,138,0.35), rgba(70,211,138,0.16));
    border-color: rgba(70,211,138,0.35);
}

.btn.danger {
    background: linear-gradient(180deg, rgba(255,92,122,0.30), rgba(255,92,122,0.14));
    border-color: rgba(255,92,122,0.35);
}

.btn.warn {
    background: linear-gradient(180deg, rgba(255,209,102,0.30), rgba(255,209,102,0.14));
    border-color: rgba(255,209,102,0.35);
}

.btn:disabled {
    opacity: 0.5;
    cursor:not-allowed;
    transform:none;
}

.hpbar {
    height: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    overflow:hidden;
    width: 240px;
}

.hpfill {
    height:100%;
    width:50%;
    background: linear-gradient(90deg, rgba(70,211,138,0.95), rgba(70,211,138,0.65));
}

.hpfill.enemy {
    background: linear-gradient(90deg, rgba(255,92,122,0.95), rgba(255,92,122,0.65));
}

.mini { font-size: 12px; color: var(--muted); }
.big { font-size: 15px; font-weight: 700; }

.cards {
    display:flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px 2px;
}

.card {
    width: 170px;
    min-height: 210px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.12);
    padding: 10px;
    cursor:pointer;
    position: relative;
    box-shadow: 0 10px 28px rgba(0,0,0,0.25);
    transition: transform 0.08s ease, filter 0.15s ease;
}

.card:hover { transform: translateY(-2px); filter: brightness(1.06); }
.card:active { transform: translateY(0px); }
.card.disabled { opacity: 0.5; cursor:not-allowed; }

.card .top { display:flex; align-items:center; gap: 8px; margin-bottom: 8px; }

.cost {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display:grid;
    place-items:center;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.14);
    font-weight: 900;
}

.ctype { font-size: 11px; color: var(--muted); }
.cname { font-weight: 900; font-size: 15px; letter-spacing: 0.2px; }
.desc { font-size: 12px; color: rgba(238,242,255,0.90); line-height: 1.35; margin-top: 8px; }

.tag {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    display: none;
}


.tag.attack { border-color: rgba(255,92,122,0.35); background: rgba(255,92,122,0.12); }
.tag.skill { border-color: rgba(70,211,138,0.35); background: rgba(70,211,138,0.12); }
.tag.power { border-color: rgba(255,209,102,0.40); background: rgba(255,209,102,0.12); }

.price {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 800;
    color: #ffe6a3;
}

.log {
    height: 360px;
    overflow:auto;
    padding: 10px;
    background: rgba(0,0,0,0.12);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
}

.log p { margin: 0 0 8px; font-size: 12px; color: rgba(238,242,255,0.92); }
.log .muted { color: var(--muted); }

.intent { display:flex; align-items:center; gap:10px; }

.intentBox {
    padding: 8px 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    min-width: 240px;
}

.footer { margin-top: 10px; color: var(--muted); font-size: 12px; }

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.58);
    display: grid;
    place-items: center;
    z-index: 9999;
    padding: 16px;
}

.modal {
    max-width: 1100px;
    width: 100%;
    max-height: 92vh;
    overflow: auto;
}

.optionBox {
    flex: 1 1 260px;
    min-width: 260px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04));
}

.optionBox h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.optionBox p {
    margin: 0 0 12px;
    color: rgba(238,242,255,0.88);
    font-size: 14px;
    line-height: 1.4;
}

.mapWrap {
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.mapBoard {
    position: relative;
    min-width: 860px;
    height: 700px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.10);
    background:
    radial-gradient(circle at top, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    overflow: hidden;
}

.mapSvg {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.mapNode {
    position: absolute;
    width: 110px;
    min-height: 46px;
    transform: translate(-50%, -50%);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 8px 10px;
    cursor: default;
    box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}

.mapNode.fight {
    background: rgba(70,211,138,0.15);
    border-color: rgba(70,211,138,0.35);
}

.mapNode.campfire {
    background: rgba(255,140,60,0.15);
    border-color: rgba(255,140,60,0.35);
}

.mapNode.shop {
    background: rgba(255,209,102,0.16);
    border-color: rgba(255,209,102,0.35);
}

.mapNode.elite {
    background: rgba(192,132,252,0.18);
    border-color: rgba(192,132,252,0.40);
}

.mapNode.boss {
    background: rgba(249,115,22,0.18);
    border-color: rgba(249,115,22,0.42);
}

.mapNode.selectable {
    cursor: pointer;
    outline: 2px solid rgba(96,165,250,0.55);
    box-shadow: 0 0 0 3px rgba(96,165,250,0.12), 0 10px 24px rgba(0,0,0,0.25);
}

.mapNode.selectable:hover {
    filter: brightness(1.12);
    transform: translate(-50%, -50%) scale(1.03);
}

.mapNode.current {
    outline: 2px solid rgba(255,255,255,0.65);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.08), 0 10px 24px rgba(0,0,0,0.25);
}

.mapNode.completed {
    opacity: 0.72;
}

.mapLegend {
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:10px;
}

.legendItem {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
}

.legendItem.fight { border-color: rgba(70,211,138,0.35); }
.legendItem.campfire { border-color: rgba(255,140,60,0.35); }
.legendItem.shop { border-color: rgba(255,209,102,0.35); }
.legendItem.elite { border-color: rgba(192,132,252,0.40); }
.legendItem.boss { border-color: rgba(249,115,22,0.42); }
.legendItem.path { border-color: rgba(96,165,250,0.55); }

@media (max-width: 900px) {
    .grid { grid-template-columns: 1fr; }
    .hpbar { width: 200px; }
    .card { width: 160px; }
    .mapBoard { height: 660px; min-width: 760px; }
    .mapNode { width: 100px; }
}


/* Attack cards */
.card.attack {
  border: 2px solid #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

/* Skill cards */
.card.skill {
  border: 2px solid #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
}

/* Power cards */
.card.power {
  border: 2px solid #a855f7;
  box-shadow: 0 0 6px rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.08);
}
