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

:root {
    --gold: #c9a84c;
    --gold-dim: #7a6128;
    --cream: #ffefcd;
    --cream-dim: rgba(255, 239, 205, 0.7);
    --bg-deep: #0e1520;
    --bg-surface: rgba(255, 255, 255, 0.04);
    --border: rgba(201, 168, 76, 0.25);
}

body {
    background: linear-gradient(160deg, #0e1520 0%, #1A2238 40%, #1e2a45 100%);
    color: var(--cream);
    font-family: 'Crimson Text', Georgia, serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.25rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(14, 21, 32, 0.95), transparent);
}

.nav-logo {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    color: var(--gold);
    text-decoration: none;
    text-transform: uppercase;
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    color: var(--cream-dim);
    text-decoration: none;
    letter-spacing: 0.08em;
    transition: color 0.3s;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform 0.3s;
}

nav a:hover, nav a.active {
    color: var(--cream);
}

nav a:hover::after, nav a.active::after {
    transform: scaleX(1);
}

.tutorial-container {
    flex: 1;
    padding: 8rem 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.tutorial-hero {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    padding-top: 2rem;
}

.ornament {
    position: absolute;
    width: 80px;
    height: 80px;
    opacity: 0.35;
}

.ornament svg {
    width: 100%;
    height: 100%;
}

.ornament-tl {
    top: 0;
    left: 0;
}

.ornament-tr {
    top: 0;
    right: 0;
    transform: scaleX(-1);
}

.hero-eyebrow {
    font-family: 'Crimson Text', serif;
    font-size: 0.9rem;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1rem;
}

.page-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    color: var(--cream);
    text-shadow: 0 0 30px rgba(201, 168, 76, 0.15);
}

.hero-rule {
    width: 120px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    margin: 1.5rem auto;
}

.hero-sub {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-size: 1.25rem;
    color: var(--cream-dim);
}

.tutorial-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.how-to-play {
    margin-bottom: 6rem;
    padding: 3rem;
    background: rgba(201, 168, 76, 0.03);
    border: 1px solid var(--border);
    position: relative;
}

.steps-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.step-number {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--gold);
    width: 50px;
    height: 50px;
    border: 1px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    background: var(--bg-deep);
    position: relative;
    z-index: 2;
}

.step-connector {
    flex: 1;
    height: 1px;
    background: var(--border);
    margin-top: 25px;
    display: block;
}

.step-content h4 {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    color: var(--cream);
    margin-bottom: 0.75rem;
}

.step-content p {
    font-size: 1rem;
    color: var(--cream-dim);
    line-height: 1.5;
}

/* Scroll Reveal and Initial Animations */
.tutorial-card, 
.how-to-play, 
.step,
.hero-eyebrow, 
.page-title, 
.hero-rule, 
.hero-sub {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease, border-color 0.3s ease, background 0.3s ease;
}

.tutorial-card, 
.how-to-play, 
.step {
    transform: translateY(30px);
}

.hero-eyebrow, 
.page-title, 
.hero-rule, 
.hero-sub {
    transform: translateY(20px);
}

.tutorial-card.visible, 
.how-to-play.visible, 
.step.visible,
.hero-eyebrow.visible, 
.page-title.visible, 
.hero-rule.visible, 
.hero-sub.visible {
    opacity: 1;
    transform: translateY(0);
}

.tutorial-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 2.5rem;
    text-align: center;
    /* transition moved to animation block above */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tutorial-card:hover {
    border-color: rgba(201, 168, 76, 0.45);
    background: rgba(201, 168, 76, 0.05);
    transform: translateY(-5px);
}

.card-icon {
    width: 60px;
    height: 60px;
    color: var(--gold);
    margin-bottom: 1.5rem;
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.tutorial-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.tutorial-card p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--cream-dim);
}

.tutorial-card strong {
    color: var(--cream);
}

.tutorial-cta {
    text-align: center;
    margin-top: 4rem;
}

.tutorial-cta h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: var(--cream);
    margin: 2rem 0 1rem;
}

.tutorial-cta p {
    font-size: 1.2rem;
    color: var(--cream-dim);
    margin-bottom: 2.5rem;
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

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

.section-divider::after {
    background: linear-gradient(to left, transparent, var(--border));
}

.divider-diamond {
    width: 8px;
    height: 8px;
    border: 1px solid var(--gold-dim);
    transform: rotate(45deg);
    flex-shrink: 0;
}

.btn-start {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    text-decoration: none;
    border: 1px solid var(--gold-dim);
    padding: 1rem 3rem;
    display: inline-block;
    transition: color 0.4s;
    position: relative;
    overflow: hidden;
    background: transparent;
    cursor: pointer;
}

.btn-start::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gold);
    transform: translateX(-101%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-start:hover {
    color: var(--bg-deep);
}

.btn-start:hover::before {
    transform: translateX(0);
}

.btn-start span {
    position: relative;
    z-index: 1;
}

footer {
    border-top: 1px solid var(--border);
    padding: 1.75rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

footer a {
    font-size: 0.85rem;
    color: var(--cream-dim);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

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

.footer-copy {
    font-size: 0.8rem;
    color: rgba(255, 239, 205, 0.7);
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    header {
        padding: 1rem 1.25rem;
    }

    nav {
        gap: 1.25rem;
    }

    .tutorial-container {
        padding-top: 6rem;
    }

    .how-to-play {
        padding: 2rem 1.5rem;
    }

    .steps-container {
        flex-direction: column;
        align-items: center;
        gap: 3rem;
    }

    .step-connector {
        display: none;
    }

    .tutorial-section {
        grid-template-columns: 1fr;
    }

    footer {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    header {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        background: rgba(14, 21, 32, 0.95);
    }

    nav a {
        font-size: 0.8rem;
    }

    nav {
        gap: 0.75rem;
    }
}