@font-face {
    font-family: 'Cinzel';
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url('/fonts/cinzel-400.ttf') format('truetype');
}

@font-face {
    font-family: 'Cinzel';
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    src: url('/fonts/cinzel-600.ttf') format('truetype');
}

@font-face {
    font-family: 'Cinzel';
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url('/fonts/cinzel-700.ttf') format('truetype');
}

@font-face {
    font-family: 'Crimson Pro';
    font-weight: 300;
    font-style: normal;
    font-display: swap;
    src: url('/fonts/crimsonpro-300.ttf') format('truetype');
}

@font-face {
    font-family: 'Crimson Pro';
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url('/fonts/crimsonpro-400.ttf') format('truetype');
}

@font-face {
    font-family: 'Crimson Pro';
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    src: url('/fonts/crimsonpro-600.ttf') format('truetype');
}

@font-face {
    font-family: 'Crimson Pro';
    font-weight: 300;
    font-style: italic;
    font-display: swap;
    src: url('/fonts/crimsonpro-italic-300.ttf') format('truetype');
}

@font-face {
    font-family: 'Crimson Pro';
    font-weight: 400;
    font-style: italic;
    font-display: swap;
    src: url('/fonts/crimsonpro-italic-400.ttf') format('truetype');
}

:root {
    --gold: #d4af37;
    --gold-light: #e8cf80;
    --gold-dark: #b08d2f;
    --parchment: #0a0908;
    --parchment-light: #11110c;
    --panel: #0d0c0a;
    --panel-border: #252320;
    --text: #e8d9b5;
    --text-dim: #9a8d72;
    --input-bg: #070504;
    --error-red: #8b2020;
}

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

html {
    font-size: 20px;
    scroll-snap-type: y proximity;
}

body {
    font-family: 'Crimson Pro', Georgia, serif;
    background: var(--parchment);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: url('/img/noise.png');
    mix-blend-mode: overlay;
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
    background-repeat: repeat;
    background-size: auto;
}

.container {
    max-width: 520px;
    width: 100%;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

a {
    color: var(--gold);
}

h1 {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: linear-gradient(180deg, #c8a020 0%, #f5e078 48%, #c8a020 52%, #f5e078 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.3));
}

h2 {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--gold);
    margin: 1.5rem 0 0.5rem;
}

.section-title {
    text-align: center;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.section-title + .panel {
    margin-bottom: 2.5rem;
}

p {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

ul {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    line-height: 1.6;
}

.header {
    text-align: center;
    padding: 3.5rem 0 1.5rem;
    margin-bottom: 2rem;
}

.header-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.header-line {
    height: 1px;
    width: 60px;
    background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
}

.header-diamond {
    width: 8px;
    height: 8px;
    background: var(--gold);
    transform: rotate(45deg);
    flex-shrink: 0;
}

.header-logo {
    display: inline-block;
    margin-bottom: 0.75rem;
}


.header-link {
    color: inherit;
    text-decoration: none;
}

.header-sub {
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 0.4rem;
}

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding-bottom: 2rem;
    position: relative;
    scroll-snap-align: start;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    background: radial-gradient(ellipse 800px 600px at 50% 40%, rgba(212, 175, 55, 0.04), transparent);
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

.below-fold {
    scroll-snap-align: start;
    min-height: 100vh;
    padding-top: 3rem;
}

.hero .header {
    margin-bottom: 1.5rem;
}

.hero .intro {
    margin-top: 1.5rem;
}

.scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gold-dark);
    opacity: 0.6;
    cursor: pointer;
    animation: scroll-bounce 2s ease-in-out infinite;
    transition: opacity 0.4s;
}

.scroll-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-hint svg {
    width: 2rem;
    height: 2rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes scroll-bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(8px);
    }
}

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    position: relative;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.panel > *:last-child {
    margin-bottom: 0;
}

.panel::before, .panel::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--gold-dark);
    border-style: solid;
    z-index: 2;
}

.panel::before {
    top: -1px;
    left: -1px;
    border-width: 2px 0 0 2px;
}

.panel::after {
    top: -1px;
    right: -1px;
    border-width: 2px 2px 0 0;
}

.panel-bottom-corners {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 0;
    pointer-events: none;
    z-index: 2;
}

.panel-bottom-corners::before, .panel-bottom-corners::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--gold-dark);
    border-style: solid;
}

.panel-bottom-corners::before {
    bottom: 0;
    left: -1px;
    border-width: 0 0 2px 2px;
}

.panel-bottom-corners::after {
    bottom: 0;
    right: -1px;
    border-width: 0 2px 2px 0;
}

.form-grid {
    display: grid;
    grid-template-columns: auto 1fr 1fr auto;
    gap: 0 0.75rem;
    align-items: end;
}

.form-group {
    margin-bottom: 0;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group.btn-group {
    margin-bottom: 0;
}

label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold-dark);
    margin-bottom: 0.35rem;
}

input[type="text"], select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--panel-border);
    background: var(--input-bg);
    color: var(--text);
    font-family: 'Crimson Pro', serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.15);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23b08d2f' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 2rem;
    cursor: pointer;
}

.btn-submit {
    width: 100%;
    padding: 0.55rem 1.2rem;
    white-space: nowrap;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #c8a020 0%, #f5e078 48%, #c8a020 52%, #f5e078 100%);
    background-size: 200% 200%;
    color: #0e0c08;
    border: none;
    cursor: pointer;
    background-position: 100% 100%;
    transition: background-position 0.4s ease, filter 0.4s ease;
    position: relative;
}

.btn-submit:hover {
    background-position: 0% 0%;
    filter: brightness(1.15);
}

.btn-link {
    display: inline-block;
    text-decoration: none;
    padding: 0.6rem 1.5rem;
    width: auto;
    flex: 1;
    text-align: center;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
}

.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-submit.loading::after {
    content: '';
    display: inline-block;
    width: 0.7em;
    height: 0.7em;
    margin-left: 0.5em;
    border: 2px solid rgba(14, 12, 8, 0.3);
    border-top-color: #0e0c08;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

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

.actions-group {
    margin: 1rem 0;
    position: relative;
    z-index: 1;
}

.actions-row {
    margin-bottom: 0.5rem;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    position: relative;
    z-index: 1;
}

.share-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid var(--panel-border);
    color: var(--text-dim);
    text-decoration: none;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.share-link:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.share-link svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.realm-select {
    position: relative;
}

.realm-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: var(--input-bg);
    border: 1px solid var(--panel-border);
    border-top: none;
    z-index: 10;
}

.realm-dropdown::-webkit-scrollbar {
    width: 6px;
}

.realm-dropdown::-webkit-scrollbar-track {
    background: var(--input-bg);
}

.realm-dropdown::-webkit-scrollbar-thumb {
    background: var(--panel-border);
}

.realm-dropdown.open {
    display: block;
}

.realm-option {
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(61, 52, 37, 0.3);
    transition: background 0.15s;
}

.realm-option:hover, .realm-option.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold-light);
}

.error-msg {
    background: rgba(139, 32, 32, 0.15);
    border: 1px solid rgba(139, 32, 32, 0.4);
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: #d4756a;
}

.result-card {
    text-align: left;
    padding: 2rem 1.5rem;
    position: relative;
    background: var(--parchment-light);
}

.result-card-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.result-card-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--parchment-light) 0%, var(--parchment-light) 50%, transparent 100%);
}

.result-card .char-render {
    position: absolute;
    right: var(--render-offset, -5%);
    top: 0;
    height: 200%;
    width: auto;
    pointer-events: none;
    filter: brightness(1.3);
}

.result-card-content {
    position: relative;
    z-index: 1;
    max-width: 75%;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.9);
}

.result-meta {
    padding: 1rem 1.5rem 1.2rem;
    text-align: center;
}

.result-meta-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
    line-height: 1.5;
}

.class-warrior {
    color: #C69B6D;
}

.class-paladin {
    color: #F48CBA;
}

.class-hunter {
    color: #AAD372;
}

.class-rogue {
    color: #FFF468;
}

.class-priest {
    color: #FFFFFF;
}

.class-deathknight {
    color: #C41E3A;
}

.class-shaman {
    color: #0070DD;
}

.class-mage {
    color: #3FC7EB;
}

.class-warlock {
    color: #8788EE;
}

.class-monk {
    color: #00FF98;
}

.class-druid {
    color: #FF7C0A;
}

.class-demonhunter {
    color: #A330C9;
}

.class-evoker {
    color: #33937F;
}

.result-label {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 1rem;
}

.result-label-date {
    margin-top: 2rem;
    margin-bottom: .3rem;
}

.result-name {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.result-subtitle {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

.result-date {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.result-age {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-style: italic;
}

.result-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
    margin: 1rem auto;
}

.result-source {
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

.date-toggle {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
    margin-bottom: 1rem;
}

.date-toggle a {
    font-family: 'Cinzel', serif;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-dim);
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--panel-border);
    transition: all 0.2s;
}

.date-toggle a:hover {
    border-color: var(--gold-dark);
    color: var(--gold);
}

.date-toggle a.active {
    border-color: var(--gold-dark);
    color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

.result-note {
    padding: 0.75rem 1rem;
    background: rgba(212, 175, 55, 0.05);
    border-left: 2px solid var(--gold-dark);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-dim);
    text-align: left;
}

.timeline-header {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold-dark);
    text-align: center;
    margin-bottom: 1.2rem;
}

.timeline {
    position: relative;
    padding-left: 2.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: linear-gradient(180deg, var(--gold-dark), var(--panel-border), var(--panel-border));
}

.tl-entry {
    position: relative;
    padding-bottom: 0.75rem;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    animation: tl-fade 0.4s ease both;
}

.tl-entry:last-child {
    padding-bottom: 0;
}

@keyframes tl-fade {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tl-dot {
    position: absolute;
    left: -2.5rem;
    top: 5px;
    width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tl-dot::before {
    content: '';
    width: 7px;
    height: 7px;
    background: var(--dot-color, var(--gold-dark));
    transform: rotate(45deg);
    box-shadow: 0 0 6px var(--dot-color, var(--gold-dark));
}

.tl-level {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold);
    width: 6rem;
    flex-shrink: 0;
    text-align: right;
}

.tl-level-small {
    font-size: 0.65rem;
}

.tl-legacy {
    font-size: 0.6rem;
    opacity: 0.6;
}

.tl-info {
    flex: 1;
    min-width: 0;
}

.tl-date {
    font-size: 0.85rem;
    color: var(--text);
}

.tl-date .tl-ago {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-left: 0.3rem;
}

.tl-exp {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-top: 0.1rem;
}

.intro {
    text-align: center;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.intro p {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.8rem;
}

.intro p:last-child {
    margin-bottom: 0;
}

.intro strong {
    color: var(--gold);
    font-weight: inherit;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.feature {
    text-align: center;
    padding: 0.75rem 0.5rem;
}

.feature-icon {
    margin-bottom: 0.5rem;
}

.feature-icon svg {
    width: 2rem;
    height: 2rem;
    fill: none;
    stroke: var(--gold);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feature-title {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.feature-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.4;
}

.faq {
    margin-top: 0;
}

.faq-item {
    border-bottom: 1px solid var(--panel-border);
    padding: 1rem 0;
}

.faq-item:first-child {
    border-top: none;
    padding-top: 0;
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-q {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.faq-a {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.footer {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-dim);
    opacity: 0.5;
}

.footer-line {
    width: 40px;
    height: 1px;
    background: var(--panel-border);
    margin: 0 auto 0.6rem;
}

.footer-links {
    margin-top: 0.5rem;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--gold);
}

.back {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
}

.back:hover {
    color: var(--gold);
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem 0;
    }

    .form-group.btn-group {
        grid-column: 1;
    }

    .form-group.btn-group label {
        display: none;
    }

    .panel {
        padding: 1rem;
    }

    .share-links {
        flex-wrap: wrap;
    }

    .tl-level {
        width: auto;
        max-width: 3.5rem;
        flex-shrink: 1;
        word-break: break-word;
    }

    .result-name {
        font-size: 1.2rem;
    }

    .result-date {
        font-size: 1.2rem;
    }

    h1 {
        font-size: 1.3rem;
        letter-spacing: 0.1em;
    }

    .container {
        max-width: 100%;
        padding: 0 1.5rem;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

@media (min-width: 769px) {
    .container {
        max-width: 720px;
    }
}
