/* NeuroQuest — мобильная адаптация, mobile-first */

:root {
  --bg: #0f0f14;
  --card-bg: #1a1a24;
  --text: #e8e8ed;
  --text-muted: #8a8a9a;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #22c55e;
  --error: #ef4444;
  --border: #2a2a36;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 640px;
  margin: 0 auto;
}

/* Header */
.header {
  padding: 1.25rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.logo {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Content */
.content {
  flex: 1;
  padding: 1rem;
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

/* Error */
.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: #fca5a5;
  padding: 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
}

/* Screen container */
#screen {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Level card */
.level-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.level-name {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.level-code {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.r1-intro {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.r1-intro-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.r1-intro-text {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.45;
}

.r1-intro-list {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.r1-intro-list li {
  margin: 0.25rem 0;
}

/* Tasks */
.task {
  margin-bottom: 1.5rem;
}

.task:last-of-type {
  margin-bottom: 1rem;
}

.task-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.task-description {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.prototype-card {
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(99, 102, 241, 0.08);
  padding: 0.75rem;
  width: 100%;
  display: block;
}

.prototype-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.prototype-caption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.prototype-iframe {
  width: 100%;
  height: 75vh;
  max-height: 720px;
  min-height: 420px;
  border: none;
  border-radius: var(--radius-sm);
  background: #fff;
}

/* Form */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  min-height: 100px;
}

textarea {
  min-height: 120px;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}

.btn:hover {
  background: var(--accent-hover);
}

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

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (min-width: 480px) {
  .btn-group {
    flex-direction: row;
  }

  .btn {
    width: auto;
  }
}

/* Profile selection */
.profile-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-btn {
  padding: 1rem;
  text-align: left;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.profile-btn:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
}

/* Completed screen */
.completed-card {
  text-align: center;
  padding: 2rem 1.5rem;
}

.completed-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.completed-card p {
  margin: 0;
  color: var(--text-muted);
}

/* Footer */
.footer {
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
