:root {
  --bg: #f4f5f0;
  --surface: #fffffc;
  --surface-2: #eef3e2;
  --ink: #0f1a22;
  --muted: #506172;
  --accent: #13795b;
  --accent-strong: #0f5f47;
  --danger: #872e2e;
  --border: #d3ddd3;
  --shadow: 0 10px 28px rgb(18 36 31 / 8%);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Readex Pro", "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 5%, #e7efcb 0%, transparent 35%),
    radial-gradient(circle at 88% 12%, #d4e8e3 0%, transparent 32%),
    var(--bg);
  color: var(--ink);
}

.app-shell {
  max-width: 740px;
  margin: 0 auto;
  padding: 16px 14px 24px;
}

.app-header {
  padding: 8px 2px 14px;
}

.app-header h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.app-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 8px 10px;
  background: color-mix(in oklab, var(--surface), #f4f9e5 42%);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.word-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.item-divider {
  overflow: hidden;
}

.divider-image {
  display: block;
  width: 100%;
  height: auto;
  min-height: 108px;
  object-fit: cover;
  background: linear-gradient(120deg, #d7e6c6, #c2d8d4);
}

.item-word {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
}

.word-main {
  flex: 1;
  min-width: 0;
}

.arabic {
  margin: 0;
  font-family: "Noto Naskh Arabic", "Amiri", serif;
  font-size: 2rem;
  line-height: 1.15;
}

.meta,
.transliteration,
.translation {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.meta {
  color: var(--muted);
  text-transform: lowercase;
}

.transliteration {
  color: #35506a;
}

.translation {
  color: #1e2e3d;
}

.notes {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  color: #2d3c33;
  font-size: 0.85rem;
}

.word-actions {
  display: grid;
  grid-auto-flow: row;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8faf6;
  color: #16334d;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-play.is-playing {
  color: #fff;
  background: #295ea6;
  border-color: #295ea6;
}

.btn-play.is-error {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.btn-learned[aria-pressed="true"] {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent-strong);
}

.item-word.is-learned {
  border-color: color-mix(in oklab, var(--accent), white 58%);
  background: color-mix(in oklab, var(--surface), #e9f5e9 35%);
}

@media (min-width: 660px) {
  .app-shell {
    padding-top: 22px;
  }

  .item-word {
    padding: 14px;
  }

  .arabic {
    font-size: 2.25rem;
  }
}
