* {
    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%);
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

#game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

.screen {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    display: block;
}

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

#start-screen {
    text-align: center;
    padding-top: 150px;
}

#start-screen h1 {
    font-size: 4em;
    color: #f39c12;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
    letter-spacing: 5px;
}

.subtitle {
    font-size: 1.5em;
    color: #95a5a6;
    margin-bottom: 50px;
    font-style: italic;
}

.start-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

button {
    cursor: pointer;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn-primary {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

#character-creation {
    padding: 40px;
}

#character-creation h2 {
    text-align: center;
    font-size: 2.5em;
    color: #f39c12;
    margin-bottom: 30px;
}

.creation-form {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #f39c12;
}

.form-group input {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #e0e0e0;
}

.class-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.class-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.class-image {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    border-radius: 50%;
    border: 2px solid rgba(243, 156, 18, 0.3);
}

.class-btn:hover {
    background: rgba(243, 156, 18, 0.1);
    border-color: #f39c12;
    transform: translateY(-3px);
}

.class-btn h3 {
    color: #f39c12;
    margin-bottom: 8px;
}

.class-btn p {
    color: #95a5a6;
    font-size: 0.9em;
}

.attribute-section {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.attribute-section h3 {
    color: #f39c12;
    margin-bottom: 15px;
}

.attribute-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.attribute-item button {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    padding: 0;
    font-size: 1.3em;
}

.attribute-item button:hover {
    background: #f39c12;
    color: white;
}

.attribute-item span {
    font-size: 1.1em;
}

#game-screen {
    display: none;
}

#game-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-info {
    display: flex;
    gap: 20px;
    font-size: 1.1em;
}

.player-info #player-name {
    color: #f39c12;
    font-weight: bold;
}

.bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    margin: 0 30px;
}

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

.bar-container label {
    min-width: 60px;
    font-size: 0.9em;
}

.bar {
    flex: 1;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.health-bar div {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
    transition: width 0.3s ease;
}

.exp-bar div {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    transition: width 0.3s ease;
}

.game-controls {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    padding: 10px 15px;
    font-size: 0.95em;
}

.btn-icon:hover {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

#game-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

#map-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
}

#game-map {
    width: 100%;
    height: 500px;
    background: #0f0f23;
    border-radius: 5px;
    border: 2px solid rgba(243, 156, 18, 0.3);
}

#location-info {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

#location-info h3 {
    color: #f39c12;
    margin-bottom: 8px;
}

#location-info p {
    color: #95a5a6;
    line-height: 1.6;
}

#action-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
}

#action-panel h3 {
    color: #f39c12;
    margin-bottom: 15px;
    text-align: center;
}

.action-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    margin-bottom: 10px;
    text-align: left;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn:hover {
    background: rgba(243, 156, 18, 0.1);
    border-color: #f39c12;
    color: #f39c12;
}

#game-log {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

#game-log h3 {
    color: #f39c12;
    margin-bottom: 10px;
}

#log-content {
    font-size: 0.95em;
    line-height: 1.8;
}

.log-entry {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

#combat-screen {
    padding: 40px;
}

#combat-arena {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 30px;
    padding: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.combatant {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    min-width: 250px;
}

.combat-image {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    border-radius: 50%;
    border: 3px solid #f39c12;
    background-size: cover;
    background-position: center;
    background-color: rgba(243, 156, 18, 0.2);
}

.combatant h3 {
    color: #f39c12;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.combat-stats {
    margin-top: 10px;
}

.combat-stats .bar {
    margin: 10px 0;
}

.enemy-bar div {
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
}

.combat-vs {
    font-size: 2em;
    color: #f39c12;
    font-weight: bold;
}

#combat-log {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 150px;
    overflow-y: auto;
}

#combat-log h3 {
    color: #f39c12;
    margin-bottom: 10px;
}

#combat-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.combat-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    padding: 15px 25px;
    font-size: 1.1em;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.combat-btn:hover {
    background: rgba(243, 156, 18, 0.2);
    border-color: #f39c12;
    color: #f39c12;
    transform: translateY(-2px);
}

.combat-btn.retreat {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
    color: #e74c3c;
}

#dialog-screen {
    padding: 40px;
}

#dialog-portrait {
    text-align: center;
    margin-bottom: 30px;
}

#portrait-image {
    width: 150px;
    height: 150px;
    margin: 0 auto 15px;
    background: rgba(243, 156, 18, 0.2);
    border-radius: 50%;
    border: 3px solid #f39c12;
}

#speaker-name {
    color: #f39c12;
    font-size: 1.5em;
}

#dialog-content {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
}

#dialog-text {
    font-size: 1.2em;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #e0e0e0;
}

#dialog-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#dialog-choices button {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    text-align: left;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#dialog-choices button:hover {
    background: rgba(243, 156, 18, 0.1);
    border-color: #f39c12;
    color: #f39c12;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease-in;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 2px solid rgba(243, 156, 18, 0.3);
    position: relative;
}

.modal-content h2 {
    color: #f39c12;
    margin-bottom: 20px;
    text-align: center;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
}

.close:hover {
    color: #f39c12;
}

#inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.inventory-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.inventory-item:hover {
    background: rgba(243, 156, 18, 0.1);
    border-color: #f39c12;
}

#stats-display {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
}

.stat-item span:first-child {
    color: #95a5a6;
}

.stat-item span:last-child {
    color: #f39c12;
    font-weight: bold;
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(243, 156, 18, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(243, 156, 18, 0.7);
}

@media (max-width: 768px) {
    #game-main {
        grid-template-columns: 1fr;
    }

    .class-options {
        grid-template-columns: 1fr;
    }

    #game-header {
        flex-direction: column;
        gap: 15px;
    }

    .bars {
        margin: 0;
        width: 100%;
    }

    .game-controls {
        width: 100%;
        justify-content: center;
    }

    #combat-arena {
        flex-direction: column;
        gap: 20px;
    }

    #combat-actions {
        flex-direction: column;
    }

    .combat-btn {
        width: 100%;
    }
}
