:root {
    --bg: #070914;
    --panel: #0b1020;
    --panel-2: #0f1529;
    --line: #24304a;
    --text: #e7ecff;
    --muted: #9fb0d9;
    --accent: #7c5cff;
    --accent-2: #49b3ff;
    --good: #67d38f;
    --bad: #ff7b8b;
    --maze-tile-size: 32px;
    --maze-wall-thickness: 3px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: #9dc7ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    background: #11182d;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1px 5px;
    color: #dbe6ff;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px;
}

.hero {
    margin-bottom: 18px;
}

.hero h1 {
    margin: 10px 0 8px;
    font-size: 2.1rem;
}

.subtitle {
    color: var(--muted);
    max-width: 980px;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #10162c;
    color: #cfe0ff;
    margin-right: 8px;
    font-size: 0.86rem;
}

.notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #10172b;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.col-4 {
    grid-column: span 4;
}

.col-6 {
    grid-column: span 6;
}

.col-8 {
    grid-column: span 8;
}

.col-12 {
    grid-column: span 12;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.015) inset;
}

.panel h2,
.panel h3 {
    margin-top: 0;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
}

th,
td {
    text-align: left;
    padding: 8px 6px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    width: 42%;
    color: #c8d7fb;
}

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    outline: none;
}

input[type="checkbox"] {
    transform: translateY(1px);
}

textarea {
    resize: vertical;
    min-height: 84px;
}

button {
    appearance: none;
    border: 1px solid transparent;
    background: linear-gradient(180deg, #8a6cff, #6d53ef);
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

button:hover {
    filter: brightness(1.05);
}

button.secondary {
    background: #111a31;
    border-color: var(--line);
    color: #d8e3ff;
}

button.tiny-btn {
    padding: 5px 9px;
    font-size: 0.82rem;
    line-height: 1.1;
}

pre {
    margin: 0;
    overflow: auto;
    padding: 12px;
    border-radius: 12px;
    background: #080d1a;
    border: 1px solid var(--line);
    color: #d9e6ff;
    font-family: "Cascadia Mono", "Consolas", "Courier New", monospace;
    font-size: 14px;
    line-height: 1.25;
}

.action-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    background: #0d1326;
}

.action-card h3 {
    margin-bottom: 8px;
}

.answer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.answer-value {
    color: #d6e2ff;
}

.is-hidden {
    display: none;
}

.open {
    color: var(--good);
}

.wall {
    color: var(--bad);
}

.maze-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    background: #060816;
}

.maze-text {
    margin: 0;
    white-space: pre;
    font-family: "Cascadia Mono", "Consolas", "Courier New", monospace;
    font-size: 18px;
    line-height: 1;
    letter-spacing: 0;
    word-spacing: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    padding: 0;
}

.maze-live {
    display: inline-block;
    min-width: max-content;
}

.maze-kind-wall {
    color: #6fb3ff;
}

.maze-kind-space,
.maze-kind-open,
.maze-kind-void {
    color: transparent;
}

.maze-kind-bot {
    color: #ff866e;
}

.maze-kind-goal {
    color: #ffffff;
}

/* Tile maze renderer */
.maze-tile-grid {
    display: grid;
    gap: 0;
    width: max-content;
}

.maze-tile {
    position: relative;
    width: var(--maze-tile-size);
    height: var(--maze-tile-size);
    background: #060816;
    overflow: hidden;
}

.maze-wall {
    position: absolute;
    display: block;
    background: #6fb3ff;
    z-index: 1;
}

.maze-wall-top {
    top: 0;
    left: 0;
    width: 100%;
    height: var(--maze-wall-thickness);
}

.maze-wall-right {
    top: 0;
    right: 0;
    width: var(--maze-wall-thickness);
    height: 100%;
}

.maze-wall-bottom {
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--maze-wall-thickness);
}

.maze-wall-left {
    top: 0;
    left: 0;
    width: var(--maze-wall-thickness);
    height: 100%;
}

.maze-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    line-height: 1;
    user-select: none;
}

.maze-bot {
    font-size: 22px;
    transform: scale(1.05);
}

.maze-goal {
    font-size: 20px;
}

.refresh-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.refresh-controls label {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: var(--muted);
}

/* MoltMaze homepage content blocks */
.hero-rich {
    margin-bottom: 22px;
}

.info-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.info-list {
    margin: 0;
    padding-left: 20px;
}

.info-list li {
    margin-bottom: 10px;
    color: var(--text);
}

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

.run-shortcut {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #0d1326;
}

.coffee-panel {
    border-style: dashed;
}

.coffee-slot {
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    background: #0a0f1d;
}

.coffee-label {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 8px;
}

.coffee-link {
    display: inline-block;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #111a31;
    color: #ffe7a6;
    text-decoration: none;
    font-weight: 700;
}

.coffee-link:hover {
    text-decoration: none;
    filter: brightness(1.06);
}

.coffee-note {
    margin-top: 10px;
}

.coffee-img {
    display: inline-block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

@media (max-width: 980px) {
    .col-4,
    .col-6,
    .col-8,
    .col-12 {
        grid-column: span 12;
    }

    .info-columns {
        grid-template-columns: 1fr;
    }
}

.changelog-body h1,
.changelog-body h2,
.changelog-body h3 {
    margin-top: 0;
}

.changelog-body p {
    color: var(--text);
}

.changelog-list {
    margin: 0;
    padding-left: 20px;
}

.changelog-list li {
    margin-bottom: 8px;
}

.ascii-legend {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #10162c;
    color: #d8e3ff;
    font-size: 0.9rem;
}
