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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

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

.main-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.scenario-panel, .probability-panel, .bayes-formula {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.scenario-content {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.evidence-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.evidence-tag {
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.evidence-tag::before {
    content: '✓';
    font-weight: bold;
}

#probCanvas {
    width: 100%;
    height: 300px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

.prob-legend {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.formula {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.fraction {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    text-align: center;
}

.numerator {
    border-bottom: 2px solid #333;
    padding-bottom: 5px;
}

.denominator {
    padding-top: 5px;
}

.formula-explain {
    font-size: 0.9em;
    line-height: 1.8;
}

.formula-explain p {
    padding: 5px 0;
}

.formula-explain strong {
    color: #667eea;
    font-family: 'Courier New', monospace;
}

.control-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow-y: auto;
    max-height: 900px;
}

.hypothesis-section, .evidence-section, .calculation-section, .stats-section, .level-section {
    margin-bottom: 20px;
}

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

.hypothesis-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.hypothesis-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.hypothesis-prob {
    font-family: 'Courier New', monospace;
    color: #667eea;
    font-size: 0.9em;
}

.prob-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}

.prob-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s;
}

#evidenceButtons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.evidence-btn {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-size: 0.9em;
}

.evidence-btn:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.evidence-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.evidence-btn.collected {
    background: #e8f5e9;
    border-color: #48bb78;
}

.calc-display {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.8;
    max-height: 200px;
    overflow-y: auto;
}

.calc-step {
    margin: 8px 0;
    padding: 8px;
    background: white;
    border-radius: 4px;
}

.stats-grid {
    display: grid;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat-label {
    font-weight: 600;
    color: #555;
}

.stat-value {
    font-family: 'Courier New', monospace;
    color: #667eea;
    font-weight: bold;
}

.button-group {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary:hover {
    background: #e53e3e;
}

.level-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.level-btn {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-size: 0.9em;
}

.level-btn:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.level-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.level-btn.completed {
    border-color: #48bb78;
    background: #48bb78;
    color: white;
}

.tutorial {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.tutorial h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.tutorial ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.tutorial li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.tutorial li:last-child {
    border-bottom: none;
}

.tutorial strong {
    color: #667eea;
}

.example {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.example h4 {
    color: #856404;
    margin-bottom: 10px;
}

.example p {
    margin: 5px 0;
    color: #856404;
}

.hint {
    font-style: italic;
    margin-top: 10px;
    font-weight: 600;
}

@media (max-width: 1200px) {
    .game-area {
        grid-template-columns: 1fr;
    }
}
