/* === Stardew Valley — What should I do today? === */

:root {
  --td: #d38a3c;            /* early-morning amber */
  --td-dark: #8f5418;
  --td-bg: #fff2e0;
  --td-have: #2f7d4a;
  --td-have-bg: #e2f2e7;
  --td-have-border: #a9d6b7;
  --td-now: #8a5a00;
  --td-now-bg: #fdefcf;
  --td-now-border: #ecc978;

  /* tab bar accent, consumed by stardew-common.css */
  --tab-bg: var(--td-bg);
  --tab-accent: var(--td);
  --tab-text: var(--td-dark);
}
html.dark {
  --td: #e6ad62;
  --td-dark: #f3cd94;
  --td-bg: rgba(230, 173, 98, 0.13);
  --td-have: #9ad9ae;
  --td-have-bg: rgba(110, 196, 140, 0.15);
  --td-have-border: rgba(140, 214, 165, 0.42);
  --td-now: #f2cc7d;
  --td-now-bg: rgba(242, 196, 108, 0.13);
  --td-now-border: rgba(242, 196, 108, 0.42);
}

main { max-width: 760px; }
.subtitle { margin-bottom: 1.4rem; }

/* --- Loader --- */
.td-drop { margin-bottom: 1.4rem; }
.td-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 1.6rem 1rem;
  border: 2px dashed var(--td);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.td-dropzone:hover, .td-dropzone.td-over { background: var(--td-bg); }
.td-drop:focus-within .td-dropzone { outline: 3px solid var(--td); outline-offset: 3px; }
.td-drop-icon { font-size: 2rem; line-height: 1; }
.td-drop-main { font-family: "Fredoka", "Nunito", sans-serif; font-weight: 600; font-size: 1.2rem; color: var(--td-dark); }
.td-drop-sub { color: var(--muted); font-size: 0.92rem; }
/* The real input stays focusable for keyboards and screen readers; the label is what you see. */
.td-file {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
}
.td-loaded .td-dropzone { flex-direction: row; justify-content: center; padding: 0.7rem 1rem; gap: 0.5rem; box-shadow: none; }
.td-loaded .td-drop-icon { font-size: 1.3rem; }
.td-loaded .td-drop-main { font-size: 1rem; }
.td-loaded .td-drop-main::after { content: " (another farm)"; font-weight: 400; color: var(--muted); }
.td-loaded .td-drop-sub { display: none; }

.td-private { margin: 0.7rem 0 0; font-size: 0.9rem; color: var(--muted); text-align: center; }
.td-status { margin: 0.5rem 0 0; min-height: 1.4em; text-align: center; font-weight: 600; color: var(--td-dark); }
.td-status.td-error {
  color: var(--ink);
  background: var(--td-bg);
  border: 2px solid var(--td);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  font-weight: 600;
  text-align: left;
}
body.td-busy, body.td-busy .td-dropzone { cursor: progress; }

/* --- Help --- */
.td-help {
  margin-top: 1rem;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.td-help summary, .td-sum {
  cursor: pointer;
  list-style: none;
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--td-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.td-help summary::-webkit-details-marker, .td-sum::-webkit-details-marker { display: none; }
.td-help summary::before, .td-sum::before {
  content: "›";
  display: inline-block;
  width: 1em;
  font-size: 1.3em;
  line-height: 1;
  transition: transform 0.15s ease;
}
.td-help[open] summary::before, details[open] > .td-sum::before { transform: rotate(90deg); }
.td-help-body { padding: 0 1.1rem 1rem; font-size: 0.95rem; }
.td-help-body h3 { margin: 0.9rem 0 0.2rem; font-size: 0.95rem; color: var(--ink); }
.td-help-body p { margin: 0.3rem 0; }
.td-help-body code {
  background: var(--td-bg);
  color: var(--ink);
  border-radius: 6px;
  padding: 0.05rem 0.35rem;
  font-size: 0.9em;
}
.td-path { display: inline-block; max-width: 100%; overflow-wrap: anywhere; user-select: all; }
.td-note { color: var(--muted); }

/* --- Result cards --- */
.td-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}
details.td-card { padding: 0; }
details.td-card > :not(summary) { margin-left: 1.15rem; margin-right: 1.15rem; }
details.td-card > :last-child { margin-bottom: 1rem; }
.td-sum { font-size: 1.05rem; padding: 0.85rem 1.15rem; }

.td-head { border-top: 5px solid var(--td); }
.td-hello { margin: 0; color: var(--muted); font-weight: 600; }
.td-farm {
  margin: 0.1rem 0 0;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.td-date { margin: 0.15rem 0 0.8rem; font-weight: 700; color: var(--td-dark); font-size: 1.05rem; }
.td-wx { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.td-wx-box {
  flex: 1 1 140px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  background: var(--td-bg);
  border-radius: 12px;
  font-weight: 600;
}
.td-wx-icon { font-size: 1.6rem; line-height: 1; }
.td-wx-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.td-luck { margin: 0.8rem 0 0; font-weight: 600; }
.td-luck .td-wx-label { display: inline; margin-right: 0.3rem; }
.td-spirits { display: block; font-weight: 400; font-style: italic; color: var(--muted); font-size: 0.93rem; margin-top: 0.15rem; }
.td-mp { margin: 0.7rem 0 0; font-size: 0.9rem; color: var(--muted); }

.td-h2 {
  margin: 0 0 0.5rem;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--td-dark);
}
.td-list { list-style: none; margin: 0; padding: 0; }
.td-item {
  display: flex;
  gap: 0.7rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
}
.td-item:first-child { border-top: none; padding-top: 0.2rem; }
.td-ico { font-size: 1.35rem; line-height: 1.3; flex: 0 0 1.7rem; text-align: center; }
.td-item > div { min-width: 0; }
.td-what { margin: 0; font-weight: 600; }
.td-detail { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.94rem; overflow-wrap: anywhere; }
.td-detail b { color: var(--ink); font-weight: 700; }
.td-empty { margin: 0.3rem 0 0.2rem; color: var(--muted); }

.td-h3 {
  margin: 0.9rem 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.td-p { margin: 0.2rem 0 0.6rem; }
.td-dim { color: var(--muted); font-size: 0.88rem; }
p.td-dim { margin: 0.5rem 0 0; }

/* rows: fish, museum, cooking */
.td-rows { list-style: none; margin: 0; padding: 0; }
.td-row {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.6rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--border);
}
.td-row:first-child { border-top: none; }
.td-row-name { font-weight: 700; flex: 0 0 auto; }
.td-row-meta { color: var(--muted); font-size: 0.9rem; flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.td-row-note { flex: 1 0 100%; font-size: 0.84rem; color: var(--muted); font-style: italic; }

/* week */
.td-wklist { list-style: none; margin: 0; padding: 0; }
.td-wk { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.6rem 0; border-top: 1px solid var(--border); }
.td-wk:first-child { border-top: none; padding-top: 0.1rem; }
.td-wk-day { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--td-dark); }
.td-wk-note { font-size: 0.88rem; color: var(--muted); overflow-wrap: anywhere; }

/* chips */
.td-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; list-style: none; margin: 0; padding: 0; }
.td-chip {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.td-chip.td-have { background: var(--td-have-bg); border-color: var(--td-have-border); color: var(--td-have); font-weight: 700; }
.td-chip.td-now { background: var(--td-now-bg); border-color: var(--td-now-border); color: var(--td-now); font-weight: 700; }
.td-chip-where { display: block; font-size: 0.75rem; font-weight: 600; opacity: 0.85; }
.td-chips-block .td-chip { border-radius: 12px; }
.td-key { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }

.td-bundle { padding: 0.55rem 0; border-top: 1px solid var(--border); }
.td-h3 + .td-bundle { border-top: none; padding-top: 0.1rem; }
.td-bundle-head { margin: 0 0 0.35rem; }

.td-swatch {
  display: inline-block;
  width: 0.8em; height: 0.8em;
  margin-left: 0.3em;
  border-radius: 3px;
  border: 1px solid var(--border);
  vertical-align: -0.05em;
}

/* trackers */
.td-btn {
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  border-radius: 12px;
  border: 2px solid var(--td);
  background: var(--td-bg);
  color: var(--td-dark);
  cursor: pointer;
  margin-top: 0.7rem;
}
.td-btn:hover { background: var(--btn); }
.td-btn:focus-visible { outline: 3px solid var(--td); outline-offset: 2px; }
.td-track-note { margin: 0.6rem 0 0; font-size: 0.92rem; }
.td-track-note a { color: var(--td-dark); }

@media (max-width: 480px) {
  .td-card { padding: 0.9rem 0.9rem; }
  details.td-card { padding: 0; }
  details.td-card > :not(summary) { margin-left: 0.9rem; margin-right: 0.9rem; }
  .td-sum { padding: 0.8rem 0.9rem; }
  .td-farm { font-size: 1.4rem; }
  h1 { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .td-help summary::before, .td-sum::before { transition: none; }
}
