:root {
  --color-background-primary: #ffffff;
  --color-background-secondary: #f3f4f6;
  --color-background-info: #dbeafe;
  --color-text-primary: #111827;
  --color-text-secondary: #4b5563;
  --color-text-info: #1e40af;
  --color-text-tertiary: #9ca3af;
  --color-border-secondary: #d1d5db;
  --color-border-info: #60a5fa;
  --border-radius-md: 6px;
  --color-border-tertiary: #9ca3af;
}
.verb-constructor {
  display: flex;
  justify-content: center;
  padding: 2rem 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 2px solid transparent;
  border-radius: var(--border-radius-md);
  transition: border-color 0.15s, background 0.15s;
}
.verb-constructor.is-overflowing {
  justify-content: flex-start;
}
.verb-constructor.feedback-success {
  border-color: #15803d;
  background: #f0fdf4;
}
.verb-constructor.feedback-error {
  border-color: #b91c1c;
  background: #fef2f2;
}
/* Единый текстовый поток для слова: буквы — соседние inline-элементы без
   зазоров, поэтому браузер соединяет их так же, как обычный арабский текст
   (в отличие от отдельных flex-элементов, которые шейпятся изолированно). */
.verb-word {
  direction: rtl;
  white-space: nowrap;
  flex-shrink: 0;
  touch-action: none;
}
.letter-display {
  display: inline;
  font-size: 50px;
  line-height: 1;
  color: var(--color-text-primary);
  font-family: "Scheherazade New", serif;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  padding: 4px 0;
  border-radius: var(--border-radius-md);
}
.letter-display.vowel-target {
  outline: 2px solid var(--color-border-info);
  outline-offset: 2px;
  background: var(--color-background-info);
}
.vowel-bank {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 0.5rem 1.25rem 1rem;
}
.vowel-tile {
  width: 40px;
  height: 46px;
  font-size: 32px;
  line-height: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  overflow: hidden;
  cursor: grab;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  background: var(--color-background-primary);
  color: var(--color-text-primary);
  font-family: "Scheherazade New", serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}
.letter-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 0.5rem 1.25rem 1.5rem;
}
.bank-tile {
  width: 46px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-family: "Scheherazade New", serif;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  background: var(--color-background-secondary);
  color: var(--color-text-primary);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}
.letter-display.dragging,
.bank-tile.dragging,
.vowel-tile.dragging {
  opacity: 0.35;
}
.drag-ghost {
  position: fixed;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 1000;
  opacity: 0.9;
}
.drop-indicator {
  position: fixed;
  display: none;
  width: 3px;
  background: var(--color-border-info);
  border-radius: 2px;
  z-index: 999;
  pointer-events: none;
}
.label {
  font-size: 12px;
  color: var(--color-text-tertiary);
  direction: ltr;
}
.hint {
  font-size: 17px;
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: 1rem;
}
.section-label {
  font-size: 17px;
  color: var(--color-text-tertiary);
  text-align: center;
  margin-bottom: 0.25rem;
}
.settings-row {
  max-width: 640px;
  margin: 1.5rem auto 0;
  padding: 0 1.25rem;
  text-align: center;
}
.settings-row + .settings-row {
  margin-top: 0.75rem;
}
.settings-row select {
  padding: 4px 8px;
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
  font-size: 16px;
}
.task-block {
  max-width: 640px;
  margin: 1.5rem auto 0;
  padding: 1rem 1.25rem;
  background: var(--color-background-secondary);
  border-radius: var(--border-radius-md);
  text-align: center;
}
.task-label {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  margin: 0 0 0.35rem;
}
.task-question {
  font-size: 20px;
  color: var(--color-text-primary);
  margin: 0;
  direction: ltr;
  text-align: left;
}
.btn-shadda {
  font-family: "Scheherazade New", serif;
  font-size: 32px;
}
.check-area {
  text-align: center;
  margin: 1.5rem 0;
}
.btn-check {
  padding: 8px 20px;
  font-size: 18px;
  cursor: pointer;
  border: none;
  border-radius: var(--border-radius-md);
  background: var(--color-border-info);
  color: #ffffff;
  transition: background 0.15s;
}
.btn-check:hover {
  background: var(--color-text-info);
}
.btn-reset {
  margin-right: 8px;
  padding: 8px 20px;
  font-size: 18px;
  cursor: pointer;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: var(--border-radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  transition: background 0.15s;
}
.btn-reset:hover {
  background: var(--color-background-secondary);
}
.feedback {
  margin-top: 0.75rem;
  font-size: 20px;
  min-height: 1.2em;
  /* direction: rtl; */
}
.feedback-success {
  color: #15803d;
}
.feedback-error {
  color: #b91c1c;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 20px;
  color: var(--color-text-primary);
  background: var(--color-background-primary);
}
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--color-background-secondary);
  direction: ltr;
}
.site-nav__brand {
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text-primary);
}
.site-nav__links {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.site-nav__links a {
  color: var(--color-text-info);
  text-decoration: none;
}
.site-nav__links a:hover {
  text-decoration: underline;
}
.site-nav__user {
  color: var(--color-text-secondary);
  font-size: 17px;
}
.site-nav__logout {
  margin: 0;
}
.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text-info);
  cursor: pointer;
  font: inherit;
}
.link-button:hover {
  text-decoration: underline;
}
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.messages {
  list-style: none;
  max-width: 720px;
  margin: 1rem auto 0;
  padding: 0 1.25rem;
  direction: ltr;
}
.message {
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius-md);
  background: var(--color-background-info);
  color: var(--color-text-info);
  margin-bottom: 0.5rem;
}
.auth-form {
  max-width: 360px;
  margin: 2rem auto;
  direction: ltr;
  text-align: left;
}
.form-field {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.form-field input {
  padding: 6px 10px;
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--border-radius-md);
}
.progress-summary {
  display: flex;
  gap: 1.5rem;
  margin: 1.5rem 0;
  direction: ltr;
}
.progress-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--color-background-secondary);
  border-radius: var(--border-radius-md);
}
.progress-stat__value {
  font-size: 24px;
  font-weight: 600;
}
.progress-stat__label {
  font-size: 12px;
  color: var(--color-text-tertiary);
}
.progress-table {
  width: 100%;
  border-collapse: collapse;
  direction: ltr;
  margin-bottom: 1.5rem;
}
.progress-table th,
.progress-table td {
  text-align: left;
  padding: 6px 10px;
  font-size: 20px;
  border-bottom: 1px solid var(--color-border-secondary);
}

@media (max-width: 480px) {
  /* .letter-display {
    font-size: 36px;
  } */
  .bank-tile,
  .vowel-tile {
    width: 38px;
    height: 44px;
    font-size: 26px;
  }
  .progress-table th,
  .progress-table td {
    padding: 6px 10px;
    font-size: 15px;
  }
}
