@charset "UTF-8";
.record-actions { display: flex; gap: 6px; }
tbody tr.is-actionable { cursor: pointer; }
tbody tr.is-actionable:hover { background: var(--soft); }
tbody tr.is-actionable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.record-detail {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  overflow: hidden;
}
.record-detail[open] { display: flex; flex-direction: column; }
html:has(.record-detail[open]) { overflow: hidden; }
.record-detail::backdrop { background: #142b2266; }
.record-detail-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 10px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.record-detail-header h2 { margin: 0; font-size: 18px; }
.record-detail-body { padding: 16px 18px; flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.record-detail-status:empty { display: none; }
.record-detail-status { margin-bottom: 12px; color: var(--muted); }
.record-detail-status.is-error { color: #ab3434; }
.record-special-rules {
  margin: 0 0 12px; padding: 9px 12px; border: 1px solid #d8b86a; border-radius: 8px;
  background: #fff7dc; color: #725317; font-weight: 700;
}
.record-detail-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.record-detail-facts dt { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.record-detail-facts dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; }
.record-detail-section { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.record-detail-section summary { cursor: pointer; font-weight: 650; padding: 4px 0; }
.record-detail-section[open] summary { margin-bottom: 10px; }
.record-detail-block > h3 { margin: 0 0 10px; padding: 4px 0; font-size: inherit; font-weight: 650; }
.record-detail .table-wrap { min-height: 0; }
.record-detail table { white-space: normal; }
.record-detail td { padding: 9px 12px; overflow-wrap: anywhere; }
.record-detail .model-name { max-width: none; }
.record-detail .pagination { margin-top: 10px; }
.record-item-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.record-deck-grid, .record-relic-grid, .record-choice-grid.is-shop { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.record-item { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.record-deck-grid .record-item[data-rarity="basic"] { background: #f8f1ec; border-color: #e6d8ce; }
.record-deck-grid .record-item[data-rarity="common"],
.record-relic-grid .record-item[data-rarity="common"] { background: #f2f5f1; border-color: #dce4d9; }
.record-deck-grid .record-item[data-rarity="uncommon"],
.record-relic-grid .record-item[data-rarity="uncommon"] { background: #edf4fa; border-color: #d1e1ed; }
.record-deck-grid .record-item[data-rarity="rare"],
.record-relic-grid .record-item[data-rarity="rare"] { background: #fff7e2; border-color: #ecdfb6; }
.record-deck-grid .record-item[data-rarity="ancient"] { background: #f5edff; border-color: #c9a8e8; }
.record-deck-grid .record-item[data-rarity="event"],
.record-relic-grid .record-item[data-rarity="event"] { background: #f7eef8; border-color: #ddc8df; }
.record-deck-grid .record-item[data-rarity="token"],
.record-relic-grid .record-item[data-rarity="token"] { background: #eef7f7; border-color: #c8dfdf; }
.record-deck-grid .record-item[data-rarity="status"] { background: #f1f1f1; border-color: #d4d4d4; }
.record-deck-grid .record-item[data-rarity="curse"] { background: #faecec; border-color: #e4c4c4; }
.record-deck-grid .record-item[data-rarity="quest"] { background: #f2effa; border-color: #d5cce8; }
/* Final deck only: multiplayer exclusivity takes precedence over rarity. */
.record-deck-grid .record-item[data-multiplayer-only="true"] { background: #e8f5e9; border-color: #91c99a; }
.record-deck-grid .record-item[data-multiplayer-only="true"] .record-item-name { color: #28613a; }
.record-relic-grid .record-item[data-rarity="empty"] { background: #f6f6f4; color: var(--muted); }
.record-route-completed { background: #edf8f0; border-color: #78b98b; }
.record-route-completed .record-item-name { color: #28633a; }
.record-route-defeated { background: #fff0ef; border-color: #d77a73; }
.record-route-defeated .record-item-name { color: #9b302a; }
.record-item-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 6px; }
.record-item-name { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.record-item-name.is-upgraded { color: #28613a; }
.record-item-count { font-size: 12px; white-space: nowrap; color: var(--muted); }
.record-item-note { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); }
.record-enchantment { display: block; margin-top: 6px; padding: 3px 6px; border-radius: 5px; background: #f0e8fa; color: #634581; font-size: 11px; overflow-wrap: anywhere; }
.record-party { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.record-party .record-item { flex: 0 1 180px; max-width: 100%; box-sizing: border-box; }
.record-choice-history { display: grid; gap: 5px; }
.record-choice-group {
  display: grid; grid-template-columns: minmax(130px, 170px) minmax(0, 1fr); align-items: start; gap: 8px;
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px;
  content-visibility: auto; contain-intrinsic-size: auto 42px;
}
.record-choice-header { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; min-width: 0; }
.record-choice-header h3 { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.record-choice-header span { font-size: 10px; }
.record-choice-grid { gap: 4px; }
.record-choice-grid.has-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.record-choice-grid.has-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.record-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 4px 8px; line-height: 1.35; }
.record-choice .record-item-note { margin-top: 0; }
.record-choice .record-enchantment { margin-top: 0; padding: 1px 4px; }
.record-choice.is-picked { background: var(--soft); border-color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
.record-choice.is-unpicked { background: var(--surface); }
@media (max-width: 1100px) {
  .record-deck-grid, .record-relic-grid, .record-choice-grid.is-shop { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .record-deck-grid, .record-relic-grid, .record-choice-grid.is-shop { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .record-detail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-detail-header, .record-detail-body { padding: 12px; }
  .record-choice-group { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .record-choice-header { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 6px; }
}
@media (max-width: 560px) {
  .record-deck-grid, .record-relic-grid, .record-choice-grid.is-shop,
  .record-choice-grid.has-three, .record-choice-grid.has-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .record-deck-grid, .record-relic-grid, .record-choice-grid.is-shop,
  .record-choice-grid.has-three, .record-choice-grid.has-four { grid-template-columns: minmax(0, 1fr); }
}
