/* greek.webdbg.io — эгейская палитра, mobile-first */

:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #14263c;
  --muted: #64748b;
  --primary: #0d5eaf;
  --primary-dark: #0a4a8a;
  --accent: #e8f1fb;
  --border: #dbe4ef;
  --good: #1a9d55;
  --hard: #d97706;
  --again: #dc2626;
  --easy: #0891b2;
  --shadow: 0 1px 3px rgba(20, 38, 60, .08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1624;
    --card: #12233a;
    --text: #e8eef6;
    --muted: #8fa3b8;
    --primary: #3b82d6;
    --primary-dark: #2d6cb8;
    --accent: #16304e;
    --border: #1e3a5c;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
}
body.with-nav { padding-bottom: 76px; }

#app {
  max-width: 540px;
  margin: 0 auto;
  padding: 16px 16px 24px;
}

h1 { font-size: 1.35rem; }
h3 { font-size: 1rem; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; padding: 32px 0; }
.no-pad { padding: 0; }
.error { color: var(--again); }
.hidden { display: none !important; }
code { background: var(--accent); padding: 1px 5px; border-radius: 4px; font-size: .85em; }

/* карточки-блоки */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 10px 0;
  box-shadow: var(--shadow);
}

/* hero-экраны */
.hero { text-align: center; padding: 12vh 8px 0; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.hero-icon { font-size: 56px; }
.hero p { max-width: 420px; }

/* кнопки */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 10px 18px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  font-size: 1rem; cursor: pointer; text-decoration: none;
  transition: transform .05s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-lg { padding: 14px 26px; font-size: 1.1rem; }
.btn-block { display: flex; width: 100%; margin: 12px 0; }
.btn small { font-size: .72rem; opacity: .75; font-weight: 400; }
.btn-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.small-btn { padding: 6px 10px; font-size: .85rem; }

/* шапка страницы */
.page-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.page-head .back { text-decoration: none; font-size: 1.3rem; color: var(--muted); }
.streak { margin-left: auto; font-weight: 600; }

/* статы */
.stat-row { display: flex; gap: 10px; margin: 12px 0; }
.stat {
  flex: 1; text-align: center; background: var(--card);
  border: 1px solid var(--border); border-radius: 14px; padding: 12px 4px;
  box-shadow: var(--shadow);
}
.stat b { font-size: 1.4rem; display: block; }
.stat span { font-size: .78rem; color: var(--muted); }

/* прогресс-бары */
.progress-line { display: flex; justify-content: space-between; margin-bottom: 6px; font-weight: 500; }
.bar { height: 10px; background: var(--accent); border-radius: 6px; overflow: hidden; }
.bar.slim { height: 6px; flex: 1; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--easy)); border-radius: 6px; transition: width .3s; }
.xp-line { text-align: center; margin-top: 10px; }

/* сессия */
.session-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.session-top .quit { text-decoration: none; color: var(--muted); font-size: 1.2rem; }
.badge-new {
  display: inline-block; background: var(--accent); color: var(--primary);
  border-radius: 8px; padding: 3px 10px; font-size: .82rem; font-weight: 600; margin-bottom: 8px;
}
.word-card { text-align: center; padding: 30px 16px; position: relative; min-height: 200px; }
.word-el { font-size: 2rem; font-weight: 700; margin-bottom: 6px; overflow-wrap: anywhere; }
.word-ru { font-size: 1.3rem; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.word-translit { margin-top: 2px; }
.example { margin-top: 14px; font-size: .95rem; background: var(--accent); border-radius: 10px; padding: 10px; }
.speak {
  position: absolute; top: 10px; right: 10px;
  background: none; border: none; font-size: 1.4rem; cursor: pointer;
}
.speak.playing { animation: audio-pulse .8s ease-in-out infinite alternate; }
@keyframes audio-pulse { to { transform: scale(1.16); filter: saturate(1.4); } }
.controls { margin-top: 14px; }
.rate-row { display: flex; gap: 8px; }
.rate-row .btn { flex: 1; padding: 12px 4px; }
.rate-again { border-color: var(--again); color: var(--again); }
.rate-hard { border-color: var(--hard); color: var(--hard); }
.rate-good { border-color: var(--good); color: var(--good); }
.rate-easy { border-color: var(--easy); color: var(--easy); }
.xp-big { font-size: 1.6rem; font-weight: 700; color: var(--good); }

/* свободная викторина */
.practice-card { min-height: 150px; }
.practice-prompt { margin-top: 14px; }
.grammar-hint {
  display: inline-block; margin-top: 8px; padding: 3px 9px;
  border-radius: 9px; background: var(--accent); color: var(--primary);
  font-size: .82rem; font-weight: 600;
}
.choice-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 12px 0; }
.choice {
  width: 100%; min-height: 50px; flex-direction: row; justify-content: space-between;
  text-align: left; font-weight: 550;
}
.choice:disabled { cursor: default; opacity: 1; }
.choice.correct { border-color: var(--good); background: rgba(26, 157, 85, .14); color: var(--good); }
.choice.wrong { border-color: var(--again); background: rgba(220, 38, 38, .12); color: var(--again); }
.practice-feedback {
  border-radius: 12px; padding: 11px 14px; margin-top: 12px; text-align: center;
}
.practice-feedback.ok { background: rgba(26, 157, 85, .14); color: var(--good); }
.practice-feedback.no { background: rgba(220, 38, 38, .12); color: var(--again); }
@media (min-width: 460px) {
  .choice-grid { grid-template-columns: 1fr 1fr; }
}

/* острова */
.island-list { display: flex; flex-direction: column; }
.island { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--text); }
.island-emoji { font-size: 1.9rem; }
.island-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.island-name { font-weight: 600; }

/* список слов */
.word-list { display: flex; flex-direction: column; gap: 6px; }
.word-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px;
}
.word-row .speak { position: static; }
.wr-el { font-weight: 600; }
.chip {
  display: inline-block; font-size: .7rem; padding: 1px 8px; border-radius: 10px;
  background: var(--accent); color: var(--muted); vertical-align: middle; margin-left: 4px;
}
.chip-mastered { background: rgba(26, 157, 85, .15); color: var(--good); }
.chip-review { background: rgba(8, 145, 178, .15); color: var(--easy); }
.chip-learning { background: rgba(217, 119, 6, .15); color: var(--hard); }

/* статистика */
.chart { display: flex; gap: 4px; align-items: flex-end; height: 90px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .65rem; color: var(--muted); justify-content: flex-end; }
.chart-bar { width: 100%; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 2px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: .78rem; }
.table td, .table th { padding: 6px 4px; border-top: 1px solid var(--border); }
.table tr:first-child th { border-top: none; }
.table tr.me td { font-weight: 700; }

/* профиль и формы */
.profile { display: flex; gap: 12px; align-items: center; }
.avatar { width: 48px; height: 48px; border-radius: 50%; }
label { display: block; margin: 10px 0; font-size: .95rem; }
select, input[type=email] {
  font-size: 1rem; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  margin-left: 6px;
}
input[type=email] { flex: 1; min-width: 180px; }

/* админка */
.admin-user {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}

/* нижняя навигация */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 10;
}
.nav a {
  display: flex; flex-direction: column; align-items: center;
  font-size: .68rem; text-decoration: none; color: var(--muted);
  min-width: 56px; padding: 2px 6px; border-radius: 10px;
}
.nav a span { font-size: 1.25rem; }
.nav a.active { color: var(--primary); font-weight: 600; }

/* тост */
.toast {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 12px; font-size: .92rem;
  z-index: 20; max-width: 90vw; text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}
