/* LEAP — Proof by Pointing UI */

:root {
    --bg: #1a1a2e;
    --surface: #16213e;
    --surface2: #0f3460;
    --accent: #e94560;
    --accent2: #533483;
    --text: #eee;
    --text-dim: #999;
    --hyp-color: #6ecb63;
    --goal-color: #58b4ff;
    --connective-color: #ffd93d;
    --proved-color: #4caf50;
    --open-color: #ff9800;
    --focus-color: #e94560;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --font-serif: 'Georgia', 'Times New Roman', serif;
}

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

body {
    font-family: var(--font-mono);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 2rem 1rem 1rem;
    border-bottom: 1px solid var(--surface2);
}

header h1 {
    font-size: 2.5rem;
    letter-spacing: 0.3em;
    color: var(--accent);
}

.subtitle {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Start screen */
#start-screen {
    max-width: 700px;
    margin: 2rem auto;
}

.input-area {
    margin-bottom: 2rem;
}

.input-area label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dim);
}

.input-row {
    display: flex;
    gap: 0.5rem;
}

.input-row input {
    flex: 1;
    padding: 0.7rem 1rem;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    background: var(--surface);
    border: 1px solid var(--surface2);
    color: var(--text);
    border-radius: 4px;
}

.input-row input:focus {
    outline: none;
    border-color: var(--accent);
}

button {
    padding: 0.7rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover { background: #d63551; }
button:disabled { opacity: 0.4; cursor: default; }

.input-help {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.input-help code {
    background: var(--surface);
    padding: 0.1em 0.3em;
    border-radius: 2px;
}

.examples h3 {
    margin-bottom: 0.7rem;
    color: var(--text-dim);
    font-weight: normal;
}

#example-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.example-btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    background: var(--surface);
    border: 1px solid var(--surface2);
    color: var(--goal-color);
    font-family: var(--font-serif);
}

.example-btn:hover {
    background: var(--surface2);
    border-color: var(--accent);
}

/* Proof screen */
.toolbar {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--surface2);
    margin-bottom: 1.5rem;
}

.toolbar button {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    background: var(--surface2);
}

.toolbar button:hover { background: var(--accent2); }

#status-text {
    margin-left: auto;
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* Sequent display */
.current-goal h3 {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: normal;
    margin-bottom: 0.5rem;
}

.sequent-container {
    background: var(--surface);
    border: 2px solid var(--surface2);
    border-radius: 6px;
    padding: 1.5rem 2rem;
    font-family: var(--font-serif);
    font-size: 1.4rem;
    line-height: 2;
    text-align: center;
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Clickable formula elements */
.sequent .formula {
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-radius: 3px;
    padding: 0.05em 0.1em;
}

.sequent .formula:hover {
    background: rgba(233, 69, 96, 0.2);
}

.sequent .connective {
    color: var(--connective-color);
    font-weight: bold;
    cursor: pointer;
}

.sequent .connective:hover {
    background: rgba(255, 217, 61, 0.25);
    border-radius: 3px;
}

.sequent .turnstile {
    color: var(--text-dim);
    font-size: 1.3em;
    margin: 0 0.5em;
}

.sequent .comma {
    color: var(--text-dim);
}

.sequent [data-side="hyp"] {
    color: var(--hyp-color);
}

.sequent [data-side="goal"] {
    color: var(--goal-color);
}

/* Message area */
.message-area {
    margin: 1rem 0;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.message-area.info {
    background: rgba(88, 180, 255, 0.1);
    border-left: 3px solid var(--goal-color);
}

.message-area.success {
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid var(--proved-color);
}

.message-area.error {
    background: rgba(233, 69, 96, 0.1);
    border-left: 3px solid var(--accent);
}

/* Dialogs */
.dialog {
    background: var(--surface);
    border: 1px solid var(--surface2);
    border-radius: 6px;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
}

.dialog h4 {
    margin-bottom: 0.7rem;
    color: var(--text-dim);
    font-weight: normal;
}

.choice-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 1rem;
    margin-bottom: 0.4rem;
    background: var(--surface2);
    border: 1px solid transparent;
    font-size: 0.9rem;
}

.choice-btn:hover {
    border-color: var(--accent);
    background: rgba(233, 69, 96, 0.1);
}

.choice-btn .choice-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
}

/* Goals list */
.goals-list {
    margin-top: 1.5rem;
}

.goals-list h3 {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: normal;
    margin-bottom: 0.5rem;
}

.goal-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.3rem;
    background: var(--surface);
    border-left: 3px solid var(--surface2);
    border-radius: 0 4px 4px 0;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.goal-item:hover {
    background: rgba(88, 180, 255, 0.05);
    border-left-color: var(--goal-color);
}

.goal-item.focused {
    border-left-color: var(--focus-color);
    background: rgba(233, 69, 96, 0.08);
}

.goal-number {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-right: 0.8rem;
    min-width: 1.5em;
}

/* Proof tree */
.proof-tree-section {
    margin-top: 1.5rem;
}

.proof-tree-section h3 {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: normal;
    margin-bottom: 0.5rem;
}

.proof-tree {
    background: var(--surface);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.85rem;
}

.tree-node {
    margin-left: 1.5rem;
    border-left: 1px solid var(--surface2);
    padding-left: 1rem;
    margin-top: 0.3rem;
}

.tree-node:first-child { margin-top: 0; }

.tree-label {
    padding: 0.3rem 0.5rem;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 0.2rem;
}

.tree-label.open {
    color: var(--open-color);
    border: 1px dashed var(--open-color);
}

.tree-label.proved {
    color: var(--proved-color);
}

.tree-label.focused {
    color: var(--focus-color);
    border: 1px solid var(--focus-color);
    background: rgba(233, 69, 96, 0.08);
}

.tree-rule {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent2);
    margin-left: 0.5rem;
}

.tree-sequent {
    font-family: var(--font-serif);
    color: var(--text-dim);
    font-size: 0.85em;
}

/* Victory overlay */
.victory-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.victory-content {
    background: var(--surface);
    border: 2px solid var(--proved-color);
    border-radius: 12px;
    padding: 3rem 4rem;
    text-align: center;
}

.victory-content h2 {
    font-size: 3rem;
    color: var(--proved-color);
    margin-bottom: 0.5rem;
}

.victory-content p {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}
