/* ========================================
   DIVINA COMMEDIA GAMES
   Medieval Parchment Theme
   ======================================== */

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

:root {
    --parchment: #f4e4c1;
    --parchment-dark: #e8d5a3;
    --ink: #2c1810;
    --ink-light: #5c3a2e;
    --accent-red: #8b1a1a;
    --accent-red-glow: #c0392b;
    --accent-gold: #b8860b;
    --accent-gold-glow: #daa520;
    --border-ornate: #8b6914;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Crimson Text', Georgia, 'Times New Roman', serif;
    background: var(--parchment);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* Parchment texture overlay */
.parchment-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(139, 105, 20, 0.02) 3px,
            rgba(139, 105, 20, 0.02) 4px
        ),
        radial-gradient(ellipse at 20% 50%, rgba(139, 90, 43, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 50%, rgba(139, 90, 43, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse at 50% 0%, rgba(100, 60, 20, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(100, 60, 20, 0.1) 0%, transparent 50%);
}

/* ---- SCREENS ---- */

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
    max-width: 720px;
    width: 100%;
    position: relative;
    z-index: 1;
    min-height: 80vh;
}

.screen.active {
    display: flex;
}

/* ---- ORNAMENTS ---- */

.ornament {
    font-size: 1.5rem;
    color: var(--border-ornate);
    letter-spacing: 1rem;
    user-select: none;
}

.ornament.top { margin-bottom: 1.5rem; }
.ornament.bottom { margin-top: 1.5rem; }

/* ---- HOME PAGE ---- */

.home-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    max-width: 800px;
    width: 100%;
    position: relative;
    z-index: 1;
    min-height: 80vh;
    justify-content: center;
}

.home-title {
    font-family: 'Cormorant SC', Georgia, serif;
    font-weight: 700;
    font-size: 3.4rem;
    color: var(--ink);
    text-shadow: 1px 1px 0 var(--parchment-dark);
    margin-bottom: 0.2rem;
    line-height: 1.2;
    letter-spacing: 0.04em;
}

.home-subtitle {
    font-family: 'Cormorant SC', Georgia, serif;
    font-size: 1.1rem;
    color: var(--ink-light);
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
}

.game-cards {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
}

.game-card {
    flex: 1;
    border: 2px solid var(--border-ornate);
    text-decoration: none;
    color: var(--ink);
    transition: all 0.3s ease;
    overflow: hidden;
    background: var(--parchment);
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(44, 24, 16, 0.15);
    border-color: var(--accent-gold);
}

.game-card-img {
    height: 180px;
    background-size: cover;
    background-position: center top;
    background-color: var(--ink);
    position: relative;
}

.game-card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(44, 24, 16, 0.4));
}

.game-card-body {
    padding: 1.2rem 1rem;
}

.game-card-body h2 {
    font-family: 'Cormorant SC', Georgia, serif;
    font-weight: 600;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.game-card-body p {
    font-size: 0.85rem;
    color: var(--ink-light);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.game-card-cta {
    font-family: 'Cormorant SC', Georgia, serif;
    font-size: 0.8rem;
    color: var(--accent-gold);
    letter-spacing: 0.05em;
}

/* ---- SHARED TITLE ELEMENTS ---- */

.game-title {
    font-family: 'Cormorant SC', Georgia, serif;
    font-weight: 700;
    font-size: 3rem;
    color: var(--ink);
    text-shadow: 1px 1px 0 var(--parchment-dark);
    margin-bottom: 0.2rem;
    line-height: 1.2;
    letter-spacing: 0.04em;
}

.subtitle {
    font-family: 'Cormorant SC', Georgia, serif;
    font-size: 1.1rem;
    color: var(--ink-light);
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
}

.dante-quote {
    border: 2px solid var(--border-ornate);
    border-image: linear-gradient(to right, transparent, var(--border-ornate), transparent) 1;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    max-width: 480px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--ink-light);
}

.dante-quote .attribution {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--border-ornate);
}

.instructions {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--ink-light);
    line-height: 1.6;
    font-style: italic;
}

/* ---- BUTTONS ---- */

.btn-medieval {
    font-family: 'Cormorant SC', Georgia, serif;
    font-size: 1.1rem;
    padding: 0.75rem 2.5rem;
    background: var(--ink);
    color: var(--parchment);
    border: 2px solid var(--border-ornate);
    cursor: pointer;
    letter-spacing: 0.1em;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-medieval:hover {
    background: var(--ink-light);
    border-color: var(--accent-gold);
    transform: scale(1.03);
}

.btn-medieval:active {
    transform: scale(0.98);
}

.btn-home {
    font-size: 0.9rem;
    padding: 0.5rem 1.5rem;
    margin-right: 0.75rem;
    background: transparent;
    color: var(--ink);
    border-color: var(--ink-light);
}

.btn-home:hover {
    background: var(--ink);
    color: var(--parchment);
}

/* ---- PROGRESS ---- */

.game-header {
    width: 100%;
    margin-bottom: 1rem;
}

.progress-text {
    font-family: 'Cormorant SC', Georgia, serif;
    font-size: 0.85rem;
    color: var(--ink-light);
    display: block;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--parchment-dark);
    border: 1px solid var(--border-ornate);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--accent-red), var(--accent-gold));
    transition: width 0.4s ease;
}

/* ---- QUESTION IMAGE ---- */

.question-image {
    width: 100%;
    max-width: 500px;
    height: 220px;
    background-size: cover;
    background-position: center;
    background-color: var(--ink);
    border: 2px solid var(--border-ornate);
    margin-bottom: 1.2rem;
    position: relative;
}

.question-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(44, 24, 16, 0.3));
    pointer-events: none;
}

/* ---- WYR GAME ---- */

.wyr-prompt {
    font-family: 'Cormorant SC', Georgia, serif;
    font-weight: 600;
    font-size: 1.7rem;
    color: var(--ink);
    margin: 0.5rem 0 1.2rem;
    letter-spacing: 0.03em;
}

.choices-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: center;
}

.choice {
    width: 100%;
    padding: 1.3rem 1.5rem;
    border: 2px solid var(--ink-light);
    cursor: pointer;
    text-align: center;
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1rem;
    line-height: 1.6;
    transition: all 0.3s ease;
    background: transparent;
    color: var(--ink);
}

.choice:hover {
    background: rgba(139, 105, 20, 0.06);
    border-color: var(--border-ornate);
    transform: scale(1.015);
    box-shadow: 0 0 16px rgba(139, 105, 20, 0.1);
}

.choice-text {
    font-size: 1.02rem;
    line-height: 1.6;
}

.choice.selected {
    transform: scale(1.02);
    border-color: var(--accent-gold);
    background: rgba(184, 134, 11, 0.1);
    box-shadow: 0 0 20px rgba(218, 165, 32, 0.15);
}

.choice.dimmed {
    opacity: 0.4;
    cursor: default;
    transform: none !important;
    box-shadow: none !important;
}

/* ---- VS DIVIDER ---- */

.vs-divider {
    display: flex;
    align-items: center;
    width: 80%;
    margin: 0;
    padding: 0.5rem 0;
}

.vs-divider::before,
.vs-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-ornate), transparent);
}

.vs-divider span {
    font-family: 'Cormorant SC', Georgia, serif;
    font-size: 1.1rem;
    padding: 0 1rem;
    color: var(--ink-light);
}

/* ---- WYR AFTERMATH ---- */

.aftermath {
    margin-top: 1.5rem;
    width: 100%;
    text-align: center;
    animation: fadeUp 0.4s ease;
}

.aftermath.hidden {
    display: none;
}

.reveal-box {
    border: 2px solid var(--border-ornate);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    font-family: 'Cormorant SC', Georgia, serif;
    font-size: 0.9rem;
    line-height: 1.6;
}

.reveal-box .realm-label {
    font-family: 'Cormorant SC', Georgia, serif;
    font-size: 1.3rem;
    display: block;
    margin-bottom: 0.3rem;
}

.reveal-box .realm-label.inferno {
    color: var(--accent-red);
}

.reveal-box .realm-label.paradiso {
    color: var(--accent-gold);
}

.reveal-box .canto-ref {
    font-size: 0.8rem;
    color: var(--ink-light);
    font-style: italic;
}

#aftermath-text {
    font-style: italic;
    font-size: 0.92rem;
    color: var(--ink-light);
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

.btn-next {
    font-size: 0.95rem;
    padding: 0.6rem 2rem;
}

/* ---- QUIZ ---- */

.quiz-question {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1.25rem;
    color: var(--ink);
    margin: 0.5rem 0 1.2rem;
    line-height: 1.5;
    font-weight: normal;
}

.answers-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.answer-btn {
    width: 100%;
    padding: 1rem 1.3rem;
    border: 2px solid var(--ink-light);
    cursor: pointer;
    text-align: left;
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: all 0.25s ease;
    background: transparent;
    color: var(--ink);
}

.answer-btn:hover {
    background: rgba(139, 105, 20, 0.06);
    border-color: var(--border-ornate);
    transform: translateX(4px);
}

.answer-btn.selected {
    border-color: var(--accent-red);
    background: rgba(139, 26, 26, 0.08);
}

/* ---- RESULTS ---- */

.results-title {
    font-family: 'Cormorant SC', Georgia, serif;
    font-weight: 700;
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.04em;
}

.result-image {
    width: 100%;
    max-width: 400px;
    height: 280px;
    background-size: cover;
    background-position: center;
    background-color: var(--ink);
    border: 2px solid var(--border-ornate);
    margin-bottom: 1.5rem;
}

.verdict-box {
    border: 2px solid var(--border-ornate);
    padding: 2rem;
    margin-bottom: 2rem;
    max-width: 540px;
    line-height: 1.8;
}

.verdict-box h3 {
    font-family: 'Cormorant SC', Georgia, serif;
    font-weight: 700;
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    letter-spacing: 0.03em;
}

.verdict-box .circle-number {
    font-family: 'Cormorant SC', Georgia, serif;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    color: var(--accent-red);
    display: block;
    margin-bottom: 0.5rem;
}

.verdict-box p {
    font-size: 0.95rem;
    color: var(--ink-light);
}

.verdict-box .dante-says {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--parchment-dark);
    font-style: italic;
    font-size: 0.85rem;
}

.results-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    font-family: 'Cormorant SC', Georgia, serif;
    font-size: 0.9rem;
}

.results-breakdown {
    max-width: 540px;
    width: 100%;
    margin-bottom: 2rem;
}

.results-breakdown h4 {
    font-family: 'Cormorant SC', Georgia, serif;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--ink-light);
    margin-bottom: 0.75rem;
}

.breakdown-bar {
    display: flex;
    align-items: center;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
}

.breakdown-label {
    width: 80px;
    text-align: right;
    padding-right: 0.6rem;
    color: var(--ink-light);
    font-family: 'Cormorant SC', Georgia, serif;
}

.breakdown-track {
    flex: 1;
    height: 14px;
    background: var(--parchment-dark);
    border: 1px solid var(--border-ornate);
    overflow: hidden;
}

.breakdown-fill {
    height: 100%;
    background: var(--accent-red);
    opacity: 0.6;
    transition: width 0.6s ease;
}

.breakdown-fill.winner {
    opacity: 1;
}

.stat-item {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 2rem;
    font-family: 'Cormorant SC', Georgia, serif;
}

.stat-label {
    color: var(--ink-light);
    font-size: 0.75rem;
}

.stat-inferno .stat-num { color: var(--accent-red); }
.stat-paradiso .stat-num { color: var(--accent-gold); }

/* ---- FOOTER ---- */

footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.7rem;
    color: var(--ink-light);
    opacity: 0.6;
}

footer p { margin-bottom: 0.2rem; }

/* ---- ANIMATIONS ---- */

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

/* ---- RESPONSIVE ---- */

@media (max-width: 600px) {
    html { font-size: 16px; }
    .home-title, .game-title { font-size: 2.4rem; }
    .wyr-prompt { font-size: 1.4rem; }
    .choice { padding: 1.1rem 1rem; }
    .dante-quote { padding: 1rem 1.2rem; }
    .results-stats { flex-direction: column; gap: 1rem; }
    .game-cards { flex-direction: column; }
    .question-image { height: 160px; }
    .result-image { height: 200px; }
}
