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

:root {
    --green: #22c55e; --yellow: #eab308; --red: #ef4444;
    --green-bg: #dcfce7; --yellow-bg: #fef9c3; --red-bg: #fee2e2;
    --bg: #f8fafc; --surface: #ffffff; --text: #1e293b; --muted: #64748b;
    --border: #e2e8f0; --primary: #3b82f6; --primary-hover: #2563eb;
    --radius: 0.5rem;
}

body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

.container { max-width: 48rem; margin: 0 auto; padding: 1.5rem; }
.container-wide { max-width: 64rem; margin: 0 auto; padding: 1.5rem; }

h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 1rem; }
h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.75rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1rem; }

/* Buttons */
.btn { display: inline-block; padding: 0.625rem 1.25rem; border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 500; cursor: pointer; text-align: center; text-decoration: none; transition: background 0.15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.875rem; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.25rem; font-size: 0.875rem; }
.form-group input, .form-group select { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; }
.form-group input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }

.error-msg { color: var(--red); font-size: 0.875rem; margin-top: 0.5rem; }

/* Navbar */
.navbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0.75rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.navbar-brand { font-weight: 700; font-size: 1.125rem; color: var(--text); text-decoration: none; }
.navbar a { color: var(--muted); text-decoration: none; margin-left: 1rem; }
.navbar a:hover { color: var(--text); }

/* Stoplight buttons */
.stoplight-buttons { display: flex; gap: 1rem; justify-content: center; margin: 2rem 0; flex-wrap: wrap; }
.stoplight-btn { width: 8rem; height: 8rem; border-radius: 50%; border: 4px solid transparent; font-size: 1rem; font-weight: 700; color: #fff; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; display: flex; align-items: center; justify-content: center; }
.stoplight-btn:hover { transform: scale(1.05); }
.stoplight-btn:focus { outline: 3px solid var(--text); outline-offset: 2px; }
.stoplight-btn.active { transform: scale(1.1); box-shadow: 0 0 0 4px rgba(0,0,0,0.2); }
.stoplight-btn.green { background: var(--green); }
.stoplight-btn.yellow { background: var(--yellow); color: var(--text); }
.stoplight-btn.red { background: var(--red); }

/* Activity mode banner */
.activity-banner { text-align: center; padding: 1rem; border-radius: var(--radius); font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem; }
.activity-banner.GROUP { background: var(--green-bg); color: #166534; }
.activity-banner.PARTNER { background: var(--yellow-bg); color: #854d0e; }
.activity-banner.SILENT { background: var(--red-bg); color: #991b1b; }

/* Aggregate bars */
.aggregate { display: flex; gap: 1rem; margin: 1.5rem 0; justify-content: center; flex-wrap: wrap; }
.aggregate-item { text-align: center; min-width: 6rem; }
.aggregate-bar { height: 8rem; width: 4rem; border-radius: var(--radius); margin: 0 auto 0.5rem; position: relative; background: var(--border); overflow: hidden; }
.aggregate-fill { position: absolute; bottom: 0; width: 100%; border-radius: 0 0 var(--radius) var(--radius); transition: height 0.3s; }
.aggregate-fill.green { background: var(--green); }
.aggregate-fill.yellow { background: var(--yellow); }
.aggregate-fill.red { background: var(--red); }
.aggregate-count { font-size: 1.5rem; font-weight: 700; }
.aggregate-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; }

/* Activity mode selector */
.mode-selector { display: flex; gap: 0.5rem; justify-content: center; margin: 1rem 0; flex-wrap: wrap; }
.mode-btn { padding: 0.625rem 1.5rem; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 600; transition: all 0.15s; }
.mode-btn:hover { border-color: var(--muted); }
.mode-btn.active { color: #fff; }
.mode-btn.active.GROUP { background: var(--green); border-color: var(--green); }
.mode-btn.active.PARTNER { background: var(--yellow); border-color: var(--yellow); color: var(--text); }
.mode-btn.active.SILENT { background: var(--red); border-color: var(--red); }

/* Course list */
.course-item { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.course-item:last-child { border-bottom: none; }

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none; }

/* Join code display */
.join-code { font-family: monospace; font-size: 2rem; font-weight: 700; letter-spacing: 0.25rem; background: var(--bg); padding: 0.75rem 1.5rem; border-radius: var(--radius); display: inline-block; }

/* Student count */
.student-count { font-size: 1.125rem; color: var(--muted); }

/* Responsive */
@media (max-width: 480px) {
    .stoplight-btn { width: 6rem; height: 6rem; font-size: 0.875rem; }
    .aggregate-bar { height: 6rem; width: 3rem; }
    h1 { font-size: 1.375rem; }
}
