/* Fantasy Consigliere — App Shell & Components */

/* ============================================================
   RESET & FOUNDATIONS
============================================================ */
* {
  box-sizing: border-box;
}
body,
html {
  margin: 0;
  padding: 0;
}
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
input,
textarea {
  font-family: inherit;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
}
ul,
ol,
li {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ============================================================
   PWA SHELL — v6.0.0 Kintsugi lesson:
   body + .app both position:fixed inset:0; no scroll bounce.
============================================================ */
.pwa-shell {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.shell-header {
  flex-shrink: 0;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  position: relative;
  z-index: 10;
}
.shell-header-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--ink);
  flex: 1;
  line-height: 1;
}
.shell-header-title span {
  color: var(--ink-3);
  font-style: italic;
}
.shell-header-back {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  margin-left: -4px;
}
.shell-header-back:active {
  color: var(--accent);
}
.shell-header-meta {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.shell-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.shell-body--no-header {
  padding-top: env(safe-area-inset-top, 0px);
}

.shell-tabbar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--bg-raised);
  border-top: 1px solid var(--rule-soft);
  padding: 8px 6px calc(22px + env(safe-area-inset-bottom, 0px));
  position: relative;
  z-index: 10;
}
.shell-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  color: var(--ink-3);
  min-height: 48px;
  transition: color 180ms var(--ease-out);
  border-radius: 10px;
}
.shell-tab[data-active="true"] {
  color: var(--accent);
}
.shell-tab svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.6;
}
.shell-tab-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ============================================================
   MODE CHIP — persistent global state indicator
============================================================ */
.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  background: var(--accent-wash);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-hot);
  cursor: pointer;
  transition: background 180ms var(--ease-out);
}
.mode-chip:active {
  background: var(--accent-glow);
}
.mode-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.mode-chip[data-mode="Rebuild"] {
  color: var(--go);
}
.mode-chip[data-mode="Rebuild"] .mode-chip-dot {
  background: var(--go);
}

/* ============================================================
   VERDICT — the signature component
============================================================ */
.verdict-card {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 20px;
  padding: 28px 24px 24px;
  position: relative;
  overflow: hidden;
}
.verdict-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.9;
}
.verdict-card[data-verdict="take"]::before,
.verdict-card[data-verdict="start"]::before {
  background: var(--go);
}
.verdict-card[data-verdict="pass"]::before,
.verdict-card[data-verdict="sit"]::before {
  background: var(--stop);
}
.verdict-card[data-verdict="neutral"]::before,
.verdict-card[data-verdict="swap"]::before,
.verdict-card[data-verdict="hold"]::before {
  background: var(--hold);
}

.verdict-eyebrow {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.verdict-word {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 0 0 12px;
}
.verdict-word[data-verdict="take"] {
  color: var(--go);
}
.verdict-word[data-verdict="pass"] {
  color: var(--stop);
}
.verdict-word[data-verdict="neutral"] {
  color: var(--ink);
}
.verdict-word[data-verdict="start"] {
  color: var(--go);
}
.verdict-word[data-verdict="sit"] {
  color: var(--stop);
}
.verdict-word[data-verdict="swap"] {
  color: var(--accent-hot);
}
.verdict-rationale {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink-2);
  letter-spacing: -0.012em;
  max-width: 36ch;
}
.verdict-changes {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.55;
}
.verdict-changes b {
  color: var(--ink-2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  display: block;
  margin-bottom: 4px;
}

/* verdict pill for inline use */
.verdict-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.verdict-pill[data-v="take"],
.verdict-pill[data-v="start"] {
  background: color-mix(in oklch, var(--go) 16%, transparent);
  color: var(--go);
}
.verdict-pill[data-v="pass"],
.verdict-pill[data-v="sit"] {
  background: color-mix(in oklch, var(--stop) 16%, transparent);
  color: var(--stop);
}
.verdict-pill[data-v="neutral"],
.verdict-pill[data-v="hold"] {
  background: color-mix(in oklch, var(--hold) 16%, transparent);
  color: var(--hold);
}
.verdict-pill[data-v="swap"] {
  background: var(--accent-wash);
  color: var(--accent-hot);
}
.verdict-pill[data-v="pick-up"] {
  background: color-mix(in oklch, var(--go) 16%, transparent);
  color: var(--go);
}
.verdict-pill[data-v="stash"] {
  background: var(--accent-wash);
  color: var(--accent-hot);
}
.verdict-pill[data-v="monitor"] {
  background: color-mix(in oklch, var(--hold) 14%, transparent);
  color: var(--hold);
}

/* ============================================================
   CARDS & SURFACES
============================================================ */
.panel {
  background: var(--bg-raised);
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  overflow: hidden;
}
.panel-header {
  padding: 14px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule-soft);
}
.panel-header-title {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.panel-header-action {
  font-size: 12px;
  color: var(--accent-hot);
  font-family: var(--font-sans);
  font-weight: 500;
}
.panel-body {
  padding: 14px 18px 16px;
}

/* ============================================================
   PLAYER ROW
============================================================ */
.player-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--rule-soft);
}
.player-row:last-child {
  border-bottom: none;
}
.player-pos {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-3);
  padding: 3px 6px;
  background: var(--bg-sunk);
  border-radius: 4px;
  text-align: center;
  letter-spacing: 0.02em;
  width: 32px;
}
.player-pos[data-p="QB"] {
  color: oklch(70% 0.11 30);
}
.player-pos[data-p="RB"] {
  color: oklch(70% 0.1 148);
}
.player-pos[data-p="WR"] {
  color: oklch(70% 0.1 240);
}
.player-pos[data-p="TE"] {
  color: oklch(70% 0.1 78);
}
.player-pos[data-p="K"] {
  color: var(--ink-4);
}
.player-pos[data-p="DEF"] {
  color: oklch(70% 0.06 260);
}
.player-pos[data-p="FLEX"] {
  color: var(--ink-3);
}
.player-name {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.2;
}
.player-meta {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
  letter-spacing: 0.01em;
}
.player-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
}
.player-value-bench {
  color: var(--ink-3);
}

/* ============================================================
   SOURCE TAGS
============================================================ */
.source-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.source-tag {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  background: var(--bg-sunk);
  color: var(--ink-3);
  border-radius: 3px;
  letter-spacing: 0.02em;
}

/* ============================================================
   RECOMMENDATION CARD
============================================================ */
.rec-card {
  background: var(--bg-raised);
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
}
.rec-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.rec-target {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.rec-target-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.rec-target-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.rec-value-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}
.rec-value-strip .num {
  font-weight: 500;
  color: var(--ink);
  font-size: 14px;
}
.rec-value-strip .arrow {
  color: var(--ink-4);
}
.rec-rationale {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  margin-top: 10px;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: transform 120ms var(--ease-out), background 180ms var(--ease-out);
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.985);
}
.btn-primary {
  background: var(--accent);
  color: #1a1407;
}
.btn-primary:active {
  background: var(--accent-hot);
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
}
.btn-ghost {
  color: var(--ink-2);
}

/* ============================================================
   INPUTS
============================================================ */
.input {
  width: 100%;
  background: var(--bg-sunk);
  border: 1px solid var(--rule-soft);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  transition: border-color 180ms var(--ease-out);
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-raised);
}
.input::placeholder {
  color: var(--ink-4);
}

/* ============================================================
   SHEETS & MODALS
============================================================ */
.scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  animation: scrim-in 180ms var(--ease-out);
}
@keyframes scrim-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-elevated);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  max-height: 82%;
  overflow-y: auto;
  z-index: 101;
  box-shadow: var(--elev-3);
  animation: sheet-in 260ms var(--ease-out);
}
@keyframes sheet-in {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--ink-4);
  border-radius: 2px;
  margin: 0 auto 16px;
  opacity: 0.6;
}
.sheet-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.022em;
  margin: 0 0 4px;
}
.sheet-sub {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal-fullscreen {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  animation: modal-in 220ms var(--ease-out);
}
@keyframes modal-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================================
   MISC
============================================================ */
.hairline {
  height: 1px;
  background: var(--rule-soft);
  margin: 16px 0;
}
.spacer-sm {
  height: 12px;
}
.spacer-md {
  height: 20px;
}
.spacer-lg {
  height: 32px;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px;
}

.num {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
}

.pos-bar {
  height: 4px;
  background: var(--bg-sunk);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.pos-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: width 400ms var(--ease-out);
}
.pos-bar-fill[data-strength="strong"] {
  background: var(--go);
}
.pos-bar-fill[data-strength="adequate"] {
  background: var(--accent);
}
.pos-bar-fill[data-strength="weak"] {
  background: var(--stop);
}

/* scrollbar kill for webkit */
.shell-body::-webkit-scrollbar,
.sheet::-webkit-scrollbar {
  display: none;
}
.shell-body,
.sheet {
  scrollbar-width: none;
}

/* ============================================================
   SKELETON LOADING
============================================================ */
@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }
  100% {
    background-position: 400px 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-sunk) 0%, var(--bg-raised) 40%, var(--bg-sunk) 80%);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-line {
  height: 13px;
  border-radius: 4px;
}

.skeleton-line-sm {
  height: 10px;
  border-radius: 3px;
}

.skeleton-card {
  background: var(--bg-raised);
  border: 1px solid var(--rule-soft);
  border-radius: 14px;
  overflow: hidden;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.skeleton-player-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--rule-soft);
}
.skeleton-player-row:last-child {
  border-bottom: none;
}

/* ============================================================
   TAB CONTENT FADE-IN
============================================================ */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fade-in 220ms var(--ease-out) both;
}

/* ============================================================
   ACTIVE / PRESS STATES
============================================================ */
.player-row:active {
  background: var(--bg-sunk);
  transition: background 80ms;
}

.panel:active {
  opacity: 0.92;
}

/* League card press */
.league-card {
  cursor: pointer;
  transition: transform 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.league-card:active {
  transform: scale(0.985);
}

/* Generic tappable row */
.tappable-row {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.tappable-row:active {
  background: var(--bg-sunk);
  transition: background 60ms;
}

/* Segmented control */
.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 0;
  background: var(--bg-sunk);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 16px;
}
.segmented-option {
  padding: 8px 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  text-align: center;
  border-radius: 8px;
  transition: all 180ms var(--ease-out);
  letter-spacing: 0.02em;
}
.segmented-option[data-active="true"] {
  background: var(--bg-raised);
  color: var(--ink);
  box-shadow: var(--elev-1);
}
