.flame-tools-page {
    --canvas: #100e10;
    --surface: #1b1517;
    --raised: #2a2021;
    --line: #53352c;
    --ink: #fff2ea;
    --muted: #cdb6aa;
    --accent: #ff9759;
    background: radial-gradient(ellipse at 80% 4%, #38231b, transparent 44%), var(--canvas);
}
.flame-tools-page .shell { width: min(1320px, calc(100% - 40px)); }
.flame-tools-page :is(input[type], select, textarea) { background: #171116; }
.flame-tools-page :is(.card, .panel, .form) { min-width: 0; }
.flame-tools-page button[type="submit"], .flame-tools-page #open-case {
    background: linear-gradient(120deg, #ffb472, #ff7336);
}
.admin-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 16px; align-items: start; }
#admin-search input { min-width: 120px; flex: 1; }
.admin-table { overflow: auto; }
.admin-table table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table :is(th, td) { padding: 8px 5px; border-bottom: 1px solid var(--line); }
.admin-table th { font-size: 13px; color: var(--muted); }
.admin-table td { font-size: 14px; overflow-wrap: anywhere; }
.admin-table td button { padding: 6px 8px; font-size: 13px; }
.admin-table small, #admin-detail h2 small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
#admin-detail h2 small { display: inline; }
.admin-catalog textarea {
    width: 100%; resize: vertical; min-height: 150px; padding: 11px;
    border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font: 13px/1.55 monospace;
}

.fd-case-tools { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 14px; }
.fd-case-tools a { text-underline-offset: 4px; }
.fd-case-tools #favorite { margin-left: auto; min-width: 48px; font-size: 26px; color: var(--accent); }
.fd-case-tools #favorite[aria-pressed="true"] { border-color: var(--accent); }
.fd-case-hero { display: grid; justify-items: center; gap: 10px; text-align: center; margin-top: 19px; }
.fd-case-hero h1 { overflow-wrap: anywhere; text-transform: uppercase; font-weight: 900; }
.fd-case-stage {
    width: min(100%, 715px);
    min-height: clamp(220px, 34vw, 368px);
    display: grid;
    align-items: center;
    background: radial-gradient(ellipse at center, #77371868, transparent 66%);
}
.fd-case-art {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    width: min(100%, 405px);
    margin-inline: auto;
    padding: 22px;
    aspect-ratio: 1.15;
}
.fd-case-art::before, .fd-case-art::after {
    position: absolute;
    inset: 8% 12%;
    z-index: -1;
    border: 2px solid #a74727;
    border-radius: 50%;
    box-shadow: 0 0 26px #ff672b57, inset 0 0 25px #ff6d2c50;
    content: "";
}
.fd-case-art::before {
    border-block-color: #ffd18c;
    border-inline-color: #ec5d29 transparent;
    border-width: 4px;
    animation: fd-case-orbit 11s linear infinite;
}
.fd-case-art::after { inset: 3% 8%; border: 1px dashed #ffb07070; transform: rotate(25deg); }
.fd-case-art img { width: 100%; height: clamp(160px, 22vw, 260px); object-fit: contain; filter: drop-shadow(0 16px 22px #210a08); }
.fd-case-summary { padding: 12px 18px 16px; width: min(100%, 435px); border: 1px solid var(--line); border-radius: 14px; background: #1d1517; }
.fd-case-summary dl { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 4px 0; }
.fd-case-summary dl div { min-width: 99px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: #25191a; }
.fd-case-summary dt { color: var(--muted); font-size: 12px; }
.fd-case-summary dd { margin: 2px 0 0; font-weight: 760; }
.fd-case-action { margin-top: 8px; }
.fd-case-summary .lead, .fd-case-summary .notice { font-size: 14px; }
.fd-case-summary .form-status:not(:empty) { margin-top: 12px; }
.fd-case-rewards { scroll-margin-top: 18px; }
.fd-case-rewards h2 { color: #ffe7d7; text-align: center; text-transform: uppercase; }
.fd-case-rewards .card { border-color: #57392f; background: radial-gradient(ellipse at 45% 0, #38221e, #1b1517 73%); }

.fd-case-reel { position: relative; min-width: 0; overflow: hidden; border: 1px solid #8a4c32; border-radius: 14px; }
.fd-case-reel::after {
    position: absolute; inset: 0 auto 0 50%; width: 3px; background: #ffa557;
    box-shadow: 0 0 14px #ff7429; content: "";
}
.fd-case-strip { position: relative; display: flex; gap: 8px; width: max-content; padding: 12px; }
.fd-case-strip article, .fd-case-winner {
    display: grid; grid-template-rows: 94px auto; justify-items: center; align-content: center;
    gap: 7px; padding: 9px; border: 1px solid #694235; border-radius: 10px; background: #2a1a1a;
    font-size: 13px; overflow-wrap: anywhere;
}
.fd-case-strip article { width: 125px; }
.fd-case-winner { width: min(210px, 100%); margin: auto; border-color: #ffa557; }
.fd-case-strip img, .fd-case-winner img { width: 94px; height: 94px; object-fit: contain; }

.fd-upgrade-wheel {
    --fd-chance: 0%;
    position: relative; isolation: isolate;
    display: grid; place-items: center;
    width: min(248px, 79vw); aspect-ratio: 1; margin-inline: auto;
    border: 1px solid #9a5638; border-radius: 50%;
    background: conic-gradient(#fc9b54 var(--fd-chance), #2c1e24 var(--fd-chance));
    box-shadow: 0 0 33px #fb6a2c35;
}
.fd-upgrade-wheel-label {
    display: grid; place-content: center; text-align: center; gap: 5px;
    width: 76%; aspect-ratio: 1; border: 1px solid #8a4c32; border-radius: 50%; background: #1b1418;
}
.fd-upgrade-wheel-label span { color: #d9b4a5; font-size: 14px; }
.fd-upgrade-pointer { position: absolute; inset: 2px; z-index: 1; }
.fd-upgrade-pointer::after {
    position: absolute; top: -4px; left: calc(50% - 7px); width: 14px; height: 19px;
    background: #fff0bd; clip-path: polygon(0 0,100% 0,50% 100%); content: "";
}
.fd-upgrade-wheel[data-result="success"] { box-shadow: 0 0 34px #ff9a4fc0; }
.fd-upgrade-wheel[data-result="miss"] { box-shadow: 0 0 31px #db474d80; }
@keyframes fd-case-orbit { to { transform: rotate(360deg); } }
[data-no-flame-motion] .fd-case-art::before { animation: none; }
@media (prefers-reduced-motion: reduce) { .fd-case-art::before { animation: none; } }
@media (max-width: 700px) {
    .flame-tools-page .shell { width: calc(100% - 24px); }
    .admin-columns { grid-template-columns: minmax(0, 1fr); }
    .fd-case-art { width: min(100%, 290px); }
}
