
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800;900&family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg: #08070d;
    --panel: #14111e;
    --panel2: #1c1729;
    --red: #ed294b;
    --red-light: #ff536a;
    --purple: #9a55ff;
    --gold: #f4c76b;
    --text: #f6f0ff;
    --muted: #aaa1ba;
    --border: #352640;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: 'Inter', Arial, sans-serif;
    background:
        radial-gradient(ellipse at 50% -15%, #462047 0%, transparent 48%),
        radial-gradient(ellipse at 100% 70%, #25112c 0%, transparent 35%),
        var(--bg);
}

button {
    font-family: inherit;
    font-size: 13px;
    letter-spacing: .5px;
    color: var(--text);
    background: linear-gradient(145deg, #282033, #17131f);
    border: 1px solid #49344f;
    border-radius: 8px;
    padding: 13px 18px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .2s, border-color .2s,
                background .2s, box-shadow .2s;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--red-light);
    box-shadow: 0 5px 24px #ed294b20;
}

button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.primary {
    color: white !important;
    border: 1px solid #ff6077 !important;
    background: linear-gradient(115deg, #a91132, #ed294b 60%, #ff5269) !important;
    box-shadow: 0 0 25px #ed294b28;
}

.primary:hover:not(:disabled) {
    box-shadow: 0 0 35px #ed294b55;
}

header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 23px clamp(16px, 5vw, 65px);
    border-bottom: 1px solid #ffffff0c;
    background: #08070dcc;
    backdrop-filter: blur(16px);
}

.logo {
    font-family: 'Cinzel', serif;
    font-size: clamp(25px, 4vw, 39px);
    font-weight: 900;
    letter-spacing: 3px;
    text-shadow: 0 0 25px #ed294b35;
}

.logo span {
    color: var(--red-light);
}

header small {
    display: block;
    margin-top: 5px;
    letter-spacing: 2px;
    font-size: 9px;
}

.gold {
    color: var(--gold) !important;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 15px;
    border: 1px solid #59442c;
    border-radius: 7px;
    background: linear-gradient(135deg, #241c20, #15111a);
    font-size: 12px;
    letter-spacing: .5px;
}

main {
    width: min(1180px, 100%);
    margin: auto;
    padding: 25px;
}

.screen {
    display: none;
    animation: screenEnter .35s ease both;
}

.screen.active {
    display: block;
}

@keyframes screenEnter {
    from { opacity: 0; transform: translateY(9px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero {
    position: relative;
    min-height: 65vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 50px 15px;
    text-align: center;
    isolation: isolate;
}

.hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: min(650px, 95%);
    height: 350px;
    background: radial-gradient(ellipse, #7d17342c, transparent 70%);
    pointer-events: none;
}

.hero h1,
h2,
.card h3 {
    font-family: 'Cinzel', serif;
}

.hero h1 {
    margin: 24px 0 12px;
    font-size: clamp(34px, 6vw, 68px);
    line-height: 1.15;
    text-shadow: 0 0 35px #ed294b30;
}

.hero p {
    max-width: 650px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.9;
}

.hero .pill {
    color: var(--red-light);
    border-color: #8e2942;
    background: #38132166;
    letter-spacing: 2px;
}

.buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 25px 0;
}

.hero .buttons button {
    min-width: 165px;
    min-height: 48px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
    gap: 17px;
    margin: 22px 0;
}

.card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background:
        linear-gradient(145deg, #211a2cdd, #100e17f5);
    box-shadow: 0 12px 35px #0002;
    transition: transform .2s, border-color .2s;
}

.card:hover {
    transform: translateY(-3px);
    border-color: #75405e;
}

.card h3 {
    font-size: 18px;
}

.card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.card .emoji {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border: 1px solid #704054;
    border-radius: 12px;
    background: radial-gradient(circle, #63233d55, #191321);
    font-size: 37px;
    margin-bottom: 15px;
}

.card .primary {
    width: 100%;
    margin-top: 8px;
}

h2 {
    font-size: clamp(23px, 4vw, 32px);
}

.muted {
    color: var(--muted);
    line-height: 1.7;
}

#canvas {
    display: block;
    width: 100%;
    height: min(65vh, 650px);
    min-height: 360px;
    border: 1px solid #52314c;
    border-radius: 10px;
    background: #090811;
    box-shadow: 0 0 45px #0008, inset 0 0 30px #38142c25;
    touch-action: none;
}

.hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: 12px 0;
}

.hud .pill {
    border-color: #453149;
    background: #17111f;
}

#hp {
    color: #ff667e;
}

#xp {
    color: #65eaff;
}

.bar {
    height: 8px;
    margin: 12px 0;
    overflow: hidden;
    border-radius: 20px;
    background: #282036;
}

.bar div {
    height: 100%;
    background: linear-gradient(90deg, #7652ff, #5cecff);
    box-shadow: 0 0 15px #5cecff55;
    transition: width .2s;
}

#overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #05030bdc;
    backdrop-filter: blur(9px);
}

#overlay.show {
    display: flex;
    animation: fadeIn .2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    width: min(680px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: clamp(20px, 4vw, 35px);
    border: 1px solid #70405e;
    border-radius: 15px;
    background:
        radial-gradient(ellipse at top, #462039, transparent 60%),
        #120e1b;
    box-shadow: 0 25px 100px #000b, 0 0 35px #ed294b14;
}

.modal h2 {
    margin-top: 5px;
}

.choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.choices button {
    min-height: 110px;
    text-align: left;
    line-height: 1.6;
}

.choices button p {
    color: var(--muted);
    font-size: 12px;
}

.touch {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin: 13px auto;
}

.touch button {
    width: 55px;
    height: 48px;
    padding: 5px;
    touch-action: none;
}

footer {
    padding: 30px 15px;
    border-top: 1px solid #ffffff0b;
    color: #71657f;
    font-size: 11px;
    text-align: center;
    letter-spacing: 2px;
}

@media (max-width: 600px) {
    header {
        padding: 17px;
    }

    main {
        padding: 14px;
    }

    .hero {
        min-height: 58vh;
        padding: 30px 4px;
    }

    .hero .buttons {
        width: 100%;
    }

    .hero .buttons button {
        flex: 1 1 145px;
    }

    #canvas {
        min-height: 350px;
        height: 58vh;
    }

    .hud {
        justify-content: flex-start;
    }

    .hud .pill {
        padding: 8px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
