:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --border: #e4e4e7;
  --text: #18181b;
  --muted: #71717a;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --content-width: 1120px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
}

.screen[hidden] {
  display: none !important;
}

#login-screen {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.login-subtitle {
  margin: 0 0 24px;
  color: var(--muted);
}

#login-form {
  display: grid;
  gap: 12px;
}

#password-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

button {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: white;
}

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 500;
}

.error {
  margin: 12px 0 0;
  color: #dc2626;
  font-size: 0.9rem;
}

.content-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px 32px 48px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 20px;
}

.header-brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
}

.header-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.session-info {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  flex-shrink: 0;
  padding-top: 2px;
}

.concept-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 20px;
}

.concept-box {
  flex: 1 1 0;
  min-width: 96px;
  height: 40px;
  padding: 0 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  transition: border-color 0.15s, background 0.15s;
  box-shadow: none;
}

.concept-box:hover {
  border-color: #93c5fd;
  transform: none;
}

.concept-box.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.concept-label {
  font-size: 0.85rem;
  text-align: center;
  padding: 0;
  white-space: nowrap;
}

.player-section {
  padding: 0;
}

#concept-title {
  margin: 0 0 16px;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 600;
}

.video-wrapper {
  background: #111;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
}

#concept-video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #d4d4d8;
  text-align: center;
  padding: 24px;
  margin: 0;
}

.video-placeholder[hidden] {
  display: none !important;
}

#concept-video[hidden] {
  display: none !important;
}

.disclaimer {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .content-container {
    padding: 20px 20px 40px;
  }

  .concept-box {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    font-size: 0.8rem;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .session-info {
    padding-top: 0;
  }
}

.quality-menu {
  position: absolute;
  right: 12px;
  bottom: 56px;
  z-index: 5;
}
.quality-menu > #quality-btn {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.quality-menu ul {
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 6px;
  display: none;
  position: absolute;
  right: 0;
  bottom: 32px;
  min-width: 92px;
}
.quality-menu ul.open { display: block; }
.quality-menu ul button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: #fff;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
}
.quality-menu ul button:hover { background: rgba(255, 255, 255, 0.15); }
