:root {
    --green: #33ff66;
    --green-dim: #1f9c45;
    --green-bright: #c8ffd4;
    --amber: #ffb000;
    --red: #ff5c5c;
    --blue: #5cc8ff;
    --background: #020a04;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    box-sizing: border-box;
    min-height: 100vh;
    padding: 32px 48px;
    background: radial-gradient(ellipse at center, #062410 0%, var(--background) 75%);
    color: var(--green);
    font-family: "IBM Plex Mono", "Courier New", monospace;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.45;
    text-shadow: 0 0 1px rgba(51, 255, 102, 0.6), 0 0 6px rgba(51, 255, 102, 0.3);
}

/* Scanlines */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15) 0,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
}

/* Darkened screen edges */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.7) 100%);
}

header h1 {
    margin: 0 0 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--green-dim);
    font-size: 1.6em;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.line {
    min-height: 1.45em;
    white-space: pre-wrap;
}

.map {
    min-height: 1.15em;
    line-height: 1.15;
    white-space: pre;
}

.echo {
    color: var(--green-dim);
}

.error {
    color: var(--amber);
    text-shadow: 0 0 6px rgba(255, 176, 0, 0.5);
}

span.player {
    color: var(--green-bright);
}

span.inventory,
.map-locked {
    color: var(--amber);
    text-shadow: 0 0 6px rgba(255, 176, 0, 0.5);
}

span.creature,
.map-creature {
    color: var(--red);
    text-shadow: 0 0 6px rgba(255, 92, 92, 0.5);
}

.rarity-common {
    color: #8fa596;
    text-shadow: none;
}

.rarity-uncommon {
    color: #d6dde3;
    text-shadow: 0 0 6px rgba(214, 221, 227, 0.5);
}

.rarity-rare {
    color: #f2c94c;
    text-shadow: 0 0 6px rgba(242, 201, 76, 0.6);
}

.rarity-mythic {
    color: #ff7a1a;
    text-shadow: 0 0 8px rgba(255, 122, 26, 0.7);
    animation: mythic-shimmer 2.4s ease-in-out infinite;
}

.rarity-special {
    color: #c77dff;
    text-shadow: 0 0 6px rgba(199, 125, 255, 0.6);
}

.rarity-token {
    color: var(--green-dim);
}

@keyframes mythic-shimmer {
    50% {
        color: #ffb45c;
        text-shadow: 0 0 14px rgba(255, 140, 40, 0.9);
    }
}

@media (prefers-reduced-motion: reduce) {
    .rarity-mythic {
        animation: none;
    }
}

span.stats {
    color: var(--green-bright);
    font-weight: 600;
}

.map-you {
    color: var(--green-bright);
    font-weight: 600;
}

.victory {
    min-height: 1.15em;
    line-height: 1.15;
    white-space: pre;
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}

.defeat {
    min-height: 1.15em;
    line-height: 1.15;
    white-space: pre;
    color: var(--red);
    font-weight: 600;
    text-shadow: 0 0 8px rgba(255, 92, 92, 0.6);
}

.chat {
    color: var(--blue);
    text-shadow: 0 0 6px rgba(92, 200, 255, 0.5);
}

span.chat-name {
    font-weight: 600;
}

.flavor {
    font-style: italic;
}

.battle {
    color: var(--amber);
    text-shadow: 0 0 6px rgba(255, 191, 71, 0.45);
}

span.ally {
    color: var(--green-bright);
    font-weight: 600;
}

span.defeated {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

#health {
    color: var(--green-bright);
    font-weight: 600;
    white-space: nowrap;
}

#health.health-low {
    color: var(--amber);
}

#health.health-critical {
    color: var(--red);
}

.map-exit {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

.prompt {
    display: flex;
    gap: 0.5em;
    margin-top: 0.3em;
}

#command {
    flex: 1;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-shadow: inherit;
    caret-color: var(--green);
}
