:root {
    --bg: #070b12;
    --panel: rgba(13, 22, 35, 0.82);
    --panel-2: rgba(18, 31, 49, 0.72);
    --border: rgba(110, 231, 255, 0.22);
    --text: #edf7ff;
    --muted: #94a9ba;
    --cyan: #39e7ff;
    --blue: #6da8ff;
    --orange: #ffb454;
    --red: #ff6b6b;
    --green: #7cf5a1;
    --shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(57, 231, 255, 0.16), transparent 32rem),
        radial-gradient(circle at bottom right, rgba(109, 168, 255, 0.16), transparent 34rem),
        linear-gradient(135deg, #05070c 0%, #0a1220 48%, #060a10 100%);
}

.reaction-page {
    width: 100%;
    min-height: 100vh;
    padding: 34px 16px;
}

.reaction-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.reaction-hero,
.reaction-form,
.result-panel,
.notice {
    border: 1px solid var(--border);
    background: linear-gradient(145deg, var(--panel), rgba(8, 14, 24, 0.82));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.reaction-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 30px;
    border-radius: 24px 24px 12px 12px;
}

.reaction-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(57, 231, 255, 0.09), transparent 55%);
    pointer-events: none;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--cyan);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    line-height: 1.05;
}

h1 {
    font-size: clamp(2rem, 5vw, 4.3rem);
    letter-spacing: -0.06em;
}

h2 {
    font-size: clamp(1.45rem, 3vw, 2.25rem);
}

.subtitle {
    max-width: 680px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.orb {
    width: 116px;
    height: 116px;
    flex: 0 0 auto;
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 30%, #ffffff, var(--cyan) 18%, rgba(57, 231, 255, 0.25) 44%, transparent 68%),
        linear-gradient(135deg, rgba(57, 231, 255, 0.18), rgba(109, 168, 255, 0.08));
    box-shadow: 0 0 46px rgba(57, 231, 255, 0.45), inset 0 0 30px rgba(255, 255, 255, 0.18);
    opacity: 0.9;
}

.reaction-form {
    margin-top: 14px;
    padding: 18px;
    border-radius: 12px;
}

.reaction-form label {
    display: block;
    margin: 0 0 10px;
    color: var(--muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.74rem;
}

.form-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 150px auto;
    gap: 12px;
}

select,
input,
button {
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.24);
    color: var(--text);
    padding: 0 14px;
    font: inherit;
    outline: none;
}

select:focus,
input:focus {
    border-color: rgba(57, 231, 255, 0.72);
    box-shadow: 0 0 0 4px rgba(57, 231, 255, 0.09);
}

select option {
    background: #0d1623;
    color: var(--text);
}

button {
    cursor: pointer;
    border-color: rgba(57, 231, 255, 0.42);
    background: linear-gradient(135deg, rgba(57, 231, 255, 0.22), rgba(109, 168, 255, 0.12));
    color: #dffbff;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

button:hover {
    transform: translateY(-1px);
    border-color: rgba(57, 231, 255, 0.82);
    background: linear-gradient(135deg, rgba(57, 231, 255, 0.32), rgba(109, 168, 255, 0.18));
}

.result-panel,
.notice {
    margin-top: 14px;
    padding: 22px;
    border-radius: 12px 12px 24px 24px;
}

.result-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(124, 245, 161, 0.34);
    color: var(--green);
    background: rgba(124, 245, 161, 0.08);
    font-weight: 900;
    white-space: nowrap;
}

.reaction-tree,
.reaction-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.reaction-children {
    position: relative;
    margin-left: 18px;
    padding-left: 18px;
    border-left: 1px solid rgba(57, 231, 255, 0.18);
}

.reaction-node {
    margin: 12px 0;
}

.reaction-card,
.reaction-raw-row {
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: var(--panel-2);
    border-radius: 14px;
}

.reaction-card {
    padding: 14px;
}

.reaction-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
}

.reaction-title::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--cyan);
    box-shadow: 0 0 16px var(--cyan);
}

.reaction-name {
    color: var(--cyan);
    font-weight: 900;
}

.reaction-intermediate {
    color: var(--blue);
}

.reaction-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

.reaction-meta span {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
}

.reaction-meta strong {
    color: var(--text);
}

.reaction-raw-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 8px 0;
    padding: 10px 12px;
}

.reaction-raw {
    color: var(--orange);
    font-weight: 850;
}

.reaction-qty {
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
}

.reaction-warning,
.error {
    color: var(--red);
}

.notice {
    color: var(--muted);
    font-weight: 700;
}

@media (max-width: 720px) {
    .reaction-page { padding: 14px; }
    .reaction-hero { padding: 22px; }
    .orb { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .result-heading { flex-direction: column; }
    .reaction-children { margin-left: 7px; padding-left: 12px; }
}
