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

body {
    background-color: black;
    color: white;
    font-family: Arial, sans-serif;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

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

/* Typography */
.main-title {
    font-size: 4rem;
    font-weight: bold;
    color: #ef4444;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.25rem;
    color: white;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.screen-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #22c55e;
    margin-bottom: 0.5rem;
}

.screen-subtitle {
    color: white;
    margin-bottom: 2rem;
}

.day-phase {
    font-size: 1.25rem;
    font-weight: bold;
    color: #facc15;
    margin-bottom: 2rem;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger, .btn-warning, .btn-success {
    padding: 1rem 2rem;
    font-size: 1.25rem;
    font-weight: bold;
    border: 4px solid white;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: #22c55e;
    color: white;
}

.btn-secondary:hover {
    background-color: #16a34a;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-danger:disabled {
    background-color: #6b7280;
    cursor: not-allowed;
}

.btn-warning {
    background-color: #ea580c;
    color: white;
    width: 100%;
    margin-top: 1rem;
}

.btn-warning:hover {
    background-color: #c2410c;
}

.btn-success {
    background-color: #16a34a;
    color: white;
}

.btn-success:hover {
    background-color: #15803d;
}

/* Character Creation Layout */
.creation-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .creation-layout {
        grid-template-columns: 1fr;
    }
}

.character-form, .character-roster {
    background-color: rgba(55, 65, 81, 0.5);
    border: 1px solid #374151;
    border-radius: 1rem;
    padding: 1.5rem;
}

.character-form h2, .character-roster h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #d1d5db;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
}

.form-group input::placeholder {
    color: #9ca3af;
}

/* Stats Section */
.stats-section {
    margin: 1.5rem 0;
}

.stats-section h3 {
    color: #e5e7eb;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.stat-group {
    margin-bottom: 1rem;
}

.stat-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.stat-group span {
    font-weight: bold;
    color: #60a5fa;
}

.stat-group input[type="range"] {
    width: 100%;
    height: 0.5rem;
    background-color: #374151;
    outline: none;
    border-radius: 0.25rem;
}

/* Character List */
.character-list {
    min-height: 300px;
    margin-bottom: 1.5rem;
}

.empty-state {
    text-align: center;
    color: #9ca3af;
    padding: 2rem;
}

.character-card {
    background-color: rgba(75, 85, 99, 0.5);
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.character-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.character-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #60a5fa;
}

.delete-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
}

.delete-btn:hover {
    color: #fca5a5;
}

.character-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
}

.stat-value {
    font-weight: 600;
}

.stat-label {
    color: #9ca3af;
}

.character-personality {
    text-align: center;
}

.personality-badge {
    display: inline-block;
    background-color: rgba(147, 51, 234, 0.3);
    color: #c084fc;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
}

/* Roster Controls */
.roster-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.character-count {
    text-align: center;
    font-size: 0.875rem;
    color: white;
}

.save-indicator {
    text-align: center;
    font-size: 0.75rem;
    color: #22c55e;
}

/* Simulation Layout */
.simulation-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .simulation-layout {
        grid-template-columns: 1fr;
    }
}

.battle-log-section, .character-status-section {
    background-color: rgba(55, 65, 81, 0.5);
    border: 1px solid #374151;
    border-radius: 1rem;
    padding: 1.5rem;
}

.battle-log-section h2, .character-status-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Battle Log */
.battle-log {
    background-color: rgba(17, 24, 39, 0.5);
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 1rem;
    height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.battle-log::-webkit-scrollbar {
    width: 6px;
}

.battle-log::-webkit-scrollbar-track {
    background: #4b5563;
    border-radius: 3px;
}

.battle-log::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 3px;
}

.battle-log::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.event-entry {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: rgba(75, 85, 99, 0.3);
    border-left: 4px solid;
}

.event-combat {
    border-left-color: #ef4444;
}

.event-exploration {
    border-left-color: #3b82f6;
}

.event-rest {
    border-left-color: #22c55e;
}

.event-death {
    border-left-color: #a855f7;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.event-time {
    color: #60a5fa;
    font-weight: 500;
}

.event-timestamp {
    color: #9ca3af;
    font-size: 0.75rem;
}

.event-description {
    color: #e5e7eb;
}

/* Character Status */
.character-status-card {
    background-color: rgba(75, 85, 99, 0.5);
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.status-name {
    font-weight: 600;
    color: #60a5fa;
}

.status-personality {
    font-size: 0.875rem;
    color: #9ca3af;
    text-transform: capitalize;
}

/* Health Bar */
.health-section {
    margin-bottom: 0.75rem;
}

.health-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.health-label {
    color: #d1d5db;
}

.health-value {
    font-weight: 500;
}

.health-bar-container {
    width: 100%;
    background-color: #4b5563;
    border-radius: 9999px;
    height: 0.5rem;
}

.health-bar {
    height: 0.5rem;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.health-high {
    background-color: #22c55e;
}

.health-medium {
    background-color: #facc15;
}

.health-low {
    background-color: #ef4444;
}

/* Status Stats */
.status-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
}

.status-stats .stat-value {
    font-weight: 500;
}

.status-stats .intel {
    color: #60a5fa;
}

.status-stats .str {
    color: #ef4444;
}

.status-stats .spd {
    color: #facc15;
}

.status-stats .stat-label {
    color: #9ca3af;
}

/* Dead Characters */
.dead-characters-section {
    margin-top: 1.5rem;
}

.dead-characters-section h3 {
    font-size: 1.125rem;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 0.75rem;
}

.dead-character-card {
    background-color: rgba(153, 27, 27, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.dead-character-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dead-character-name {
    color: #fca5a5;
    font-weight: 500;
}

.death-day {
    color: #9ca3af;
    font-size: 0.875rem;
}

.death-cause {
    color: #fecaca;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Winner Info */
.winner-info {
    background-color: rgba(55, 65, 81, 0.5);
    border: 1px solid #374151;
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 600px;
}

.winner-name {
    font-size: 2rem;
    font-weight: 600;
    color: #facc15;
    margin-bottom: 1rem;
}

.winner-subtitle {
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

.winner-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.winner-stat {
    background-color: rgba(75, 85, 99, 0.5);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
}

.winner-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.winner-stat-label {
    color: #9ca3af;
    font-size: 0.875rem;
}

.winner-health {
    margin-top: 1rem;
}

.winner-health-label {
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

.winner-health-bar {
    width: 100%;
    background-color: #4b5563;
    border-radius: 9999px;
    height: 1rem;
    margin-bottom: 0.5rem;
}

.winner-health-fill {
    height: 1rem;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.winner-health-text {
    text-align: center;
    font-weight: 500;
}

/* Battle Summary */
.battle-summary {
    background-color: rgba(55, 65, 81, 0.5);
    border: 1px solid #374151;
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 800px;
}

.battle-summary h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 1.5rem;
    text-align: center;
}

.summary-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .summary-layout {
        grid-template-columns: 1fr;
    }
}

.elimination-order h3, .battle-stats h3 {
    font-size: 1.125rem;
    font-weight: 500;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.elimination-entry {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: rgba(75, 85, 99, 0.3);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.elimination-rank {
    width: 2rem;
    height: 2rem;
    background-color: #dc2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.875rem;
    margin-right: 1rem;
}

.elimination-info {
    flex: 1;
}

.elimination-name {
    font-weight: 500;
    color: #fca5a5;
}

.elimination-details {
    font-size: 0.875rem;
    color: #9ca3af;
}

.stat-entry {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: rgba(75, 85, 99, 0.3);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.stat-label {
    color: #d1d5db;
}

.stat-value {
    font-weight: 600;
}

.stat-days {
    color: #60a5fa;
}

.stat-combat {
    color: #ef4444;
}

.stat-total {
    color: #facc15;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .screen-title {
        font-size: 2rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .character-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .winner-stats {
        grid-template-columns: 1fr;
    }
}