/* ===== 韭币 chrome (auth chip) ===== */
.jiu-coin-chrome {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.jiu-coin-chrome[hidden] {
  display: none !important;
}
.jiu-coin-balance {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: #1f6b3a;
  padding: 4px 8px 4px 6px;
  border: 1.5px solid #1f6b3a;
  border-radius: 999px;
  background: rgba(61, 184, 106, 0.12);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.08);
}
.jiu-coin-icon {
  color: #1f6b3a;
  display: block;
  flex-shrink: 0;
  width: 0.95em;
  height: 0.95em;
  overflow: hidden;
}
.jiu-coin-inline,
.jiu-coin-amt {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  line-height: 1;
}
.jiu-coin-inline {
  margin: 0 0.12em;
}
.jiu-coin-success-amt,
.jiu-coin-amt .jiu-price-num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
}
.jiu-coin-success-body .jiu-coin-icon,
.jiu-coin-modal-body .jiu-coin-icon {
  color: #1f6b3a;
}
.jiu-coin-daily-btn {
  font: inherit;
  cursor: pointer;
  border: 1.5px solid #1f6b3a;
  background: #e4f6ea;
  color: #14532d;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.08);
}
.jiu-coin-daily-btn:hover:not(:disabled) {
  background: #d2efdc;
}
.jiu-coin-daily-btn:disabled,
.jiu-coin-daily-btn.is-claimed {
  opacity: 0.72;
  cursor: default;
  box-shadow: none;
}


.jiu-daily-short { display: none; }
.jiu-daily-full { display: inline; }

[data-theme="dark"] .jiu-coin-balance {
  color: #7dcea0;
  border-color: #3d8f5f;
  background: rgba(61, 184, 106, 0.16);
}
[data-theme="dark"] .jiu-coin-icon {
  color: #7dcea0;
}
[data-theme="dark"] .jiu-coin-daily-btn {
  border-color: #3d8f5f;
  background: #1a3324;
  color: #b7e0c5;
}
[data-theme="dark"] .jiu-coin-daily-btn:hover:not(:disabled) {
  background: #21402d;
}

/* ===== Title-trailing price pills (home / hub) ===== */
.jiu-price-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 0.4em;
  padding: 2px 7px 2px 8px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  vertical-align: 0.12em; /* whole pill vs title, not icon vs digit */
  border-radius: 999px;
  border: 1.5px solid var(--ink, #2a2a2a);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}
.jiu-price-badge .jiu-price-num {
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.jiu-price-badge.jiu-price-paid .jiu-coin-icon {
  color: #1f6b3a;
}
.jiu-price-badge.jiu-price-free .jiu-coin-icon {
  color: var(--ink-soft, #5a5348);
  opacity: 0.85;
}
.jiu-price-badge.jiu-price-paid {
  color: #14532d;
  background: rgba(61, 184, 106, 0.16);
  border-color: #1f6b3a;
}
.jiu-price-badge.jiu-price-free {
  color: var(--ink-soft, #5a5348);
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--line, #3a3530);
}

[data-theme="dark"] .jiu-price-badge.jiu-price-paid {
  color: #b7e0c5;
  background: rgba(61, 184, 106, 0.18);
  border-color: #3d8f5f;
}
[data-theme="dark"] .jiu-price-badge.jiu-price-free {
  color: var(--mute, #a89f90);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line, #efe6d4);
}
[data-theme="dark"] .jiu-price-badge.jiu-price-paid .jiu-coin-icon {
  color: #7dcea0;
}
[data-theme="dark"] .jiu-price-badge.jiu-price-free .jiu-coin-icon {
  color: var(--mute, #a89f90);
}
[data-theme="dark"] .jiu-coin-modal-body .jiu-coin-icon,
[data-theme="dark"] .jiu-coin-success-body .jiu-coin-icon {
  color: #7dcea0;
}

/* ===== Daily claim confirm / success modals (纸墨) ===== */
.jiu-coin-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.45);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.jiu-coin-modal[hidden] {
  display: none !important;
}
.jiu-coin-dialog {
  position: relative;
  width: min(420px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--paper, #f7f1e6);
  color: var(--ink, #222);
  border: 2px solid var(--line, #2a2a2a);
  border-radius: 16px;
  padding: 22px 18px 16px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.18);
}
.jiu-coin-dialog h2 {
  margin: 0 28px 12px 0;
  font-family: var(--kaiti, "Kaiti SC", "KaiTi", serif);
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.jiu-coin-close-x {
  position: absolute;
  right: 10px;
  top: 8px;
  border: none;
  background: transparent;
  color: var(--ink, #222);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.jiu-coin-modal-body {
  margin: 0 0 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink, #222);
}
.jiu-coin-success-body {
  font-size: 1.05rem;
  text-align: center;
  padding: 6px 4px 2px;
  font-family: var(--kaiti, "Kaiti SC", "KaiTi", serif);
  letter-spacing: 0.06em;
}
.jiu-coin-dialog--celebrate {
  text-align: center;
}
.jiu-coin-dialog--celebrate .jiu-coin-modal-actions {
  justify-content: center;
}
.jiu-coin-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.jiu-coin-primary,
.jiu-coin-secondary {
  font: inherit;
  cursor: pointer;
  border: 1.5px solid var(--ink, #2a2a2a);
  border-radius: 999px;
  padding: 7px 16px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
  color: var(--ink, #2a2a2a);
}
.jiu-coin-primary {
  background: #e4f6ea;
  color: #14532d;
  border-color: #1f6b3a;
}
.jiu-coin-secondary {
  background: var(--paper, #f7f1e6);
}
.jiu-coin-primary:hover:not(:disabled),
.jiu-coin-secondary:hover:not(:disabled) {
  filter: brightness(0.97);
}
.jiu-coin-primary:disabled {
  opacity: 0.72;
  cursor: wait;
  box-shadow: none;
}

[data-theme="dark"] .jiu-coin-modal {
  background: rgba(0, 0, 0, 0.55);
}
[data-theme="dark"] .jiu-coin-dialog {
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .jiu-coin-primary {
  background: #1a3324;
  color: #b7e0c5;
  border-color: #3d8f5f;
}
[data-theme="dark"] .jiu-coin-secondary {
  background: var(--paper, #1c1a16);
  color: var(--ink, #efe6d4);
  border-color: var(--line, #efe6d4);
}

@media (max-width: 640px) {
  .jiu-coin-chrome {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .jiu-coin-daily-btn {
    padding: 6px 8px;
    font-size: 12px;
    min-height: 36px;
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.08);
  }
  .jiu-daily-full { display: none; }
  .jiu-daily-short { display: inline; }
  .jiu-coin-balance {
    padding: 5px 7px 5px 5px;
    font-size: 12px;
    min-height: 36px;
  }
  .jiu-coin-modal-actions {
    justify-content: stretch;
  }
  .jiu-coin-primary,
  .jiu-coin-secondary {
    flex: 1;
    text-align: center;
  }
  .jiu-price-badge {
    font-size: 10px;
    padding: 2px 7px;
  }
}
@media (max-width: 420px) {
  .jiu-coin-daily-btn {
    padding: 6px 7px;
    letter-spacing: 0;
  }
  .jiu-coin-balance {
    padding: 5px 6px;
  }
}

/* ===== icon-unify: drawn 韭币 art inside the unchanged 0.95em box =====
   The box is `.jiu-coin-icon` above (width/height .95em, overflow hidden, flex:none) — the art only FILLS it.
   Light art is the default everywhere. Dark art (cream sticker, light-brown outline) is opt-in ONLY over
   genuinely dark surfaces in the dark theme (listed below). Kraft surfaces in dark theme (modals/cards,
   rewind button + confirm, fill-mode / confirm dialogs, rank card) keep the light art — do not add them here. */
.jiu-coin-icon > .jiu-coin-pic,
.jiu-coin-icon > svg {
  display: block;
  width: 100%;
  height: 100%;
}
.jiu-coin-img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  image-rendering: auto;
  -webkit-user-drag: none;
  user-select: none;
}
.jiu-coin-pic--night { display: none !important; }
[data-theme="dark"] :is(
  .jiu-coin-balance,
  .jiu-price-badge,
  .academy-zone-card,
  .pvp-rules,
  #pvpReadyCopy,
  #pvpResultMeMeta
) .jiu-coin-pic--day { display: none; }
[data-theme="dark"] :is(
  .jiu-coin-balance,
  .jiu-price-badge,
  .academy-zone-card,
  .pvp-rules,
  #pvpReadyCopy,
  #pvpResultMeMeta
) .jiu-coin-pic--night { display: block !important; }

/* ===== wheel-polish: 后悔券 as an inline unit icon + shared unit-icon helpers (js/unit-icons.js) =====
   `.ticket-icon` mirrors `.jiu-coin-icon`: a 1.15em square box the art only fills (object-fit keeps the 15×17 stub's ratio).
   The words stay in the DOM as `.u-sr` (visually hidden, out of flow) so screen readers / innerText still say 韭币 / 后悔券. */
.u-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.ticket-icon {
  display: block;
  flex-shrink: 0;
  width: 1.15em;
  height: 1.15em;
  margin: -0.1em 0; /* paints 1.15em, takes 0.95em of line height (like the coin box), so no line or button grows */
  overflow: hidden;
}
.ticket-icon > .ticket-pic { display: block; width: 100%; height: 100%; }
.ticket-img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}
.ticket-icon.is-art-fallback { width: auto; height: auto; font-size: 0.85em; line-height: 1; }
.u-ticket-amt {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  line-height: 1;
  white-space: nowrap;
  vertical-align: baseline;
}
.u-ticket-n { font-variant-numeric: tabular-nums; }
.u-amt { white-space: nowrap; }
.ticket-pic--night { display: none !important; }
[data-theme="dark"] :is(
  #leaderboardAssistNote,
  .result-ticket-chip
) .ticket-pic--day { display: none; }
[data-theme="dark"] :is(
  #leaderboardAssistNote,
  .result-ticket-chip
) .ticket-pic--night { display: block !important; }
