/* The task board on the profile page: what Vye set you, how far you are, and the dungeon when you are in it.
   Builds on profile.html's tokens (--pink, --green, --gold, --red, --cut, .card, .btn). */

.tb { display: grid; gap: 18px; }
/* Four tabs do not fit a phone: the row scrolls, and each tab gets tighter */
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .tab { flex: none; }
@media (max-width: 560px) { .tabs .tab { padding: 10px 11px 9px; font-size: 12px; } }
/* The count lands after the tab row is drawn; its negative margins keep it from making the row taller, which pushed
   the whole page down by a few pixels when it came in */
.tb-tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin: -6px 0 -6px 8px; padding: 0 6px; background: var(--pink); color: #fff; font: 700 12px var(--mono); letter-spacing: 0; vertical-align: 2px; }
.tb-tab-count.locked { background: var(--red); }

/* ---------- the numbers on top ---------- */
.tb-hud { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tb-hud.five { grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); }
.tb-stat.vc b { color: var(--cyan); text-shadow: 0 0 18px rgba(0,255,213,.45); }
@media (max-width: 760px) { .tb-hud.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tb-hud.five .vc { grid-column: 1 / -1; } }
.tb-stat { padding: 14px 16px; border: 1px solid var(--line); background: rgba(10,0,15,.72); clip-path: var(--cut-sm); display: grid; gap: 2px; }
.tb-stat b { font: 400 30px "Hacked", Impact, sans-serif; letter-spacing: .04em; line-height: 1; font-variant-numeric: tabular-nums; }
.tb-stat span { font: 700 12px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ghost); }
.tb-stat.hot b { color: var(--hot); text-shadow: 0 0 18px rgba(255,36,146,.55); }
.tb-stat.good b { color: var(--mint); }
.tb-stat.bad b { color: var(--red); }
.tb-stat.gold b { color: var(--gold); }
@media (max-width: 640px) { .tb-hud { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- a task ---------- */
.tb-task { position: relative; display: grid; gap: 14px; }
.tb-task header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.tb-task h3 { margin: 0; font: 400 clamp(20px, 3vw, 26px) "Hacked", Impact, sans-serif; letter-spacing: .04em; }
.tb-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-chip { padding: 3px 8px; border: 1px solid rgba(255,255,255,.16); font: 700 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.tb-chip.pink { border-color: rgba(255,36,146,.6); color: var(--soft); }
.tb-chip.red { border-color: rgba(255,61,95,.7); color: var(--red); }
.tb-chip.green { border-color: rgba(125,255,43,.6); color: var(--mint); }
.tb-chip.gold { border-color: rgba(255,253,120,.5); color: var(--gold); }
.tb-line { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.55; max-width: 68ch; }
.tb-line b { color: #fff; }
.tb-quote { margin: 0; padding: 12px 14px; border-left: 3px solid var(--pink); background: rgba(255,36,146,.08); font: 500 15px var(--mono); line-height: 1.5; color: #fff; overflow-wrap: anywhere; }
.tb-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font: 700 12px var(--mono); letter-spacing: .08em; color: var(--ghost); font-variant-numeric: tabular-nums; }
.tb-row b { color: #fff; }
.tb-row .warn { color: var(--gold); }
.tb-row .danger { color: var(--red); }

/* ---------- bars ---------- */
/* segmented: one cell per step, filled ones glow; the newest fill pops */
.tb-segs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; height: 22px; }
.tb-seg { position: relative; border: 1px solid rgba(255,36,146,.35); background: rgba(0,0,0,.45); transform: skewX(-14deg); }
.tb-seg.on { border-color: var(--pink); background: linear-gradient(180deg, var(--hot), var(--pink)); box-shadow: 0 0 14px rgba(255,36,146,.55); }
.tb-seg.on.fresh { animation: tb-pop .7s cubic-bezier(.2,1.6,.4,1); }
.tb-segs.green .tb-seg.on { border-color: var(--green); background: linear-gradient(180deg, var(--mint), var(--green)); box-shadow: 0 0 14px rgba(125,255,43,.45); }
.tb-segs.red .tb-seg { border-color: rgba(255,61,95,.35); }
.tb-segs.red .tb-seg.on { border-color: var(--red); background: linear-gradient(180deg, #ff8095, var(--red)); box-shadow: 0 0 14px rgba(255,61,95,.55); }
.tb-segs.dense { height: 14px; gap: 3px; }
@keyframes tb-pop { 0% { transform: skewX(-14deg) scaleY(.2); filter: brightness(2.2); } 100% { transform: skewX(-14deg) scaleY(1); filter: none; } }

/* continuous: time left, draining */
.tb-bar { position: relative; height: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.5); overflow: hidden; }
.tb-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--pink), var(--hot)); box-shadow: 0 0 12px rgba(255,36,146,.6); transition: width 1s linear; }
.tb-bar.gold i { background: linear-gradient(90deg, #d8b600, var(--gold)); box-shadow: 0 0 12px rgba(255,253,120,.45); }
.tb-bar.red i { background: linear-gradient(90deg, #b3002a, var(--red)); }

/* ---------- handing in a praise ---------- */
.tb-entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tb-entries li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; font-size: 14px; color: var(--dim); overflow-wrap: anywhere; }
.tb-entries li.fresh { animation: tb-in .6s ease-out; }
.tb-entries .where { font: 700 13px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--hot); min-width: 62px; }
@keyframes tb-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.tb-flash { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(255,36,146,.4), transparent 62%); animation: tb-flash .9s ease-out forwards; }
@keyframes tb-flash { from { opacity: 1; } to { opacity: 0; } }

/* ---------- history ---------- */
.tb-history { list-style: none; margin: 0; padding: 0; display: grid; }
.tb-history li { display: grid; grid-template-columns: 96px 1fr auto; gap: 4px 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 14px; }
.tb-history .title { color: #fff; overflow-wrap: anywhere; min-width: 0; }
.tb-history .when { font: 700 12px var(--mono); color: var(--ghost); white-space: nowrap; }
.tb-history li.child .title { padding-left: 14px; color: var(--dim); }
@media (max-width: 640px) { .tb-history li { grid-template-columns: 1fr auto; } .tb-history li > .tb-chip { grid-column: 1 / -1; justify-self: start; } }

.tb-empty { text-align: center; padding: 40px 18px; }
.tb-empty p { color: var(--dim); max-width: 46ch; margin: 8px auto 0; line-height: 1.55; }

/* ---------- the dungeon: everything else is locked ---------- */
.tb.locked .tb-hud, .tb.locked .tb-others { filter: grayscale(.9) brightness(.45); pointer-events: none; user-select: none; }
.tb-others { position: relative; display: grid; gap: 18px; }
.tb-lockbar { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 16px; border: 1px dashed rgba(255,61,95,.7); color: var(--red); font: 400 clamp(14px, 2.6vw, 19px) "Hacked", Impact, sans-serif; letter-spacing: .16em; text-transform: uppercase; text-align: center; text-shadow: 0 0 16px rgba(255,61,95,.7); }
.tb-lockbar svg { flex: none; width: 20px; height: 20px; fill: currentColor; }

.tb-cell {
  position: relative; padding: clamp(20px, 3.5vw, 32px); display: grid; gap: 18px;
  border: 1px solid rgba(255,61,95,.75);
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(255,61,95,.09) 46px 50px),
    radial-gradient(circle at 50% 0%, rgba(255,61,95,.22), transparent 60%),
    rgba(12,0,4,.92);
  box-shadow: 0 0 0 1px rgba(255,61,95,.15), 0 0 60px rgba(255,61,95,.22), inset 0 0 80px rgba(0,0,0,.7);
  clip-path: var(--cut);
}
.tb-cell::before { content: ""; position: absolute; inset: 0 0 auto; height: 8px; background: repeating-linear-gradient(-45deg, var(--red) 0 12px, #1a0006 12px 24px); opacity: .85; }
.tb-cell .stamp { justify-self: start; padding: 6px 12px; border: 2px solid var(--red); color: var(--red); font: 400 clamp(22px, 4vw, 34px) "Hacked", Impact, sans-serif; letter-spacing: .2em; transform: rotate(-3deg); text-shadow: 0 0 16px rgba(255,61,95,.8); }
.tb-cell h3 { margin: 0; font: 400 clamp(22px, 3.4vw, 30px) "Hacked", Impact, sans-serif; letter-spacing: .05em; }
.tb-cell .why { color: var(--dim); font-size: 14px; line-height: 1.55; }
.tb-cell .why b { color: #fff; }
.tb-now { display: grid; gap: 10px; padding: 16px; border: 1px solid rgba(255,61,95,.45); background: rgba(0,0,0,.5); }
.tb-now .label { font: 700 12px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--red); }
.tb-now h4 { margin: 0; font: 400 20px "Hacked", Impact, sans-serif; letter-spacing: .05em; }
.tb-now .tb-quote { border-left-color: var(--red); background: rgba(255,61,95,.08); }
.tb-eval { padding: 12px 14px; border: 1px dashed var(--gold); color: var(--gold); font: 700 12.5px var(--mono); letter-spacing: .06em; }
.btn.red { --btn-line: rgba(255,61,95,.8); --btn-bg: rgba(255,61,95,.16); }
.tb-cell .lock-note { font-size: 12.5px; color: var(--ghost); }

@media (prefers-reduced-motion: reduce) {
  .tb-seg.on.fresh, .tb-entries li.fresh, .tb-flash { animation: none; }
  .tb-bar i { transition: none; }
}

/* Rewards to collect: a task she judged done whose pay is not written as paid (profile-tasks.js collectCard) */
.tb-collect { border-color: rgba(255,253,120,.45); }
.tb-collect .tb-history li { grid-template-columns: 1fr auto auto; }
.tb-collect .end { display: flex; align-items: center; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.tb-collect .btn { min-height: 38px; padding: 9px 14px; }
.tb-collect-got { font: 700 13px var(--mono); color: var(--mint); white-space: nowrap; }
.tb-collect-got.fresh { animation: tb-collected .9s cubic-bezier(.2,.9,.3,1.4); }
.tb-collect-note { font-size: 13px; color: var(--dim); max-width: 34ch; }
.tb-collect-note.failed { color: var(--red); }
.tb-step b { color: var(--soft); }

/* Give up on a running task, with its Are you sure row (profile-tasks.js giveUpRow) */
.tb-giveup { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.tb-giveup .btn { min-height: 34px; padding: 7px 12px; }
.tb-giveup.asking span { font-size: 13px; color: var(--soft); margin-right: auto; }
@keyframes tb-collected { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .tb-collect-got.fresh { animation: none; } }
@media (max-width: 560px) { .tb-collect .tb-history li { grid-template-columns: 1fr auto; } .tb-collect .end { grid-column: 1 / -1; justify-content: flex-start; } }
