* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0b1220;
    --panel: #0f172a;
    --card: #111827;
    --accent: #22d3ee;
    --accent-2: #34d399;
    --danger: #f87171;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: #1f2937;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

body {
    font-family: "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at 15% 20%, rgba(52, 211, 153, 0.08), transparent 35%), radial-gradient(circle at 80% 0%, rgba(34, 211, 238, 0.12), transparent 30%), var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.container {
    width: min(1300px, 100%);
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
    background: rgba(10, 15, 28, 0.85);
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}

.logo {
    font-weight: 800;
    letter-spacing: 0.03em;
}

.header-meta {
    display: flex;
    gap: 8px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    gap: 6px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: var(--accent-2);
    font-size: 0.9rem;
}

.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    padding: 28px 0 32px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 18px;
}

.panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.eyebrow {
    color: var(--accent-2);
    font-weight: 700;
    letter-spacing: 0.06em;
    font-size: 0.95rem;
}

.lead {
    color: var(--muted);
    margin-top: 6px;
}

h1 {
    font-size: clamp(1.6rem, 2.6vw, 2.4rem);
    margin: 6px 0;
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-ghost {
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn-primary {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #0b1220;
    box-shadow: 0 12px 30px rgba(34, 211, 238, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(34, 211, 238, 0.35);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: rgba(52, 211, 153, 0.4);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.stat-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.92rem;
}

.selection-text {
    font-weight: 700;
    color: var(--text);
}

.canvas-wrapper {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #0d1524;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: crosshair;
}

.legend {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid var(--border);
}

.dot.p1 {
    background: #34d399;
}

.dot.p2 {
    background: #f87171;
}

.dot.obstacle {
    background: #2f3645;
}

.dot.base {
    background: #7dd3fc;
}

.dot.reachable {
    background: rgba(52, 211, 153, 0.4);
}

.dot.attackable {
    background: rgba(248, 113, 113, 0.4);
}

.info-block {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.list {
    list-style: disc;
    padding-left: 18px;
    margin-top: 6px;
}

.divider {
    height: 1px;
    background: var(--border);
}

.log-area {
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.footer {
    border-top: 1px solid var(--border);
    padding: 18px 0 24px;
    background: rgba(0, 0, 0, 0.18);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 960px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    canvas {
        height: auto;
    }
}
 