/* Roast tool. Loaded after the classic site's CSS (Bootstrap + styles.css for the shared navbar and footer), so
   everything is scoped to .tool and avoids Bootstrap's class names (.btn, .row, .alert, .badge, .progress). */
[hidden] { display: none !important; }

body.tool-page { display: flex; flex-direction: column; min-height: 100vh; }
body.tool-page > main { flex: 1 0 auto; width: 100%; }

.tool { max-width: 860px; margin: 0 auto; padding: 120px 1rem 2rem; --line: rgba(255, 255, 255, .14);
    --muted: rgba(255, 255, 255, .65); --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; }

.tool-head { text-align: center; margin-bottom: 2rem; }
.tool-head h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 400; text-transform: uppercase; margin: 0 0 .5rem; }
.tool-head .lead-line { color: var(--muted); margin: 0; }

.tool .panel { border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem 1.4rem; margin-bottom: 1rem; }

/* Ask: two tabs on top of the panel, the input below */
.tool .ask { padding-top: 0; }
.tool .tabs { display: flex; margin: 0 -1.4rem 1.2rem; border-bottom: 1px solid var(--line); }
.tool .tab { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: 1rem .5rem .85rem;
    background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font: inherit;
    font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; transition: color .2s ease, border-color .2s ease; }
.tool .tab:hover { color: #fff; }
.tool .tab.active { color: #fff; border-bottom-color: #fff; box-shadow: 0 8px 14px -12px rgba(255, 255, 255, .9); }
.tool .tab:focus-visible { outline: none; color: #fff; background: rgba(255, 255, 255, .05); }
.tool .tab:first-child { border-top-left-radius: 14px; }
.tool .tab:last-child { border-top-right-radius: 14px; }
.tool .line { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.tool .ac { position: relative; flex: 1 1 16rem; min-width: 0; }
.tool input[type=text] { width: 100%; background: #000; color: #fff; border: 1px solid var(--line); border-radius: 10px;
    padding: .65rem .9rem; font: inherit; font-size: 15px; min-width: 0; }
.tool input[type=text]:focus { outline: none; border-color: rgba(255, 255, 255, .6); }

/* GitHub username suggestions */
.tool .suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .3rem; list-style: none;
    background: #0b0b0b; border: 1px solid rgba(255, 255, 255, .22); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .7); }
.tool .suggest li { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: 7px; cursor: pointer; color: #fff; font-size: 14px; }
.tool .suggest li img { width: 24px; height: 24px; border-radius: 50%; flex: none; background: #222; }
.tool .suggest li[aria-selected=true], .tool .suggest li:hover { background: rgba(255, 255, 255, .1); }
.tool .suggest li.note { color: var(--muted); cursor: default; font-size: 12.5px; }
.tool .suggest li.note:hover { background: none; }
.tool .tbtn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; margin: 0; padding: .6rem 1.15rem;
    border: 1px solid #fff; border-radius: 999px; background: transparent; color: #fff; font: inherit; font-size: 13px;
    letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; transition: box-shadow .3s ease; }
.tool .tbtn:hover, .tool .tbtn:focus-visible { box-shadow: 0 0 22px rgba(255, 255, 255, .45); outline: none; }
.tool .tbtn.primary { background: #fff; color: #000; }
.tool .tbtn.ghost { border-color: var(--line); color: var(--muted); }
.tool .tbtn:disabled { opacity: .4; cursor: default; box-shadow: none; }
.tool .status { color: var(--muted); font-size: .9rem; margin: .8rem 0 0; }
.tool .err { color: #fecaca; border: 1px solid var(--bad); background: rgba(248, 113, 113, .08); border-radius: 10px;
    padding: .65rem .9rem; margin: .9rem 0 0; font-size: .92rem; }
.tool .status:empty, .tool .err:empty { display: none; }
.tool .status.busy::before { content: ''; display: inline-block; width: .7rem; height: .7rem; border: 2px solid rgba(255, 255, 255, .25);
    border-top-color: #fff; border-radius: 50%; margin-right: .5rem; vertical-align: -1px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Result */
.tool .result { padding: 1.6rem 1.6rem 1.4rem; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tool .kicker { color: var(--muted); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; margin: 0 0 .4rem; }
.tool .arche { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 .9rem; line-height: 1.1; }
.tool .scoreline { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.tool .bar { flex: 1 1 auto; height: 4px; background: rgba(255, 255, 255, .12); border-radius: 3px; overflow: hidden; }
.tool .bar span { display: block; height: 100%; width: 0; background: #fff; box-shadow: 0 0 10px #fff; transition: width .8s ease; }
.tool .score { margin: 0; white-space: nowrap; font-size: .95rem; color: var(--muted); }
.tool .score strong { color: #fff; font-size: 1.4rem; }
.tool .score em { font-style: normal; margin-left: .6rem; }
.tool .opener { font-size: 1.05rem; margin: 0 0 1rem; }
.tool .lines { list-style: none; padding: 0; margin: 0 0 1rem; }
.tool .lines li { display: flex; gap: .75rem; padding: .85rem 0; border-top: 1px solid var(--line); line-height: 1.55; color: rgba(255, 255, 255, .82); }
.tool .lines .lm { flex: none; width: 1.3rem; padding-top: .1rem; text-align: center; }
.tool .lines .lm:empty::before { content: ''; display: inline-block; width: .5rem; height: .5rem; margin-top: .45rem; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.tool .lines li.s3 .lm:empty::before { background: var(--warn); }
/* the worst burns: fire, full white, a bit bigger */
.tool .lines li.s4, .tool .lines li.s5 { color: #fff; font-size: 1.04rem; }
.tool .lines li.s4 .lm, .tool .lines li.s5 .lm { color: var(--bad); font-size: 1.1rem; filter: drop-shadow(0 0 6px rgba(248, 113, 113, .8)); }
.tool .lines li.s5 { font-weight: 700; }
/* spotlights quote the real repo / commit / page */
.tool .lines li.spot { font-style: normal; }
.tool .lines li.spot .lm { color: rgba(255, 255, 255, .5); }

/* Entrance: archetype slams in, then each line drops in turn, the closer last */
.tool .result.play .arche { animation: slam .55s cubic-bezier(.2, 1.4, .4, 1) both; }
.tool .result.play .opener { animation: drop .45s ease both .25s; }
.tool .result.play .lines li { animation: drop .45s ease both; animation-delay: calc(.5s + var(--i) * .22s); }
.tool .result.play .lines li.s4, .tool .result.play .lines li.s5 { animation-name: drop, jolt; animation-duration: .45s, .35s;
    animation-delay: calc(.5s + var(--i) * .22s), calc(.9s + var(--i) * .22s); }
.tool .result.play .closer, .tool .result.play .actions { animation: drop .45s ease both; animation-delay: calc(.6s + var(--i, 7) * .22s); }
@keyframes slam { 0% { opacity: 0; transform: scale(1.6); filter: blur(8px); letter-spacing: 8px; } 60% { opacity: 1; filter: blur(0); }
    100% { transform: scale(1); letter-spacing: 1px; } }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes jolt { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@media (prefers-reduced-motion: reduce) { .tool .result.play * { animation: none !important; } }

/* Score band: the number and bar take the status colour of the damage */
.tool .result[data-band=bad] .score strong { color: var(--bad); text-shadow: 0 0 14px rgba(248, 113, 113, .6); }
.tool .result[data-band=bad] .bar span { background: var(--bad); box-shadow: 0 0 12px var(--bad); }
.tool .result[data-band=warn] .score strong { color: var(--warn); }
.tool .result[data-band=warn] .bar span { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.tool .bar span { transition: none; }
.tool .closer { border-top: 1px solid var(--line); padding-top: 1rem; color: var(--muted); margin: 0 0 1.1rem; }
.tool .info { flex: none; display: inline-grid; place-items: center; width: 2rem; height: 2rem; margin: 0; padding: 0; border: 1px solid var(--line);
    border-radius: 50%; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; transition: color .2s ease, border-color .2s ease; }
.tool .info:hover, .tool .info:focus-visible, .tool .info[aria-expanded=true] { color: #fff; border-color: rgba(255, 255, 255, .6); outline: none; }
.tool .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tool .stats { color: var(--muted); font-size: .85rem; margin: -.4rem 0 1.1rem; padding: .6rem .8rem; border: 1px solid var(--line);
    border-radius: 10px; background: #0a0a0a; }
.tool .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

/* How it works */
.tool .guide { margin-top: .4rem; color: var(--muted); font-size: .92rem; }
.tool .guide summary { cursor: pointer; width: max-content; }
.tool .guide summary:hover { color: #fff; }
.tool .guide p { margin: .7rem 0 0; }

@media (max-width: 575px) {
    .tool { padding-top: 100px; }
    .tool .panel { padding: 1.1rem 1rem; }
    .tool .scoreline { flex-wrap: wrap; gap: .5rem .8rem; }
    .tool .scoreline .bar { flex-basis: 100%; }
    .tool .tabs { margin-left: -1rem; margin-right: -1rem; }
    .tool .tab { font-size: 11.5px; letter-spacing: 1px; }
}
