:root {
  --bg: #0f1115;
  --card: #1a1f29;
  --text: #e5e7eb;
  --muted: #9aa4b2;
  --accent: #3b82f6;
  --border: #263040;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.site-header {
  padding: 32px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
}

.site-header h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.2px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 88px;
  transition: transform 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  border-color: var(--accent);
}

.card .content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.7s ease, transform 0.7s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.card:hover .content {
  left: 16px;
  transform: translate(0, -50%);
}

.card i {
  font-size: 48px;
  line-height: 1;
  transition: transform 0.5s ease;
}

.card .label {
  font-weight: 600;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.6s ease, max-width 0.6s ease;
}

.card:hover .label {
  opacity: 1;
  max-width: 200px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}
.login-wrapper {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.login-card .field {
  display: grid;
  gap: 6px;
}

.login-card label {
  font-size: 13px;
  color: var(--muted);
}

.login-card .field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-card .checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #12161e;
  color: var(--text);
}

.login-card button {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.login-card button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.muted-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.error {
  min-height: 18px;
  color: #ef4444;
  font-size: 13px;
}
.progress-badge {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.back-link {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #141a22;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  position: absolute;
  top: 16px;
  right: 24px;
}

.card.completed {
  border-color: var(--accent);
}

.actions {
  margin-top: 12px;
  display: flex;
}

.actions button {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #141a22;
  color: var(--text);
  cursor: pointer;
}

.example pre {
  margin: 0;
  background: #0c0f14;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  overflow: auto;
}

.example-controls {
  margin-top: 8px;
}

.run-button-inline {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 640px;
  width: 90%;
  padding: 16px;
}

.modal-content pre {
  margin: 0;
}

.close-btn {
  float: right;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #141a22;
  color: var(--text);
  cursor: pointer;
}

.quiz-button {
  position: fixed;
  bottom: 16px;
  left: 24px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  text-decoration: none;
}

.quiz-area {
  display: grid;
  gap: 12px;
}

.prompt {
  font-size: 14px;
  color: var(--muted);
}

.editor {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0c0f14;
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.quiz-actions {
  display: flex;
  gap: 8px;
}

.quiz-actions button {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  cursor: pointer;
}

.next-button {
  position: fixed;
  bottom: 16px;
  right: 24px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  text-decoration: none;
}
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
  height: 100%;
}
.lesson-number {
  font-size: 22px;
  font-weight: 700;
}
.category {
  font-size: 14px;
  color: var(--muted);
}

.starter-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid var(--accent);
  color: var(--text);
}