/* states.css — visual treatment for empty / loading / error state primitives.
 *
 * Used by every screen via public/js/views/states.js. Tokens come from
 * public/css/tokens.css. No glow effects (user has aphantasia — legibility
 * outweighs visual flourish); the only animation is the shimmer keyframe.
 */

/* ── StateBlock shell ───────────────────────────────────── */
.state-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 56px 24px;
  text-align: center;
  flex: 1;
  min-height: 360px;
}

.state-block--dense {
  gap: 12px;
  padding: 32px 24px;
  min-height: 220px;
}

.state-block__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.state-block__icon-char {
  font-size: 64px;
  color: var(--ink-3);
  line-height: 1;
}

.state-block--dense .state-block__icon-char {
  font-size: 48px;
}

.state-block__title {
  font-size: 38px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

.state-block--dense .state-block__title {
  font-size: 28px;
}

.state-block--danger .state-block__title {
  color: var(--warn);
}

.state-block__body {
  font-size: var(--t-small, 14px);
  color: var(--ink-3);
  max-width: 280px;
  line-height: 1.5;
  margin: 0;
}

.state-block__action {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

/* ── Skel — shared shimmer primitive ────────────────────── */
.skel {
  background: linear-gradient(
    90deg,
    var(--hairline) 0%,
    var(--hairline-2) 50%,
    var(--hairline) 100%
  );
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
}

@keyframes skel-shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

/* Respect users who prefer reduced motion: hold a static tint. */
@media (prefers-reduced-motion: reduce) {
  .skel {
    animation: none;
    background: var(--hairline-2);
  }
}

/* ── Home loading skel layout ───────────────────────────── */
.state-home-loading {
  padding: 20px 20px 32px;
}

.state-home-loading__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.state-home-loading__header-left { flex: 1; }
.state-home-loading__header-right {
  display: flex;
  gap: 8px;
}

.state-home-loading__garden {
  margin-top: 28px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline);
  position: relative;
  height: 320px;
}

.state-home-loading__stone {
  position: absolute;
}

/* ── Practice loading skel layout ───────────────────────── */
.state-practice-loading {
  padding: 20px 20px 32px;
}

.state-practice-loading__hero {
  padding: 18px;
  background: var(--ink);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  gap: 14px;
}

.state-practice-loading__hero-body { flex: 1; }

.state-practice-loading__grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.state-practice-loading__card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  min-height: 130px;
}

/* ── Word detail loading skel layout ────────────────────── */
.state-word-detail-loading {
  padding: 0 20px 32px;
}

.state-word-detail-loading__hero {
  padding-top: 24px;
  padding-bottom: 16px;
}

.state-word-detail-loading__chips {
  display: flex;
  gap: 8px;
}

.state-word-detail-loading__box {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}

.state-word-detail-loading__row {
  margin-top: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  display: flex;
  gap: 12px;
  align-items: center;
}

.state-word-detail-loading__row-body { flex: 1; }

/* ── Session interstitial ───────────────────────────────── */
.state-session-interstitial {
  flex: 1;
  padding: 8px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.state-session-interstitial--correct {
  background: var(--accent-soft);
}

.state-session-interstitial--incorrect {
  background: var(--warn-soft);
}

.state-session-interstitial__choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Session interrupted ────────────────────────────────── */
.state-session-interrupted {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
}

.state-session-interrupted__body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.state-session-interrupted__actions {
  padding: 20px;
  border-top: 1px solid var(--hairline);
  display: flex;
  gap: 10px;
}

/* ── Profile loading ────────────────────────────────────── */
.state-profile-loading {
  padding: 24px 20px 32px;
}

.state-profile-loading__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.state-profile-loading__head-body { flex: 1; }

.state-profile-loading__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.state-profile-loading__tile {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}
