/* ==========================================================================
   Dungeon Roguelike - Main Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Fira+Code:wght@400;500&family=Crimson+Pro:ital,wght@0,400;0,600;1,400&display=swap');

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    /* Colors - Dark Fantasy Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a26;
    --bg-card: #1e1e2a;
    --bg-hover: #252535;
    
    --text-primary: #e8e6e3;
    --text-secondary: #a8a5a0;
    --text-muted: #6b6966;
    
    --accent-gold: #d4a853;
    --accent-gold-bright: #f0c674;
    --accent-red: #c75050;
    --accent-red-bright: #e06060;
    --accent-blue: #5588cc;
    --accent-blue-bright: #70a0e0;
    --accent-green: #50a050;
    --accent-green-bright: #70c070;
    --accent-purple: #9070b0;
    
    /* Health/Mana/XP bars */
    --health-fill: linear-gradient(90deg, #8b2020, #c75050);
    --health-track: #2a1515;
    --mana-fill: linear-gradient(90deg, #203080, #5070c0);
    --mana-track: #151525;
    --xp-fill: linear-gradient(90deg, #806020, #c0a050);
    --xp-track: #1a1510;
    
    /* Borders & Shadows */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.12);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow-gold: 0 0 20px rgba(212, 168, 83, 0.3);
    
    /* Typography */
    --font-display: 'Cinzel', serif;
    --font-body: 'Crimson Pro', serif;
    --font-mono: 'Fira Code', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.6;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    
    /* Subtle texture */
    background-image: 
        radial-gradient(ellipse at 20% 0%, rgba(30, 30, 50, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(40, 30, 30, 0.4) 0%, transparent 50%);
}

#game-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.screen.hidden {
    display: none !important;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Character Selection Screen
   ========================================================================== */

#character-select {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg) var(--space-xl);
    gap: var(--space-md);
    min-height: 100vh;
    background: 
        radial-gradient(circle at 50% 0%, rgba(212, 168, 83, 0.08) 0%, transparent 40%),
        var(--bg-primary);
}

.title-section {
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

.title-section .game-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: var(--space-xs);
}

.title-section .game-subtitle {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.game-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-gold-bright) 0%, var(--accent-gold) 50%, var(--accent-gold-bright) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px rgba(212, 168, 83, 0.4);
    margin-bottom: var(--space-sm);
}

.game-subtitle {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

.select-section {
    width: 100%;
    max-width: 1000px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.select-section h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    letter-spacing: 0.1em;
}

.class-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

/* Responsive: 2 columns on medium screens, 1 on small */
@media (max-width: 900px) {
    .class-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .class-options {
        grid-template-columns: 1fr;
    }
}

.class-card {
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.class-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.class-card.selected {
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-glow-gold);
}

.class-icon {
    font-size: 2rem;
    margin-bottom: var(--space-xs);
    filter: drop-shadow(0 0 8px rgba(212, 168, 83, 0.5));
}

.class-card h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--accent-gold);
    margin-bottom: var(--space-xs);
    letter-spacing: 0.05em;
}

.class-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px var(--space-sm);
    margin-bottom: var(--space-xs);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.class-stats .stat {
    display: flex;
    justify-content: space-between;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.class-stats .label {
    color: var(--text-muted);
}

.class-stats .value {
    color: var(--text-primary);
    font-weight: 500;
}

.class-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.3;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Input row container for side-by-side layout */
.input-row {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
}

.name-input, .seed-input {
    margin-bottom: var(--space-sm);
    text-align: center;
}

.name-input label, .seed-input label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    letter-spacing: 0.05em;
}

.name-input input, .seed-input input {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    width: 200px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.name-input input:focus, .seed-input input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(212, 168, 83, 0.2);
}

.start-btn {
    display: block;
    margin: var(--space-md) auto 0;
    font-family: var(--font-display);
    font-size: 1rem;
    padding: var(--space-sm) var(--space-xl);
    background: linear-gradient(135deg, var(--accent-gold), #b08030);
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg-primary);
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-gold);
}

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

/* ==========================================================================
   Loading Screen
   ========================================================================== */

#loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

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

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-medium);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-lg);
}

.loading-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

/* ==========================================================================
   Game Layout
   ========================================================================== */

.game-layout {
    display: grid;
    grid-template-columns: 280px 1fr 260px;
    min-height: 100vh;
    gap: 1px;
    background: var(--border-subtle);
}

@media (max-width: 1024px) {
    .game-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
}

/* Sidebars */
.sidebar {
    background: var(--bg-secondary);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.sidebar-left {
    border-right: 1px solid var(--border-subtle);
}

.sidebar-right {
    border-left: 1px solid var(--border-subtle);
}

/* Main game area */
.game-main {
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-lg);
}

/* ==========================================================================
   Player Info (Left Sidebar)
   ========================================================================== */

.player-info {
    text-align: center;
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.player-portrait {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    margin-bottom: var(--space-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.player-portrait:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
}

.player-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--accent-gold);
    letter-spacing: 0.05em;
}

.player-class {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Stat Bars */
.stat-bars {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.stat-bar {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-bar-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-bar-track {
    height: 8px;
    background: var(--health-track);
    border-radius: 4px;
    overflow: hidden;
}

.health-bar .stat-bar-track {
    background: var(--health-track);
}

.health-bar .stat-bar-fill {
    height: 100%;
    background: var(--health-fill);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.mana-bar .stat-bar-track {
    background: var(--mana-track);
}

.mana-bar .stat-bar-fill {
    height: 100%;
    background: var(--mana-fill);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.xp-bar .stat-bar-track {
    background: var(--xp-track);
}

.xp-bar .stat-bar-fill {
    height: 100%;
    background: var(--xp-fill);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Player Stats Grid */
.player-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.player-stats .stat-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.stat-icon {
    width: 20px;
    text-align: center;
}

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

.stat-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Gold Display */
.player-gold {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.1), rgba(212, 168, 83, 0.05));
    border: 1px solid rgba(212, 168, 83, 0.2);
    border-radius: var(--radius-md);
}

.gold-icon {
    font-size: 1.5rem;
    color: var(--accent-gold);
}

.gold-amount {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent-gold-bright);
}

.gold-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Relics Display */
.player-relics {
    margin-top: var(--space-md);
    padding: var(--space-sm);
    background: rgba(144, 112, 176, 0.08);
    border: 1px solid rgba(144, 112, 176, 0.2);
    border-radius: var(--radius-md);
}

.player-relics h3 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--accent-purple);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.relic-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.relic-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--text-muted);
    cursor: help;
    transition: all 0.2s ease;
}

.relic-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.relic-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.relic-name {
    font-size: 0.75rem;
    font-family: var(--font-body);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Relic Rarity Colors */
.relic-common {
    border-left-color: var(--text-muted);
}
.relic-common .relic-name { color: var(--text-secondary); }
.relic-common .relic-icon { color: var(--text-muted); }

.relic-uncommon {
    border-left-color: var(--accent-green);
}
.relic-uncommon .relic-name { color: var(--accent-green); }
.relic-uncommon .relic-icon { color: var(--accent-green); }

.relic-rare {
    border-left-color: var(--accent-blue);
}
.relic-rare .relic-name { color: var(--accent-blue-bright); }
.relic-rare .relic-icon { color: var(--accent-blue); }

.relic-legendary {
    border-left-color: var(--accent-gold);
    background: linear-gradient(90deg, rgba(212, 168, 83, 0.1), transparent);
}
.relic-legendary .relic-name { 
    color: var(--accent-gold-bright); 
    font-weight: 600;
}
.relic-legendary .relic-icon { 
    color: var(--accent-gold); 
    text-shadow: 0 0 5px rgba(212, 168, 83, 0.5);
}

.relic-more {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    padding: var(--space-xs);
    font-style: italic;
}

/* Game Stats */
.game-stats {
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

.game-stat {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: var(--space-xs) 0;
}

/* ==========================================================================
   Room View
   ========================================================================== */

.room-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.room-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.room-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px rgba(212, 168, 83, 0.4));
}

.room-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

.room-level {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.room-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.7;
}

/* Interactables */
.room-interactables h3,
.room-connections h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
}

.interactable-list,
.connection-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.interactable-item,
.connection-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
}

.interactable-icon,
.connection-icon {
    font-size: 1.2rem;
}

.connection-item.available {
    border-color: var(--accent-green);
    background: rgba(80, 160, 80, 0.1);
}

.connection-item.locked {
    opacity: 0.5;
}

.connection-status {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ==========================================================================
   Combat View
   ========================================================================== */

.combat-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.combat-header {
    text-align: center;
    padding: var(--space-md);
    background: linear-gradient(135deg, rgba(199, 80, 80, 0.2), rgba(199, 80, 80, 0.1));
    border: 1px solid rgba(199, 80, 80, 0.3);
    border-radius: var(--radius-md);
}

.combat-header h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--accent-red-bright);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.turn-indicator {
    margin-top: var(--space-sm);
    font-size: 0.9rem;
}

.turn-indicator .player-turn {
    color: var(--accent-green-bright);
    font-weight: 600;
}

.turn-indicator .enemy-turn {
    color: var(--accent-red-bright);
    font-weight: 600;
}

.targeting-mode {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    animation: fadeIn 0.2s ease;
}

.targeting-prompt {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    align-items: center;
}

.targeting-text {
    color: var(--accent-gold-bright);
    font-size: 1.1rem;
}

.cancel-targeting-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-targeting-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.enemy-card.selectable {
    cursor: pointer;
}

.enemy-card.selectable:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px rgba(212, 168, 83, 0.3);
}

.enemy-card.targeted {
    border-color: var(--accent-gold);
    box-shadow: 0 0 25px rgba(212, 168, 83, 0.5);
}

/* Enemy attacking state - red pulsing glow */
.enemy-card.attacking {
    border-color: var(--accent-red);
    box-shadow: 0 0 30px rgba(199, 80, 80, 0.6);
    animation: enemy-attacking-pulse 0.5s ease-in-out infinite;
    transform: scale(1.05);
    z-index: 10;
}

@keyframes enemy-attacking-pulse {
    0%, 100% {
        box-shadow: 0 0 30px rgba(199, 80, 80, 0.6);
    }
    50% {
        box-shadow: 0 0 50px rgba(199, 80, 80, 0.9), 0 0 80px rgba(199, 80, 80, 0.4);
    }
}

/* Enemy attack overlay */
.enemy-attack-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    z-index: 50;
    cursor: pointer;
    animation: fadeIn 0.2s ease;
}

.enemy-attack-message {
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-primary));
    border: 2px solid var(--accent-red);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    max-width: 80%;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
    box-shadow: 
        0 0 30px rgba(199, 80, 80, 0.4),
        0 10px 40px rgba(0, 0, 0, 0.5);
    animation: bounceIn 0.3s ease;
}

.click-to-continue {
    color: var(--text-muted);
    font-size: 0.85rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.target-indicator {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--accent-gold);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1s ease-in-out infinite;
}

.target-icon {
    font-size: 1rem;
}

.defeated-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
}

.defeated-text {
    color: var(--accent-red);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.combat-actions {
    margin-top: auto;
}

.waiting-message {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: var(--space-lg);
}

.combat-log-inline {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    max-height: 100px;
    overflow-y: auto;
}

.combat-log-messages {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.combat-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    animation: slide-in-left 0.3s ease-out;
}

.enemies-list {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.75rem, 2vw, 1.5rem);
    justify-content: center;
    padding: 0 1rem;
}

.enemy-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 0;
    padding-bottom: clamp(0.5rem, 1vw, 1rem);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    /* Responsive width: min 160px, preferred 15vw, max 260px */
    width: clamp(160px, 15vw, 260px);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.enemy-card:hover {
    border-color: var(--accent-red);
    box-shadow: 0 0 15px rgba(199, 80, 80, 0.2);
}

.enemy-card.defeated {
    opacity: 0.4;
    filter: grayscale(1);
}

/* Enemy portrait container - not needed with vertical layout */

.enemy-image {
    width: 100%;
    /* Responsive height: min 160px, preferred 18vw, max 280px */
    height: clamp(160px, 18vw, 280px);
    border-radius: 0;
    border: none;
    border-bottom: 3px solid var(--accent-red);
    box-shadow: none;
    transition: transform 0.3s ease, filter 0.2s ease;
    margin: 0;
    margin-bottom: clamp(0.25rem, 0.5vw, 0.5rem);
    padding: 0;
    display: block;
    object-fit: cover;
    object-position: center center;
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

/* API images from D&D 5e API - may have transparent backgrounds */
.enemy-image.api-image {
    object-fit: cover;
    object-position: center center;
    background: linear-gradient(180deg, #1a1a2e 0%, #0d0d1a 100%);
    padding: 0;
}

/* Placeholder SVG images */
.enemy-image.placeholder-image {
    object-fit: cover;
    object-position: center top;
}

.enemy-card:hover .enemy-image {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.enemy-card.defeated .enemy-image {
    border-color: var(--text-muted);
    filter: grayscale(0.8);
}

/* Enemy type icon badge */
.enemy-type-icon {
    position: absolute;
    bottom: clamp(4px, 0.5vw, 8px);
    right: clamp(4px, 0.5vw, 8px);
    width: clamp(28px, 2.5vw, 36px);
    height: clamp(28px, 2.5vw, 36px);
    background: var(--bg-secondary);
    border: 2px solid var(--border-medium);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.9rem, 1.2vw, 1.2rem);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.enemy-card:hover .enemy-type-icon {
    transform: scale(1.1);
    border-color: var(--accent-red);
}

.enemy-card.defeated .enemy-type-icon {
    opacity: 0.5;
}

/* ==========================================================================
   Tooltips
   ========================================================================== */

.tooltip-trigger {
    display: contents;
}

.tooltip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    padding: 0;
    min-width: 220px;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: tooltip-fade-in 0.15s ease-out;
    pointer-events: none;
}

@keyframes tooltip-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tooltip-header {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.tooltip-title {
    display: block;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.tooltip-subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.tooltip-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0;
}

.tooltip-stats {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tooltip-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.tooltip-stat .stat-icon {
    width: 20px;
    text-align: center;
}

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

.tooltip-stat .stat-value {
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.tooltip-stat .stat-value.positive {
    color: var(--accent-green-bright);
}

.tooltip-stat .stat-value.negative {
    color: var(--accent-red);
}

.tooltip-footer {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.tooltip-cr {
    color: var(--accent-gold);
}

.tooltip-hp {
    color: var(--health-fill);
}

.tooltip-value {
    color: var(--accent-gold);
}

/* Enemy tooltip specific */
.enemy-tooltip {
    width: 260px;
}

/* Item tooltip specific */
.item-tooltip {
    width: 280px;
}

.tooltip-rarity {
    padding: 0.25rem 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.tooltip-rarity.rarity-common {
    color: var(--text-muted);
    background: rgba(189, 195, 199, 0.1);
}

.tooltip-rarity.rarity-uncommon {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.tooltip-rarity.rarity-rare {
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.tooltip-rarity.rarity-veryrare {
    color: #9b59b6;
    background: rgba(155, 89, 182, 0.1);
}

.tooltip-rarity.rarity-legendary {
    color: #e67e22;
    background: rgba(230, 126, 34, 0.15);
}

.tooltip-title.rarity-common { color: #bdc3c7; }
.tooltip-title.rarity-uncommon { color: #2ecc71; }
.tooltip-title.rarity-rare { color: #3498db; }
.tooltip-title.rarity-veryrare { color: #9b59b6; }
.tooltip-title.rarity-legendary { 
    color: #e67e22; 
    text-shadow: 0 0 8px rgba(230, 126, 34, 0.5);
}

.tooltip-description {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.4;
    margin: 0;
}

.tooltip-damage {
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.damage-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.damage-value {
    color: var(--accent-red);
    font-weight: 600;
    font-family: var(--font-mono);
}

.tooltip-ability {
    padding: 0.75rem 1rem;
}

.ability-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.ability-name {
    display: block;
    color: var(--accent-purple);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.ability-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* ==========================================================================
   Ability Tooltip (Combat Actions)
   ========================================================================== */

.ability-tooltip,
.attack-tooltip,
.flee-tooltip {
    width: 300px;
}

.ability-tooltip .tooltip-header,
.attack-tooltip .tooltip-header,
.flee-tooltip .tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.ability-tooltip .tooltip-title,
.attack-tooltip .tooltip-title,
.flee-tooltip .tooltip-title {
    font-size: 1.1rem;
}

.tooltip-type-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--bg-primary);
    font-weight: 600;
    white-space: nowrap;
}

.ability-tooltip .tooltip-description,
.attack-tooltip .tooltip-description,
.flee-tooltip .tooltip-description {
    font-style: normal;
    color: var(--text-secondary);
}

/* Ability damage section */
.ability-damage-section,
.ability-healing-section,
.ability-effects-section {
    padding: 0.5rem 1rem;
}

.ability-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.ability-stat:last-child {
    margin-bottom: 0;
}

.ability-stat .stat-icon {
    font-size: 0.9rem;
    width: 1.2rem;
    text-align: center;
}

.ability-stat .stat-label {
    flex: 1;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.ability-stat .stat-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

.ability-stat .stat-value.damage-dice {
    color: var(--accent-red);
}

.ability-stat .stat-value.positive {
    color: var(--accent-green);
}

/* Ability effects */
.ability-effect {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.ability-effect .effect-icon {
    font-size: 0.9rem;
}

.ability-effect .effect-text {
    font-size: 0.85rem;
    color: var(--accent-gold);
}

.ability-effect.buff .effect-text {
    color: var(--accent-green);
}

.ability-save {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-light);
}

.ability-save .save-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.ability-save .save-type {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-purple);
    font-weight: 600;
    background: rgba(144, 112, 176, 0.2);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
}

/* Ability footer (cost, cooldown, target) */
.ability-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.ability-cost,
.ability-cooldown,
.ability-target {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
}

.ability-cost .cost-icon,
.ability-cooldown .cooldown-icon,
.ability-target .target-icon {
    font-size: 0.85rem;
}

.ability-cost .cost-value {
    color: var(--mana-fill);
    font-weight: 600;
}

.ability-cooldown .cooldown-value {
    color: var(--text-muted);
}

.ability-target .target-value {
    color: var(--accent-gold);
}

/* Enemy details wrapper - not needed with vertical layout */

.enemy-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(2px, 0.3vw, 4px);
    margin-bottom: clamp(0.25rem, 0.5vw, 0.5rem);
    width: 100%;
    padding: 0 clamp(0.5rem, 1vw, 1rem);
}

.enemy-name {
    font-family: var(--font-display);
    font-size: clamp(0.85rem, 1vw, 1.1rem);
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
}

.enemy-cr {
    font-family: var(--font-mono);
    font-size: clamp(0.65rem, 0.8vw, 0.8rem);
    color: var(--text-muted);
    padding: clamp(2px, 0.3vw, 4px) clamp(4px, 0.5vw, 8px);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.enemy-hp-bar {
    position: relative;
    height: clamp(18px, 2vw, 24px);
    width: calc(100% - clamp(1rem, 2vw, 2rem));
    background: var(--health-track);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: clamp(0.25rem, 0.5vw, 0.5rem);
}

.enemy-hp-fill {
    height: 100%;
    background: var(--health-fill);
    transition: width 0.3s ease;
}

.enemy-hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: clamp(0.65rem, 0.9vw, 0.85rem);
    font-weight: 500;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.enemy-stats {
    display: flex;
    justify-content: space-around;
    width: 100%;
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    color: var(--text-muted);
    padding: clamp(0.25rem, 0.5vw, 0.5rem) clamp(0.5rem, 1vw, 1rem);
    gap: clamp(0.5rem, 1vw, 1rem);
}

.enemy-stats span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* ==========================================================================
   Action Area
   ========================================================================== */

.action-area {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--border-subtle);
}

.action-area h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: var(--space-md);
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
}

.action-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-gold);
}

.action-label {
    color: var(--text-primary);
}

/* Action type specific styles */
.action-basic_attack {
    border-color: var(--accent-red);
}

.action-basic_attack:hover {
    background: rgba(199, 80, 80, 0.2);
}

.action-ability {
    border-color: var(--accent-purple);
}

.action-ability:hover {
    background: rgba(144, 112, 176, 0.2);
}

.action-flee {
    border-color: var(--text-muted);
}

.action-move {
    border-color: var(--accent-green);
}

.action-move:hover {
    background: rgba(80, 160, 80, 0.2);
}

.action-use_item {
    border-color: var(--accent-blue);
}

.action-use_item:hover {
    background: rgba(80, 120, 200, 0.2);
}

/* Potion button with special styling */
.action-potion {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, rgba(80, 160, 80, 0.1), transparent);
}

.action-potion:hover {
    background: linear-gradient(135deg, rgba(80, 160, 80, 0.25), rgba(80, 160, 80, 0.1));
    border-color: var(--accent-green);
}

/* ==========================================================================
   Potion Selection Modal
   ========================================================================== */

.potion-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}

.potion-modal {
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-primary));
    border: 2px solid var(--accent-green);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    min-width: 280px;
    max-width: 400px;
    box-shadow: 
        0 0 30px rgba(80, 160, 80, 0.3),
        0 10px 40px rgba(0, 0, 0, 0.5);
    animation: bounceIn 0.2s ease;
}

.potion-modal h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--accent-green);
    text-align: center;
    margin-bottom: var(--space-md);
    text-shadow: 0 0 10px rgba(80, 160, 80, 0.5);
}

.potion-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.potion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.potion-item:hover {
    background: rgba(80, 160, 80, 0.2);
    border-color: var(--accent-green);
    transform: translateX(4px);
}

.potion-name {
    color: var(--text-primary);
}

.potion-count {
    color: var(--accent-gold);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.potion-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: var(--space-md);
    margin-bottom: 0;
}

/* ==========================================================================
   Target Selection Overlay
   ========================================================================== */

.target-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

.target-overlay h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--accent-gold);
    letter-spacing: 0.1em;
}

.target-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.target-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 300px;
}

.target-btn:hover {
    border-color: var(--accent-red);
    background: rgba(199, 80, 80, 0.2);
    transform: scale(1.02);
}

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

.target-hp {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   Right Sidebar (Minimap & Log)
   ========================================================================== */

.minimap {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.minimap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.minimap-header h3 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
}

.minimap-header .current-level {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-gold);
    background: rgba(212, 168, 83, 0.15);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.minimap-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.minimap-level {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-xs);
    border-radius: var(--radius-sm);
}

.minimap-level.current-level-row {
    background: rgba(212, 168, 83, 0.1);
    border: 1px solid rgba(212, 168, 83, 0.2);
}

.minimap-level-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    min-width: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

.level-arrow {
    font-size: 0.6rem;
}

.level-arrow.up { color: var(--accent-blue); }
.level-arrow.down { color: var(--accent-green); }
.level-marker { color: var(--accent-gold); }

.minimap-rooms {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    flex: 1;
    justify-content: center;
}

.minimap-room {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: default;
    transition: all 0.2s ease;
    position: relative;
}

/* Current room - Gold */
.minimap-room.current {
    border-color: var(--accent-gold) !important;
    box-shadow: 0 0 12px rgba(212, 168, 83, 0.7), inset 0 0 8px rgba(212, 168, 83, 0.2);
    background: rgba(212, 168, 83, 0.25);
    transform: scale(1.15);
    z-index: 2;
}

/* Came from - Blue (previous rooms) */
.minimap-room.came-from {
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 8px rgba(85, 136, 204, 0.5);
    background: rgba(85, 136, 204, 0.2);
}

/* Can go to - Green (next available rooms) */
.minimap-room.can-go-to {
    border-color: var(--accent-green) !important;
    box-shadow: 0 0 8px rgba(80, 160, 80, 0.5);
    background: rgba(80, 160, 80, 0.2);
    animation: pulse-green 1.5s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 8px rgba(80, 160, 80, 0.5); }
    50% { box-shadow: 0 0 14px rgba(80, 160, 80, 0.8), 0 0 4px rgba(80, 160, 80, 0.3) inset; }
}

/* Cleared rooms */
.minimap-room.cleared:not(.came-from):not(.current) {
    opacity: 0.5;
    background: rgba(80, 160, 80, 0.1);
    border-color: rgba(80, 160, 80, 0.4);
}

/* Locked rooms */
.minimap-room.locked {
    opacity: 0.3;
    border-style: dashed;
    border-color: var(--text-muted);
}

/* Room type icons (subtle background tint) */
.minimap-room.room-combat { background-color: rgba(199, 80, 80, 0.1); }
.minimap-room.room-elite { background-color: rgba(199, 80, 80, 0.15); }
.minimap-room.room-boss { background-color: rgba(199, 80, 80, 0.2); }
.minimap-room.room-treasure { background-color: rgba(212, 168, 83, 0.1); }
.minimap-room.room-shop { background-color: rgba(80, 160, 80, 0.1); }
.minimap-room.room-rest { background-color: rgba(80, 136, 204, 0.1); }
.minimap-room.room-event { background-color: rgba(144, 112, 176, 0.1); }
.minimap-room.room-puzzle { background-color: rgba(176, 144, 80, 0.1); }

/* Legend */
.minimap-legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xs) var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-subtle);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    border: 2px solid;
    flex-shrink: 0;
}

.legend-dot.current { 
    border-color: var(--accent-gold); 
    background: rgba(212, 168, 83, 0.3);
    box-shadow: 0 0 4px rgba(212, 168, 83, 0.5);
}

.legend-dot.came-from { 
    border-color: var(--accent-blue); 
    background: rgba(85, 136, 204, 0.3);
}

.legend-dot.can-go-to { 
    border-color: var(--accent-green); 
    background: rgba(80, 160, 80, 0.3);
}

.legend-dot.locked { 
    border-color: var(--text-muted); 
    border-style: dashed;
    opacity: 0.5;
}

/* Message Log */
.message-log {
    display: flex;
    flex-direction: column;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    overflow: hidden;
    max-height: 500px;
    min-height: 300px;
}

.message-log h3 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
    flex-shrink: 0;
}

.log-entries {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scroll-behavior: smooth;
}

/* Custom scrollbar for log */
.log-entries::-webkit-scrollbar {
    width: 6px;
}

.log-entries::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.log-entries::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 3px;
}

.log-entries::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.log-entry {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: var(--space-xs) var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
    line-height: 1.4;
    animation: slide-in-left 0.2s ease-out;
}

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

/* Most recent entry (first in reversed list) gets highlight */
.log-entry:first-child:not(.log-empty) {
    background: rgba(212, 168, 83, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    border-left: 2px solid var(--accent-gold);
    padding-left: calc(var(--space-sm) - 2px);
}

.log-entry.log-empty {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    background: none;
}

/* Log message formatting - colored names */
.log-player {
    color: #4ecdc4;
    font-weight: 600;
}

.log-enemy {
    color: #ff6b6b;
    font-weight: 600;
}

.log-damage {
    color: #e74c3c;
    font-weight: 700;
}

.log-heal {
    color: #2ecc71;
    font-weight: 700;
}

.log-gold {
    color: #f1c40f;
    font-weight: 700;
}

.log-ability {
    color: #9b59b6;
    font-weight: 600;
    font-style: italic;
}

.log-crit {
    color: #e67e22;
    font-weight: 700;
    text-transform: uppercase;
}

.log-miss {
    color: #7f8c8d;
    font-style: italic;
}

.log-roll {
    color: #95a5a6;
    font-size: 0.85em;
    font-family: monospace;
}

.log-room {
    color: #3498db;
}

/* Item rarity colors in log */
.log-item {
    color: #95a5a6;
    font-weight: 600;
}

.log-item-common {
    color: #bdc3c7;
    font-weight: 600;
}

.log-item-uncommon {
    color: #2ecc71;
    font-weight: 600;
}

.log-item-rare {
    color: #3498db;
    font-weight: 600;
}

.log-item-veryrare {
    color: #9b59b6;
    font-weight: 600;
}

.log-item-legendary {
    color: #e67e22;
    font-weight: 700;
    text-shadow: 0 0 4px rgba(230, 126, 34, 0.5);
}

/* Additional log styling */
.log-xp {
    color: #f39c12;
    font-weight: 600;
}

.log-mana {
    color: #3498db;
    font-weight: 600;
}

.log-status {
    color: #9b59b6;
    font-style: italic;
}

.log-flee {
    color: #95a5a6;
    font-style: italic;
}

/* ==========================================================================
   End Screen
   ========================================================================== */

.end-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-xl);
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.end-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.15em;
    margin-bottom: var(--space-md);
}

.end-screen .end-title {
    background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.end-message {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: var(--space-xl);
}

.end-stats {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    min-width: 300px;
    margin-bottom: var(--space-xl);
}

.end-stats h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--accent-gold);
    margin-bottom: var(--space-md);
    letter-spacing: 0.1em;
}

.end-stats .stat-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
}

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

.restart-btn {
    font-family: var(--font-display);
    font-size: 1.1rem;
    padding: var(--space-md) var(--space-2xl);
    background: linear-gradient(135deg, var(--accent-gold), #b08030);
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg-primary);
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-gold);
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ==========================================================================
   Combat Animations (for React integration)
   ========================================================================== */

/* Attack animation - shake effect */
@keyframes attack-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Damage flash - red flash on hit */
@keyframes damage-flash {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.5) sepia(1) hue-rotate(-50deg); }
}

/* Heal flash - green glow */
@keyframes heal-flash {
    0%, 100% { filter: brightness(1); box-shadow: none; }
    50% { filter: brightness(1.2); box-shadow: 0 0 20px rgba(80, 200, 80, 0.5); }
}

/* Critical hit - larger shake + glow */
@keyframes critical-hit {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    25% { transform: scale(1.1); filter: brightness(1.5) sepia(1) hue-rotate(-50deg); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.05); }
}

/* Enemy defeated - fade out and shrink */
@keyframes enemy-defeat {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); filter: brightness(2); }
    100% { opacity: 0; transform: scale(0.5); }
}

/* Ability cast - glow effect */
@keyframes ability-cast {
    0% { box-shadow: 0 0 0 rgba(147, 112, 219, 0); }
    50% { box-shadow: 0 0 30px rgba(147, 112, 219, 0.8); }
    100% { box-shadow: 0 0 0 rgba(147, 112, 219, 0); }
}

/* Status effect applied */
@keyframes status-applied {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Turn indicator pulse */
@keyframes turn-pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Slide in from left (for combat log messages) */
@keyframes slide-in-left {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Slide in from right */
@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Bounce in */
@keyframes bounce-in {
    0% { opacity: 0; transform: scale(0.3); }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* Animation utility classes */
.animate-attack { animation: attack-shake 0.3s ease-out; }
.animate-damage { animation: damage-flash 0.3s ease-out; }
.animate-heal { animation: heal-flash 0.5s ease-out; }
.animate-critical { animation: critical-hit 0.5s ease-out; }
.animate-defeat { animation: enemy-defeat 0.5s ease-out forwards; }
.animate-cast { animation: ability-cast 0.4s ease-out; }
.animate-status { animation: status-applied 0.3s ease-out; }
.animate-turn { animation: turn-pulse 1.5s ease-in-out infinite; }
.animate-slide-left { animation: slide-in-left 0.3s ease-out; }
.animate-slide-right { animation: slide-in-right 0.3s ease-out; }
.animate-bounce { animation: bounce-in 0.4s ease-out; }

/* Staggered animation delays for lists */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* Transition utilities */
.transition-fast { transition: all 0.15s ease; }
.transition-normal { transition: all 0.3s ease; }
.transition-slow { transition: all 0.5s ease; }

/* ==========================================================================
   Scrollbar Styling
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-medium);
}

/* ==========================================================================
   Inventory & Character Overlays
   ========================================================================== */

/* Shared overlay styles */
.inventory-overlay,
.character-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modal-overlay-fade 0.3s ease-out;
    backdrop-filter: blur(4px);
}

@keyframes modal-overlay-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Shared modal styles */
.inventory-modal,
.character-modal {
    background: linear-gradient(145deg, rgba(25, 22, 38, 0.98), rgba(18, 16, 28, 0.99));
    border: 2px solid var(--border-accent);
    border-radius: var(--radius-lg);
    max-width: 900px;
    max-height: 85vh;
    width: 95%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modal-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 0 60px rgba(212, 168, 83, 0.2),
        0 0 100px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modal headers */
.inventory-header,
.character-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.15), rgba(212, 168, 83, 0.05));
    border-bottom: 2px solid rgba(212, 168, 83, 0.3);
    position: relative;
}

/* Decorative header accents */
.inventory-header::before,
.character-header::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.inventory-header h2,
.character-header h2 {
    margin: 0;
    color: var(--accent-gold);
    font-family: var(--font-display);
    font-size: 1.75rem;
    text-shadow: 0 2px 10px rgba(212, 168, 83, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.inventory-header h2::before {
    content: '🎒';
    font-size: 1.5rem;
}

.character-header h2::before {
    content: '📜';
    font-size: 1.5rem;
}

.close-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s ease;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* Inventory content layout */
.inventory-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* Equipment section */
.equipment-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.equipment-section h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.equipment-slots {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.equipment-slot {
    background: linear-gradient(135deg, rgba(30, 25, 45, 0.8), rgba(20, 18, 35, 0.9));
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Slot type indicator */
.equipment-slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--border-medium);
    transition: background 0.3s ease;
}

.equipment-slot[data-slot="weapon"]::before {
    background: linear-gradient(180deg, #e74c3c, #c0392b);
}

.equipment-slot[data-slot="armor"]::before {
    background: linear-gradient(180deg, #3498db, #2980b9);
}

.equipment-slot[data-slot="accessory"]::before {
    background: linear-gradient(180deg, #f1c40f, #e67e22);
}

.equipment-slot:hover {
    border-color: var(--accent-gold);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.slot-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.equipment-slot[data-slot="weapon"] .slot-label::before { content: '⚔️'; }
.equipment-slot[data-slot="armor"] .slot-label::before { content: '🛡️'; }
.equipment-slot[data-slot="accessory"] .slot-label::before { content: '💍'; }

.slot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
    gap: 0.75rem;
}

.slot-item.filled .item-name {
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
}

.slot-item.empty .empty-slot {
    color: var(--text-muted);
    font-style: italic;
}

.equipment-image {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    border: 1px solid var(--border-accent);
    flex-shrink: 0;
}

.unequip-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.unequip-btn:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* Gold display */
.gold-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.15), rgba(241, 196, 15, 0.05));
    border: 2px solid rgba(241, 196, 15, 0.4);
    border-radius: var(--radius-md);
    margin-top: auto;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.15);
}

.gold-display::before {
    content: '💰';
    font-size: 1.5rem;
}

.gold-icon {
    font-size: 1.5rem;
    color: var(--accent-gold);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.gold-amount {
    font-size: 1.75rem;
    color: var(--accent-gold);
    font-weight: bold;
    font-family: var(--font-mono);
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.gold-amount {
    font-size: 1.25rem;
    color: var(--gold);
    font-weight: bold;
}

/* Inventory grid section */
.inventory-grid-section {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(30, 25, 45, 0.5), rgba(20, 18, 35, 0.6));
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--border-subtle);
}

.inventory-grid-section h3 {
    margin: 0 0 1.25rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inventory-grid-section h3::before {
    content: '📦';
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    max-height: 400px;
    padding-right: 0.5rem;
}

/* Custom scrollbar for inventory */
.inventory-grid::-webkit-scrollbar {
    width: 6px;
}

.inventory-grid::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.inventory-grid::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.inventory-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

.inventory-modal .empty-inventory {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-subtle);
}

/* Inventory item cards */
.inventory-item {
    background: linear-gradient(135deg, rgba(35, 30, 50, 0.9), rgba(25, 22, 38, 0.95));
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

/* Shine effect */
.inventory-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.5s ease;
}

.inventory-item:hover::before {
    left: 150%;
}

.inventory-item:hover {
    border-color: var(--accent-gold);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.inventory-item .item-image {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    border: 2px solid var(--border-subtle);
    padding: 4px;
    background: var(--bg-tertiary);
    transition: all 0.3s ease;
}

.inventory-item:hover .item-image {
    transform: scale(1.1) rotate(-5deg);
    border-color: var(--accent-gold);
}

/* Rarity glow effects for inventory items */
.inventory-item.rarity-uncommon {
    border-color: rgba(46, 204, 113, 0.4);
    box-shadow: inset 0 0 15px rgba(46, 204, 113, 0.1);
}

.inventory-item.rarity-uncommon:hover {
    border-color: #2ecc71;
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.2);
}

.inventory-item.rarity-rare {
    border-color: rgba(52, 152, 219, 0.4);
    box-shadow: inset 0 0 15px rgba(52, 152, 219, 0.1);
}

.inventory-item.rarity-rare:hover {
    border-color: #3498db;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.2);
}

.inventory-item.rarity-very_rare,
.inventory-item.rarity-veryrare {
    border-color: rgba(155, 89, 182, 0.4);
    box-shadow: inset 0 0 15px rgba(155, 89, 182, 0.15);
}

.inventory-item.rarity-very_rare:hover,
.inventory-item.rarity-veryrare:hover {
    border-color: #9b59b6;
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.25);
}

.inventory-item.rarity-legendary {
    border-color: rgba(230, 126, 34, 0.5);
    box-shadow: inset 0 0 20px rgba(230, 126, 34, 0.15);
    animation: legendary-item-pulse 2s ease-in-out infinite;
}

.inventory-item.rarity-legendary:hover {
    border-color: #e67e22;
    box-shadow: 0 8px 30px rgba(230, 126, 34, 0.3);
}

@keyframes legendary-item-pulse {
    0%, 100% { box-shadow: inset 0 0 20px rgba(230, 126, 34, 0.15); }
    50% { box-shadow: inset 0 0 30px rgba(230, 126, 34, 0.25); }
}

/* Item type indicator */
.inventory-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.inventory-item.item-weapon::after {
    background: linear-gradient(180deg, #e74c3c, #c0392b);
}

.inventory-item.item-armor::after {
    background: linear-gradient(180deg, #3498db, #2980b9);
}

.inventory-item.item-accessory::after {
    background: linear-gradient(180deg, #f1c40f, #e67e22);
}

.inventory-item.item-consumable::after {
    background: linear-gradient(180deg, #2ecc71, #27ae60);
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.item-info .item-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-info .item-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.item-action-btn {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.2), rgba(212, 168, 83, 0.1));
    border: 1px solid rgba(212, 168, 83, 0.4);
    color: var(--accent-gold);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.item-action-btn:hover {
    background: linear-gradient(135deg, var(--accent-gold), #e67e22);
    border-color: var(--accent-gold);
    color: #1a1a2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 168, 83, 0.3);
}

/* Character sheet content */
.character-content {
    padding: 1.75rem;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* Custom scrollbar for character content */
.character-content::-webkit-scrollbar {
    width: 6px;
}

.character-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.character-content::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.character-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

.character-info {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.1), transparent);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(212, 168, 83, 0.2);
    position: relative;
}

/* Decorative corners */
.character-info::before,
.character-info::after {
    content: '◆';
    position: absolute;
    color: rgba(212, 168, 83, 0.3);
    font-size: 1rem;
}

.character-info::before {
    top: 0.5rem;
    left: 0.75rem;
}

.character-info::after {
    bottom: 0.5rem;
    right: 0.75rem;
}

.character-portrait {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 4px solid var(--accent-gold);
    margin: 0 auto 1.25rem;
    object-fit: cover;
    background: var(--bg-tertiary);
    box-shadow: 
        0 0 30px rgba(212, 168, 83, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.character-portrait:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 40px rgba(212, 168, 83, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.character-info h3 {
    margin: 0;
    color: var(--accent-gold);
    font-family: var(--font-display);
    font-size: 2rem;
    text-shadow: 0 2px 10px rgba(212, 168, 83, 0.3);
}

.character-class {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    display: block;
    font-size: 1.1rem;
}

/* Section headers */
.character-stats,
.character-abilities,
.character-experience,
.character-run-stats {
    background: linear-gradient(135deg, rgba(30, 25, 45, 0.6), rgba(20, 18, 35, 0.7));
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--border-subtle);
}

.character-stats h4,
.character-abilities h4,
.character-experience h4,
.character-run-stats h4 {
    margin: 0 0 1.25rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: var(--font-display);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.character-stats.ability-scores h4::before { content: ''; } /* Using emoji in JSX */
.character-stats.derived-stats h4::before { content: ''; } /* Using emoji in JSX */
.character-stats:not(.ability-scores):not(.derived-stats) h4::before { content: '⚔️'; }
.character-abilities h4::before { content: '✨'; }
.character-experience h4::before { content: '📈'; }
.character-run-stats h4::before { content: '🏆'; }

/* Ability score modifier styling */
.stat-modifier {
    font-size: 0.85em;
    color: var(--accent-gold);
    margin-left: 0.25rem;
    font-weight: 600;
}

/* Grid for ability scores - more compact */
.ability-scores .stat-grid {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 600px) {
    .ability-scores .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* XP Bar in character sheet */
.xp-bar-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.character-experience .xp-bar {
    height: 20px;
    background: linear-gradient(135deg, rgba(30, 25, 45, 0.8), rgba(20, 18, 35, 0.9));
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    position: relative;
}

.character-experience .xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #9b59b6, #8e44ad, #9b59b6);
    background-size: 200% 100%;
    animation: xp-shimmer 3s ease-in-out infinite;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.5);
}

@keyframes xp-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.character-experience .xp-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    font-family: var(--font-mono);
}

.character-experience .xp-text strong {
    color: var(--accent-purple);
}

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

.stat-item {
    background: linear-gradient(135deg, rgba(40, 35, 55, 0.8), rgba(30, 25, 45, 0.9));
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
}

.stat-item:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stat-item .stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.stat-item .stat-value {
    font-size: 1.5rem;
    color: var(--accent-gold);
    font-weight: bold;
    font-family: var(--font-mono);
    text-shadow: 0 0 10px rgba(212, 168, 83, 0.3);
}

.ability-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ability-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(40, 35, 55, 0.6), rgba(30, 25, 45, 0.7));
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
}

.ability-item:hover {
    border-color: var(--accent-purple);
    transform: translateX(5px);
}

.ability-item.on-cooldown {
    opacity: 0.6;
    border-color: var(--border-subtle);
}

.ability-item .ability-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ability-item .ability-name {
    color: var(--accent-purple);
    font-weight: 600;
    font-size: 1rem;
}

.ability-item .ability-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.ability-item .ability-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.ability-item .ability-cost {
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.9rem;
}

.ability-item .ability-cd {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Old ability-item selector for backward compatibility */
.ability-item-old {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border-left: 3px solid var(--accent-purple);
    gap: 1rem;
}

.ability-item.on-cooldown {
    opacity: 0.6;
    border-left-color: var(--text-muted);
}

.ability-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.ability-name {
    color: var(--text-primary);
    font-weight: 500;
}

.ability-description {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.ability-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.ability-cost {
    color: var(--accent-blue);
    font-size: 0.875rem;
    font-weight: 500;
}

.ability-cd {
    color: var(--accent-red);
    font-size: 0.75rem;
}

.character-experience p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

/* Responsive adjustments for overlays */
@media (max-width: 768px) {
    .inventory-content {
        grid-template-columns: 1fr;
    }
    
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Event View Styles
   ========================================================================== */

.event-view {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 2rem;
    position: relative;
}

/* Mystical background effect */
.event-view::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(156, 89, 182, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(155, 89, 182, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 20% 80%, rgba(142, 68, 173, 0.1) 0%, transparent 40%);
    pointer-events: none;
    animation: mystical-pulse 4s ease-in-out infinite;
}

@keyframes mystical-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.event-container {
    background: linear-gradient(145deg, rgba(30, 25, 45, 0.95), rgba(20, 18, 35, 0.98));
    border: 2px solid rgba(156, 89, 182, 0.4);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 550px;
    width: 100%;
    text-align: center;
    animation: event-appear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 0 80px rgba(156, 89, 182, 0.3),
        0 0 40px rgba(142, 68, 173, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

/* Decorative corner accents */
.event-container::before,
.event-container::after {
    content: '✦';
    position: absolute;
    font-size: 1.5rem;
    color: rgba(156, 89, 182, 0.4);
    animation: twinkle 2s ease-in-out infinite;
}

.event-container::before {
    top: 1rem;
    left: 1rem;
}

.event-container::after {
    bottom: 1rem;
    right: 1rem;
    animation-delay: 1s;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.2); }
}

@keyframes event-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.event-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.event-icon {
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(156, 89, 182, 0.5));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.event-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--text-primary);
    text-shadow: 0 2px 10px rgba(156, 89, 182, 0.5);
    margin: 0;
}

.event-description {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border-left: 3px solid rgba(156, 89, 182, 0.5);
}

.event-description p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
}

.event-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.event-description {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.event-description p {
    margin: 0;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
}

.event-outcome {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.event-outcome::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.event-outcome.positive {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(46, 204, 113, 0.05));
    border: 1px solid rgba(46, 204, 113, 0.3);
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.15);
}

.event-outcome.positive::before {
    background: linear-gradient(180deg, #2ecc71, #27ae60);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

.event-outcome.negative {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15), rgba(231, 76, 60, 0.05));
    border: 1px solid rgba(231, 76, 60, 0.3);
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.15);
}

.event-outcome.negative::before {
    background: linear-gradient(180deg, #e74c3c, #c0392b);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.outcome-icon {
    font-size: 3rem;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    animation: outcome-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes outcome-bounce {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.outcome-details {
    flex: 1;
}

.outcome-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    font-family: var(--font-display);
    color: var(--text-primary);
}

.event-outcome.positive .outcome-name {
    color: #2ecc71;
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.event-outcome.negative .outcome-name {
    color: #e74c3c;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

.outcome-description {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.outcome-stats,
.outcome-item,
.outcome-gold,
.outcome-heal,
.outcome-damage {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    display: inline-block;
    font-weight: 600;
}

.stat-change {
    font-weight: bold;
    margin-right: 0.5rem;
}

.stat-change.positive {
    color: #2ecc71;
}

.stat-change.negative {
    color: var(--danger);
}

.outcome-item {
    color: var(--gold);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.outcome-gold {
    color: var(--gold);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.outcome-heal {
    color: var(--success);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.outcome-damage {
    color: var(--danger);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.event-hint {
    padding-top: 1rem;
    margin-bottom: 1rem;
}

.event-hint p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    animation: hint-pulse 2s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.event-actions {
    display: flex;
    justify-content: center;
}

.accept-event-btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-display);
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.accept-event-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.accept-event-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.5);
    background: linear-gradient(135deg, #a569bd, #9b59b6);
}

.accept-event-btn:hover::before {
    left: 100%;
}

.accept-event-btn:active {
    transform: translateY(-1px);
}

/* ==========================================================================
   Shop View Styles
   ========================================================================== */

.shop-view {
    padding: 2rem;
    position: relative;
    min-height: 500px;
}

/* Merchant atmosphere background */
.shop-view::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 50% 10%, rgba(46, 204, 113, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(241, 196, 15, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 60%, rgba(46, 204, 113, 0.06) 0%, transparent 35%);
    pointer-events: none;
    animation: shop-ambience 6s ease-in-out infinite;
}

@keyframes shop-ambience {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.shop-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(46, 204, 113, 0.3);
    position: relative;
    z-index: 1;
}

.shop-icon {
    font-size: 4rem;
    animation: merchant-sway 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 15px rgba(46, 204, 113, 0.4));
}

@keyframes merchant-sway {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

.shop-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--accent-green-bright);
    text-shadow: 0 2px 15px rgba(46, 204, 113, 0.5);
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold);
}

.shop-header .player-gold {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.2), rgba(241, 196, 15, 0.05));
    border: 2px solid rgba(241, 196, 15, 0.4);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.2);
}

.shop-header .gold-icon {
    font-size: 1.5rem;
    color: var(--accent-gold);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.shop-header .gold-amount {
    font-size: 1.5rem;
    color: var(--accent-gold);
    font-weight: bold;
    font-family: var(--font-mono);
}

.shop-description {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.shop-description::before,
.shop-description::after {
    content: '"';
    color: var(--accent-green);
    font-size: 1.5rem;
}

.shop-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.shop-section {
    background: linear-gradient(145deg, rgba(30, 25, 40, 0.9), rgba(20, 18, 30, 0.95));
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-medium);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.shop-section h3 {
    margin: 0 0 1.25rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shop-section h3::before {
    font-size: 1.2rem;
}

.shop-section.for-sale h3 {
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.3);
}

.shop-section.for-sale h3::before {
    content: '🛒';
}

.shop-section.for-sell h3 {
    color: var(--accent-gold);
    border-color: rgba(241, 196, 15, 0.3);
}

.shop-section.for-sell h3::before {
    content: '💰';
}

.shop-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom scrollbar for shop */
.shop-grid::-webkit-scrollbar {
    width: 6px;
}

.shop-grid::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.shop-grid::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.shop-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-green);
}

.empty-shop,
.shop-view .empty-inventory {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.shop-item {
    display: grid;
    grid-template-columns: 56px 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

/* Shine effect */
.shop-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.5s ease;
}

.shop-item:hover::before {
    left: 150%;
}

.shop-item:hover {
    transform: translateX(5px);
    border-color: var(--border-accent);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.shop-item-image {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    border: 2px solid var(--border-subtle);
    background: var(--bg-tertiary);
    padding: 4px;
}

.shop-item:hover .shop-item-image {
    transform: scale(1.1) rotate(-5deg);
    border-color: var(--accent-gold);
}

/* Rarity glow effects for shop items */
.shop-item.rarity-uncommon {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(46, 204, 113, 0.1) 100%);
}

.shop-item.rarity-rare {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(52, 152, 219, 0.1) 100%);
}

.shop-item.rarity-very_rare {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(155, 89, 182, 0.15) 100%);
}

.shop-item.rarity-legendary {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(230, 126, 34, 0.15) 100%);
    animation: legendary-shop-pulse 2s ease-in-out infinite;
}

@keyframes legendary-shop-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(230, 126, 34, 0.2); }
    50% { box-shadow: 0 0 20px rgba(230, 126, 34, 0.4); }
}

.shop-item.affordable {
    border-left: 3px solid var(--success);
}

.shop-item.too-expensive {
    border-left: 3px solid var(--danger);
    opacity: 0.7;
}

.shop-item.sellable {
    border-left: 3px solid var(--gold);
}

/* Item type colors */
.shop-item.item-weapon {
    border-left-color: var(--danger);
}

.shop-item.item-armor {
    border-left-color: var(--info);
}

.shop-item.item-accessory {
    border-left-color: var(--gold);
}

.shop-item.item-consumable {
    border-left-color: var(--success);
}

.shop-item .item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.shop-item .item-name {
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-item .item-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.shop-item .item-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 4px;
    min-width: 60px;
}

.item-price .price-amount {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--gold);
}

.item-price .price-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.item-price.sell-price {
    background: rgba(76, 175, 80, 0.1);
}

.item-price.sell-price .price-amount {
    color: var(--success);
}

.buy-btn,
.sell-btn {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.buy-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    box-shadow: 0 3px 10px rgba(46, 204, 113, 0.3);
}

.buy-btn:hover:not(.disabled) {
    background: linear-gradient(135deg, #27ae60, #229954);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.buy-btn.disabled {
    background: var(--bg-hover);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.sell-btn {
    background: linear-gradient(135deg, #f1c40f, #e67e22);
    color: #1a1a2e;
    box-shadow: 0 3px 10px rgba(241, 196, 15, 0.3);
}

.sell-btn:hover {
    background: linear-gradient(135deg, #f39c12, #d35400);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(241, 196, 15, 0.4);
}

/* Shop actions */
.shop-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.leave-shop-btn {
    padding: 1rem 2.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.leave-shop-btn:hover {
    border-color: var(--accent-green);
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Responsive shop layout */
@media (max-width: 768px) {
    .shop-content {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Puzzle View Styles
   ========================================================================== */

.puzzle-view {
    padding: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.puzzle-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.puzzle-icon {
    font-size: 2.5rem;
}

.puzzle-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--info);
}

.puzzle-attempts {
    text-align: center;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.puzzle-attempts.attempts-warning {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning);
}

.puzzle-attempts.attempts-critical {
    background: rgba(244, 67, 54, 0.2);
    color: var(--danger);
    animation: pulse 1s ease-in-out infinite;
}

.puzzle-question {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.puzzle-question p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.puzzle-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.puzzle-option {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.puzzle-option:hover {
    border-color: var(--info);
    background: var(--bg-hover);
    transform: translateX(5px);
}

.puzzle-option:active {
    transform: translateX(2px);
}

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

.skip-puzzle-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--text-muted);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.skip-puzzle-btn:hover {
    border-color: var(--warning);
    color: var(--warning);
}

/* ==========================================================================
   Treasure View Styles
   ========================================================================== */

.treasure-view {
    padding: 2rem;
    position: relative;
    min-height: 400px;
}

/* Golden shimmer background */
.treasure-view::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 50% 20%, rgba(241, 196, 15, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 70%, rgba(230, 126, 34, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 60%, rgba(241, 196, 15, 0.08) 0%, transparent 35%);
    pointer-events: none;
    animation: treasure-shimmer 5s ease-in-out infinite;
}

@keyframes treasure-shimmer {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Floating particles effect */
.treasure-view::after {
    content: '✦ ✧ ✦';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    color: rgba(241, 196, 15, 0.3);
    letter-spacing: 3rem;
    animation: float-particles 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float-particles {
    0%, 100% { 
        transform: translateX(-50%) translateY(0);
        opacity: 0.3;
    }
    50% { 
        transform: translateX(-50%) translateY(-15px);
        opacity: 0.6;
    }
}

.treasure-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.treasure-icon {
    font-size: 4rem;
    animation: treasure-bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 15px rgba(241, 196, 15, 0.5));
}

@keyframes treasure-bounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.treasure-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--accent-gold);
    text-shadow: 0 2px 15px rgba(241, 196, 15, 0.5);
    margin: 0;
}

.treasure-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
}

.treasure-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    font-style: italic;
    position: relative;
    z-index: 1;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.treasure-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold);
}

.treasure-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.interactables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.interactable-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 1.5rem;
    background: linear-gradient(145deg, rgba(30, 25, 40, 0.9), rgba(20, 18, 30, 0.95));
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

/* Shine effect on cards */
.interactable-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(241, 196, 15, 0.1), transparent);
    transition: left 0.6s ease;
}

.interactable-card.available {
    border-color: rgba(241, 196, 15, 0.5);
    cursor: pointer;
    box-shadow: 
        0 4px 20px rgba(241, 196, 15, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.interactable-card.available:hover {
    background: linear-gradient(145deg, rgba(40, 35, 55, 0.95), rgba(30, 25, 45, 0.98));
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent-gold);
    box-shadow: 
        0 12px 35px rgba(241, 196, 15, 0.25),
        0 0 30px rgba(241, 196, 15, 0.15);
}

.interactable-card.available:hover::before {
    left: 150%;
}

.interactable-card.used {
    opacity: 0.4;
    border-color: var(--border-subtle);
    filter: grayscale(0.5);
}

.interactable-card .interactable-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.interactable-card.available:hover .interactable-icon {
    transform: scale(1.15) rotate(-5deg);
    filter: drop-shadow(0 6px 15px rgba(241, 196, 15, 0.4));
}

.interactable-card .interactable-name {
    font-weight: 600;
    font-family: var(--font-display);
    color: var(--text-primary);
    font-size: 1.1rem;
}

.interact-btn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #f1c40f, #e67e22);
    border: none;
    border-radius: var(--radius-md);
    color: #1a1a2e;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.3);
}

.interact-btn:hover {
    background: linear-gradient(135deg, #f39c12, #d35400);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 196, 15, 0.4);
}

.used-label {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.no-treasures {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.leave-treasure-btn {
    display: block;
    margin: 0 auto;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.leave-treasure-btn:hover {
    border-color: var(--accent-gold);
    color: var(--text-primary);
    background: var(--bg-hover);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.interact-btn:hover {
    background: #e6c200;
    transform: scale(1.05);
}

.used-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

.no-treasures {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem;
}

.leave-treasure-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 1rem auto 0;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.leave-treasure-btn:hover {
    border-color: var(--border-accent);
    background: var(--bg-hover);
}

/* ==========================================================================
   Rest View Styles
   ========================================================================== */

.rest-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.rest-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rest-icon {
    font-size: 3rem;
    animation: flicker 2s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.98); }
}

.rest-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--accent-gold);
}

.rest-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-style: italic;
}

.rest-status {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-bar .status-label {
    width: 30px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-bar-container {
    flex: 1;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.status-bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
}

.hp-status .status-bar-fill {
    background: var(--health-fill);
}

.mana-status .status-bar-fill {
    background: var(--mana-fill);
}

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

.heal-preview {
    color: var(--accent-green-bright);
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: right;
}

.rest-info {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(80, 160, 80, 0.1);
    border: 1px solid rgba(80, 160, 80, 0.3);
    border-radius: var(--radius-md);
}

.rest-info p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.rest-info strong {
    color: var(--accent-green-bright);
}

.rest-warning {
    color: var(--accent-gold) !important;
    font-size: 0.9rem;
}

.rest-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 300px;
}

.rest-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-green), #3d8b3d);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.rest-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #5cb85c, #4cae4c);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(80, 160, 80, 0.4);
}

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

.leave-rest-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.leave-rest-btn:hover {
    border-color: var(--accent-gold);
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ==========================================================================
   Room Navigator
   ========================================================================== */

.room-navigator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 1.5rem;
    margin: 1rem 0;
}

.nav-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.nav-section-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    font-family: var(--font-display);
}

.nav-rooms-row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Room Cards */
.nav-room-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-lg);
    min-width: 140px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-room-card.selectable {
    cursor: pointer;
}

.nav-room-card.selectable:hover,
.nav-room-card.hovered {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Room type colors */
.nav-room-card.room-hostile {
    border-color: rgba(199, 80, 80, 0.5);
}
.nav-room-card.room-hostile.selectable:hover,
.nav-room-card.room-hostile.hovered {
    border-color: var(--accent-red);
    box-shadow: 0 8px 25px rgba(199, 80, 80, 0.3);
}

.nav-room-card.room-treasure {
    border-color: rgba(212, 168, 83, 0.5);
}
.nav-room-card.room-treasure.selectable:hover,
.nav-room-card.room-treasure.hovered {
    border-color: var(--accent-gold);
    box-shadow: 0 8px 25px rgba(212, 168, 83, 0.3);
}

.nav-room-card.room-shop {
    border-color: rgba(80, 160, 80, 0.5);
}
.nav-room-card.room-shop.selectable:hover,
.nav-room-card.room-shop.hovered {
    border-color: var(--accent-green);
    box-shadow: 0 8px 25px rgba(80, 160, 80, 0.3);
}

.nav-room-card.room-rest {
    border-color: rgba(80, 136, 204, 0.5);
}
.nav-room-card.room-rest.selectable:hover,
.nav-room-card.room-rest.hovered {
    border-color: var(--accent-blue);
    box-shadow: 0 8px 25px rgba(80, 136, 204, 0.3);
}

.nav-room-card.room-special {
    border-color: rgba(156, 89, 182, 0.5);
}
.nav-room-card.room-special.selectable:hover,
.nav-room-card.room-special.hovered {
    border-color: var(--accent-purple);
    box-shadow: 0 8px 25px rgba(156, 89, 182, 0.3);
}

/* Current room styling */
.nav-room-card.current {
    border-color: var(--accent-gold);
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(212, 168, 83, 0.1));
    box-shadow: 0 0 20px rgba(212, 168, 83, 0.2);
}

/* Previous room styling */
.nav-room-card.previous {
    opacity: 0.7;
    border-style: dashed;
}

/* Room card elements */
.nav-room-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.nav-room-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.nav-room-type {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

.nav-room-level {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-room-marker {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.current-marker {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

.previous-marker {
    background: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid var(--border-medium);
}

.next-marker {
    background: var(--accent-green);
    color: var(--bg-primary);
    animation: pulse 2s ease-in-out infinite;
}

/* Connection lines */
.nav-connection {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 40px;
    position: relative;
}

.connection-line {
    width: 2px;
    flex: 1;
    background: var(--border-medium);
    transition: background 0.3s ease;
}

.nav-connection.active .connection-line {
    background: var(--accent-gold);
    box-shadow: 0 0 8px rgba(212, 168, 83, 0.5);
}

.connection-arrow {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.nav-connection.active .connection-arrow {
    color: var(--accent-gold);
}

.nav-connection.down .connection-arrow {
    margin-top: -4px;
}

.nav-connection.up .connection-arrow {
    margin-bottom: -4px;
}

/* End message */
.nav-end-message {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Exploration actions */
.exploration-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Seed Display
   ========================================================================== */

.seed-display {
    position: fixed;
    bottom: var(--space-md);
    left: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(10, 10, 15, 0.9);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.seed-label {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.seed-value {
    color: var(--accent-gold);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.seed-value:hover {
    background: rgba(212, 168, 83, 0.15);
    color: var(--accent-gold-bright);
}

/* ==========================================================================
   Error Screen
   ========================================================================== */

.error-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-xl);
    background: 
        radial-gradient(circle at 50% 30%, rgba(199, 80, 80, 0.1) 0%, transparent 50%),
        var(--bg-primary);
    text-align: center;
}

.error-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--accent-red);
    margin-bottom: var(--space-lg);
}

.error-message {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: var(--space-xl);
}

.error-details {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    max-width: 800px;
    width: 100%;
    margin-bottom: var(--space-xl);
    text-align: left;
}

.error-details summary {
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 600;
    padding: var(--space-sm);
}

.error-details pre {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin: var(--space-md) 0;
}

.error-details p {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin: var(--space-xs) 0;
}

.error-actions {
    display: flex;
    gap: var(--space-md);
}

.error-btn {
    font-family: var(--font-display);
    font-size: 1rem;
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(135deg, var(--accent-red) 0%, #a03030 100%);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.error-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(199, 80, 80, 0.4);
}

/* ==========================================================================
   Tutorial Hints
   ========================================================================== */

.tutorial-hint-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: tutorialFadeIn 0.3s ease;
    backdrop-filter: blur(2px);
}

@keyframes tutorialFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.tutorial-hint {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    border: 2px solid var(--accent-gold);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 
        0 0 40px rgba(212, 168, 83, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.5);
    animation: tutorialSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

@keyframes tutorialSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Decorative corner accents */
.tutorial-hint::before,
.tutorial-hint::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid var(--accent-gold);
    opacity: 0.5;
}

.tutorial-hint::before {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.tutorial-hint::after {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

.tutorial-hint-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    animation: tutorialIconPulse 2s ease-in-out infinite;
}

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

.tutorial-hint-content {
    margin-bottom: var(--space-lg);
}

.tutorial-hint-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin: 0 0 var(--space-md) 0;
    text-shadow: 0 0 10px rgba(212, 168, 83, 0.5);
}

.tutorial-hint-message {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

.tutorial-hint-dismiss {
    font-family: var(--font-display);
    font-size: 1rem;
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(135deg, var(--accent-gold) 0%, #b08030 100%);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.tutorial-hint-dismiss:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(212, 168, 83, 0.5);
    background: linear-gradient(135deg, var(--accent-gold-bright) 0%, var(--accent-gold) 100%);
}

.tutorial-hint-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

.tutorial-hint-shortcut {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Progress dots for multi-step tutorials (future use) */
.tutorial-hint-progress {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.tutorial-hint-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s ease;
}

.tutorial-hint-dot.active {
    background: var(--accent-gold);
    box-shadow: 0 0 8px rgba(212, 168, 83, 0.5);
}

