:root {
    --bg: #1a1a2e;
    --card: #16213e;
    --accent: #0f3460;
    --text: #e9ecef;
    --text-dim: #adb5bd;
    --danger: #e63946;
    --warning: #f77f00;
    --success: #06ffa5;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    line-height: 1.6;
    overflow: hidden;
}

.container {
    max-width: 1400px;
    width: 100%;
    max-height: 100vh;
    overflow: hidden;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--success);
    text-shadow: 0 0 20px rgba(6, 255, 165, 0.3);
}

.subtitle {
    color: var(--text-dim);
    font-size: 1.1rem;
    font-style: italic;
}

.mode-select {
    background: var(--card);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.mode-select h2 {
    margin-bottom: 30px;
    font-size: 2rem;
}

.mode-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.mode-btn {
    background: var(--accent);
    border: 2px solid transparent;
    padding: 30px 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: var(--card);
    border-color: var(--success);
    transform: translateY(-5px);
}

.mode-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.mode-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.mode-desc {
    color: var(--text-dim);
    font-size: 0.95rem;
}

#game-screen, #result-screen {
    background: var(--card);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-height: 85vh;
    overflow-y: auto;
}

#result-screen::-webkit-scrollbar {
    width: 8px;
}

#result-screen::-webkit-scrollbar-track {
    background: var(--accent);
    border-radius: 4px;
}

#result-screen::-webkit-scrollbar-thumb {
    background: var(--success);
    border-radius: 4px;
}

#result-screen::-webkit-scrollbar-thumb:hover {
    background: var(--text);
}

.game-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
    max-height: calc(85vh - 60px);
}

.game-left {
    min-height: 0;
    max-height: calc(85vh - 60px);
    overflow-y: auto;
    padding-right: 10px;
    padding-bottom: 40px;
}

.game-left::-webkit-scrollbar {
    width: 8px;
}

.game-left::-webkit-scrollbar-track {
    background: var(--accent);
    border-radius: 4px;
}

.game-left::-webkit-scrollbar-thumb {
    background: var(--success);
    border-radius: 4px;
}

.game-left::-webkit-scrollbar-thumb:hover {
    background: var(--text);
}

.game-right {
    position: sticky;
    top: 0;
    max-height: calc(85vh - 60px);
    overflow-y: auto;
}

#progress-bar {
    background: var(--accent);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

#progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--success);
    width: 10%;
    transition: width 0.3s ease;
    opacity: 0.3;
}

#progress-text {
    position: relative;
    z-index: 1;
    font-weight: bold;
}

#sanity-meter {
    margin-bottom: 30px;
}

.meter-label {
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-dim);
}

.meter-bar {
    background: var(--accent);
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

#sanity-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--danger), var(--warning), var(--success));
    width: 100%;
    transition: width 0.5s ease;
}

#sanity-text {
    display: inline-block;
    margin-top: 5px;
    font-weight: bold;
    color: var(--success);
}

.meters-container {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.meter-group {
    background: var(--accent);
    padding: 15px;
    border-radius: 10px;
}

.meter-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.stress-meter {
    background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
}

.anger-meter {
    background: linear-gradient(90deg, var(--warning), var(--danger));
}

.meter-value {
    display: inline-block;
    margin-top: 5px;
    font-weight: bold;
}

#battle-score {
    background: var(--accent);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.score-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    text-align: center;
}

.score-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.score-label {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--success);
}

#battle-roast {
    margin-bottom: 20px;
}

#question-container {
    margin-bottom: 30px;
}

#question-text {
    font-size: 1.3rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

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

.choice-btn {
    background: var(--accent);
    color: var(--text);
    border: 2px solid transparent;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
}

.choice-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.choice-text {
    font-size: 1rem;
}

.choice-stats {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-dim);
    flex-wrap: wrap;
}

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

.stat-positive {
    color: var(--success);
}

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

.stat-neutral {
    color: var(--warning);
}

.choice-btn.battle-choice {
    padding: 15px 20px;
}

.choice-btn.battle-choice .choice-content {
    gap: 0;
}

.choice-btn.battle-choice .choice-stats {
    display: none;
}

.choice-btn:hover {
    background: var(--card);
    border-color: var(--success);
    transform: translateX(10px);
}

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

#response-container {
    margin-top: 30px;
}

.advisor-response {
    background: var(--accent);
    border-left: 4px solid var(--danger);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

#response-box {
    background: var(--accent);
    border-left: 4px solid var(--danger);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

#response-box.player-response {
    background: rgba(6, 255, 165, 0.15);
    border-left: 4px solid var(--success);
}

#response-text {
    font-size: 1.2rem;
    line-height: 1.6;
    font-style: italic;
}

button {
    background: var(--success);
    color: var(--bg);
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(6, 255, 165, 0.4);
}

button:active {
    transform: translateY(0);
}

.hidden {
    display: none;
}

#result-screen h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-align: center;
    color: var(--danger);
}

#final-diagnosis {
    background: var(--accent);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 1.3rem;
    line-height: 1.8;
    border-left: 4px solid var(--danger);
}

#final-score {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--text-dim);
}

#restart-btn, #quit-btn {
    margin: 10px;
}

#quit-btn {
    background: var(--danger);
}

#quit-btn {
    background: var(--danger);
}

#roast-counter {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-dim);
}

#roast-count {
    color: var(--success);
    font-weight: bold;
    font-size: 1.5rem;
}

#reaction-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.reaction-btn {
    background: var(--accent);
    color: var(--text);
    padding: 12px;
    font-size: 1rem;
    border-radius: 8px;
}

.reaction-btn:hover {
    background: var(--card);
    border: 2px solid var(--success);
}

.reaction-btn.selected {
    background: var(--success);
    color: var(--bg);
    border: 2px solid var(--success);
}

#achievements {
    background: var(--accent);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.achievement {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin: 5px 0;
    background: var(--card);
    border-radius: 8px;
    border-left: 3px solid var(--success);
}

.achievement-icon {
    font-size: 1.5rem;
}

.achievement-text {
    flex: 1;
}

.achievement-title {
    font-weight: bold;
    color: var(--success);
}

.achievement-desc {
    font-size: 0.9rem;
    color: var(--text-dim);
}

#share-section {
    text-align: center;
    margin-bottom: 20px;
}

#share-btn {
    background: var(--warning);
    color: var(--bg);
}

#share-btn {
    background: var(--warning);
    color: var(--bg);
}

.recovery-prompt {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: var(--success);
}

#recovery-container {
    margin-top: 30px;
}

@media (max-width: 1024px) {
    .game-layout {
        grid-template-columns: 1fr;
    }
    
    .game-right {
        position: relative;
    }
    
    .meters-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }
    
    #game-screen, #result-screen {
        padding: 20px;
        max-height: 90vh;
    }
    
    #question-text {
        font-size: 1.1rem;
    }
    
    .choice-btn {
        font-size: 0.95rem;
        padding: 12px 15px;
    }
    
    .meters-container {
        grid-template-columns: 1fr;
    }
}
