.hidden-button {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    margin: 0;
    padding: 16px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.student-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 16px;
}

.student-bar .label {
    color: #94a3b8;
    font-size: 12px;
    margin-right: 8px;
}

.student-bar .value {
    color: #fbbf24;
    font-weight: bold;
    font-size: 14px;
}

.btn-exit {
    padding: 8px 16px;
    background: #ef4444;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    cursor: pointer;
}

.btn-exit:hover {
    background: #dc2626;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    color: #fbbf24;
    font-size: 32px;
    margin: 0 0 8px 0;
}

header p {
    color: #94a3b8;
    margin: 0 0 12px 0;
}

.badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid #475569;
    color: #cbd5e1;
}

.badge.blue { background: rgba(59, 130, 246, 0.2); border-color: #2563eb; color: #93c5fd; }
.badge.purple { background: rgba(147, 51, 234, 0.2); border-color: #7c3aed; color: #d8b4fe; }
.badge.green { background: rgba(16, 185, 129, 0.2); border-color: #059669; color: #6ee7b7; }

.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 1024px) {
    .main-grid {
        grid-template-columns: 4fr 8fr;
    }
}

.panel {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.panel h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #e2e8f0;
}

.panel h4 {
    margin: 12px 0 8px 0;
    font-size: 14px;
    color: #94a3b8;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.panel-header h3 {
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-box {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #e2e8f0;
}

.stat-number.yellow { color: #fbbf24; }
.stat-number.green { color: #34d399; }
.stat-number.red { color: #ef4444; }

.progress-box {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #94a3b8;
}

.progress-bar {
    height: 8px;
    background: #334155;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #f59e0b, #fbbf24);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.optimal-box {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    color: #94a3b8;
}

.optimal-box b { color: #e2e8f0; }
.optimal-box .green { color: #34d399; }
.optimal-box .yellow { color: #fbbf24; }
.optimal-box .red { color: #ef4444; }

.algo-list {
    margin-bottom: 12px;
}

.algo-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 4px;
}

.algo-item:hover {
    background: rgba(51, 65, 85, 0.5);
}

.algo-item input[type="radio"] {
    margin-top: 2px;
}

.algo-item label {
    cursor: pointer;
    flex: 1;
}

.algo-item label b {
    display: block;
    color: #e2e8f0;
    font-size: 14px;
}

.algo-item label span {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    margin-top: 2px;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(to right, #f59e0b, #d97706);
    border: none;
    border-radius: 8px;
    color: #0f172a;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: transform 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid #475569;
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #334155;
}

.btn-small {
    padding: 6px 12px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #475569;
}

.graph-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.log-panel {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 6px;
    padding: 8px;
    font-size: 12px;
    margin-bottom: 12px;
}

.log-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-bottom: 1px solid #334155;
    line-height: 1.4;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry .time {
    color: #64748b;
    font-family: Consolas, monospace;
    font-size: 11px;
}

.log-entry .action {
    color: #fbbf24;
    font-weight: bold;
    font-size: 11px;
}

.log-entry .details {
    color: #cbd5e1;
    font-size: 11px;
}

.log-entry .stats {
    color: #64748b;
    font-size: 11px;
}

.empty {
    color: #64748b;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.canvas-container {
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    border-radius: 8px;
    border: 1px solid #334155;
    height: 450px;
    position: relative;
}

.hint {
    margin-top: 12px;
    padding: 10px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 6px;
    color: #fcd34d;
    font-size: 14px;
    text-align: center;
}

.theory p {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0 0 8px 0;
}

.theory ul {
    margin: 0;
    padding-left: 20px;
    color: #94a3b8;
    font-size: 13px;
}

.theory li {
    margin-bottom: 4px;
}

.theory-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .theory-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.pseudo-code {
    margin-top: 16px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #334155;
}

.pseudo-code h4 {
    margin: 0 0 8px 0;
    color: #e2e8f0;
}

.pseudo-code pre {
    margin: 0;
    color: #94a3b8;
    font-family: Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
}

.mono {
    font-family: Consolas, 'Courier New', monospace;
    background: rgba(15, 23, 42, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    color: #fbbf24;
}

.legend {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #94a3b8;
}

.legend span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot.gray { background: #475569; }
.dot.yellow { background: #fbbf24; }

.line {
    width: 20px;
    height: 3px;
    display: inline-block;
}

.line.gray { background: #475569; }
.line.yellow { background: #fbbf24; }

.yellow { color: #fbbf24; }
.green { color: #34d399; }
.red { color: #ef4444; }
.blue { color: #60a5fa; }