/* Hogwarts RPG - Mobile-First Dark Magical Theme */
/* Barafranca-style text RPG aesthetic */

:root {
    /* Core colors */
    --bg-dark: #0a0a12;
    --bg-card: #12121f;
    --bg-card-hover: #1a1a2e;
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --text-muted: #555566;

    /* Magical accents */
    --gold: #d4af37;
    --gold-bright: #ffd700;
    --magic-blue: #4a9eff;
    --magic-purple: #9966ff;

    /* Resource colors */
    --health-red: #cc3333;
    --health-bg: #331111;
    --energy-green: #33cc66;
    --energy-bg: #113322;
    --mana-blue: #3366cc;
    --mana-bg: #111133;

    /* House colors */
    --gryffindor: #740001;
    --gryffindor-accent: #d4af37;
    --slytherin: #1a472a;
    --slytherin-accent: #5d5d5d;
    --ravenclaw: #0e1a40;
    --ravenclaw-accent: #946b2d;
    --hufflepuff: #372e29;
    --hufflepuff-accent: #ecb939;

    /* Rarity colors */
    --rarity-common: #888888;
    --rarity-uncommon: #33cc33;
    --rarity-rare: #3399ff;
    --rarity-epic: #9933ff;
    --rarity-legendary: #ff9900;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;

    /* Safe areas for mobile */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    background: var(--bg-dark);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    padding-top: calc(var(--safe-top) + 100px);
    padding-bottom: calc(var(--safe-bottom) + 70px);
}

/* ========== STATUS BAR ========== */
.status-bar {
    position: fixed;
    top: var(--safe-top);
    left: 0;
    right: 0;
    height: 44px;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-md);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    z-index: 100;
}

.player-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.player-name {
    font-weight: 600;
    color: var(--gold);
}

.player-level {
    background: var(--magic-purple);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.currency {
    font-weight: 600;
    color: var(--gold-bright);
}

/* ========== RESOURCE BARS ========== */
.resource-bars {
    position: fixed;
    top: calc(var(--safe-top) + 44px);
    left: 0;
    right: 0;
    background: var(--bg-dark);
    padding: var(--spacing-xs) var(--spacing-md);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    z-index: 99;
}

.gear-combat-stats {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    font-size: 10px;
    padding-top: 2px;
}

.gear-combat-stats .stat-pow {
    color: var(--gold);
}

.gear-combat-stats .stat-def {
    color: var(--energy-green);
}

.bar {
    flex: 1;
    height: 16px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.health-bar { background: var(--health-bg); }
.energy-bar { background: var(--energy-bg); }
.mana-bar { background: var(--mana-bg); }

/* XP Bar - Inside resource bars */
.xp-bar-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-top: 2px;
}

.xp-bar-thin {
    flex: 1;
    height: 8px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.xp-bar-thin .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #b8860b, var(--gold), var(--gold-bright));
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.5);
}

.xp-text {
    font-size: 10px;
    font-weight: 600;
    color: var(--gold);
    white-space: nowrap;
}

.xp-percent {
    font-size: 10px;
    font-weight: 600;
    color: var(--gold-bright);
}

.bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
}

.health-bar .bar-fill { background: linear-gradient(90deg, #aa2222, var(--health-red)); }
.energy-bar .bar-fill { background: linear-gradient(90deg, #22aa44, var(--energy-green)); }
.mana-bar .bar-fill { background: linear-gradient(90deg, #2244aa, var(--mana-blue)); }

.bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* ========== ACTIVE QUEST BANNER ========== */
.active-quest-banner {
    background: linear-gradient(135deg, #2a1a40 0%, #1a1030 100%);
    border: 1px solid var(--magic-purple);
    border-radius: 8px;
    padding: var(--spacing-sm) var(--spacing-md);
    margin: var(--spacing-sm) var(--spacing-md) 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quest-name {
    font-weight: 600;
    color: var(--magic-purple);
}

.quest-timer {
    font-family: monospace;
    font-size: 16px;
    color: var(--gold);
}

/* ========== MAIN CONTENT ========== */
.game-content {
    padding: var(--spacing-md);
    min-height: calc(100vh - 155px);
}

/* ========== BOTTOM NAV ========== */
.bottom-nav {
    position: fixed;
    bottom: var(--safe-bottom);
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(0deg, #0f0f1a 0%, #1a1a2e 100%);
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    z-index: 100;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.bottom-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    padding: var(--spacing-sm) var(--spacing-md);
    transition: color 0.2s;
    flex-shrink: 0;
    min-width: 64px;
}

.nav-item.active {
    color: var(--gold);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--magic-purple) 0%, #7744cc 100%);
    color: white;
}

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

.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, #b8860b 100%);
    color: #111;
}

.btn-danger {
    background: linear-gradient(135deg, #cc3333 0%, #992222 100%);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
}

.btn-warning {
    background: #d97706;
    border-color: #d97706;
    color: white;
    animation: pulse-warning 0.5s ease-in-out infinite alternate;
}

@keyframes pulse-warning {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Searching state for battle button */
.btn.searching {
    position: relative;
    pointer-events: none;
}

.searching-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spinnerRotate {
    to { transform: rotate(360deg); }
}

/* ========== CARDS ========== */
.location-card, .quest-card, .spell-card, .opponent-card, .shop-item, .item-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border: 1px solid rgba(255,255,255,0.05);
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: var(--spacing-md);
}

input, select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 16px;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--magic-purple);
}

input::placeholder {
    color: var(--text-muted);
}

/* ========== AUTH PAGES ========== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--spacing-lg);
}

.auth-container, .character-create {
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.game-logo {
    font-size: 32px;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.game-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: var(--spacing-xs);
}

.auth-footer {
    text-align: center;
    margin-top: var(--spacing-lg);
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--gold);
    text-decoration: none;
}

/* ========== CHARACTER CREATION ========== */
.character-create h1 {
    text-align: center;
    color: var(--gold);
    margin-bottom: var(--spacing-sm);
}

.character-create .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.form-section {
    margin-bottom: var(--spacing-lg);
}

.form-section label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.house-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.house-option {
    cursor: pointer;
}

.house-option input {
    display: none;
}

.house-card {
    padding: var(--spacing-md);
    border-radius: 8px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.house-gryffindor .house-card { background: var(--gryffindor); }
.house-slytherin .house-card { background: var(--slytherin); }
.house-ravenclaw .house-card { background: var(--ravenclaw); }
.house-hufflepuff .house-card { background: var(--hufflepuff); }

.house-option input:checked + .house-card {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.house-name {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.house-traits {
    font-size: 10px;
    color: var(--text-secondary);
}

/* ========== ALERTS ========== */
.alert {
    padding: var(--spacing-md);
    border-radius: 6px;
    margin-bottom: var(--spacing-md);
}

.alert-error {
    background: rgba(204, 51, 51, 0.2);
    border: 1px solid var(--health-red);
    color: #ff6666;
}

.alert-warning {
    background: rgba(255, 153, 0, 0.2);
    border: 1px solid #ff9900;
    color: #ffaa33;
}

.alert-success {
    background: rgba(51, 204, 102, 0.2);
    border: 1px solid var(--energy-green);
    color: #66ff99;
}

/* ========== HOME PAGE ========== */
.location-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, #1a1a30 100%);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.location-name {
    color: var(--gold);
    margin-bottom: var(--spacing-xs);
}

.location-area {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: var(--spacing-sm);
}

.location-desc {
    font-style: italic;
    color: var(--text-secondary);
}

.quick-stats {
    background: var(--bg-card);
    border-radius: 8px;
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 600;
}

.house-color {
    color: var(--gold);
}

.quick-actions h3, .activity-feed h3 {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-sm);
}

.area-group {
    margin-bottom: var(--spacing-md);
}

.area-group h4 {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
}

.location-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    margin: 2px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    min-width: 80px;
}

.location-btn .loc-name {
    font-weight: 500;
}

.location-btn .loc-level {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.location-btn.current {
    border-color: var(--gold);
}

.location-btn.current .loc-name {
    color: var(--gold);
}

/* ========== QUESTS PAGE ========== */
.page-title {
    font-size: 20px;
    color: var(--gold);
    margin-bottom: var(--spacing-md);
}

.quest-section h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin: var(--spacing-md) 0 var(--spacing-sm);
}

.quest-card {
    display: block;
    overflow: hidden;
    padding: 0;
}

.quest-card .quest-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
}

.quest-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.quest-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.quest-card.completed {
    opacity: 0.5;
}

.quest-info {
    flex: 1;
    min-width: 150px;
}

.quest-name {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.quest-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.quest-meta {
    margin-top: var(--spacing-xs);
    font-size: 11px;
}

.energy-cost {
    color: var(--energy-green);
    margin-right: var(--spacing-sm);
}

.quest-time {
    color: var(--text-muted);
}

.quest-rewards {
    text-align: right;
}

.reward-exp, .reward-gold {
    display: block;
    font-size: 12px;
}

.reward-exp {
    color: var(--magic-purple);
}

.reward-gold {
    color: var(--gold);
}

.active-quest-card {
    background: linear-gradient(135deg, #2a1a40 0%, #1a1030 100%);
    border: 1px solid var(--magic-purple);
    padding: var(--spacing-lg);
    border-radius: 8px;
    text-align: center;
}

.active-quest-card.ready {
    border-color: var(--gold);
    background: linear-gradient(135deg, #2a2a10 0%, #1a1a00 100%);
}

.quest-name-large {
    font-size: 18px;
    color: var(--text-primary);
    margin: var(--spacing-sm) 0;
}

.progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin-bottom: var(--spacing-sm);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--magic-purple);
    transition: width 0.5s;
}

/* ========== DUEL PAGE ========== */
.duel-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: var(--spacing-lg);
}

.stat-box {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: 8px;
    min-width: 80px;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--gold);
}

.stat-name {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.combat-power {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: var(--spacing-lg);
    color: var(--text-secondary);
}

.combat-power strong {
    color: var(--magic-blue);
    font-size: 18px;
}

.opponents h3 {
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
}

.opponent-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.opponent-info {
    flex: 1;
}

.opponent-name {
    display: block;
    font-weight: 600;
}

.opponent-house {
    font-size: 12px;
    color: var(--text-secondary);
}

.opponent-stats {
    text-align: right;
    font-size: 12px;
}

.opponent-stats .level {
    display: block;
    color: var(--magic-purple);
    font-weight: 600;
}

.opponent-stats .record {
    color: var(--text-muted);
}

.duel-info {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: 8px;
}

.duel-info h4 {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: var(--spacing-sm);
}

.duel-info ul {
    list-style: none;
    font-size: 12px;
    color: var(--text-muted);
}

.duel-info li {
    padding: var(--spacing-xs) 0;
}

/* ========== SPELLS PAGE ========== */
.spell-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
}

.tab-btn.active {
    border-color: var(--magic-purple);
    color: var(--magic-purple);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.spell-card {
    border-left: 3px solid var(--text-muted);
}

.spell-card.type-attack { border-color: var(--health-red); }
.spell-card.type-defense { border-color: var(--mana-blue); }
.spell-card.type-healing { border-color: var(--energy-green); }
.spell-card.type-utility { border-color: var(--gold); }
.spell-card.type-dark { border-color: var(--magic-purple); }

.spell-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
}

.spell-name {
    font-weight: 600;
}

.spell-type {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.spell-incantation {
    font-style: italic;
    color: var(--magic-purple);
    margin-bottom: var(--spacing-xs);
}

.spell-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.spell-stats, .spell-requirements {
    display: flex;
    gap: var(--spacing-md);
    font-size: 11px;
    color: var(--text-muted);
}

.damage { color: var(--health-red); }
.mana-cost { color: var(--mana-blue); }
.heal { color: var(--energy-green); }
.defense { color: var(--magic-blue); }
.effect { color: var(--gold); }

.spell-card.locked {
    opacity: 0.7;
}

/* ========== PROFILE PAGE ========== */
.profile-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.avatar.house-gryffindor { background: var(--gryffindor); }
.avatar.house-slytherin { background: var(--slytherin); }

/* Rename Section */
.rename-section {
    margin-bottom: var(--spacing-lg);
}

.rename-collapsed {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.rename-collapsed:hover {
    border-color: var(--gold);
}

.rename-cost {
    color: var(--gold);
    font-weight: 600;
    font-size: 12px;
}

.rename-form {
    padding: var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--gold);
    border-radius: 6px;
}

.rename-form input {
    margin-bottom: var(--spacing-sm);
}

.rename-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.rename-actions .btn {
    flex: 1;
}
.avatar.house-ravenclaw { background: var(--ravenclaw); }
.avatar.house-hufflepuff { background: var(--hufflepuff); }

.profile-info h2 {
    color: var(--gold);
    margin-bottom: 2px;
}

.house-badge {
    font-size: 12px;
    color: var(--text-secondary);
}

.stats-section, .wand-section, .inventory-section, .leaderboard-section, .actions-section {
    margin-bottom: var(--spacing-lg);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.section-header h3 {
    margin-bottom: 0;
}

.stats-section h3, .wand-section h3, .inventory-section h3, .leaderboard-section h3 {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
}

.stat-item {
    background: var(--bg-card);
    padding: var(--spacing-sm);
    border-radius: 6px;
    text-align: center;
}

.stat-item .stat-name {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
}

.stat-item .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--magic-blue);
}

.wand-card {
    background: var(--bg-card);
    padding: var(--spacing-md);
    border-radius: 8px;
}

.wand-detail {
    color: var(--text-secondary);
    padding: var(--spacing-xs) 0;
}

.inventory-list, .leaderboard {
    background: var(--bg-card);
    border-radius: 8px;
}

.item-card {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin: 0;
    border-radius: 0;
    gap: var(--spacing-sm);
}

.item-card:last-child {
    border-bottom: none;
}

.item-name {
    font-weight: 500;
}

.item-qty {
    color: var(--text-muted);
    margin-left: var(--spacing-sm);
}

.item-card .item-info {
    flex: 1;
    min-width: 0;
}

.item-card .item-stats {
    display: flex;
    gap: var(--spacing-xs);
    font-size: 10px;
    flex-shrink: 0;
}

.item-card .item-actions {
    flex-shrink: 0;
}

.item-stats span {
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
}

.item-stats .stat-hp { color: var(--health-red); }
.item-stats .stat-mp { color: var(--mana-blue); }
.item-stats .stat-pow { color: var(--gold); }
.item-stats .stat-def { color: var(--energy-green); }

.item-card.equipped {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--magic-purple);
}

.gear-summary {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    background: var(--bg-darker);
    border-radius: 6px;
    font-size: 11px;
    align-items: center;
}

.gear-summary .gear-label {
    color: var(--text-muted);
    margin-right: var(--spacing-xs);
}

.gear-summary span:not(.gear-label) {
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
}

.gear-summary .stat-hp { color: var(--health-red); }
.gear-summary .stat-mp { color: var(--mana-blue); }
.gear-summary .stat-pow { color: var(--gold); }
.gear-summary .stat-def { color: var(--energy-green); }

.gear-tip {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    padding-left: var(--spacing-sm);
}

/* Rarity borders */
.rarity-common { border-left: 3px solid var(--rarity-common); padding-left: var(--spacing-sm); }
.rarity-uncommon { border-left: 3px solid var(--rarity-uncommon); padding-left: var(--spacing-sm); }
.rarity-rare { border-left: 3px solid var(--rarity-rare); padding-left: var(--spacing-sm); }
.rarity-epic { border-left: 3px solid var(--rarity-epic); padding-left: var(--spacing-sm); }
.rarity-legendary { border-left: 3px solid var(--rarity-legendary); padding-left: var(--spacing-sm); }

.lb-row {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.lb-row:last-child {
    border-bottom: none;
}

.lb-row.you {
    background: rgba(212, 175, 55, 0.1);
}

.lb-rank {
    width: 30px;
    color: var(--gold);
    font-weight: 600;
}

.lb-name {
    flex: 1;
}

.lb-house {
    font-size: 11px;
    color: var(--text-muted);
    margin-right: var(--spacing-md);
}

.lb-level {
    color: var(--magic-purple);
    font-weight: 600;
}

/* ========== SHOP PAGE ========== */
.wallet {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: var(--spacing-lg);
    color: var(--text-secondary);
}

.wallet strong {
    color: var(--gold-bright);
    font-size: 20px;
}

.shop-section {
    margin-bottom: var(--spacing-lg);
}

.shop-section h3 {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
}

.shop-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.shop-item .item-image,
.item-card .item-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.shop-item .item-image img,
.item-card .item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-item .item-info {
    flex: 1;
}

.shop-item .item-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.shop-item .item-effect {
    display: inline-block;
    font-size: 10px;
    color: var(--energy-green);
    background: var(--energy-bg);
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 2px;
}

.item-buy {
    text-align: right;
}

.item-price {
    display: block;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

/* ========== MODALS ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: var(--spacing-lg);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: var(--spacing-lg);
    max-width: 320px;
    width: 100%;
    text-align: center;
}

#duel-result h3 {
    font-size: 24px;
    margin-bottom: var(--spacing-md);
}

#duel-result .win {
    color: var(--gold);
}

#duel-result .loss {
    color: var(--health-red);
}

#duel-result .details {
    margin: var(--spacing-md) 0;
    font-size: 14px;
    color: var(--text-secondary);
}

#duel-result .rewards {
    margin-bottom: var(--spacing-md);
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast {
    position: fixed;
    bottom: calc(var(--safe-bottom) + 80px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--gold);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 20px;
    z-index: 300;
    animation: slideUp 0.3s ease;
}

.toast.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* ========== EMPTY STATES ========== */
.empty-state {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
    font-style: italic;
}

/* ========== HOUSE BODY CLASSES ========== */
body.house-gryffindor .status-bar {
    border-bottom-color: var(--gryffindor);
}
body.house-slytherin .status-bar {
    border-bottom-color: var(--slytherin);
}
body.house-ravenclaw .status-bar {
    border-bottom-color: var(--ravenclaw);
}
body.house-hufflepuff .status-bar {
    border-bottom-color: var(--hufflepuff);
}

/* ========== UTILITIES ========== */
.hidden {
    display: none !important;
}

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

.mt-md {
    margin-top: var(--spacing-md);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

/* ========== CREATURE BATTLE PAGE ========== */
.page-battle .battle-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: var(--spacing-lg);
}

.battle-arena {
    background: linear-gradient(180deg, #1a1020 0%, #0a0a15 100%);
    border: 1px solid var(--magic-purple);
    border-radius: 12px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.creature-image-container {
    text-align: center;
    margin-bottom: var(--spacing-md);
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.creature-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.15s ease-out;
}

.creature-image.attacking {
    animation: creature-attack 0.4s ease-out;
}

@keyframes creature-attack {
    0% { transform: scale(1) translateY(0); }
    25% { transform: scale(1.1) translateY(-10px); }
    50% { transform: scale(1.15) translateY(20px); }
    75% { transform: scale(1.05) translateX(5px); }
    100% { transform: scale(1) translateY(0) translateX(0); }
}

.creature-image.hit {
    animation: creature-hit 0.3s ease-out;
}

@keyframes creature-hit {
    0% { filter: brightness(1); }
    50% { filter: brightness(2) saturate(0.5); }
    100% { filter: brightness(1); }
}

.creature-panel {
    text-align: center;
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(153, 102, 255, 0.3);
    margin-bottom: var(--spacing-md);
}

.creature-info {
    margin-bottom: var(--spacing-sm);
}

.creature-name {
    font-size: 20px;
    font-weight: 700;
    display: block;
    margin-bottom: var(--spacing-xs);
}

.creature-name.rarity-common { color: var(--rarity-common); }
.creature-name.rarity-uncommon { color: var(--rarity-uncommon); }
.creature-name.rarity-rare { color: var(--rarity-rare); }
.creature-name.rarity-epic { color: var(--rarity-epic); }
.creature-name.rarity-legendary { color: var(--rarity-legendary); }

.creature-level {
    background: var(--magic-purple);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-right: var(--spacing-xs);
}

.creature-type {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.creature-hp-bar {
    height: 20px;
    background: var(--health-bg);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    margin: var(--spacing-sm) 0;
}

.creature-hp-bar .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #992222, var(--health-red));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.creature-hp-bar .bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.creature-desc {
    font-size: 12px;
    font-style: italic;
    color: var(--text-muted);
    margin-top: var(--spacing-sm);
}

/* Floating Damage Numbers - WoW-style linear float */
.floating-damage {
    position: absolute;
    top: 50%;
    left: calc(50% + 40px);
    font-size: 32px;
    font-weight: 900;
    color: white;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 8px rgba(0,0,0,0.5);
    pointer-events: none;
    z-index: 100;
    animation: damageFloat 1.5s linear forwards;
}

.floating-damage.crit {
    font-size: 44px;
    color: var(--gold-bright);
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 12px var(--gold);
}

.floating-damage.crit::before {
    content: 'CRIT! ';
    font-size: 22px;
    color: #ff4444;
}

/* Monster damage - red, offset left */
.floating-damage.monster {
    left: calc(50% - 40px);
    color: #ff4444;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 8px rgba(0,0,0,0.5);
}

/* Simple linear float up and fade */
@keyframes damageFloat {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-120px);
        opacity: 0;
    }
}

.attack-timer {
    height: 8px;
    background: rgba(255,100,100,0.2);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin-top: var(--spacing-xs);
}

.attack-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff8800);
    border-radius: 4px;
    transition: width 0.1s linear;
    width: 0%;
}

.attack-timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
}

.battle-log {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    max-height: 120px;
    overflow-y: auto;
}

.log-entry {
    font-size: 12px;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-secondary);
}

.log-entry:last-child {
    border-bottom: none;
}

.player-panel {
    margin-bottom: var(--spacing-md);
}

.player-battle-stats {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.player-battle-stats .stat {
    flex: 1;
}

.player-battle-stats .label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

.mini-bar {
    height: 16px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.mini-bar.health { background: var(--health-bg); }
.mini-bar.mana { background: var(--mana-bg); }

.mini-bar .bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
}

.mini-bar.health .bar-fill { background: linear-gradient(90deg, #aa2222, var(--health-red)); }
.mini-bar.mana .bar-fill { background: linear-gradient(90deg, #2244aa, var(--mana-blue)); }

.mini-bar .bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.gear-bonus {
    font-size: 11px;
    color: var(--energy-green);
    text-align: center;
}

.spell-selection h4 {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
}

.spell-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.spell-btn {
    padding: var(--spacing-sm);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.spell-btn:hover:not(:disabled) {
    border-color: var(--magic-purple);
    background: var(--bg-card-hover);
}

.spell-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.spell-btn.on-cooldown {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.spell-btn.on-cooldown::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(153, 102, 255, 0.3), transparent);
    animation: cooldownSweep 2s linear;
}

@keyframes cooldownSweep {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.spell-btn.attack { border-left: 3px solid var(--health-red); }
.spell-btn.defense { border-left: 3px solid var(--mana-blue); }
.spell-btn.healing { border-left: 3px solid var(--energy-green); }
.spell-btn.utility { border-left: 3px solid var(--gold); }
.spell-btn.basic-attack { border-left: 3px solid var(--text-muted); background: var(--bg-darker); }

.spell-btn .spell-name {
    display: block;
    font-weight: 600;
    font-size: 12px;
    color: var(--magic-purple);
}

.spell-btn .spell-info {
    font-size: 10px;
    color: var(--text-muted);
}

.flee-btn {
    width: 100%;
    margin-top: var(--spacing-sm);
}

/* Battle Potions */
.battle-potions {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.battle-potions h4 {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.potion-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.potion-btn {
    flex: 1;
    min-width: 120px;
    background: var(--bg-darker);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.potion-btn:hover {
    background: rgba(255,255,255,0.1);
}

.potion-btn.health-potion {
    border-left: 3px solid var(--health-red);
}

.potion-btn.mana-potion {
    border-left: 3px solid var(--mana-blue);
}

.potion-btn .potion-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

.potion-btn .potion-info {
    font-size: 10px;
    color: var(--text-muted);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* Start Battle Section */
.start-battle-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: var(--spacing-lg);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.start-battle-section p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.creatures-preview {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    text-align: left;
}

.creatures-preview h4 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
}

.creature-list {
    list-style: none;
}

.creature-list li {
    padding: var(--spacing-xs) 0 var(--spacing-xs) var(--spacing-sm);
    font-size: 13px;
    border-left: 3px solid var(--text-muted);
    margin-bottom: var(--spacing-xs);
}

.creature-list li.rarity-common { color: var(--rarity-common); border-left-color: var(--rarity-common); }
.creature-list li.rarity-uncommon { color: var(--rarity-uncommon); border-left-color: var(--rarity-uncommon); }
.creature-list li.rarity-rare { color: var(--rarity-rare); border-left-color: var(--rarity-rare); }
.creature-list li.rarity-epic { color: var(--rarity-epic); border-left-color: var(--rarity-epic); }
.creature-list li.rarity-legendary { color: var(--rarity-legendary); border-left-color: var(--rarity-legendary); }

.level-range {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: var(--spacing-xs);
}

.battle-cost {
    display: flex;
    justify-content: space-around;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: var(--spacing-md);
}

/* Recent Battles */
.recent-battles h3 {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
}

.battle-history {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.battle-entry {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.battle-entry:last-child {
    border-bottom: none;
}

.battle-entry .result {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.battle-entry.victory .result {
    background: var(--energy-green);
    color: white;
}

.battle-entry.defeat .result {
    background: var(--health-red);
    color: white;
}

.battle-entry .creature {
    flex: 1;
    font-size: 13px;
}

.battle-entry .rewards {
    font-size: 11px;
    color: var(--gold);
}

/* Battle Tips */
.battle-tips {
    margin-top: var(--spacing-lg);
}

.battle-tips .toggle-tips {
    width: 100%;
    font-size: 12px;
    text-transform: uppercase;
}

.battle-tips .tips-content {
    display: none;
    list-style: none;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: 8px;
}

.battle-tips.expanded .tips-content {
    display: block;
}

.battle-tips li {
    padding: var(--spacing-xs) 0;
    padding-left: 16px;
    position: relative;
}

.battle-tips li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--magic-purple);
}

.battle-tips em {
    color: var(--magic-purple);
    font-style: normal;
}

/* Battle Result Modal */
#battle-result h3 {
    font-size: 28px;
    margin-bottom: var(--spacing-md);
}

#battle-result .win {
    color: var(--gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

#battle-result .loss {
    color: var(--health-red);
}

.battle-log-final {
    margin: var(--spacing-md) 0;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: left;
    background: rgba(0,0,0,0.2);
    padding: var(--spacing-sm);
    border-radius: 6px;
}

.battle-log-final p {
    padding: var(--spacing-xs) 0;
}

#battle-result .rewards {
    margin: var(--spacing-md) 0;
}

#battle-result .rewards .xp {
    display: block;
    color: var(--magic-purple);
    font-size: 16px;
    font-weight: 600;
}

#battle-result .rewards .gold {
    display: block;
    color: var(--gold);
    font-size: 16px;
    font-weight: 600;
}

#battle-result .penalties {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: rgba(204, 51, 51, 0.2);
    border-radius: 6px;
}

#battle-result .penalties .gold-lost {
    display: block;
    color: var(--health-red);
    font-size: 16px;
    font-weight: 600;
}

#battle-result .penalties .item-lost {
    display: block;
    color: #ff9966;
    font-size: 14px;
    margin-top: 4px;
}

/* Quest Result Modal */
#quest-result h3 {
    font-size: 20px;
    margin-bottom: var(--spacing-sm);
}

#quest-result .quest-name-result {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

#quest-result .rewards {
    margin: var(--spacing-md) 0;
}

#quest-result .rewards .xp {
    display: block;
    color: var(--magic-purple);
    font-size: 16px;
    font-weight: 600;
}

#quest-result .rewards .gold {
    display: block;
    color: var(--gold);
    font-size: 16px;
    font-weight: 600;
}

#quest-result .level-up {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: linear-gradient(135deg, var(--magic-purple), var(--gold));
    border-radius: 6px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    animation: levelUpPulse 1s ease-in-out infinite;
}

@keyframes levelUpPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.alert-danger {
    background: rgba(204, 51, 51, 0.2);
    border: 1px solid var(--health-red);
    color: #ff6666;
    padding: var(--spacing-md);
    border-radius: 6px;
    margin-bottom: var(--spacing-md);
}

/* ========== BATTLE RESULT ANIMATIONS ========== */
#battle-result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    pointer-events: none;
    overflow: hidden;
}

/* Victory Animation - Golden glow with rising particles */
#battle-result-overlay.victory-animation {
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.3) 0%, rgba(212, 175, 55, 0.1) 40%, transparent 70%);
    animation: victoryPulse 2s ease-in-out infinite;
}

@keyframes victoryPulse {
    0%, 100% {
        background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.3) 0%, rgba(212, 175, 55, 0.1) 40%, transparent 70%);
    }
    50% {
        background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.4) 0%, rgba(212, 175, 55, 0.2) 50%, transparent 80%);
    }
}

.victory-particle {
    position: absolute;
    bottom: -20px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    border-radius: 50%;
    box-shadow: 0 0 10px var(--gold), 0 0 20px var(--gold-bright);
    animation: riseAndFade 3s ease-out infinite;
}

.victory-particle:nth-child(odd) {
    width: 6px;
    height: 6px;
    background: white;
    box-shadow: 0 0 8px white, 0 0 15px var(--gold);
}

.victory-particle:nth-child(3n) {
    width: 4px;
    height: 4px;
    animation-duration: 4s;
}

@keyframes riseAndFade {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg) scale(0);
        opacity: 0;
    }
}

/* Defeat Animation - Dark red vignette with descending ash */
#battle-result-overlay.defeat-animation {
    background: radial-gradient(ellipse at center, transparent 0%, rgba(100, 0, 0, 0.3) 50%, rgba(50, 0, 0, 0.6) 100%);
    animation: defeatPulse 3s ease-in-out infinite;
}

@keyframes defeatPulse {
    0%, 100% {
        background: radial-gradient(ellipse at center, transparent 0%, rgba(100, 0, 0, 0.3) 50%, rgba(50, 0, 0, 0.6) 100%);
    }
    50% {
        background: radial-gradient(ellipse at center, transparent 0%, rgba(80, 0, 0, 0.4) 40%, rgba(30, 0, 0, 0.7) 100%);
    }
}

#battle-result-overlay.defeat-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(139, 0, 0, 0.3) 0%, transparent 30%),
        radial-gradient(circle at 80% 20%, rgba(139, 0, 0, 0.2) 0%, transparent 25%);
    animation: defeatFlicker 0.5s ease-in-out infinite alternate;
}

@keyframes defeatFlicker {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Modal enhancements for win/loss */
#battle-modal.victory .modal-content {
    border: 2px solid var(--gold);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.5), 0 0 60px rgba(212, 175, 55, 0.3);
    animation: victoryModalGlow 2s ease-in-out infinite;
}

@keyframes victoryModalGlow {
    0%, 100% { box-shadow: 0 0 30px rgba(212, 175, 55, 0.5), 0 0 60px rgba(212, 175, 55, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.6), 0 0 80px rgba(212, 175, 55, 0.4); }
}

#battle-modal.defeat .modal-content {
    border: 2px solid var(--health-red);
    box-shadow: 0 0 30px rgba(204, 51, 51, 0.5), 0 0 60px rgba(100, 0, 0, 0.3);
    animation: defeatModalGlow 3s ease-in-out infinite;
}

@keyframes defeatModalGlow {
    0%, 100% { box-shadow: 0 0 30px rgba(204, 51, 51, 0.5), 0 0 60px rgba(100, 0, 0, 0.3); }
    50% { box-shadow: 0 0 20px rgba(139, 0, 0, 0.4), 0 0 40px rgba(50, 0, 0, 0.2); }
}
