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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

/* Character Creation Screen */
.character-creation {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.character-creation h1 {
    font-size: 2.5rem;
    color: #ffd700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.character-creation h2 {
    font-size: 1.5rem;
    color: #aaa;
    margin-bottom: 30px;
}

.class-selection {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.class-card {
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid #444;
    border-radius: 15px;
    padding: 25px 20px;
    width: 250px;
    cursor: pointer;
    text-align: center;
}

.class-card:hover {
    border-color: #ffd700;
    background: rgba(50, 50, 80, 0.6);
    transform: translateY(-5px);
}

.class-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 10px;
}

.class-card h3 {
    font-size: 1.5rem;
    color: #ffd700;
    margin-bottom: 15px;
}

.class-stats {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    text-align: left;
}

.class-stats p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.stat-high {
    color: #4eff4e;
    font-weight: bold;
}

.stat-mid {
    color: #ffff4e;
    font-weight: bold;
}

.stat-low {
    color: #ff6b6b;
    font-weight: bold;
}

.class-desc {
    font-size: 0.85rem;
    color: #bbb;
    margin-bottom: 15px;
    line-height: 1.4;
}

.class-ability {
    background: rgba(100, 50, 150, 0.3);
    border: 1px solid #8855aa;
    border-radius: 5px;
    padding: 8px;
    font-size: 0.85rem;
    color: #dda0dd;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Stats Bar */
.stats-bar {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    border: 2px solid #444;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.player-avatar {
    font-size: 2rem;
}

.player-name {
    font-size: 1.2rem;
    font-weight: bold;
}

.gold {
    margin-left: auto;
    font-size: 1.1rem;
    color: #ffd700;
}

.stat-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.combat-stats {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    justify-content: center;
}

.combat-stat {
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 1rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat label {
    width: 70px;
    font-size: 0.9rem;
}

.bar-container {
    flex: 1;
    height: 20px;
    background: #333;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid #555;
}

.bar {
    height: 100%;
    border-radius: 10px;
}

.health-bar {
    background: linear-gradient(90deg, #ff4444, #ff6b6b);
    width: 100%;
}

.mana-bar {
    background: linear-gradient(90deg, #4466ff, #66aaff);
    width: 100%;
}

.exp-bar {
    background: linear-gradient(90deg, #4444ff, #6b6bff);
    width: 0%;
}

.bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

/* Game Area */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.location {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 20px;
    min-height: 300px;
    border: 2px solid #444;
}

.location-header {
    text-align: center;
    margin-bottom: 20px;
}

.location-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 10px;
}

.location-title {
    font-size: 1.5rem;
    color: #ffd700;
}

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

.location-description {
    margin-bottom: 20px;
    color: #ccc;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.action-btn {
    background: linear-gradient(180deg, #4a4a6a, #3a3a5a);
    border: 2px solid #666;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: linear-gradient(180deg, #5a5a7a, #4a4a6a);
    border-color: #888;
}

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

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

.action-btn.ability-btn {
    background: linear-gradient(180deg, #6a4a8a, #5a3a7a);
    border-color: #8866aa;
}

.action-btn.ability-btn:hover:not(.disabled) {
    background: linear-gradient(180deg, #7a5a9a, #6a4a8a);
    border-color: #aa88cc;
}

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

.training-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.training-buttons .action-btn {
    padding: 15px 20px;
    font-size: 1.1rem;
}

/* Shop Items */
.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.shop-item {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #555;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.shop-item-icon {
    font-size: 2rem;
}

.shop-item-name {
    font-weight: bold;
    margin: 5px 0;
}

.shop-item-desc {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 10px;
}

.shop-item-price {
    color: #ffd700;
    margin-bottom: 10px;
}

.buy-btn {
    background: linear-gradient(180deg, #228b22, #1a6b1a);
    border: 2px solid #2a9b2a;
    color: #fff;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
}

.buy-btn:hover {
    background: linear-gradient(180deg, #2a9b2a, #228b22);
}

.buy-btn:disabled {
    background: #444;
    border-color: #555;
    cursor: not-allowed;
}

/* Combat Area */
.combat-area {
    text-align: center;
}

.enemies-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.enemy-display {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #555;
    border-radius: 10px;
    padding: 10px;
    min-width: 100px;
    cursor: pointer;
}

.enemy-display:hover:not(.dead) {
    border-color: #888;
}

.enemy-display.selected {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.enemy-display.dead {
    opacity: 0.4;
    cursor: default;
}

.enemy-icon {
    font-size: 3rem;
    display: block;
}

.enemy-name {
    font-size: 1rem;
    color: #ff6b6b;
    margin: 5px 0;
}

.enemy-hp-bar {
    width: 80px;
    height: 10px;
    background: #333;
    border-radius: 5px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #555;
}

.enemy-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff6b6b);
}

/* Message Log */
.message-log {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 15px;
    height: 120px;
    overflow-y: auto;
    border: 2px solid #444;
}

.message-log p {
    margin-bottom: 5px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.message-damage {
    color: #ff6b6b;
}

.message-heal {
    color: #6bff6b;
}

.message-gold {
    color: #ffd700;
}

.message-exp {
    color: #6b6bff;
}

.message-level {
    color: #ff6bff;
    font-weight: bold;
}

/* Navigation */
.navigation {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-btn {
    background: linear-gradient(180deg, #2a4a6a, #1a3a5a);
    border: 2px solid #3a5a7a;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    background: linear-gradient(180deg, #3a5a7a, #2a4a6a);
    border-color: #4a6a8a;
}

/* Inventory */
.inventory-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 40, 0.98);
    border: 3px solid #666;
    border-radius: 15px;
    padding: 20px;
    z-index: 100;
    min-width: 300px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.inventory-panel.open {
    display: block;
}

.inventory-panel h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #ffd700;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.inventory-slot {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #444;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    position: relative;
}

.inventory-slot:hover {
    border-color: #888;
    background: rgba(50, 50, 80, 0.5);
}

.inventory-slot .item-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 1px 4px;
    border-radius: 3px;
}

.inventory-slot.empty {
    opacity: 0.5;
    cursor: default;
}

.close-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: #444;
    border: 2px solid #666;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
}

.close-btn:hover {
    background: #555;
}

.inventory-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    background: linear-gradient(180deg, #4a4a6a, #3a3a5a);
    border: 2px solid #666;
    border-radius: 50%;
    cursor: pointer;
}

.inventory-toggle:hover {
    background: linear-gradient(180deg, #5a5a7a, #4a4a6a);
}

.save-toggle {
    position: fixed;
    bottom: 20px;
    right: 80px;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    background: linear-gradient(180deg, #4a4a6a, #3a3a5a);
    border: 2px solid #666;
    border-radius: 50%;
    cursor: pointer;
}

.save-toggle:hover {
    background: linear-gradient(180deg, #5a5a7a, #4a4a6a);
}

/* Continue Section */
.continue-section {
    background: rgba(0, 100, 0, 0.3);
    border: 2px solid #4a4;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.continue-btn {
    background: linear-gradient(180deg, #2a6a2a, #1a5a1a);
    border: 2px solid #4a8a4a;
    color: #fff;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 1.3rem;
    cursor: pointer;
    margin-bottom: 10px;
}

.continue-btn:hover {
    background: linear-gradient(180deg, #3a7a3a, #2a6a2a);
}

.save-info {
    color: #aaa;
    font-size: 0.9rem;
    margin: 10px 0;
}

.new-game-btn {
    background: transparent;
    border: 1px solid #666;
    color: #888;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
}

.new-game-btn:hover {
    border-color: #f66;
    color: #f66;
}

/* Item tooltip */
.item-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #888;
    border-radius: 8px;
    padding: 10px;
    z-index: 200;
    max-width: 200px;
}

.item-tooltip h4 {
    color: #ffd700;
    margin-bottom: 5px;
}

.item-tooltip p {
    font-size: 0.85rem;
    color: #ccc;
}

.use-btn {
    margin-top: 8px;
    width: 100%;
    padding: 6px;
    background: #228b22;
    border: none;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.use-btn:hover {
    background: #2a9b2a;
}

/* Level up display */
.level-display {
    font-size: 0.9rem;
    color: #aaa;
    margin-left: 10px;
}

/* Responsive */
@media (max-width: 600px) {
    .stat-bars {
        font-size: 0.8rem;
    }

    .stat label {
        width: 50px;
    }

    .nav-btn {
        padding: 10px 15px;
        font-size: 1rem;
    }

    .inventory-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
