@import url("https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Jura:wght@300;400;600&family=Nosifer&display=swap");

:root {
    --blood-red: #8a0303;
    --dark-blood: #3e0000;
    --lava-orange: #ff3300;
    --abyss-black: #050101;
    --ink: #e0e0e0;
    --text-glow: 0 0 10px rgba(255, 51, 0, 0.8), 0 0 20px rgba(255, 0, 0, 0.6);
}

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

body {
    background-color: var(--abyss-black);
    color: var(--ink);
    font-family: "Jura", sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%238a0303" d="M12 2L9.5 9.5 2 12l7.5 2.5L12 22l2.5-7.5L22 12l-7.5-2.5z"/></svg>') 12 12, auto;
}

html {
    -webkit-text-size-adjust: 100%;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    z-index: 100;
}

.hell-bg {
    position: fixed;
    inset: 0;
    background-image: url("/static/images/narak_bg.png");
    background-size: cover;
    background-position: center;
    z-index: -3;
    filter: brightness(0.65) contrast(1.1);
    animation: slowZoom 28s infinite alternate;
}

.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    opacity: 0.05;
    background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="n"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23n)"/%3E%3C/svg%3E');
}

#embers {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 1;
    width: min(1100px, 96vw);
    margin: 0 auto;
    padding: 10px 0 30px;
}

body.centered-mode .container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.centered-mode .main-header {
    margin-top: 0;
}

body.centered-mode #step-0,
body.centered-mode #step-1,
body.centered-mode #step-2,
body.centered-mode #step-3,
body.centered-mode #judgment-loading,
body.centered-mode #step-result {
    max-width: 780px;
    margin-inline: auto;
}

.main-header {
    margin-top: 14px;
    margin-bottom: 0;
    text-align: center;
}

h1 {
    font-family: "Nosifer", cursive;
    font-size: 5rem;
    letter-spacing: 10px;
    line-height: 1.05;
    margin-bottom: 5px;
    word-break: break-word;
    position: relative;
    display: inline-block;
    color: #cc1100;
    text-shadow:
        0 0 4px rgba(180, 10, 0, 1.00),
        0 0 16px rgba(120, 0, 0, 0.95),
        0 0 40px rgba(80, 0, 20, 0.70),
        0 0 90px rgba(40, 0, 10, 0.45);
    animation: glitch 3s infinite, ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow:
            0 0 4px rgba(180, 10, 0, 1.00),
            0 0 16px rgba(120, 0, 0, 0.95),
            0 0 40px rgba(80, 0, 20, 0.70),
            0 0 90px rgba(40, 0, 10, 0.45);
    }

    to {
        text-shadow:
            0 0 6px rgba(220, 20, 0, 1.00),
            0 0 28px rgba(160, 0, 0, 1.00),
            0 0 60px rgba(100, 0, 30, 0.85),
            0 0 120px rgba(60, 0, 10, 0.55);
    }
}

h1::after {
    content: "";
    display: block;
    width: 55%;
    height: 1px;
    margin: 10px auto 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(140, 0, 0, 0.5) 30%,
            rgba(180, 10, 5, 0.8) 50%,
            rgba(140, 0, 0, 0.5) 70%,
            transparent 100%);
}

.subtitle {
    margin: 0 auto 10px;
    max-width: 780px;
    min-height: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}

#rotating-tagline {
    display: block;
    font-family: "Jura", sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 3px;
    line-height: 1.4;
    text-align: center;
    text-transform: uppercase;
    text-shadow:
        0 0 8px rgba(255, 110, 30, 0.75),
        0 0 26px rgba(200, 50, 0, 0.45);
    transition: opacity 0.45s ease, transform 0.45s ease;
    will-change: opacity, transform;
}

#rotating-tagline.tagline-exit {
    opacity: 0;
    transform: translateY(-8px);
}

#rotating-tagline.tagline-enter {
    opacity: 0;
    transform: translateY(10px);
}

#rotating-tagline.tagline-visible {
    opacity: 1;
    transform: translateY(0);
}

.narak-card {
    background: rgba(10, 0, 0, 0.7);
    border: 1px solid rgba(255, 0, 0, 0.35);
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    box-shadow: 0 0 30px rgba(138, 3, 3, 0.35), inset 0 0 20px rgba(0, 0, 0, 0.8);
    margin-bottom: 14px;
    display: none;
    animation: blockReveal 0.8s forwards;
}

.narak-card.active,
#step-feedback.active {
    display: block;
    max-width: 780px;
    width: 95%;
    margin: 20px auto;
    padding: 2rem;
    box-sizing: border-box;
}

h2 {
    font-family: "Cinzel Decorative", serif;
    color: var(--lava-orange);
    margin-bottom: 12px;
    font-size: 1.6rem;
    text-shadow: var(--text-glow);
}

h3 {
    font-family: "Cinzel Decorative", serif;
    color: #ffb499;
    margin: 14px 0 8px;
    font-size: 1.25rem;
}

.center {
    text-align: center;
}

.intro-copy {
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.stack {
    display: flex;
    flex-direction: column;
}

.gap {
    gap: 12px;
}

.small-note {
    color: #d5b2a7;
    margin-bottom: 10px;
}

.hidden {
    display: none !important;
}

.auth-panel {
    margin-top: 14px;
    display: none;
    border: 1px solid rgba(255, 88, 42, 0.3);
    border-radius: 10px;
    padding: 12px;
    background:
        linear-gradient(180deg, rgba(34, 0, 0, 0.55), rgba(10, 0, 0, 0.7));
    box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.65);
}

.auth-panel.show {
    display: block;
}

.feedback-panel {
    display: none;
    padding-top: 10px;
}

.feedback-panel.show {
    display: block;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.35);
}

.auth-tab {
    flex: 1;
    background: rgba(35, 0, 0, 0.58);
    border: 1px solid #ff3333;
    color: #ffd9cf;
    font-family: "Cinzel Decorative", serif;
    font-size: 0.92rem;
    letter-spacing: 1px;
    padding: 10px 10px;
    cursor: pointer;
    text-transform: uppercase;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
    line-height: 1;
}

.auth-tab:hover {
    background: linear-gradient(180deg, var(--lava-orange) 0%, var(--blood-red) 100%);
    color: #fff;
    box-shadow: 0 0 20px var(--lava-orange);
}

.auth-tab.active {
    background: linear-gradient(180deg, var(--blood-red) 0%, #200000 100%);
    color: #fff;
    border-color: 1px solid #ff3333;
    box-shadow: 0 0 14px rgba(255, 88, 30, 0.28);
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 2px;
}

.auth-form.active {
    display: flex;
}

.auth-form input {
    width: 100%;
}

.auth-form .btn-hell {
    width: 100%;
    margin-top: 6px;
}

.auth-msg {
    margin: 0;
    padding: 0;
    color: #ff998a;
    font-weight: 600;
    font-size: 0.84rem;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.25s ease, max-height 0.3s ease, margin 0.3s ease;
}

.auth-msg.show {
    opacity: 1;
    max-height: 48px;
    margin-top: 6px;
    margin-bottom: 6px;
    color: #ffc3b6;
}

.toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
}

.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

label {
    display: block;
    font-family: "Cinzel Decorative", serif;
    color: #ff9999;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.input-group {
    margin-bottom: 18px;
}

input,
select,
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--dark-blood);
    color: #fff;
    padding: 12px;
    border-radius: 4px;
    font-family: "Jura", sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--lava-orange);
    box-shadow: 0 0 15px rgba(255, 51, 0, 0.38), inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.4;
}

input.invalid,
textarea.invalid {
    border-color: #ff3b3b !important;
    box-shadow: 0 0 12px rgba(255, 59, 59, 0.5);
    animation: shake 0.4s both;
}

fieldset {
    border: 1px solid var(--dark-blood);
    border-radius: 8px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.25);
}

legend {
    padding: 0 8px;
    color: var(--lava-orange);
    font-family: "Cinzel Decorative", serif;
}

.btn-hell {
    background: linear-gradient(180deg, var(--blood-red) 0%, #200000 100%);
    border: 1px solid #ff3333;
    color: #fff;
    font-family: "Cinzel Decorative", serif;
    font-size: 0.95rem;
    font-weight: bold;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.btn-hell:hover {
    background: linear-gradient(180deg, var(--lava-orange) 0%, var(--blood-red) 100%);
    box-shadow: 0 0 20px var(--lava-orange);
}

.btn-secondary {
    background: transparent;
    border-color: var(--blood-red);
}

.btn-ghost {
    background: transparent;
    border-color: #6c4a4a;
}

.form-nav {
    display: flex;
    gap: 10px;
}

.form-nav .btn-hell {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #222;
    margin-bottom: 18px;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--lava-orange);
    box-shadow: 0 0 10px var(--lava-orange);
}

.mini-list {
    list-style: none;
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
}

.mini-list li {
    padding-left: 8px;
    line-height: 1.35;
}

#battlePlan {
    text-align: left;
    gap: 0;
    margin-bottom: 0;
    counter-reset: battle-count;
}

#battlePlan li {
    padding: 8px 10px 8px 32px;
    border-bottom: 1px solid rgba(255, 51, 0, 0.12);
    line-height: 1.5;
    font-size: 0.97rem;
    position: relative;
    counter-increment: battle-count;
}

#battlePlan li::before {
    content: counter(battle-count, decimal-leading-zero);
    color: var(--lava-orange);
    font-family: "Cinzel Decorative", serif;
    font-size: 0.72rem;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    line-height: 1;
}

#battlePlan li:last-child {
    border-bottom: none;
}

#step-result .btn-hell {
    margin-top: 16px;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.kpi {
    border: 1px solid #572828;
    border-radius: 6px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
}

.kpi span {
    font-size: 0.72rem;
    color: #d0aca0;
    display: block;
}

.kpi strong {
    font-size: 1.15rem;
    color: #fff3ef;
}

#trendChart {
    width: 100%;
    border: 1px solid #4a2323;
    border-radius: 8px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.24);
}

.loading-card {
    text-align: center;
}

.pentagram-spinner {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid var(--blood-red);
    margin: 8px auto 16px;
    animation: spin 3s linear infinite;
    position: relative;
}

.pentagram-spinner::before {
    content: "*";
    font-size: 50px;
    color: var(--lava-orange);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.judgment-reveal {
    text-align: center;
}

.score-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 4px solid var(--blood-red);
    margin: 14px auto;
    display: grid;
    place-items: center;
    font-size: 3rem;
    font-family: "Nosifer", cursive;
    box-shadow: 0 0 30px var(--blood-red), inset 0 0 15px var(--blood-red);
    animation: heartbeat 1.6s infinite;
}

.vitals {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.vitals span {
    color: #9f8c86;
}

.vitals strong {
    color: #ff9b7a;
    font-size: 1.3rem;
}

.typing-text {
    text-align: left;
    padding-left: 12px;
    min-height: 84px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.advice-box {
    background: rgba(255, 51, 0, 0.1);
    padding: 12px;
    margin-bottom: 20px;
    text-align: left;
}

.advice-box strong {
    color: var(--lava-orange);
}

.advice-box p {
    margin-top: 8px;
}

.feedback-form {
    margin-top: 8px;
}

.feedback-form .btn-hell {
    width: 100%;
    margin-top: 4px;
}

.credit-token {
    margin-top: 8px;
    margin-bottom: 14px;
    margin-left: 160px;
    margin-right: 160px;
    min-height: 38px;
    border: 1px solid rgba(255, 70, 24, 0.46);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(36, 0, 0, 0.8), rgba(14, 0, 0, 0.92));
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.72), 0 0 14px rgba(140, 15, 2, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 10px;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
}

.credit-token-text {
    font-family: "Cinzel Decorative", serif;
    font-size: 0.74rem;
    letter-spacing: 0.6px;
    color: #ffd7cc;
    text-shadow: 0 0 8px rgba(255, 68, 24, 0.42);
}

.credit-token-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #ffe0d7;
    font-size: 0.71rem;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 104, 40, 0.68);
    background: radial-gradient(circle at 32% 28%, rgba(255, 120, 48, 0.42), rgba(58, 0, 0, 0.94) 72%);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.58);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.credit-token-link svg {
    width: 13px;
    height: 13px;
    fill: #ffd8cd;
    filter: drop-shadow(0 0 6px rgba(255, 74, 28, 0.65));
}

.credit-token-link span {
    display: none;
}

.credit-token-link:hover {
    border-color: #ff5a2a;
    box-shadow: 0 0 12px rgba(255, 80, 28, 0.52), 0 0 22px rgba(255, 80, 28, 0.2);
    transform: translateY(-1px) scale(1.08);
}

.credit-token-icons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hell-footer {
    width: 100%;
    margin-top: 18px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 62, 20, 0.62);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(18, 0, 0, 0.97) 0%, rgba(45, 2, 2, 0.92) 42%, rgba(24, 0, 0, 0.97) 100%);
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.82),
        0 0 32px rgba(160, 12, 0, 0.44),
        0 0 8px rgba(255, 68, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    white-space: nowrap;
}

.hell-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(100deg, rgba(255, 66, 0, 0.12) 0 3px, rgba(255, 66, 0, 0) 3px 10px);
    mix-blend-mode: screen;
    animation: lavaSweep 3.6s linear infinite;
}

.footer-credit {
    font-family: "Cinzel Decorative", serif;
    color: #ffe0d4;
    font-size: 0.85rem;
    letter-spacing: 0.9px;
    text-align: center;
    text-shadow:
        0 0 8px rgba(255, 60, 10, 0.78),
        0 0 16px rgba(255, 34, 0, 0.32);
    z-index: 1;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.footer-icon-link {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 102, 36, 0.72);
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 120, 34, 0.32), rgba(90, 0, 0, 0.95) 65%);
    display: inline-grid;
    place-items: center;
    position: relative;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.55);
}

.footer-icon-link svg {
    width: 14px;
    height: 14px;
    fill: #ffe3db;
    filter: drop-shadow(0 0 6px rgba(255, 82, 22, 0.9));
}

.footer-icon-link:hover {
    transform: translateY(-2px) scale(1.08);
    border-color: #ff5c22;
    box-shadow:
        0 0 14px rgba(255, 68, 0, 0.52),
        0 0 24px rgba(255, 68, 0, 0.22),
        inset 0 0 12px rgba(255, 104, 38, 0.36);
}

a {
    color: #ffd5c8;
}

body.flash-blood {
    animation: flashBlood 0.35s forwards;
}

.shake {
    animation: shake 0.45s both;
}

@keyframes slowZoom {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(1px, -1px); }
    40% { transform: translate(-1px, 1px); }
    60% { transform: translate(1px, 1px); }
    80% { transform: translate(-1px, -1px); }
}

@keyframes titleFlicker {
    0%, 100% { opacity: 1; }
    8% { opacity: 0.92; }
    9% { opacity: 0.75; }
    10% { opacity: 1; }
    58% { opacity: 0.95; }
    60% { opacity: 0.82; }
    62% { opacity: 1; }
}

@keyframes blockReveal {
    from {
        transform: translateY(24px) scale(0.97);
        opacity: 0;
        filter: blur(3px);
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes flashBlood {
    0% { box-shadow: inset 0 0 0 rgba(255, 0, 0, 0); }
    50% { box-shadow: inset 0 0 180px rgba(255, 0, 0, 0.6); }
    100% { box-shadow: inset 0 0 0 rgba(255, 0, 0, 0); }
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes lavaSweep {
    from { transform: translateX(-18%); }
    to { transform: translateX(18%); }
}

#narak-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 200;
    min-width: 220px;
    max-width: 86vw;
    background: rgba(25, 5, 5, 0.95);
    border: 1px solid #ff5a44;
    color: #ffe5de;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
}

#narak-toast.show {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

body.credits-hidden #credits-trigger {
    display: none;
}

/* ══════════════════════════════════════════════════════
   CREDITS — Gate of Hell
══════════════════════════════════════════════════════ */

#credits-trigger {
    position: fixed;
    top: 24px;
    right: 32px;
    z-index: 9000;
    width: 60px;
    height: 60px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    box-shadow: none;
    transition: transform 0.22s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sigil-tooltip {
    position: absolute;
    right: 75px;
    white-space: nowrap;
    background: rgba(10, 0, 0, 0.7);
    border: 1px solid #ff3300;
    color: #ff3300;
    padding: 6px 14px;
    border-radius: 4px;
    font-family: "Cinzel Decorative", serif;
    font-size: 0.75rem;
    letter-spacing: 2px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(15px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 20px rgba(255, 51, 0, 0.4), inset 0 0 10px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    text-shadow: 0 0 8px rgba(255, 51, 0, 0.8);
}

.sigil-tooltip::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: rgba(10, 0, 0, 0.7);
    border-right: 1px solid #ff3300;
    border-top: 1px solid #ff3300;
}

#credits-trigger:hover .sigil-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
}

#credits-trigger svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 0 10px rgba(255, 60, 0, 0.6));
}

#credits-trigger:hover {
    transform: scale(1.15);
}

.sigil-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: drawSigil 5s infinite linear;
    filter: drop-shadow(0 0 2px rgba(255, 34, 0, 0.4));
}

.sigil-core {
    animation: corePulse 2s infinite ease-in-out;
}

@keyframes drawSigil {
    0% { stroke-dashoffset: 400; opacity: 0; }
    10% { opacity: 1; }
    40% { stroke-dashoffset: 0; }
    80% { stroke-dashoffset: 0; opacity: 1; filter: drop-shadow(0 0 8px rgba(255, 68, 0, 0.8)); }
    100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes corePulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.5); opacity: 1; fill: #ff0000; }
}

/* ── Overlay ── */
.credits-gate {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 0, 0, 0.92);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    perspective: 1800px;
    overflow: hidden;
}

.credits-gate.open {
    opacity: 1;
    pointer-events: all;
}

.credits-gate::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    transform: translateX(-50%);
    background: linear-gradient(180deg,
            transparent 0%,
            rgba(255, 120, 0, 0.9) 30%,
            rgba(255, 50, 0, 1) 50%,
            rgba(255, 120, 0, 0.9) 70%,
            transparent 100%);
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 5;
    box-shadow: 0 0 30px 8px rgba(255, 80, 0, 0.6);
}

.credits-gate.open::before {
    opacity: 1;
    animation: lavaSeam 1.1s ease-out forwards;
}

@keyframes lavaSeam {
    0% { opacity: 1; width: 6px; }
    40% { opacity: 0.9; width: 3px; }
    100% { opacity: 0; width: 1px; }
}

/* ── Gate doors ── */
.gate-door {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background:
        repeating-linear-gradient(0deg,
            rgba(255, 60, 0, 0.07) 0 3px,
            transparent 3px 20px),
        repeating-linear-gradient(90deg,
            rgba(255, 40, 0, 0.04) 0 1px,
            transparent 1px 36px),
        linear-gradient(180deg, #200000 0%, #0f0000 55%, #040000 100%);
    border: none;
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1), filter 0.7s ease;
    filter: brightness(1) blur(0px);
    overflow: hidden;
}

.gate-door::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 50% 100%, rgba(255, 50, 0, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 40% 30% at 50% 20%, rgba(200, 30, 0, 0.1) 0%, transparent 60%);
    animation: doorGlow 2.8s ease-in-out infinite alternate;
}

.gate-door::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg,
            transparent 0%,
            rgba(255, 100, 0, 0.5) 20%,
            rgba(255, 50, 0, 0.8) 50%,
            rgba(255, 100, 0, 0.5) 80%,
            transparent 100%);
    box-shadow: 0 0 12px rgba(255, 60, 0, 0.6);
}

@keyframes doorGlow {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

.gate-door-left {
    left: 0;
    transform-origin: left center;
}

.gate-door-left::after {
    right: 0;
}

.gate-door-right {
    right: 0;
    transform-origin: right center;
}

.gate-door-right::after {
    left: 0;
}

.credits-gate.open .gate-door-left {
    transform: translateX(-30%) rotateY(-155deg) skewY(10deg) scale(0.85);
    filter: brightness(0.4) blur(2px);
}

.credits-gate.open .gate-door-right {
    transform: translateX(30%) rotateY(155deg) skewY(-10deg) scale(0.85);
    filter: brightness(0.4) blur(2px);
}

.credits-gate.flash::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    background: radial-gradient(circle at center,
            rgba(255, 150, 0, 0.75) 0%,
            rgba(255, 50, 0, 0.45) 30%,
            transparent 70%);
    animation: hellBlast 0.55s ease-out forwards;
}

@keyframes hellBlast {
    0% { opacity: 1; transform: scale(0.1); }
    50% { opacity: 0.85; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(2.5); }
}

/* ── Credits content card ── */
.credits-content {
    position: relative;
    z-index: 10;
    background:
        linear-gradient(145deg, rgba(38, 2, 0, 0.98) 0%, rgba(14, 0, 0, 1) 100%);
    border: 1px solid rgba(255, 80, 20, 0.6);
    border-radius: 20px;
    padding: 50px 60px 40px;
    width: min(92vw, 820px);
    max-height: 85vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    text-align: center;
    box-shadow:
        0 0 60px rgba(220, 20, 0, 0.5),
        0 0 120px rgba(120, 0, 0, 0.35),
        0 0 200px rgba(60, 0, 0, 0.2),
        inset 0 0 50px rgba(0, 0, 0, 0.75);
    opacity: 0;
    transform: scale(0.7) translateY(40px) rotateX(8deg);
    transition: opacity 0.55s ease 0.35s, transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s;
}

.credits-gate.open .credits-content {
    opacity: 1;
    transform: scale(1) translateY(0) rotateX(0deg);
}

.credits-flame-top {
    font-size: 5.2rem;
    margin-bottom: 10px;
    display: inline-block;
    animation: floatFlame 2.4s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 14px rgba(255, 100, 0, 0.8));
}

@keyframes floatFlame {
    from { transform: translateY(0px) scale(1) rotate(-3deg); }
    to { transform: translateY(-8px) scale(1.06) rotate(3deg); }
}

.credits-title {
    font-family: "Nosifer", cursive;
    font-size: 3.5rem;
    line-height: 1.02;
    letter-spacing: 10px;
    margin: 0 0 15px;
    padding-bottom: 12px;
    text-transform: uppercase;
    color: #ff2a00;
    text-shadow:
        0 0 6px rgba(255, 70, 22, 0.9),
        0 0 22px rgba(200, 20, 0, 0.55),
        0 0 60px rgba(90, 0, 0, 0.35);
    position: relative;
    isolation: isolate;
    animation: titleGlitch 4s ease-in-out infinite;
}

.credits-title::after {
    content: "";
    display: block;
    width: min(420px, 68%);
    height: 1px;
    margin: 12px auto 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 140, 60, 0.22) 20%,
            rgba(255, 70, 22, 0.7) 50%,
            rgba(255, 140, 60, 0.22) 80%,
            transparent 100%);
    box-shadow: 0 0 18px rgba(255, 70, 22, 0.28);
}

@keyframes titleGlitch {
    0%, 90%, 100% {
        text-shadow: 0 0 10px rgba(200, 10, 0, 0.95), 0 0 32px rgba(130, 0, 0, 0.7), 0 0 70px rgba(80, 0, 0, 0.4);
        letter-spacing: 10px;
    }
    92% { text-shadow: -3px 0 #ff0000, 3px 0 #ffdd00; letter-spacing: 12px; }
    94% { text-shadow: 3px 0 #ff0000, -3px 0 #00ffff; letter-spacing: 9px; }
    96% {
        text-shadow: 0 0 10px rgba(200, 10, 0, 0.95), 0 0 32px rgba(130, 0, 0, 0.7);
        letter-spacing: 10px;
    }
}

.credits-sub {
    font-family: "Jura", sans-serif;
    font-size: 0.95rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #9a6a5a;
    margin-bottom: 6px;
}

.credits-name {
    font-family: "Cinzel Decorative", serif;
    font-size: 2rem;
    color: #ffd9cc;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-shadow: 0 0 18px rgba(255, 100, 40, 0.55);
    animation: nameGlow 3s ease-in-out infinite alternate;
}

@keyframes nameGlow {
    from { text-shadow: 0 0 12px rgba(255, 90, 30, 0.4); }
    to { text-shadow: 0 0 24px rgba(255, 140, 60, 0.75), 0 0 50px rgba(200, 60, 0, 0.3); }
}

.credits-year {
    font-size: 0.9rem;
    color: #6a4040;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
}

.credits-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.credits-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(30, 0, 0, 0.72);
    border: 1px solid rgba(255, 70, 20, 0.3);
    border-radius: 12px;
    text-decoration: none;
    color: #ffd0c0;
    font-family: "Jura", sans-serif;
    font-size: 1.05rem;
    letter-spacing: 1px;
    transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.2s ease;
    animation: linkSlideIn 0.5s ease both;
}

.credits-links a:nth-child(1) { animation-delay: 0.55s; }
.credits-links a:nth-child(2) { animation-delay: 0.65s; }
.credits-links a:nth-child(3) { animation-delay: 0.75s; }
.credits-links a:nth-child(4) { animation-delay: 0.85s; }

@keyframes linkSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.credits-links a:hover {
    background: rgba(110, 12, 0, 0.6);
    border-color: rgba(255, 100, 30, 0.75);
    box-shadow: 0 0 20px rgba(255, 60, 0, 0.4), 0 0 40px rgba(180, 20, 0, 0.2);
    transform: translateY(-3px) scale(1.02);
    color: #fff;
}

.credits-links a svg {
    width: 28px;
    height: 28px;
    fill: #ff9070;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(255, 80, 20, 0.55));
    transition: fill 0.2s ease, filter 0.2s ease;
}

.credits-links a:hover svg {
    fill: #ffcc99;
    filter: drop-shadow(0 0 10px rgba(255, 150, 50, 0.8));
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — Tablet (≤ 900px)
══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    h1 {
        font-size: 3.8rem;
        letter-spacing: 6px;
    }

    .kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .credits-content {
        padding: 36px 32px 28px;
    }

    .credits-title {
        font-size: 2.6rem;
        letter-spacing: 6px;
    }

    .credits-name {
        font-size: 1.6rem;
    }

    .credit-token {
        margin-left: 60px;
        margin-right: 60px;
    }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — Mobile (≤ 640px)
══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    h1 {
        font-size: 2.6rem;
        letter-spacing: 4px;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.05rem;
    }

    #rotating-tagline {
        font-size: 0.85rem;
        letter-spacing: 2px;
    }

    .narak-card.active,
    #step-feedback.active {
        padding: 1.2rem;
        margin: 12px auto;
    }

    .split {
        grid-template-columns: 1fr;
    }

    .kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .score-circle {
        width: 100px;
        height: 100px;
        font-size: 2.4rem;
    }

    .vitals strong {
        font-size: 1.1rem;
    }

    .credit-token {
        margin-left: 0;
        margin-right: 0;
    }

    .hell-footer {
        flex-wrap: wrap;
        gap: 8px;
        white-space: normal;
        text-align: center;
    }

    .footer-credit {
        font-size: 0.72rem;
        letter-spacing: 0.5px;
    }

    #credits-trigger {
        top: 12px;
        right: 14px;
        width: 44px;
        height: 44px;
    }

    .sigil-tooltip {
        display: none;
    }

    .credits-content {
        padding: 24px 18px 20px;
        border-radius: 14px;
    }

    .credits-flame-top {
        font-size: 3.5rem;
    }

    .credits-title {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }

    .credits-name {
        font-size: 1.25rem;
    }

    .credits-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .credits-links a {
        font-size: 0.82rem;
        padding: 10px 10px;
        gap: 8px;
        letter-spacing: 0.5px;
    }

    .credits-links a svg {
        width: 20px;
        height: 20px;
    }

    .btn-hell {
        font-size: 0.82rem;
        padding: 10px 12px;
    }

    .auth-tab {
        font-size: 0.78rem;
        padding: 8px 6px;
    }

    .intro-copy {
        font-size: 0.95rem;
    }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — Small Mobile (≤ 420px)
══════════════════════════════════════════════════════ */
@media (max-width: 420px) {
    h1 {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    .credits-title {
        font-size: 1.4rem;
        letter-spacing: 2px;
    }

    .credits-name {
        font-size: 1.05rem;
    }

    .credits-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .credits-links a {
        font-size: 0.75rem;
        padding: 8px 8px;
        gap: 6px;
    }

    .credits-links a svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .kpis {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .kpi strong {
        font-size: 1rem;
    }

    .score-circle {
        width: 86px;
        height: 86px;
        font-size: 2rem;
    }

    .form-nav {
        flex-direction: column;
    }

    .toolbar {
        gap: 6px;
    }

    .credits-content {
        padding: 18px 14px 16px;
    }

    .credits-flame-top {
        font-size: 2.8rem;
    }

    #credits-trigger {
        width: 38px;
        height: 38px;
        top: 10px;
        right: 10px;
    }

    .hell-footer {
        padding: 8px 10px;
    }
}