* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: #020617;
    color: #ffffff;
}

body {
    overflow-x: hidden;
}

a {
    color: inherit;
}

.hero {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 10%, rgba(99,102,241,.32), transparent 34%),
        radial-gradient(circle at 80% 15%, rgba(245,158,11,.18), transparent 30%),
        linear-gradient(135deg, #020617, #0f172a 55%, #111827);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 32px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, black, transparent);
}

.overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 20%, rgba(2,6,23,.78) 100%);
}

.content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 42px;
    border-radius: 34px;
    background: rgba(15, 23, 42, .58);
    border: 1px solid rgba(255,255,255,.14);
    backdrop-filter: blur(20px);
    box-shadow: 0 35px 100px rgba(0,0,0,.62);
}

.content h1 {
    font-size: clamp(50px, 9vw, 104px);
    letter-spacing: 11px;
    margin: 0 0 18px;
    font-weight: 900;
    text-shadow: 0 0 36px rgba(129,140,248,.75);
}

.content p {
    font-size: clamp(16px, 2.4vw, 21px);
    line-height: 1.7;
    color: #dbeafe;
    margin: 0 auto 18px;
    max-width: 720px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 14px 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: .3px;
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 14px 36px rgba(99,102,241,.36);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
    margin: 6px;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 18px 46px rgba(99,102,241,.52);
}

.game-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at 25% 0%, rgba(79,70,229,.32), transparent 30%),
        radial-gradient(circle at 90% 20%, rgba(245,158,11,.14), transparent 28%),
        linear-gradient(135deg, #020617 0%, #07111f 44%, #0f172a 100%);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.game-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
    background-size: 46px 46px;
    opacity: .8;
}

.game-topbar {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(300px, auto);
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 24px;
    background: rgba(15,23,42,.70);
    backdrop-filter: blur(18px);
    box-shadow: 0 20px 70px rgba(0,0,0,.38);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 25px;
    background: linear-gradient(135deg, #f8fafc, #818cf8);
    color: #020617;
    box-shadow: 0 0 35px rgba(129,140,248,.45);
}

.brand-title {
    font-size: 25px;
    font-weight: 900;
    letter-spacing: 5px;
}

.brand-subtitle {
    margin-top: 3px;
    color: #a5b4fc;
    font-size: 13px;
}

.chapter-block {
    text-align: right;
}

.chapter-kicker {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #020617;
    background: #f8fafc;
}

.chapter-title {
    margin-top: 6px;
    font-size: 16px;
    font-weight: 800;
}

.scene-counter {
    margin-top: 3px;
    color: #cbd5e1;
    font-size: 13px;
}

.progress-bar {
    position: relative;
    z-index: 2;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.10);
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6366f1, #a78bfa, #f59e0b);
    box-shadow: 0 0 30px rgba(129,140,248,.55);
    transition: width .35s ease;
}

.game-layout {
    position: relative;
    z-index: 2;
    flex: 1;
    display: grid;
    grid-template-columns: 285px minmax(0, 1fr);
    gap: 16px;
    min-height: 0;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.player-card,
.attribute-panel,
.game-menu {
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 24px;
    background: rgba(15,23,42,.72);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 60px rgba(0,0,0,.36);
}

.player-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 900;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 0 28px rgba(99,102,241,.42);
}

.player-card strong {
    display: block;
    font-size: 16px;
}

.player-card small {
    display: block;
    color: #94a3b8;
    margin-top: 3px;
}

.attribute-panel {
    padding: 16px;
}

.attribute-panel h3 {
    margin: 0 0 14px;
    font-size: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #c7d2fe;
}

.attr-row {
    margin-bottom: 13px;
}

.attr-head {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #e5e7eb;
    margin-bottom: 7px;
}

.attr-track {
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,.10);
}

.attr-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    transition: width .35s ease;
}

.attr-terra { background: linear-gradient(90deg, #22c55e, #86efac); }
.attr-agua { background: linear-gradient(90deg, #38bdf8, #bae6fd); }
.attr-ar { background: linear-gradient(90deg, #a78bfa, #ddd6fe); }
.attr-fogo { background: linear-gradient(90deg, #f97316, #fed7aa); }
.attr-eclipse { background: linear-gradient(90deg, #64748b, #f8fafc); }

.game-menu {
    padding: 12px;
    display: grid;
    gap: 10px;
}

.game-menu a {
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 16px;
    color: #ffffff;
    background: rgba(99,102,241,.18);
    border: 1px solid rgba(129,140,248,.24);
    font-weight: 800;
    transition: transform .2s ease, background .2s ease;
}

.game-menu a:hover {
    transform: translateY(-1px);
    background: rgba(99,102,241,.35);
}

.scene-stage {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(320px, .85fr) minmax(360px, 1.15fr);
    gap: 16px;
}

.scene-art,
.story-card {
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 30px;
    background: rgba(15,23,42,.72);
    backdrop-filter: blur(20px);
    box-shadow: 0 24px 80px rgba(0,0,0,.42);
    overflow: hidden;
    min-height: 520px;
}

.scene-art {
    position: relative;
}

.scene-art img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.scene-art.has-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 45%, rgba(2,6,23,.65));
}

.aeternum-visual {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 35%, rgba(129,140,248,.32), transparent 28%),
        radial-gradient(circle at 50% 50%, rgba(245,158,11,.12), transparent 35%),
        linear-gradient(135deg, #020617, #111827);
}

.aeternum-visual::before {
    content: "";
    position: absolute;
    width: 140%;
    height: 140%;
    background:
        conic-gradient(from 180deg, transparent, rgba(129,140,248,.18), transparent, rgba(245,158,11,.12), transparent);
    animation: slowRotate 18s linear infinite;
}

.orb {
    width: min(48vw, 310px);
    height: min(48vw, 310px);
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #ffffff, #a5b4fc 12%, #4f46e5 34%, transparent 67%);
    opacity: .95;
    filter: blur(.2px);
    box-shadow: 0 0 80px rgba(129,140,248,.45), inset 0 0 70px rgba(255,255,255,.18);
    animation: floatOrb 4s ease-in-out infinite alternate;
    z-index: 2;
}

.rings {
    position: absolute;
    width: min(72vw, 440px);
    height: min(72vw, 440px);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 70px rgba(129,140,248,.25);
}

.rings::before,
.rings::after {
    content: "";
    position: absolute;
    inset: 34px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
}

.rings::after {
    inset: 76px;
}

.visual-code,
.visual-title {
    position: absolute;
    z-index: 3;
    left: 24px;
    right: 24px;
    text-align: center;
}

.visual-code {
    bottom: 70px;
    color: #a5b4fc;
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: 800;
}

.visual-title {
    bottom: 34px;
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 900;
    text-shadow: 0 0 30px rgba(129,140,248,.65);
}

.story-card {
    padding: clamp(24px, 3vw, 36px);
    display: flex;
    flex-direction: column;
}

.story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.story-meta span {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #c7d2fe;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.story-card h1 {
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1;
    margin: 0 0 24px;
    text-shadow: 0 0 34px rgba(129,140,248,.5);
}

.story-text {
    font-size: clamp(17px, 2vw, 20px);
    line-height: 1.65;
    color: #e5e7eb;
    overflow-y: auto;
    padding-right: 8px;
    max-height: 430px;
    letter-spacing: .2px;
}

.story-text::-webkit-scrollbar {
    width: 8px;
}

.story-text::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,.48);
    border-radius: 999px;
}

.choice-dock {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.choice-card {
    min-height: 82px;
    padding: 16px 18px;
    border-radius: 22px;
    text-decoration: none;
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(99,102,241,.95), rgba(79,70,229,.78));
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 18px 55px rgba(79,70,229,.28);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
    position: relative;
    overflow: hidden;
}

.choice-card::after {
    content: ">";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    opacity: .75;
}

.choice-card span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ddd6fe;
    font-weight: 900;
}

.choice-card strong {
    padding-right: 28px;
    font-size: 16px;
}

.choice-card:hover {
    transform: translateY(-3px);
    filter: brightness(1.08);
    box-shadow: 0 24px 70px rgba(79,70,229,.42);
}

.effect-fade .story-card,
.effect-fade .scene-art {
    animation: fadeInUp .55s ease both;
}

.effect-flash .scene-art {
    animation: flashPulse 1.3s ease-in-out infinite alternate;
}

.effect-shake .story-card {
    animation: softShake .35s ease both;
}

.effect-pulse .orb {
    animation: floatOrb 4s ease-in-out infinite alternate, orbPulse 1.4s ease-in-out infinite alternate;
}

.effect-fog .scene-art {
    filter: saturate(.9);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes flashPulse {
    from { filter: brightness(.95); }
    to { filter: brightness(1.35); }
}

@keyframes softShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

@keyframes slowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes floatOrb {
    from { transform: translateY(-8px) scale(.98); }
    to { transform: translateY(8px) scale(1.02); }
}

@keyframes orbPulse {
    from { box-shadow: 0 0 70px rgba(129,140,248,.35), inset 0 0 70px rgba(255,255,255,.15); }
    to { box-shadow: 0 0 120px rgba(129,140,248,.65), inset 0 0 90px rgba(255,255,255,.22); }
}

@media (max-width: 1120px) {
    .scene-stage {
        grid-template-columns: 1fr;
    }

    .scene-art,
    .story-card {
        min-height: 360px;
    }

    .story-text {
        max-height: none;
    }
}

@media (max-width: 860px) {
    .game-shell {
        padding: 10px;
    }

    .game-topbar {
        grid-template-columns: 1fr;
    }

    .chapter-block {
        text-align: left;
    }

    .game-layout {
        grid-template-columns: 1fr;
    }

    .side-panel {
        order: 2;
    }

    .scene-stage {
        order: 1;
    }

    .attribute-panel {
        display: none;
    }

    .game-menu {
        grid-template-columns: repeat(2, 1fr);
    }

    .scene-art {
        min-height: 280px;
    }

    .story-card {
        min-height: auto;
    }

    .choice-dock {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .brand-title {
        font-size: 20px;
        letter-spacing: 3px;
    }

    .brand-subtitle {
        display: none;
    }

    .brand-mark {
        width: 42px;
        height: 42px;
    }

    .game-topbar {
        padding: 13px;
        border-radius: 18px;
    }

    .scene-art,
    .story-card,
    .player-card,
    .game-menu {
        border-radius: 18px;
    }

    .story-card {
        padding: 20px;
    }

    .story-card h1 {
        font-size: 34px;
    }

    .story-text {
        font-size: 16px;
        line-height: 1.8;
    }

    .game-menu {
        grid-template-columns: 1fr;
    }

    .choice-card {
        min-height: 74px;
    }
}
