/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  color-scheme: light;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --success-ink: #166534;
  --error: #dc2626;
  --error-soft: #fef2f2;
  --warning: #ea580c;
  --ink: #111827;
  --muted: #4b5563;
  --line: #e5e7eb;
  --page: #f9fafb;
  --green: var(--primary);
  --green-soft: var(--success-soft);
  --green-ink: var(--success-ink);
  --red: var(--error);
  --red-soft: var(--error-soft);
  --red-ink: #991b1b;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
}

.bg-stone-100 { background-color: var(--page); }
.text-stone-900 { color: var(--ink); }
.text-stone-500,
.text-stone-600,
.text-stone-700 { color: var(--muted); }
.border-stone-200,
.border-stone-300 { border-color: var(--line); }
.bg-emerald-600 { background-color: var(--primary); }
.bg-emerald-50 { background-color: var(--success-soft); }
.text-emerald-800,
.text-emerald-700 { color: var(--success-ink); }
.bg-red-50 { background-color: var(--error-soft); }
.text-red-800 { color: var(--red-ink); }
.rounded-2xl.bg-white,
.rounded-2xl.shadow-sm {
  border: 1px solid var(--line);
}

.hy {
  font-family: Inter, Sylfaen, "Noto Sans Armenian", sans-serif;
  line-height: 1.7;
}

h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-link {
  color: var(--primary);
  font-weight: 600;
}

.text-link:hover {
  color: var(--primary-dark);
}

.btn {
  border-radius: 0.75rem;
  min-height: 48px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

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

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary-light);
}

.streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 700;
}

.streak-flame {
  width: 20px;
  height: 20px;
  flex: none;
}

input:focus,
select:focus,
textarea:focus,
.field:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.exercise {
  width: 100%;
  margin: 0 auto;
  padding: 0 0 32px;
}

.wordmark {
  margin: 0 0 18px;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.panel {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px 28px 24px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.nav-link,
.pressable,
.choice,
.profile-button,
.card {
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 999px;
  padding: 0 10px;
}

.nav-link:hover,
.profile-button:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.pressable:hover,
button.card:hover {
  filter: brightness(1.03);
}

a.card:hover,
a.card:active {
  transform: none;
}

.pressable:active,
.choice:active,
.nav-link:active,
button.card:active,
.profile-button:active {
  transform: scale(0.95);
}

.choice {
  display: flex;
  align-items: center;
  min-height: 64px;
  border: 2px solid var(--line);
  border-radius: 0.75rem;
  background: #fff;
  padding: 14px 16px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
}

.choice:hover {
  border-color: var(--primary);
}

.choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lesson-dock {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 28px;
  padding: 18px 0 8px;
  background: linear-gradient(to bottom, rgba(249, 250, 251, 0), var(--page) 28%);
}

button:disabled,
input[type="submit"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.profile-menu {
  position: relative;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  list-style: none;
}

.profile-button::-webkit-details-marker {
  display: none;
}

.profile-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 180px;
  padding: 8px;
  border: 1px solid #e7e5e4;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(20, 20, 20, 0.12);
}

.profile-link,
.profile-link-button {
  display: flex;
  width: 100%;
  align-items: center;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 0 12px;
  text-align: left;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.profile-link:hover,
.profile-link-button:hover {
  background: #f5f5f4;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  object-fit: cover;
}

.alphabet-table {
  width: 100%;
  border-collapse: collapse;
}

.alphabet-table th,
.alphabet-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f4;
  text-align: left;
}

.alphabet-table th {
  color: #78716c;
  font-size: 0.85rem;
  font-weight: 600;
}

.alphabet-table tr:hover td {
  background: #fafaf9;
}

.reward-popup {
  position: relative;
  z-index: 6;
  margin-bottom: 16px;
  animation: sovorel-popup 420ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.reward {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: var(--success-soft);
  padding: 28px 16px;
  text-align: center;
  color: var(--success);
  box-shadow: 0 12px 28px rgba(22, 163, 74, 0.18);
}

@keyframes sovorel-popup {
  0% { transform: translateY(12px) scale(0.96); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.reward-mark {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  animation: sovorel-reward 520ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.reward-burst {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 12px;
  height: 12px;
}

.reward-burst span {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  animation: sovorel-spark 560ms ease-out forwards;
}

.reward-burst span:nth-child(2) { background: var(--accent); animation-delay: 20ms; }
.reward-burst span:nth-child(3) { background: var(--success); }
.reward-burst span:nth-child(4) { background: var(--accent); animation-delay: 30ms; }
.reward-burst span:nth-child(5) { background: #86efac; }
.reward-burst span:nth-child(6) { background: var(--accent); animation-delay: 10ms; }

@keyframes sovorel-reward {
  0% { transform: scale(0.6); opacity: 0; }
  55% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes sovorel-spark {
  0% { transform: translate(0, 0) scale(0.4); opacity: 1; }
  100% { opacity: 0; }
}

.reward-burst span:nth-child(1) { animation-name: sovorel-spark-1; }
.reward-burst span:nth-child(2) { animation-name: sovorel-spark-2; }
.reward-burst span:nth-child(3) { animation-name: sovorel-spark-3; }
.reward-burst span:nth-child(4) { animation-name: sovorel-spark-4; }
.reward-burst span:nth-child(5) { animation-name: sovorel-spark-5; }
.reward-burst span:nth-child(6) { animation-name: sovorel-spark-6; }

@keyframes sovorel-spark-1 { to { transform: translate(-70px, -36px) scale(1); opacity: 0; } }
@keyframes sovorel-spark-2 { to { transform: translate(74px, -28px) scale(1); opacity: 0; } }
@keyframes sovorel-spark-3 { to { transform: translate(-36px, 22px) scale(1); opacity: 0; } }
@keyframes sovorel-spark-4 { to { transform: translate(42px, 26px) scale(1); opacity: 0; } }
@keyframes sovorel-spark-5 { to { transform: translate(-8px, -48px) scale(1); opacity: 0; } }
@keyframes sovorel-spark-6 { to { transform: translate(8px, 34px) scale(1); opacity: 0; } }

.celebrate {
  animation: sovorel-pop 280ms ease;
}

@keyframes sovorel-pop {
  from { transform: scale(0.97); }
  to { transform: scale(1); }
}

.progress-count {
  margin: 0;
  min-width: 3.2rem;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: right;
}

.exercise h1 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lede {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.column h2 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: center;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  appearance: none;
  width: 100%;
  min-height: 58px;
  padding: 10px 8px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.35rem;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.card:hover:not(:disabled) {
  border-color: #cfcfcf;
}

.card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.card.is-selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.card.is-correct {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success-ink);
  cursor: default;
}

.card.is-wrong {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red-ink);
}

.feedback {
  min-height: 1.5rem;
  margin: 22px 0 14px;
  text-align: center;
  font-size: 0.98rem;
}

.feedback.is-success { color: var(--green-ink); }
.feedback.is-error { color: var(--red-ink); }

.new-round {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.new-round:hover { background: #fafafa; }
.new-round:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .panel { padding: 22px 16px 18px; }
  .columns { gap: 8px; }
  .card { min-height: 52px; font-size: 1.05rem; padding: 8px 4px; }
  .exercise h1 { font-size: 1.35rem; }
}
