:root {
    --ink: #1d2939;
    --muted: #667085;
    --line: #e4e7ec;
    --paper: #fbfaf7;
    --card: #ffffff;
    --accent: #d46a3b;
    --accent-dark: #a94824;
    --soft-accent: #fff0e9;
    --success: #13795b;
    --error: #b42318;
    --shadow: 0 18px 45px rgba(29, 41, 57, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 0%, rgba(212, 106, 59, 0.11), transparent 28rem),
        var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

a { color: var(--accent-dark); }

.site-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 72px;
}

.hero-panel,
.game-panel,
.panel,
.plot-card {
    background: var(--card);
    border: 1px solid rgba(228, 231, 236, 0.9);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.hero-panel,
.game-panel,
.panel { padding: clamp(28px, 6vw, 64px); }

.hero-panel {
    min-height: 430px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.hero-panel h1,
.game-panel h1,
.panel h1,
.admin-header h1 {
    max-width: 780px;
    margin: 12px 0 18px;
    font-size: clamp(2.4rem, 6vw, 5.5rem);
    letter-spacing: -0.055em;
    line-height: 0.98;
}

.game-panel { max-width: 760px; margin: 0 auto; }
.game-panel h1 { font-size: clamp(2.4rem, 6vw, 4.7rem); }

.eyebrow,
.step-label,
.node-heading,
.start-link span {
    margin: 0;
    color: var(--accent-dark);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-copy,
.muted,
.hint { color: var(--muted); }
.hero-copy { max-width: 590px; font-size: 1.12rem; }
.hero-mark { color: var(--accent); font-size: 10rem; line-height: 1; transform: rotate(-12deg); }

.game-meta,
.admin-header,
.plot-card-header,
.node-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.step-count { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.progress { display: flex; gap: 8px; margin: 28px 0 42px; }
.progress-dot { display: block; width: 44px; height: 5px; border-radius: 10px; background: var(--line); }
.progress-dot.is-active { background: var(--accent); }
.step-label { margin-bottom: 14px; }
.story-text { margin: 28px 0 40px; font-size: 1.2rem; white-space: pre-wrap; }

.primary-button,
.ghost-button,
.small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.primary-button { color: #fff; background: var(--accent); }
.primary-button:hover { background: var(--accent-dark); }
.ghost-button { color: var(--ink); background: transparent; border-color: var(--line); }
.small-button { min-height: 36px; padding: 7px 12px; color: var(--accent-dark); background: var(--soft-accent); }
.finish-note { padding: 18px; color: var(--success); background: #eaf8f2; border-radius: 12px; font-weight: 700; }

.narrow-panel,
.auth-panel { max-width: 600px; margin: 80px auto; }
.auth-panel { max-width: 440px; }
.stack-form { display: grid; gap: 10px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 0.88rem; font-weight: 700; }
input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 11px 12px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}
textarea { resize: vertical; }
input:focus,
textarea:focus { outline: 3px solid rgba(212, 106, 59, 0.2); border-color: var(--accent); }

.admin-header { margin-bottom: 28px; align-items: flex-start; }
.admin-header h1 { margin-bottom: 8px; font-size: clamp(2.2rem, 5vw, 4.3rem); }
.plot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.plot-card { padding: 24px; }
.plot-card h2 { margin: 4px 0 0; font-size: 1.25rem; }
.plot-card-header { min-height: 104px; }
.qr-code { width: 104px; height: 104px; border-radius: 8px; image-rendering: pixelated; }
.start-link { display: grid; gap: 3px; margin: 18px 0; padding: 12px; background: #f8f9fb; border-radius: 9px; overflow: hidden; }
.start-link a { overflow-wrap: anywhere; font-size: 0.78rem; }
.node-list { display: grid; gap: 12px; }
.node-editor { display: grid; gap: 9px; padding-top: 16px; border-top: 1px solid var(--line); }
.node-heading { align-items: center; }
.node-heading a { font-size: 0.8rem; }
.token-preview { color: var(--muted); overflow-wrap: anywhere; font-size: 0.72rem; }
.node-editor .small-button { justify-self: start; }
.empty-panel { max-width: 680px; margin: 0 auto; }
.flash { margin: 0 0 20px; padding: 12px 14px; border-radius: 10px; background: #eaf8f2; color: var(--success); }
.flash.error { background: #fff0ef; color: var(--error); }
code { font-family: "SFMono-Regular", Consolas, monospace; }

@media (max-width: 760px) {
    .site-shell { width: min(100% - 20px, 680px); padding-top: 20px; }
    .hero-panel { min-height: 0; }
    .hero-mark { display: none; }
    .plot-grid { grid-template-columns: 1fr; }
    .admin-header { flex-direction: column; }
    .progress-dot { flex: 1; }
}

