/* layout.css - Structural layout and sizing */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Fixed game container sizing */
.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Use full viewport height */
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Set specific heights for components to prevent overflow */
.game-header {
    flex: 0 0 auto; /* Don't grow or shrink */
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.stats {
    display: flex;
    gap: 20px;
}

/* WSV Controls Structure */
.wsv-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wsv-label {
    display: flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.tooltip-container {
    position: relative;
}

.tooltip {
    position: absolute;
    z-index: 100;
    display: none;
    width: 550px;
    border-radius: 8px;
    padding: 15px;
}

.tooltip-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.tooltip-section {
    padding: 10px;
    border-radius: 5px;
}

/* Monster Area Layout */
.monster-area {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 10px;
}

.monster-name {
    position: relative; /* Changed from absolute */
    margin-bottom: 5px;
    text-align: center;
    width: 100%;
    top: auto;
    left: auto;
    right: auto;
}

.monster {
    position: relative;
    width: 200px;
    height: 140px; /* Fits better */
    transition: transform 0.2s ease;
}

.monster img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.health-bar {
    position: relative; /* Changed from absolute */
    bottom: auto;
    left: auto;
    transform: none;
    width: 80%;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.health-fill {
    height: 100%;
    width: 100%;
    transition: width 0.3s ease;
}

/* Damage text positioning */
.damage-text {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    z-index: 10;
    pointer-events: none;
}

.multiplier-text {
    margin-top: 2px;
    white-space: nowrap;
}

/* Typing area layout */
.typing-area {
    flex: 1 1 auto; /* Fill remaining space but allow shrinking */
    min-height: 150px;
    max-height: calc(100vh - 400px);
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.typing-input {
    width: 100%;
    flex: 1;
    padding: 15px;
    border: none;
    outline: none;
    resize: none;
    overflow-y: auto;
}

/* Special Effect Positioning */
.special-effect {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
}

/* Bottom bar - completely hidden */
.bottom-bar {
    display: none;
}

/* Milestone progress (hidden) */
.word-milestone-progress {
    display: none; /* Hide as we're not using it anymore */
}

.word-milestone-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.word-count-display {
    display: none; /* Hide as we're not using it anymore */
}

/* Milestone text positioning */
.milestone-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    z-index: 10;
    pointer-events: none;
    text-align: center;
}

/* Bonus Panel Layout */
.bonus-panel {
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px;
    flex: 0 0 auto;
}

.bonus-panel-header {
    text-align: center;
    margin-bottom: 8px;
}

.bonus-items {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.bonus-item {
    flex: 1;
    border-radius: 5px;
    padding: 8px;
}

.bonus-name {
    margin-bottom: 5px;
}

.bonus-value {
    margin-bottom: 5px;
    text-align: center;
}

.bonus-info {
    text-align: center;
    margin-bottom: 5px;
}

.total-words {
    text-align: center;
    margin-top: 2px;
    margin-bottom: 5px;
}

.bonus-bar {
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.bonus-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
}

/* Large Milestone Notification Layout */
.milestone-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    border-radius: 10px;
    padding: 20px;
}

.milestone-notification-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.milestone-notification-icon {
    margin-bottom: 10px;
}

.milestone-notification-title {
    margin-bottom: 5px;
}

/* Debug info */
#debug-info {
    position: fixed;
    bottom: 10px;
    right: 10px;
    padding: 5px;
    border-radius: 5px;
    max-width: 300px;
    display: none;
}

/* Responsive layouts */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .stats {
        margin-top: 5px;
        width: 100%;
        justify-content: space-between;
    }
    
    .tooltip {
        width: 300px;
    }
    
    .tooltip-grid {
        grid-template-columns: 1fr;
    }
    
    .monster-area {
        flex: 0 0 180px; /* Smaller on mobile */
    }
    
    .typing-area {
        max-height: calc(100vh - 350px);
    }
    
    .bonus-items {
        flex-direction: column;
        gap: 10px;
    }
}