/**
 * RPG GAME V2 - COMPLETE STYLING
 * Progressive Discovery Adventure System
 */

/* ============= GLOBAL GAME STYLES ============= */
.game-overlay,
.game-container {
    font-family: 'Georgia', serif;
    color: #fff;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes shimmer {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.9); }
}

@keyframes lampFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@keyframes genieAppear {
    0% { opacity: 0; transform: scale(0.5) translateY(100px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* ============= GAME SCENES ============= */
.game-scene {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
}

.aziza-chamber {
    background: linear-gradient(180deg, #1a0033 0%, #330066 100%);
}

.riddle-scene {
    background: linear-gradient(180deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

.vision-scene {
    background: linear-gradient(180deg, #000000 0%, #1a1a2e 50%, #16213e 100%);
}

.genie-scene {
    background: radial-gradient(circle, #667eea 0%, #764ba2 50%, #1a0033 100%);
}

.battle-scene {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1b3d 50%, #1a1a1a 100%);
}

/* ============= CHARACTER PORTRAITS ============= */
.character-portrait {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    border: 3px solid #ffd700;
    margin-bottom: 30px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    animation: fadeIn 1s;
}

.character-portrait-large {
    width: 300px;
    height: 300px;
}

/* ============= DIALOGUE BOXES ============= */
.dialogue-box {
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 40px;
    max-width: 700px;
    width: 100%;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.8s;
}

.dialogue-title {
    color: #ffd700;
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.dialogue-text {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #e0e0e0;
}

.dialogue-text.emphasis {
    color: #ffd700;
    font-style: italic;
    font-size: 1.3rem;
}

.dialogue-text.warn {
    color: #ff6b6b;
    font-weight: bold;
}

.dialogue-text .highlight {
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

/* ============= RIDDLE BOXES ============= */
.riddle-box {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 30px;
    margin: 30px 0;
    text-align: center;
}

.riddle-title {
    color: #ffd700;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.riddle-text {
    font-size: 1.3rem;
    line-height: 2;
    color: #ffd700;
    font-style: italic;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

/* ============= INPUT GROUPS ============= */
.input-group {
    margin: 25px 0;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    color: #ffd700;
    font-size: 1.1rem;
    font-weight: bold;
}

.input-group input[type="text"],
.input-group textarea {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #667eea;
    border-radius: 8px;
    color: #fff;
    font-family: 'Georgia', serif;
    transition: all 0.3s;
}

.input-group input[type="text"]:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ============= BUTTONS ============= */
.game-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-family: 'Georgia', serif;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.game-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.game-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.game-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.game-btn-secondary {
    background: rgba(102, 126, 234, 0.3);
    color: white;
    border: 2px solid #667eea;
}

.game-btn-secondary:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

.game-btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
    color: white;
}

.game-btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.6);
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ============= HINT BOXES ============= */
.hint-box {
    background: rgba(102, 126, 234, 0.2);
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.hint-box.special {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
}

.hint-box h3 {
    color: #ffd700;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.hint-box p {
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.8;
}

.hint-text-large {
    font-size: 1.3rem;
    color: #ffd700;
    font-style: italic;
    line-height: 2;
}

/* ============= RESULT BOXES ============= */
.result-box {
    margin-top: 25px;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    animation: fadeIn 0.5s;
}

.result-box.success {
    background: rgba(76, 175, 80, 0.2);
    border: 2px solid #4CAF50;
}

.result-box.error {
    background: rgba(244, 67, 54, 0.2);
    border: 2px solid #f44336;
}

.result-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.result-box.success .result-title {
    color: #4CAF50;
}

.result-box.error .result-title {
    color: #f44336;
}

/* ============= VISION SCENES ============= */
.vision-overlay {
    width: 100%;
    max-width: 900px;
    animation: fadeIn 1.5s;
}

.vision-title {
    font-size: 3.5rem;
    color: #ffd700;
    text-align: center;
    margin-bottom: 40px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    animation: pulse 2s infinite;
}

.vision-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.vision-image {
    width: 100%;
    max-width: 600px;
    border-radius: 15px;
    border: 3px solid #ffd700;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
    margin: 0 auto;
}

/* ============= GENIE INTERFACE ============= */
.genie-interface,
.genie-entrance,
.genie-limit {
    width: 100%;
    max-width: 800px;
    animation: genieAppear 1s;
}

.genie-title {
    font-size: 3rem;
    color: #ffd700;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 0 40px rgba(255, 215, 0, 1);
    animation: pulse 3s infinite;
}

.genie-box {
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #ffd700;
}

.genie-speech {
    font-size: 1.4rem;
    color: #ffd700;
    font-style: italic;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.questions-remaining {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    margin-bottom: 30px;
}

.questions-remaining p {
    color: #fff;
    font-size: 1.2rem;
    margin: 0;
}

.questions-remaining strong {
    color: #ffd700;
    font-size: 1.5rem;
}

.genie-response {
    min-height: 100px;
    margin-bottom: 20px;
}

.genie-answer {
    background: rgba(102, 126, 234, 0.2);
    border-left: 4px solid #ffd700;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    animation: fadeIn 0.8s;
}

/* ============= LAMP ELEMENTS ============= */
.lamp-discover-title {
    font-size: 3rem;
    color: #ffd700;
    margin-bottom: 30px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    animation: pulse 2s infinite;
}

.lamp-image-large {
    width: 300px;
    height: auto;
    margin: 30px auto;
    display: block;
    filter: drop-shadow(0 0 40px #ffd700);
    animation: lampFloat 3s ease-in-out infinite;
}

#floating-lamp {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    font-size: 40px;
    cursor: pointer;
    z-index: 99999;
    animation: lampFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    transition: transform 0.3s;
}

#floating-lamp:hover {
    transform: scale(1.2) rotate(10deg);
}

/* ============= BATTLE SYSTEM ============= */
.battle-arena {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.battle-header {
    text-align: center;
    margin-bottom: 40px;
}

.battle-title {
    font-size: 3rem;
    color: #ffd700;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.battle-subtitle {
    font-size: 1.3rem;
    color: #e0e0e0;
}

.battle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.combatant {
    background: rgba(0, 0, 0, 0.7);
    border: 3px solid;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
}

.combatant.player {
    border-color: #4CAF50;
}

.combatant.enemy {
    border-color: #f44336;
}

.combatant-name {
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: bold;
}

.combatant.player .combatant-name {
    color: #4CAF50;
}

.combatant.enemy .combatant-name {
    color: #f44336;
}

.combatant-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    margin: 20px auto;
    border: 3px solid;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.combatant.player .combatant-image {
    border-color: #4CAF50;
}

.combatant.enemy .combatant-image {
    border-color: #f44336;
}

.health-bar-container {
    margin: 20px 0;
}

.health-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.health-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid;
}

.combatant.player .health-bar {
    border-color: #4CAF50;
}

.combatant.enemy .health-bar {
    border-color: #f44336;
}

.health-fill {
    height: 100%;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
}

.combatant.enemy .health-fill {
    background: linear-gradient(90deg, #f44336 0%, #ff6b6b 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
    text-align: left;
}

.stat {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.stat-label {
    color: #999;
    font-size: 0.9rem;
}

.stat-value {
    color: #ffd700;
    font-size: 1.2rem;
    font-weight: bold;
}

.battle-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 30px;
}

.action-btn {
    padding: 20px;
    font-size: 1.2rem;
    border: 2px solid;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Georgia', serif;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.action-btn.attack {
    border-color: #f44336;
}

.action-btn.attack:hover:not(:disabled) {
    background: rgba(244, 67, 54, 0.3);
}

.action-btn.defend {
    border-color: #2196F3;
}

.action-btn.defend:hover:not(:disabled) {
    background: rgba(33, 150, 243, 0.3);
}

.action-btn.special {
    border-color: #ffd700;
}

.action-btn.special:hover:not(:disabled) {
    background: rgba(255, 215, 0, 0.3);
}

.action-btn.flee {
    border-color: #9E9E9E;
}

.action-btn.flee:hover:not(:disabled) {
    background: rgba(158, 158, 158, 0.3);
}

.action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.battle-log {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 20px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 30px;
}

.battle-log-title {
    color: #ffd700;
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.log-entry {
    padding: 8px;
    margin: 5px 0;
    border-radius: 5px;
    font-size: 1rem;
    animation: fadeIn 0.5s;
}

.log-entry.player-action {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.log-entry.enemy-action {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.log-entry.system {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

/* ============= VICTORY/DEFEAT SCREENS ============= */
.battle-result {
    text-align: center;
    animation: fadeIn 1s;
}

.result-icon {
    font-size: 6rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.result-message {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.battle-result.victory .result-message {
    color: #4CAF50;
}

.battle-result.defeat .result-message {
    color: #f44336;
}

.rewards-box {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 30px;
    margin: 30px auto;
    max-width: 500px;
}

.rewards-title {
    color: #ffd700;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.reward-list {
    list-style: none;
    padding: 0;
}

.reward-item {
    font-size: 1.2rem;
    padding: 10px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* ============= DR. CRANIUM & CTHULHU ============= */
.cranium-lab {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a3a1a 50%, #0a0a0a 100%);
}

.cthulhu-chamber {
    background: linear-gradient(180deg, #000000 0%, #0d1b2a 50%, #1b263b 100%);
}

.boss-portrait {
    width: 400px;
    height: 400px;
    object-fit: cover;
    border-radius: 20px;
    border: 4px solid #f44336;
    margin: 30px auto;
    display: block;
    box-shadow: 0 0 60px rgba(244, 67, 54, 0.8);
    animation: pulse 3s infinite;
}

/* ============= RESPONSIVE DESIGN ============= */
@media (max-width: 768px) {
    .dialogue-box {
        padding: 25px;
    }

    .dialogue-title {
        font-size: 1.5rem;
    }

    .dialogue-text {
        font-size: 1rem;
    }

    .riddle-title {
        font-size: 2rem;
    }

    .riddle-text {
        font-size: 1.1rem;
    }

    .game-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .battle-grid {
        grid-template-columns: 1fr;
    }

    .battle-actions {
        grid-template-columns: 1fr;
    }

    .character-portrait {
        width: 150px;
        height: 150px;
    }

    #floating-lamp {
        width: 50px;
        height: 50px;
        font-size: 30px;
        bottom: 20px;
        right: 20px;
    }

    .vision-title,
    .genie-title,
    .battle-title {
        font-size: 2rem;
    }
}

/* ============= ACCESSIBILITY ============= */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.game-btn:focus,
input:focus,
textarea:focus {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}
