/* v094: farm dashboard at the top of the accounts page (replaces the "เลือก ID ที่ต้องการดู" heading). */
:root {
  --dash-ink: #f0f0ff;
  --dash-ink-2: #c3c6dc;
  --dash-ink-3: #8a90ad;
  --dash-ink-4: #5f6684;
  --dash-edge: rgb(255 255 255 / 8%);
  --dash-edge-soft: rgb(255 255 255 / 5%);
  --dash-card: linear-gradient(150deg, rgb(30 32 58 / 94%), rgb(16 19 35 / 96%) 72%);
  --dash-well: rgb(7 9 20 / 55%);
  --dash-win: #78e7b8;
  --dash-loss: #ff7d93;
  --dash-pearl: #7ee8e6;
  --dash-gold: #f4d38a;
  --dash-violet: #ab91ff;
  --dash-ease: cubic-bezier(0.23, 1, 0.32, 1);
}

/* Heading row: title, time window, live dot. Search stays on the right. */
.directory-intro.dash-intro { align-items: center; margin-bottom: 16px; }
.dash-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; min-width: 0; }
html body #directory-title.dash-title { margin: 0; color: var(--dash-ink); font-size: clamp(22px, 1.1rem + 1vw, 30px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.dash-title .kicker-star { color: var(--dash-violet); font-size: .7em; vertical-align: .12em; }
.dash-window { padding: 5px 10px; border: 1px solid var(--dash-edge); border-radius: 999px; background: var(--dash-well); color: var(--dash-ink-2); font-size: 12px; font-weight: 600; }
.dash-live { display: inline-flex; align-items: center; gap: 7px; color: var(--dash-ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.dash-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--dash-win); box-shadow: 0 0 0 3px rgb(120 231 184 / 16%); animation: dash-pulse 2.4s ease-in-out infinite; }
.dash-live.is-failed i { background: var(--dash-loss); box-shadow: 0 0 0 3px rgb(255 125 147 / 16%); animation: none; }
@keyframes dash-pulse { 50% { opacity: .45; } }

/* Grid: winrate leads, pearls second, two small cards stacked on the right. */
.farm-dash { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .9fr); gap: 12px; margin-bottom: 22px; }
.dash-card { position: relative; min-width: 0; overflow: hidden; padding: 18px; border: 1px solid var(--dash-edge); border-radius: 18px; background: var(--dash-card); box-shadow: 0 14px 32px rgb(0 0 0 / 22%), inset 0 1px rgb(255 255 255 / 4%); }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dash-label { display: inline-flex; align-items: center; gap: 7px; color: var(--dash-ink-3); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.dash-sub { color: var(--dash-ink-4); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.dash-hero, .dash-big, .dash-mid { display: block; color: var(--dash-ink); font-variant-numeric: tabular-nums; letter-spacing: -.035em; line-height: 1; }

/* Winrate: the focal number. The bottom edge is split win/loss by the real share. */
.dash-win::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: linear-gradient(90deg, var(--dash-win) 0 var(--win-share, 0%), var(--dash-loss) var(--win-share, 0%) 100%); opacity: .85; }
.farm-dash.is-loading .dash-win::after { background: var(--dash-edge); }
.dash-win-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 14px 0 16px; }
.dash-hero { font-size: clamp(48px, 2.2rem + 2.2vw, 68px); font-weight: 800; }
.dash-hero small { margin-left: 2px; color: var(--dash-win); font-size: .46em; font-weight: 700; letter-spacing: 0; }
.dash-wl { display: grid; gap: 6px; justify-items: end; padding-bottom: 4px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-wl span { display: inline-flex; align-items: baseline; gap: 6px; }
.dash-wl b { color: var(--dash-ink); font-size: 16px; font-weight: 700; }
.dash-wl .is-win { color: var(--dash-win); }
.dash-wl .is-loss { color: var(--dash-loss); }

/* 24 hourly bars, wins at the bottom, losses on top (like a wave counter). */
.dash-wave { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); align-items: end; gap: 3px; height: 64px; padding: 6px; border-radius: 10px; background: var(--dash-well); }
.dash-bar { height: var(--h, 2%); min-height: 2px; border-radius: 3px 3px 1px 1px; background: linear-gradient(to bottom, var(--dash-loss) 0 var(--loss, 0%), var(--dash-win) var(--loss, 0%) 100%); opacity: .9; transform-origin: bottom; animation: dash-rise .5s var(--dash-ease) both; transition: opacity .15s ease; }
.dash-bar:hover { opacity: 1; filter: brightness(1.15); }
.dash-bar.is-empty { background: rgb(255 255 255 / 9%); }
.dash-bar:nth-child(3n) { animation-delay: 30ms; } .dash-bar:nth-child(3n+1) { animation-delay: 60ms; }
@keyframes dash-rise { from { transform: scaleY(.2); opacity: 0; } }
.dash-axis { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); margin-top: 6px; padding: 0 6px; color: var(--dash-ink-4); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-axis span:last-child { justify-self: end; }

/* Pearls: total, average, and an hourly line in the pearl color. */
.dash-pearl-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; }
.dash-pearl-icon img { width: 18px; height: 18px; object-fit: contain; }
.dash-pearl-icon img:not([src]) { visibility: hidden; }
.dash-big { margin: 14px 0 8px; color: var(--dash-pearl); font-size: clamp(34px, 1.6rem + 1.4vw, 46px); font-weight: 800; text-shadow: 0 0 28px rgb(126 232 230 / 22%); }
.dash-avg { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 12px; color: var(--dash-ink-3); font-size: 12px; }
.dash-avg b { color: var(--dash-ink); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-avg small { color: var(--dash-ink-4); font-size: 11px; }
.dash-spark { display: block; width: 100%; height: 56px; color: var(--dash-pearl); }
.dash-pearl .dash-axis { padding: 0; }

/* Right column. */
.dash-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; min-width: 0; }
.dash-best, .dash-unique { padding: 16px 18px; }
.dash-mid { margin: 10px 0 6px; font-size: 30px; font-weight: 800; }
.dash-best .dash-mid { color: var(--dash-gold); }
.dash-best-where { display: grid; gap: 2px; margin: 0; color: var(--dash-ink-2); font-size: 13px; font-weight: 600; line-height: 1.35; }
.dash-best-where span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-best-where small { color: var(--dash-ink-4); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.dash-unique { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: center; gap: 4px 14px; }
.dash-unique-icon { grid-row: span 2; width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 6px 14px rgb(171 145 255 / 35%)); }
.dash-unique .dash-mid { margin: 8px 0 0; }
.dash-unique .dash-mid small { color: var(--dash-ink-3); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.dash-meter { grid-column: 2; height: 5px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: var(--dash-well); }
.dash-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8b7bff, var(--dash-violet)); transition: width .6s var(--dash-ease); }

/* Loading: soft shimmer on the numbers. */
.farm-dash.is-loading :is(.dash-hero, .dash-big, .dash-mid) { color: var(--dash-ink-4); text-shadow: none; }

@media (max-width: 1080px) {
  .farm-dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dash-stack { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
}
/* v095: phone is compact. Winrate and Pearls stay full width, the two small cards sit side by side. */
@media (max-width: 680px) {
  .directory-intro.dash-intro { align-items: stretch; gap: 10px; margin-bottom: 10px; }
  html body #directory-title.dash-title { font-size: 20px; }
  .dash-head { gap: 6px 8px; }
  .dash-window { padding: 3px 8px; font-size: 11px; }
  .dash-live { font-size: 11px; }
  .farm-dash { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 14px; }
  .dash-card { padding: 12px 14px; border-radius: 14px; }
  .dash-label { font-size: 10px; letter-spacing: .1em; }
  .dash-sub { font-size: 11px; }
  .dash-win-main { margin: 6px 0 8px; }
  .dash-hero { font-size: 38px; }
  .dash-wl { gap: 2px; font-size: 12px; padding-bottom: 2px; }
  .dash-wl b { font-size: 14px; }
  .dash-wave { gap: 2px; height: 38px; padding: 4px; border-radius: 8px; }
  .dash-axis { margin-top: 4px; font-size: 9px; }
  .dash-big { margin: 6px 0 4px; font-size: 26px; }
  .dash-avg { margin-bottom: 6px; font-size: 11px; }
  .dash-avg b { font-size: 15px; }
  .dash-spark { height: 34px; }
  .dash-stack { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .dash-best, .dash-unique { padding: 12px; }
  .dash-mid { margin: 6px 0 4px; font-size: 22px; }
  .dash-best-where { font-size: 11px; }
  .dash-best-where small { font-size: 10px; }
  .dash-best-where small { white-space: normal; }
  .dash-unique { grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; }
  .dash-unique-icon { grid-row: auto; width: 30px; height: 30px; }
  .dash-unique .dash-mid { margin: 4px 0 0; }
  .dash-unique .dash-mid small { font-size: 11px; }
  .dash-meter { grid-column: 1 / -1; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .dash-bar { animation: none; }
  .dash-live i { animation: none; }
  .dash-meter span { transition: none; }
}
/* v331: all-time Summer Pearls under the 24-hour number */
.dash-alltime { margin-top: 4px; font-size: 12px; font-weight: 700; color: #f4d38a; font-variant-numeric: tabular-nums; }
