/* ===== Покерный тренажёр разбора — design tokens & components ===== */

h1 { font-size: 32px; font-weight: 700; line-height: 1.25; }
h2 { font-size: 24px; font-weight: 700; line-height: 1.3; }
h3 { font-size: 18px; font-weight: 600; line-height: 1.4; }
body, p, li, label, input, select, button { line-height: 1.5; }

/* ---------- Nav ---------- */
.nav-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: 999px; font-weight: 600; font-size: .875rem;
  color: #2D2A2699; transition: all .2s ease;
}
.nav-pill:hover { color: #2D2A26; background: #FFFFFF; }
.nav-pill-active { background: #FF7A59; color: #fff; box-shadow: 0 2px 8px rgba(255,122,89,.35); }
.nav-pill-active:hover { color: #fff; background: #FF7A59; }

.tabbar-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .65rem; font-weight: 600; color: #2D2A2680; min-width: 64px;
}
.tabbar-item-active { color: #FF7A59; }

/* ---------- Card slots ---------- */
.card-slot {
  position: relative; aspect-ratio: 2/3; border-radius: .85rem;
  border: 2px dashed #F0E4DC; background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card-slot:hover { box-shadow: 0 6px 16px rgba(45,42,38,.08); transform: translateY(-2px); }
.card-slot.filled { border-style: solid; border-color: #F0E4DC; }
.card-slot img { width: 100%; height: 100%; object-fit: contain; border-radius: .7rem; }
.card-slot .placeholder { color: #2D2A2640; font-size: 1.5rem; }
.card-slot.required-missing { border-color: #FF3B30; animation: shake .35s ease; }
.card-slot.just-filled { animation: card-snap .32s cubic-bezier(.34,1.56,.64,1); }

@keyframes card-snap {
  0% { transform: scale(.7) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.08) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.field-error-hint {
  font-size: .75rem; color: #FF3B30; margin-top: .25rem; display: none;
}
.field-error-hint.show { display: block; }

/* ---------- Deck picker modal ---------- */
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: .4rem; }
.deck-card-btn {
  border-radius: .5rem; overflow: hidden; border: 2px solid transparent; background: #fff;
  transition: transform .15s ease, border-color .15s ease; cursor: pointer;
}
.deck-card-btn:hover:not(:disabled) { transform: translateY(-3px); border-color: #FF7A59; }
.deck-card-btn:disabled { opacity: .25; cursor: not-allowed; }
.deck-card-btn img { width: 100%; display: block; }

/* ---------- Poker table ---------- */
.poker-table {
  background: radial-gradient(ellipse at center, #FFFFFF 0%, #FFF3EC 100%);
  border: 2px solid #F0E4DC; border-radius: 2rem; padding: 1.5rem;
  box-shadow: inset 0 0 0 8px #FFF9F5;
}
.board-slot { width: clamp(48px, 12vw, 76px); }
.street-tab {
  padding: .45rem .9rem; border-radius: 999px; font-weight: 700; font-size: .8rem;
  color: #2D2A2670; border: 1px solid #F0E4DC; background: #fff; transition: all .2s ease;
}
.street-tab-active { background: #2D2A26; color: #fff; border-color: #2D2A26; }
.street-tab:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- Action feed ---------- */
.feed-item {
  animation: slide-in .28s ease;
  border: 1px solid #F0E4DC; border-radius: .85rem; padding: .6rem .8rem; background: #fff;
}
@keyframes slide-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.actor-dot { width: .55rem; height: .55rem; border-radius: 999px; display: inline-block; }
.actor-dot.me { background: #FF7A59; }
.actor-dot.opponent { background: #2D2A2650; }

/* ---------- Verdict badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .75rem;
  padding: .3rem .65rem; border-radius: 999px; animation: badge-pop .4s ease;
}
.badge-good { background: #34C75920; color: #1f8a3c; }
.badge-marginal { background: #FFB02025; color: #a06600; }
.badge-mistake { background: #FF3B3020; color: #c62828; }
@keyframes badge-pop {
  0% { transform: scale(.6); opacity: 0; }
  55% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---------- Timeline (report) ---------- */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before {
  content: ''; position: absolute; left: .45rem; top: .25rem; bottom: .25rem; width: 2px; background: #F0E4DC;
}
.timeline-item { position: relative; margin-bottom: 1rem; }
.timeline-dot {
  position: absolute; left: -1.75rem; top: .3rem; width: 1rem; height: 1rem; border-radius: 999px;
  border: 3px solid #fff; box-shadow: 0 0 0 2px currentColor;
}
.timeline-dot.good { color: #34C759; }
.timeline-dot.marginal { color: #FFB020; }
.timeline-dot.mistake { color: #FF3B30; }

.explain-panel {
  overflow: hidden; max-height: 0; transition: max-height .32s ease;
}
.explain-panel.open { max-height: 480px; }

/* ---------- Skeleton loading ---------- */
.skeleton { background: linear-gradient(90deg, #F0E4DC 25%, #FBEFE8 37%, #F0E4DC 63%); background-size: 400% 100%; animation: skeleton-wave 1.4s ease infinite; border-radius: .6rem; }
@keyframes skeleton-wave { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Toasts ---------- */
.toast {
  background: #2D2A26; color: #fff; padding: .8rem 1rem; border-radius: .85rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); display: flex; align-items: center; gap: .75rem;
  animation: toast-in .25s ease;
}
.toast.toast-error { background: #FF3B30; }
@keyframes toast-in { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Cards & hover lift ---------- */
.surface-card {
  background: #fff; border: 1px solid #F0E4DC; border-radius: 1rem; transition: box-shadow .2s ease, transform .2s ease;
}
.surface-card.hoverable:hover { box-shadow: 0 10px 24px rgba(45,42,38,.08); transform: translateY(-2px); }

/* ---------- Stats mini widgets ---------- */
.stat-widget canvas { width: 100% !important; height: 44px !important; }

/* ---------- Focus & motion ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #FF7A59; outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
