/* ui/DailyOps — the Daily Ops panel. Contract: ./DailyOps.spec.md */

.sp-ops { display: flex; flex-direction: column; gap: 10px; color: var(--sp-text); }
.sp-ops__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.sp-ops__title {
  margin: 0; font-family: var(--sp-font-display); font-weight: 600; font-size: 18px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.sp-ops__refresh { font-family: var(--sp-font-mono); font-variant-numeric: tabular-nums; font-size: 13px; color: var(--sp-text-dim); }
.sp-ops__missions { display: flex; flex-direction: column; gap: 10px; }
.sp-ops[data-variant="station"] { box-sizing: border-box; width: 100%; max-width: 1100px; margin-inline: auto; padding: 20px 16px 24px; }
.sp-ops[data-variant="station"] .sp-ops__missions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

/* A job ticket: a riveted plate with a strip of hazard tape down its left edge. */
.sp-ops__mission {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 14px 26px;
  border-radius: var(--sp-radius); border: 1px solid var(--sp-seam);
  background: var(--sp-tape) left / 12px 100% no-repeat, var(--sp-rivets), var(--sp-plate);
  box-shadow: var(--sp-bevel);
}
.sp-ops__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sp-ops__slot { font-family: var(--sp-font-display); font-weight: 600; font-size: 13px; letter-spacing: 0.12em; color: var(--sp-text-faint); }
/* The ticket's kind: a stamped label, dark lettering on a pale tag, a degree off square. */
.sp-ops__mission .sp-ops__slot { padding: 3px 8px 2px; letter-spacing: 0.1em; color: var(--sp-ink); background: color-mix(in srgb, var(--sp-text) 92%, var(--sp-ink)); border-radius: 2px; transform: rotate(-1.2deg); box-shadow: 0 1px 0 var(--sp-edge-dark); }
.sp-ops__reward, .sp-ops__claimed {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--sp-font-mono); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; color: var(--sp-quanta);
}
.sp-ops__claimed { color: var(--sp-text-dim); text-transform: uppercase; }
.sp-ops__icon { flex: none; width: 12px; height: 12px; background: currentColor; }
.sp-ops__icon[data-icon="check"] { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat; }
.sp-ops__icon[data-icon="reroll"] { width: 14px; height: 14px; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.3-5.7'/%3E%3Cpath d='M20 4v4h-4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.3-5.7'/%3E%3Cpath d='M20 4v4h-4'/%3E%3C/svg%3E") center / contain no-repeat; }
.sp-ops__text { margin: 0; font-size: 14px; line-height: 1.35; }
/* Progress is a gauge: a dark well, blocks of hazard yellow. */
.sp-ops__bar { position: relative; flex: 1; height: 10px; border-radius: 2px; background: var(--sp-well); border: 1px solid var(--sp-seam); box-shadow: var(--sp-inset); overflow: hidden; }
.sp-ops__fill {
  position: absolute; inset: 0 auto 0 0;
  background: var(--sp-gauge);
  transition: width 500ms var(--sp-ease-out);
}
.sp-ops__count { min-width: 36px; text-align: right; font-family: var(--sp-font-mono); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--sp-text-dim); }

.sp-ops__mission[data-state="complete"] {
  border-color: var(--sp-quanta);
  box-shadow: var(--sp-bevel), 0 0 0 2px var(--sp-quanta);
}
.sp-ops__mission[data-state="complete"] .sp-ops__fill { background: var(--sp-quanta); }
.sp-ops__mission[data-state="complete"] .sp-ops__count { color: var(--sp-quanta); }
.sp-ops__mission[data-state="claimed"] { opacity: 0.62; }
.sp-ops__mission[data-state="claimed"] .sp-ops__text { color: var(--sp-text-dim); }
.sp-ops__mission[data-state="claimed"] .sp-ops__fill { background: var(--sp-text-faint); }

.sp-ops__claim, .sp-ops__reroll, .sp-ops__line { min-height: 44px; }
/* The mockup's `.btn.claim`: the Theme's primary, lit in the currency colour
   (its glow, border and corner brackets), at the card's full width. */
.sp-ops .sp-ops__claim {
  --sp-action: var(--sp-quanta);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 0; width: 100%; height: 44px; min-height: 44px; padding: 0 16px; margin-top: 8px;
  font-family: var(--sp-font-display); font-weight: 600; font-size: 14px; line-height: 1;
  letter-spacing: 0.12em; text-indent: 0.12em; text-transform: uppercase; white-space: nowrap;
}
.sp-ops__claims { display: flex; gap: 8px; margin-top: 8px; }
.sp-ops__claims .sp-ops__claim { flex: 1; width: auto; margin-top: 0; }
.sp-ops__claim-double {
  flex: none; min-width: 64px; height: 44px; padding: 0 12px; border-radius: var(--sp-radius-sm); cursor: pointer;
  border: 1px solid var(--sp-seam);
  background: color-mix(in srgb, var(--sp-quanta) 8%, var(--sp-space-2)); color: var(--sp-quanta);
  box-shadow: inset 0 1px 0 var(--sp-edge-light), 0 3px 0 var(--sp-edge-dark);
  font-family: var(--sp-font-display); font-weight: 600; font-size: 14px; letter-spacing: 0.08em;
}
.sp-ops__claim-double:disabled { opacity: 0.5; cursor: default; }
.sp-ops .sp-ops__reroll {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; max-width: 100%; padding: 0 16px; border-radius: var(--sp-radius-sm); border: 1px solid var(--sp-seam); background: var(--sp-space-2);
  box-shadow: inset 0 1px 0 var(--sp-edge-light), 0 3px 0 var(--sp-edge-dark);
  font-family: var(--sp-font-display); font-weight: 500; font-size: 14px; line-height: 1; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sp-text);
}
.sp-ops .sp-ops__reroll:hover { background: color-mix(in srgb, var(--sp-text) 10%, var(--sp-space-2)); }

.sp-ops__bonus {
  display: flex; align-items: center; gap: 10px; padding: 12px 4px 0; margin-top: 4px;
  border-top: 1px solid var(--sp-line); font-size: 12px;
}
.sp-ops__grow { flex: 1; height: 1px; background: linear-gradient(90deg, var(--sp-line), transparent); }
.sp-ops__pips { display: inline-flex; gap: 10px; }
.sp-ops__bonus .sp-ops__slot { letter-spacing: 0.12em; }
.sp-ops__pip { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--sp-line-strong); background: var(--sp-well); }
.sp-ops__pip[data-on="true"] { background: var(--sp-quanta); border-color: var(--sp-quanta); }
.sp-ops__bonus[data-state="ready"] { color: var(--sp-quanta); }
.sp-ops__bonus[data-state="claimed"] { opacity: 0.62; }

.sp-ops__line {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 0 16px;
  background: color-mix(in srgb, var(--sp-space-1) 60%, var(--sp-space-0)); border: 0; border-bottom: 2px solid var(--sp-seam);
  color: var(--sp-text); font: inherit; font-size: 12px; cursor: pointer;
}
.sp-ops__line .sp-ops__title { font-size: 13px; }
.sp-ops__line .sp-ops__pips { gap: 4px; }
.sp-ops__line .sp-ops__pip { width: 7px; height: 7px; }
.sp-ops__more { margin-left: auto; color: var(--sp-text-faint); }

/* ——— the reroll confirm: a centred modal, a bottom sheet on a phone ——— */
.sp-ops-sheet { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; }
.sp-ops-sheet__scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--sp-space-0) 70%, transparent); animation: sp-ops-fade 220ms var(--sp-ease-out); }
.sp-ops-sheet__panel {
  position: relative; width: min(420px, calc(100vw - 32px)); max-height: 90vh; overflow: auto;
  display: flex; flex-direction: column; gap: 10px; padding: 26px 24px 22px;
  border-radius: var(--sp-radius); border: 1px solid var(--sp-seam); background: var(--sp-rivets), var(--sp-plate); box-shadow: var(--sp-bevel);
  color: var(--sp-text); animation: sp-ops-rise 220ms var(--sp-ease-out); transition: transform 160ms var(--sp-ease-out);
}
.sp-ops-sheet__handle { display: none; }
.sp-ops-sheet__title {
  margin: 0; padding-right: 36px; font-family: var(--sp-font-display); font-weight: 600; font-size: 16px;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.sp-ops-sheet__text { margin: 0; font-size: 15px; line-height: 1.4; }
.sp-ops-sheet__loss { margin: 0; font-size: 13px; line-height: 1.5; color: var(--sp-text-dim); }
.sp-ops-sheet__actions { display: flex; gap: 12px; margin-top: 8px; }
.sp-ops-sheet__button { flex: 1 1 0; min-width: 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; white-space: normal; overflow-wrap: break-word; text-align: center; }
.sp-ops-sheet__close {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px;
  border: 0; background: none; color: var(--sp-text-dim); font-size: 16px; cursor: pointer;
}
@keyframes sp-ops-rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sp-ops-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 599px) {
  .sp-ops[data-variant="station"] .sp-ops__claim { min-height: 56px; }
  .sp-ops-sheet { place-items: end stretch; }
  .sp-ops-sheet__panel {
    width: 100%; border-radius: var(--sp-radius) var(--sp-radius) 0 0;
    padding: 8px 20px calc(22px + env(safe-area-inset-bottom));
  }
  .sp-ops-sheet__handle { display: flex; justify-content: center; padding: 6px 0 10px; touch-action: none; cursor: grab; }
  .sp-ops-sheet__handle i { width: 36px; height: 4px; border-radius: 2px; background: var(--sp-line-strong); }
  .sp-ops-sheet__actions { flex-direction: column-reverse; }
  .sp-ops-sheet__button { min-height: 56px; }
  @keyframes sp-ops-rise { from { transform: translateY(100%); } to { transform: none; } }
}

@media (prefers-reduced-motion: reduce) {
  .sp-ops-sheet__panel, .sp-ops-sheet__scrim { animation: none; transition: none; }
}
