.sealed-theme {
  --bg: #0d1118;
  --panel: #13161e;
  --panel-strong: #0f121a;
  --panel-secondary: #151922;
  --border-gray: #3a4156;
  --border-dark: #1f3b59;
  --accent: #c9a84c;
  --accent-strong: #c9a84c;
  --accent-light: #f5e7b2;
  --accent-rgb: 201, 168, 76;
  --accent-light-rgb: 245, 231, 178;
  --text: #dde2f0;
  --text-bright: #eaf7ff;
  --text-secondary: #c2c9da;
  --text-light: #dfe6f5;
  --text-header: #f0f4ff;
  --text-pure: #eef4ff;
  --muted: #8d95a8;
  --line: #252a38;
  --btn-bg: var(--panel-secondary);
  --btn-bg-active: rgba(var(--accent-rgb), 0.10);
  --btn-border: var(--border-gray);
  --btn-border-active: #c9a84c;
  --btn-hover-bg: #1b2030;
  --btn-hover-color: #f2e7c2;
  --btn-hover-border: rgba(var(--accent-rgb), 0.6);
  --btn-hover-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.55), 0 0 12px rgba(var(--accent-rgb), 0.25);
  background: var(--bg);
  color: var(--text);
}

.sealed-page-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 20px 88px;
}

.sealed-page {
  max-width: none;
  margin: 0;
}

.sealed-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.sealed-kicker {
  margin: 0 0 4px;
  color: #7dd3c7;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sealed-header h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
}

.sealed-master-status,
.sealed-note,
.sealed-inline-error,
.sealed-empty,
.sealed-deck-status {
  font-size: 13px;
  line-height: 1.7;
}

.sealed-master-status {
  display: none;
  margin: 0;
  color: #b9c9d7;
  text-align: right;
}

.sealed-master-status.is-error {
  display: block;
}

.sealed-master-status.is-error,
.sealed-inline-error {
  color: #fca5a5;
}

.sealed-master-status.is-ready {
  color: #8be4bd;
}

.sealed-restore {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(125, 211, 199, 0.28);
  border-radius: 8px;
  background: rgba(9, 28, 43, 0.92);
}

.sealed-restore h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.sealed-restore p {
  margin: 0 0 8px;
  color: #cbd8e4;
  font-size: 13px;
  line-height: 1.7;
}

.sealed-view-tabs,
.sealed-class-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sealed-class-tabs {
  align-items: center;
}

.sealed-view-tabs {
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(125, 211, 199, 0.22);
}

.sealed-view-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #a9bacb;
  min-height: 38px;
  padding: 0 12px;
  font-weight: 850;
  cursor: pointer;
}

.sealed-class-tab {
  width: 38px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(125, 211, 199, 0.18);
  border-radius: 6px;
  background: rgba(16, 23, 34, 0.88);
  color: #a9bacb;
  padding: 0;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.sealed-class-tab:hover,
.sealed-class-tab:focus-visible {
  border-color: rgba(125, 211, 199, 0.46);
  background: rgba(26, 39, 54, 0.96);
}

.sealed-class-tab img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 0.72;
  filter: brightness(0.95) saturate(0.95);
}

.sealed-view-tab.active,
.sealed-view-tab.is-active {
  border-bottom-color: #7dd3c7;
  color: #ffffff;
  background: rgba(125, 211, 199, 0.08);
}

.sealed-view-tab:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.sealed-class-tab.active,
.sealed-class-tab.is-active {
  border-color: #d5b15a;
  background: rgba(213, 177, 90, 0.12);
  box-shadow: inset 0 -2px 0 rgba(213, 177, 90, 0.88);
  transform: translateY(-1px);
}

.sealed-class-tab.dim img {
  filter: grayscale(0.5) brightness(0.65);
  opacity: 0.8;
}

.sealed-class-tab.active img,
.sealed-class-tab.is-active img {
  opacity: 1;
  filter: brightness(1.15) saturate(1.12);
}

.sealed-view {
  display: none;
}

.sealed-view.is-active {
  display: block;
}

.sealed-grid {
  display: grid;
  gap: 14px 26px;
}

.sealed-grid-setup {
  grid-template-columns: minmax(360px, 0.4fr) minmax(0, 0.6fr);
}

.sealed-seed-panel {
  grid-column: 1 / -1;
}

.sealed-panel {
  border: 1px solid rgba(125, 211, 199, 0.22);
  border-radius: 8px;
  background: rgba(9, 22, 35, 0.96);
  padding: 16px;
}

.sealed-grid-setup > .sealed-panel {
  border: 0;
  border-top: 1px solid rgba(125, 211, 199, 0.26);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(9, 22, 35, 0.54), rgba(9, 22, 35, 0.12));
  padding: 14px 0 0;
}

.sealed-panel h2,
.sealed-panel-head h2 {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: 0;
}

.sealed-section-title {
  color: #edfaff;
  font-size: 18px;
  line-height: 1.3;
}

.sealed-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.sealed-actions,
.sealed-main-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sealed-main-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.sealed-main-actions[hidden] {
  display: none;
}

#sealed-view-opening .sealed-main-actions {
  position: sticky;
  bottom: 0;
  z-index: 30;
  margin-top: 18px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: transparent;
  justify-items: center;
}

#sealed-view-opening .sealed-main-actions::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: 0;
  background: linear-gradient(to top, rgba(8, 12, 19, 0.96) 0%, rgba(8, 12, 19, 0.88) 66%, rgba(8, 12, 19, 0) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

#sealed-view-opening .sealed-main-actions.is-stuck::before {
  opacity: 1;
}

#sealed-to-builder-btn {
  position: relative;
  z-index: 1;
  min-width: 190px;
  justify-content: center;
}

.sealed-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sealed-action-row-secondary {
  margin-top: 2px;
}

.sealed-action-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sealed-disabled-action-tip {
  position: relative;
}

/* disabled ボタンは既存 tip-wrap のクリックトリガーにできないため、親要素で無効時チップを制御する。 */
.sealed-disabled-tip-pop {
  left: calc(100% + 10px);
}

.sealed-disabled-action-tip:not(.has-disabled-tip) .sealed-disabled-tip-pop {
  display: none;
}

.sealed-action-help .sealed-tip-wrap {
  align-self: center;
}

.sealed-btn:not(.btn),
.sealed-primary:not(.btn),
.sealed-icon-btn:not(.btn) {
  min-height: 34px;
  border: 1px solid rgba(125, 211, 199, 0.34);
  border-radius: 6px;
  background: #10283b;
  color: #edfaff;
  padding: 0 12px;
  font-weight: 850;
  cursor: pointer;
}

.sealed-primary:not(.btn) {
  border-color: #7dd3c7;
  background: #0f766e;
}

.sealed-btn:not(.btn):hover,
.sealed-primary:not(.btn):hover,
.sealed-icon-btn:not(.btn):hover {
  background: #17405d;
}

.sealed-primary:not(.btn):hover {
  background: #0d9488;
}

.sealed-btn:not(.btn):disabled,
.sealed-primary:not(.btn):disabled,
.sealed-icon-btn:not(.btn):disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.sealed-pack-plan {
  max-width: 760px;
  margin-left: 10px;
}

.sealed-pack-plan {
  display: grid;
  gap: 8px;
}

.sealed-pack-option {
  margin: 12px 0 0 10px;
}

.sealed-pack-plan ~ .sealed-inline-error {
  margin-left: 10px;
}

.sealed-pack-actions {
  margin-top: 0;
}

.sealed-pack-actions .btn {
  min-height: 30px;
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.sealed-btn-add {
  margin-top: 0;
}

.sealed-pack-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto 52px;
  gap: 6px;
  align-items: center;
}

.sealed-input,
.sealed-select:not(.filter-select),
.sealed-textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(125, 211, 199, 0.26);
  border-radius: 6px;
  background: #0a1a29;
  color: #edfaff;
  padding: 0 10px;
  font-weight: 750;
  font-size: 14px;
}

.sealed-select.filter-select {
  width: 100%;
  min-width: 0;
}

.sealed-pack-row .cr-input {
  width: 100%;
  min-width: 0;
}

.sealed-pack-count-controls {
  min-width: 94px;
  gap: 4px;
  justify-content: flex-end;
}

.sealed-pack-count-controls button {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 999px;
  padding: 0;
}

.sealed-pack-count-input {
  width: 38px;
  min-width: 38px;
  min-height: 30px;
  padding: 0 4px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sealed-pack-remove {
  width: 52px;
  min-height: 30px;
  padding: 0 6px;
  white-space: nowrap;
}

.sealed-textarea {
  min-height: 92px;
  padding: 10px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  line-height: 1.45;
}

.sealed-share-code {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.sealed-share-code label,
.sealed-basic-count-label {
  color: #cbd8e4;
  font-size: 13px;
  font-weight: 900;
}

.sealed-rule-stack {
  display: grid;
  gap: 14px;
}

.sealed-rule-basic {
  display: grid;
  grid-template-columns: minmax(220px, max-content) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(37, 42, 56, 0.78);
  padding: 14px 0 10px;
}

.sealed-rules-panel .sealed-basic-check {
  font-size: 14px;
  font-weight: 900;
}

.sealed-rules-panel .sealed-basic-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.sealed-basic-count {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 8px;
  align-items: center;
}

.sealed-basic-count[hidden] {
  display: none;
}

.sealed-rule-editor {
  display: grid;
  gap: 6px;
}

.sealed-rule-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.sealed-rule-editor-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  min-height: 22px;
}

.sealed-rule-label-with-help,
.sealed-rule-editor h3,
.sealed-rule-dialog-title-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sealed-rule-editor h3 {
  margin: 0;
  color: #cbd8e4;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.sealed-tip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.sealed-help-chip {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  min-height: 16px;
  max-height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  border: 1px solid var(--border-gray);
  border-radius: 50%;
  background: linear-gradient(180deg, #1c2330 0%, #131925 100%);
  color: #e7edf9;
  padding: 0;
  font-family: inherit;
  font-size: 10px;
  font-weight: 900;
  line-height: 16px;
  letter-spacing: 0;
  text-indent: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 2px 8px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  overflow: hidden;
}

.sealed-help-chip:hover,
.sealed-help-chip:focus-visible,
.sealed-help-chip[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent-light);
  background: linear-gradient(180deg, rgba(var(--accent-rgb),0.28) 0%, rgba(var(--accent-rgb),0.18) 100%);
  transform: translateY(-1px);
  outline: none;
}

.sealed-tip-pop {
  position: absolute;
  top: 50%;
  left: calc(100% + 14px);
  transform: translateY(-50%);
  min-width: 180px;
  max-width: min(236px, calc(100vw - 56px));
  padding: 6px 8px;
  border: 1px solid rgba(var(--accent-rgb),0.45);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(20, 26, 37, 0.99) 0%, rgba(12, 17, 26, 0.99) 100%);
  color: var(--text-pure);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.01em;
  box-shadow: 0 16px 32px rgba(0,0,0,0.52);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 80;
}

.sealed-tip-pop::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: rgba(var(--accent-rgb),0.45);
}

.sealed-tip-pop::after {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(100% - 1px);
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #1a202b;
}

.sealed-rule-dialog-title-row .sealed-tip-wrap {
  position: relative;
}

.sealed-rule-dialog-title-row .sealed-tip-pop {
  top: 50%;
  left: calc(100% + 12px);
  right: auto;
  transform: translateY(-50%);
  width: max-content;
  max-width: min(320px, calc(100vw - 96px));
  z-index: 120;
}

.sealed-rule-dialog-title-row .sealed-tip-pop::before {
  top: 50%;
  left: auto;
  right: 100%;
  bottom: auto;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: rgba(var(--accent-rgb),0.45);
}

.sealed-rule-dialog-title-row .sealed-tip-pop::after {
  top: 50%;
  left: auto;
  right: calc(100% - 1px);
  bottom: auto;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #1a202b;
}

.sealed-rule-rows {
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(37, 42, 56, 0.78);
  margin-left: 10px;
}

.sealed-rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid rgba(37, 42, 56, 0.78);
  padding: 6px 0;
}

.sealed-rule-row .sealed-icon-btn {
  min-height: 34px;
}

.sealed-rule-card {
  position: relative;
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 40px;
  overflow: hidden;
  padding-right: 102px;
}

.sealed-rule-card strong {
  position: relative;
  z-index: 1;
  overflow: hidden;
  color: #edfaff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-shadow:
    1px 0 0 rgba(10,12,18,0.95),
    -1px 0 0 rgba(10,12,18,0.95),
    0 1px 0 rgba(10,12,18,0.95),
    0 -1px 0 rgba(10,12,18,0.95),
    0 0 8px rgba(10,12,18,0.8);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sealed-rule-card img {
  position: absolute;
  top: 50%;
  right: 0;
  width: 100px;
  height: 40px;
  object-fit: contain;
  transform: translateY(-50%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.16) 7%, rgba(0,0,0,0.70) 18%, #000 30%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.16) 7%, rgba(0,0,0,0.70) 18%, #000 30%, #000 100%);
}

.sealed-rule-count {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 3;
  min-width: 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(7, 10, 16, 0.78);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  color: #edfaff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  padding: 1px 5px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.sealed-rule-dialog {
  width: min(720px, calc(100vw - 32px));
  border: 1px solid rgba(125, 211, 199, 0.34);
  border-radius: 8px;
  background: #091623;
  color: #edfaff;
  padding: 0;
}

.sealed-rule-dialog::backdrop {
  background: rgba(2, 6, 12, 0.72);
}

.sealed-rule-dialog-inner {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.sealed-rule-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(37, 42, 56, 0.78);
  padding-bottom: 10px;
}

.sealed-rule-dialog h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.sealed-rule-dialog-list {
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(37, 42, 56, 0.78);
  margin-left: 10px;
}

.sealed-rule-dialog-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px 60px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid rgba(37, 42, 56, 0.78);
  padding: 7px 0;
}

.sealed-rule-dialog-row .sealed-icon-btn {
  min-width: 60px;
  padding: 0 10px;
  white-space: nowrap;
}

.sealed-rule-dialog-row .sealed-rule-card {
  padding-right: 102px;
}

.sealed-rule-dialog-row .sealed-rule-card img {
  width: 100px;
}

.sealed-rule-dialog-empty {
  margin: 0;
  padding: 10px 12px;
}

.sealed-rule-dialog label {
  display: grid;
  gap: 6px;
  color: #cbd8e4;
  font-size: 13px;
  font-weight: 900;
}

.sealed-rule-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  border: 0;
  padding: 0;
}

.sealed-rule-radio-group[hidden] {
  display: none;
}

.sealed-rule-radio-group legend {
  flex: 0 0 100%;
  color: #cbd8e4;
  font-size: 13px;
  font-weight: 900;
}

.sealed-rule-radio-group label {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(125, 211, 199, 0.26);
  border-radius: 6px;
  background: #0a1a29;
  color: #edfaff;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.sealed-rule-radio-group label:has(input:checked) {
  border-color: #7dd3c7;
  background: rgba(15, 118, 110, 0.55);
}

.sealed-rule-radio-group label:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.42;
}

.sealed-deck-share {
  display: grid;
  gap: 8px;
}

.sealed-deck-share {
  margin-top: 8px;
  border-top: 1px solid rgba(37, 42, 56, 0.78);
  padding: 8px 10px 0 0;
}

.sealed-official-deck-btn {
  min-width: 168px;
}

.sealed-seed-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.sealed-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 0;
  border-bottom: 0;
}

.sealed-mode-tab {
  min-height: 34px;
  border: 1px solid rgba(125, 211, 199, 0.28);
  border-radius: 6px;
  background: #10283b;
  color: #edfaff;
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.sealed-mode-tab.active,
.sealed-mode-tab.is-active {
  border-color: #7dd3c7;
  background: #0f766e;
}

.sealed-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.sealed-summary:empty {
  display: none;
}

.sealed-summary-card {
  border: 1px solid rgba(125, 211, 199, 0.2);
  border-radius: 8px;
  background: rgba(9, 22, 35, 0.95);
  padding: 12px;
}

.sealed-summary-card span {
  display: block;
  color: #a9bacb;
  font-size: 12px;
  font-weight: 800;
}

.sealed-summary-card strong {
  display: block;
  margin-top: 2px;
  font-size: 24px;
}

.sealed-empty {
  border: 1px dashed rgba(125, 211, 199, 0.24);
  border-radius: 8px;
  background: rgba(9, 22, 35, 0.72);
  color: #cbd8e4;
  padding: 18px;
}

.sealed-empty[hidden] {
  display: none;
}

.sealed-opening-list {
  display: grid;
  gap: 16px;
}

.sealed-set-block {
  border-top: 1px solid rgba(37, 42, 56, 0.9);
  background: transparent;
}

.sealed-set-block summary {
  cursor: pointer;
  padding: 14px 0 12px;
  font-weight: 900;
}

.sealed-class-summary {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sealed-class-summary img {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  object-fit: contain;
}

.sealed-rarity-block {
  padding: 0 14px 14px;
}

.sealed-rarity-block h3 {
  margin: 2px 0 8px;
  color: var(--text-header);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.sealed-rarity-block.rarity-4 h3 {
  background: linear-gradient(135deg, #ffd6ff 0%, #b5d8ff 35%, #d5ffea 70%, #ffd6ff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.sealed-rarity-block.rarity-3 h3 {
  color: #d8b74e;
}

.sealed-rarity-block.rarity-2 h3 {
  color: #d6e4f4;
}

.sealed-rarity-block.rarity-1 h3 {
  color: #b9c9df;
}

.sealed-rarity-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 30px;
  padding: 0;
}

.sealed-class-cards {
  padding: 0 14px 14px;
}

.sealed-ticket-cards {
  padding: 0 14px 14px;
}

.sealed-reward-row {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
  min-height: 50px;
  border-bottom: 1px solid rgba(37, 42, 56, 0.78);
  overflow: hidden;
}

.sealed-ticket-row {
  grid-template-columns: 24px minmax(0, 1fr);
  padding-right: 44px;
}

.sealed-reward-info {
  min-width: 0;
  position: relative;
  margin-right: -132px;
  z-index: 1;
}

.sealed-reward-row.no-class .sealed-reward-info {
  align-self: center;
}

.sealed-reward-row.no-class .sealed-reward-info strong {
  line-height: 1.35;
}

.sealed-reward-info strong {
  display: block;
  overflow: hidden;
  color: var(--text-pure);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sealed-reward-class {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.sealed-reward-class img {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  object-fit: contain;
  opacity: 0.84;
}

.sealed-reward-class span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sealed-reward-thumb {
  width: 100px;
  height: 40px;
  grid-column: 3;
  justify-self: end;
  object-fit: contain;
  transform: translateX(-18px);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.16) 7%, rgba(0,0,0,0.70) 18%, #000 30%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.16) 7%, rgba(0,0,0,0.70) 18%, #000 30%, #000 100%);
}

.sealed-reward-count {
  position: absolute;
  top: 5px;
  right: 3px;
  z-index: 3;
  min-width: 24px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(7, 10, 16, 0.78);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  color: var(--text-pure);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  padding: 1px 6px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.sealed-reward-row:not(.sealed-ticket-row) .sealed-reward-count {
  right: 21px;
}

.sealed-ticket-mark {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(209, 173, 70, 0.48);
  border-radius: 50%;
  background: rgba(209, 173, 70, 0.18);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.sealed-ticket-meta {
  display: block;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sealed-card-row,
.sealed-deck-row {
  border-color: rgba(37, 42, 56, 0.78);
}

.sealed-card-name {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #f8fbff;
  font-weight: 900;
  position: relative;
  z-index: 1;
  text-shadow:
    1px 0 0 rgba(10,12,18,0.95),
    -1px 0 0 rgba(10,12,18,0.95),
    0 1px 0 rgba(10,12,18,0.95),
    0 -1px 0 rgba(10,12,18,0.95),
    0 0 8px rgba(10,12,18,0.8);
}

.sealed-card-meta {
  color: #a9bacb;
  font-size: 12px;
  position: relative;
  z-index: 1;
  grid-column: 2;
}

.sealed-builder-head {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.sealed-deck-title-row {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border-bottom: 0;
  background: transparent;
  padding: 14px 0 10px;
}

.sealed-card-browser > .sealed-section-title {
  display: flex;
  align-items: center;
  min-height: 52px;
  margin: 0;
}

.sealed-deck-title-row .sealed-section-title {
  margin: 0;
}

.sealed-deck-status {
  margin: 0;
  text-align: right;
  color: #edfaff;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
}

.sealed-deck-count {
  color: inherit;
  font-size: 24px;
}

.sealed-deck-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, 0.34fr);
  gap: 12px;
  align-items: stretch;
  min-height: 102px;
  padding: 8px 0 10px;
}

.sealed-deck-curve-bars {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
  align-items: end;
}

.sealed-deck-curve-item {
  display: grid;
  grid-template-rows: 14px 34px 16px;
  gap: 2px;
  justify-items: center;
  min-width: 0;
}

.sealed-deck-curve-count {
  color: #edfaff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.sealed-deck-curve-track {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 14px;
  height: 34px;
  border: 1px solid rgba(125, 211, 199, 0.18);
  background: rgba(13, 33, 24, 0.72);
}

.sealed-deck-curve-bar {
  display: block;
  width: 100%;
  max-height: 100%;
  min-height: 2px;
  background: linear-gradient(180deg, #b9e934, #2d8a08);
}

.sealed-deck-curve-bar.is-empty {
  min-height: 0;
  background: transparent;
}

.sealed-deck-curve-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 16px;
  border-radius: 999px;
  background: rgba(44, 122, 31, 0.78);
  color: #dbffd5;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.sealed-deck-type-counts {
  display: grid;
  align-content: start;
  gap: 3px;
}

.sealed-deck-type-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  color: #d7e1eb;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
}

.sealed-deck-type-row strong {
  color: #edfaff;
  font-size: 15px;
}

.sealed-deck-type-row.is-follower span {
  color: #ff9ab4;
}

.sealed-deck-type-row.is-spell span {
  color: #d5a6ff;
}

.sealed-deck-type-row.is-amulet span {
  color: #86e2b0;
}

.sealed-deck-count.is-over {
  color: #f87171;
}

.sealed-deck-status.is-complete {
  color: #edfaff;
}

.sealed-deck-status.is-error {
  color: #edfaff;
}

.sealed-builder {
  --sealed-builder-pane-height: clamp(420px, calc(100vh - 360px), 860px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.sealed-builder[hidden] {
  display: none;
}

.sealed-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(132px, auto);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.sealed-filter-control {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.sealed-filter-label {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-align: left;
}

.sealed-filter-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.sealed-filter-row .sealed-input,
.sealed-filter-control-row .sealed-input {
  min-width: 0;
}

.sealed-sort-btn {
  width: 100%;
  min-width: 132px;
  white-space: nowrap;
}

.sealed-filter-dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sealed-filter-dialog-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.sealed-card-browser,
.sealed-deck-panel {
  display: grid;
  height: var(--sealed-builder-pane-height);
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 14px 0 0;
}

.sealed-card-browser {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.sealed-deck-panel {
  grid-template-rows: auto auto auto minmax(0, 1fr);
  border-left: 1px solid rgba(125, 211, 199, 0.18);
  padding-top: 0;
  padding-left: 18px;
}

.sealed-mobile-jump {
  display: none;
}

.sealed-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd8e4;
  font-size: 13px;
  white-space: nowrap;
}

.sealed-card-list,
.sealed-deck-list {
  display: grid;
  gap: 0;
  align-content: start;
  align-items: start;
  grid-auto-rows: min-content;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  border-top: 0;
}

.sealed-card-row,
.sealed-deck-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  border-bottom: 1px solid rgba(37, 42, 56, 0.78);
  border-radius: 0;
  background: transparent;
  padding: 0 10px;
}

.sealed-deck-row {
  grid-template-columns: minmax(0, 1fr) 100px;
}

.sealed-card-row:hover,
.sealed-deck-row:hover {
  background: rgba(38, 32, 18, 0.84);
}

.sealed-card-row.is-maxed .sealed-card-cell {
  opacity: 0.46;
}

.sealed-card-row.is-maxed:hover .sealed-card-cell {
  opacity: 0.62;
}

.sealed-card-cell {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-content: center;
  align-items: center;
  column-gap: 8px;
  min-height: 46px;
  padding-right: 104px;
  overflow: hidden;
}

.sealed-card-cost {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  background: #5a4a33;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), 0 2px 6px rgba(0,0,0,0.35);
  text-shadow: 0 1px 2px rgba(0,0,0,0.75);
  position: relative;
  z-index: 1;
}

.sealed-card-cost.r1 {
  background: #5a4a33;
}

.sealed-card-cost.r2 {
  background: #7087a7;
  color: #ffffff;
}

.sealed-card-cost.r3 {
  background: #b08c2d;
}

.sealed-card-cost.r4 {
  background: linear-gradient(135deg, #ffd6ff 0%, #b5d8ff 35%, #d5ffea 70%, #ffd6ff 100%);
  color: #1b1d2a;
  text-shadow: none;
}

.sealed-card-thumb {
  position: absolute;
  top: 50%;
  right: 0;
  width: 100px;
  height: 40px;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
  transform: translateY(-50%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.16) 7%, rgba(0,0,0,0.70) 18%, #000 30%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.16) 7%, rgba(0,0,0,0.70) 18%, #000 30%, #000 100%);
}

.sealed-card-thumb-empty {
  display: block;
}

.sealed-card-detail {
  position: fixed;
  z-index: 80;
  width: min(360px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 24px));
  overflow: auto;
  border: 1px solid rgba(210, 170, 71, 0.64);
  background: rgba(8, 12, 20, 0.96);
  box-shadow: 0 18px 48px rgba(0,0,0,0.48);
  color: #edfaff;
}

.sealed-card-detail[hidden] {
  display: none;
}

.sealed-card-detail.is-pinned {
  border-color: rgba(210, 170, 71, 0.92);
}

.sealed-card-detail-media {
  position: relative;
  height: 92px;
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 -48px 58px rgba(8,12,20,0.92);
  overflow: hidden;
}

.sealed-card-detail-media canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.sealed-card-detail-media-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px 14px;
  background: rgba(8,12,20,0.88);
  color: #edfaff;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.sealed-card-detail-media-fallback[hidden] {
  display: none;
}

.sealed-card-detail-header {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px 8px;
  margin-top: -42px;
}

.sealed-card-detail-header .sealed-card-cost {
  width: 30px;
  height: 30px;
  font-size: 16px;
}

.sealed-card-detail-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sealed-card-detail-title small {
  color: #c8d3df;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sealed-card-detail-title strong {
  color: #fff7e4;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 6px rgba(0,0,0,0.72);
}

.sealed-card-detail-stats {
  display: inline-flex;
  gap: 6px;
}

.sealed-card-detail-stats b {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  isolation: isolate;
}

.sealed-card-detail-stats b::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 2px 7px rgba(0,0,0,0.42);
}

.sealed-card-detail-stat.is-attack::before {
  background: #5aa5d6;
  clip-path: polygon(50% 0%, 76% 20%, 64% 55%, 88% 55%, 88% 75%, 61% 75%, 61% 100%, 39% 100%, 39% 75%, 12% 75%, 12% 55%, 36% 55%, 24% 20%);
}

.sealed-card-detail-stat.is-health::before {
  background: linear-gradient(180deg, #d74848, #7a202a);
  clip-path: polygon(50% 0%, 90% 16%, 84% 70%, 50% 100%, 16% 70%, 10% 16%);
}

.sealed-card-detail-meta {
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 7px 14px;
  color: #cbd8e4;
  font-size: 13px;
  font-weight: 800;
}

.sealed-card-detail-text {
  padding: 12px 14px 14px;
  color: #f5f7fb;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
  white-space: normal;
}

.sealed-count-controls {
  display: grid;
  grid-template-columns: 24px 34px 24px;
  align-items: center;
  justify-content: end;
  gap: 6px;
  width: 100px;
}

.sealed-count-controls > span {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  min-width: 34px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.sealed-count-current,
.sealed-count-max {
  display: inline;
  min-width: 0;
}

.sealed-count-max {
  color: #7f8da0;
  font-size: 0.68em;
  margin-left: 1px;
}

.sealed-count-controls button {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border: 1px solid rgba(125, 211, 199, 0.34);
  border-radius: 999px;
  background: #10283b;
  color: #edfaff;
  padding: 0;
  font-weight: 900;
  cursor: pointer;
}

.sealed-count-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.sealed-note {
  margin: 8px 0 0;
  color: #a9bacb;
}

.sealed-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid rgba(var(--accent-rgb), 0.95);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #f7e8b5, #d2ae4b);
  color: #0d0f14;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.5;
  box-shadow: 0 0 0 2px rgba(13, 15, 20, 0.88), 0 16px 34px rgba(0,0,0,0.62);
  pointer-events: none;
}

.sealed-toast::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #d2ae4b;
}

.sealed-toast.is-below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #f7e8b5;
}

.sealed-toast:not(.is-anchored)::after {
  display: none;
}

/* 既存ページの色・操作部品に寄せるためのシールド専用上書き */
.sealed-theme .sealed-kicker,
.sealed-theme .sealed-panel h2,
.sealed-theme .sealed-panel-head h2,
.sealed-theme .sealed-section-title,
.sealed-theme .sealed-rule-dialog h2 {
  color: var(--text-header);
}

.sealed-theme .sealed-kicker {
  color: var(--accent);
}

.sealed-theme .sealed-header h1 {
  color: var(--text-pure);
}

.sealed-theme input[type="checkbox"],
.sealed-theme input[type="radio"] {
  accent-color: var(--accent);
}

.sealed-theme .sealed-master-status,
.sealed-theme .sealed-note,
.sealed-theme .sealed-empty,
.sealed-theme .sealed-deck-status,
.sealed-theme .sealed-share-code label,
.sealed-theme .sealed-basic-count-label,
.sealed-theme .sealed-rule-editor h3,
.sealed-theme .sealed-rule-dialog label,
.sealed-theme .sealed-rule-radio-group legend,
.sealed-theme .sealed-check,
.sealed-theme .sealed-summary-card span {
  color: var(--text-secondary);
}

.sealed-theme .sealed-master-status.is-ready,
.sealed-theme .sealed-deck-status.is-complete {
  color: var(--accent-light);
}

.sealed-theme .sealed-deck-status,
.sealed-theme .sealed-deck-status.is-complete,
.sealed-theme .sealed-deck-status.is-error {
  color: var(--text-pure);
}

.sealed-theme .sealed-deck-count:not(.is-over) {
  color: inherit;
}

.sealed-theme .sealed-view-tabs {
  gap: 8px;
  border-bottom-color: transparent;
}

.sealed-theme .sealed-view-tab {
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-md);
  background: var(--panel-secondary);
  color: var(--text-secondary);
  min-height: var(--guide-control-h, 32px);
  padding: 0 12px;
  font-size: 13px;
  transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}

.sealed-theme .sealed-view-tab:hover:not(:disabled),
.sealed-theme .sealed-view-tab:focus-visible:not(:disabled) {
  border-color: var(--btn-hover-border);
  background: var(--btn-hover-bg);
  color: var(--btn-hover-color);
  box-shadow: var(--btn-hover-shadow);
  transform: none;
}

.sealed-theme .sealed-view-tab:disabled {
  border-color: rgba(75, 85, 105, 0.5);
  background: rgba(15, 23, 42, 0.42);
  color: var(--text-muted);
  box-shadow: none;
  opacity: 0.56;
}

.sealed-theme .sealed-view-tab.active,
.sealed-theme .sealed-view-tab.is-active {
  border-color: var(--accent);
  background: var(--btn-bg-active);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.35);
  transform: translateY(-1px);
}

.sealed-theme .sealed-class-tab,
.sealed-theme .sealed-mode-tab,
.sealed-theme .sealed-count-controls button,
.sealed-theme .sealed-rule-radio-group label {
  border-color: var(--btn-border);
  border-radius: var(--radius-md);
  background: var(--btn-bg);
  color: var(--text-secondary);
  box-shadow: none;
  transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}

.sealed-theme .sealed-count-controls button,
.sealed-theme .sealed-mode-tab,
.sealed-theme .sealed-rule-radio-group label {
  min-height: var(--guide-control-h, 32px);
}

.sealed-theme .sealed-pack-count-controls button {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  padding: 0;
}

.sealed-theme .sealed-count-controls button {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  padding: 0;
}

.sealed-theme .sealed-primary {
  color: var(--dark-bg);
}

.sealed-theme .btn,
.sealed-theme .filter-select,
.sealed-theme .cr-input {
  border-radius: var(--radius-md);
}

.sealed-theme .sealed-btn.btn,
.sealed-theme .sealed-icon-btn.btn {
  border-color: var(--border-gray);
  background: var(--panel-secondary);
  color: var(--text-secondary);
  box-shadow: none;
}

.sealed-theme .sealed-btn.btn:hover,
.sealed-theme .sealed-btn.btn:focus-visible,
.sealed-theme .sealed-icon-btn.btn:hover,
.sealed-theme .sealed-icon-btn.btn:focus-visible {
  border-color: var(--btn-hover-border);
  background: var(--btn-hover-bg);
  color: var(--btn-hover-color);
  box-shadow: var(--btn-hover-shadow);
}

.sealed-theme .sealed-official-deck-btn:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.72);
  background: rgba(var(--accent-rgb), 0.92);
  color: var(--dark-bg);
}

.sealed-theme .sealed-official-deck-btn:hover:not(:disabled),
.sealed-theme .sealed-official-deck-btn:focus-visible:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.86);
  background: var(--accent);
  color: var(--dark-bg);
}

.sealed-theme .btn:hover,
.sealed-theme .btn:focus-visible {
  transform: none;
}

.sealed-theme .btn.active,
.sealed-theme .btn.is-active {
  transform: translateY(-1px);
}

.sealed-theme .sealed-class-tab:hover,
.sealed-theme .sealed-class-tab:focus-visible,
.sealed-theme .sealed-mode-tab:hover,
.sealed-theme .sealed-mode-tab:focus-visible,
.sealed-theme .sealed-count-controls button:hover:not(:disabled),
.sealed-theme .sealed-rule-radio-group label:hover {
  border-color: var(--btn-hover-border);
  background: var(--btn-hover-bg);
  color: var(--btn-hover-color);
  box-shadow: var(--btn-hover-shadow);
  transform: none;
}

.sealed-theme .sealed-class-tab.active,
.sealed-theme .sealed-class-tab.is-active,
.sealed-theme .sealed-mode-tab.active,
.sealed-theme .sealed-mode-tab.is-active,
.sealed-theme .sealed-rule-radio-group label:has(input:checked) {
  border-color: var(--accent);
  background: var(--btn-bg-active);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.35);
  transform: translateY(-1px);
}

.sealed-theme .sealed-class-tab.active,
.sealed-theme .sealed-class-tab.is-active {
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.35);
}

.sealed-theme .sealed-input,
.sealed-theme .sealed-select:not(.filter-select),
.sealed-theme .sealed-textarea {
  border-color: var(--border-gray);
  border-radius: var(--radius-md);
  background: var(--panel-secondary);
  color: var(--text-light);
  box-shadow: none;
  color-scheme: dark;
}

.sealed-theme .sealed-select.filter-select {
  border-color: var(--border-gray);
  background: var(--panel-secondary);
  color: var(--text-light);
  box-shadow: none;
  color-scheme: dark;
  appearance: auto;
  cursor: pointer;
}

.sealed-theme .cr-input {
  border-color: var(--border-gray);
  background: var(--panel-secondary);
  color: var(--text-light);
  box-shadow: none;
  color-scheme: dark;
}

.sealed-theme .filter-select:hover,
.sealed-theme .cr-input:hover {
  border-color: var(--btn-hover-border);
  box-shadow: var(--btn-hover-shadow);
}

.sealed-theme .sealed-input:focus,
.sealed-theme .sealed-select:focus,
.sealed-theme .sealed-textarea:focus,
.sealed-theme .cr-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.28);
}

.sealed-theme .sealed-input::placeholder,
.sealed-theme .sealed-textarea::placeholder {
  color: var(--muted);
}

.sealed-theme .sealed-panel,
.sealed-theme .sealed-restore,
.sealed-theme .sealed-summary-card,
.sealed-theme .sealed-empty {
  border-color: var(--border-dark);
  border-radius: var(--radius-md);
  background: rgba(19, 22, 30, 0.70);
}

.sealed-theme .sealed-set-block {
  border-color: rgba(37, 42, 56, 0.9);
  border-radius: 0;
  background: transparent;
}

.sealed-theme .sealed-grid-setup > .sealed-panel,
.sealed-theme .sealed-card-browser,
.sealed-theme .sealed-deck-panel {
  border-color: var(--border-dark);
  background: linear-gradient(180deg, rgba(19, 22, 30, 0.34), rgba(19, 22, 30, 0.04));
}

.sealed-theme .sealed-card-browser,
.sealed-theme .sealed-deck-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.sealed-theme .sealed-deck-panel {
  border-left: 1px solid rgba(var(--accent-rgb), 0.18);
}

.sealed-theme .sealed-restore p {
  color: var(--text-secondary);
}

.sealed-theme .sealed-rule-basic,
.sealed-theme .sealed-rule-dialog-head,
.sealed-theme .sealed-card-list,
.sealed-theme .sealed-deck-list,
.sealed-theme .sealed-rule-rows,
.sealed-theme .sealed-rule-row,
.sealed-theme .sealed-card-row,
.sealed-theme .sealed-deck-row {
  border-color: var(--line);
}

.sealed-theme .sealed-rule-card strong,
.sealed-theme .sealed-rule-count,
.sealed-theme .sealed-card-name {
  color: var(--text-pure);
}

.sealed-theme .sealed-rule-dialog {
  border-color: var(--border-gray);
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  color: var(--text-light);
}

.sealed-theme .sealed-rule-dialog::backdrop {
  background: rgba(4, 6, 10, 0.74);
}

.sealed-theme .sealed-empty {
  border-color: var(--border-gray);
  background: rgba(19, 22, 30, 0.54);
}

.sealed-theme .sealed-card-row:hover,
.sealed-theme .sealed-deck-row:hover {
  background: rgba(var(--accent-rgb), 0.08);
}

.sealed-theme .sealed-card-row.is-maxed .sealed-card-cell {
  opacity: 0.46;
}

.sealed-theme .sealed-card-row.is-maxed:hover .sealed-card-cell {
  opacity: 0.62;
}

@media (max-width: 980px) {
  .sealed-grid-setup,
  .sealed-builder,
  .sealed-rule-basic,
  .sealed-rule-columns,
  .sealed-rule-row {
    grid-template-columns: 1fr;
  }

  .sealed-deck-panel {
    height: auto;
    overflow: visible;
    border-left: 0;
    padding-left: 0;
  }

  .sealed-card-browser {
    height: auto;
    overflow: visible;
    grid-template-rows: auto auto auto auto;
  }

  .sealed-deck-panel {
    grid-template-rows: auto auto auto auto auto;
  }

  .sealed-card-list,
  .sealed-deck-list {
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .sealed-filter-row {
    grid-template-columns: minmax(0, 1fr) minmax(132px, auto);
  }

  .sealed-rarity-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .sealed-page-wrap {
    padding: 18px 14px 60px;
  }

  .sealed-builder {
    --sealed-mobile-class-sticky-height: 68px;
    --sealed-mobile-section-sticky-top: var(--sealed-mobile-class-sticky-height);
    --sealed-mobile-filter-sticky-top: calc(var(--sealed-mobile-class-sticky-height) + 52px);
    --sealed-mobile-deck-title-sticky-top: var(--sealed-mobile-class-sticky-height);
    --sealed-mobile-deck-jump-sticky-top: var(--sealed-mobile-deck-title-sticky-top);
    --sealed-mobile-deck-stats-sticky-top: calc(var(--sealed-mobile-deck-title-sticky-top) + 60px);
    --sealed-mobile-deck-filter-sticky-top: calc(var(--sealed-mobile-deck-stats-sticky-top) + 90px);
  }

  .sealed-header,
  .sealed-panel-head,
  .sealed-builder-head {
    display: block;
  }

  .sealed-builder-head {
    position: sticky;
    top: 0;
    z-index: 70;
    margin: 0 0 8px;
    padding: 14px 0 10px;
    background: #080c14;
    box-shadow: 0 12px 0 #080c14, 0 20px 18px rgba(3, 6, 10, 0.38);
    overflow: visible;
  }

  .sealed-class-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-top: 1px;
  }

  .sealed-class-tab.active,
  .sealed-class-tab.is-active,
  .sealed-theme .sealed-class-tab.active,
  .sealed-theme .sealed-class-tab.is-active {
    transform: none;
  }

  .sealed-class-tabs::-webkit-scrollbar {
    display: none;
  }

  .sealed-card-browser > .sealed-section-title,
  .sealed-deck-title-row {
    position: sticky;
    top: var(--sealed-mobile-section-sticky-top);
    z-index: 60;
    min-height: 52px;
    background: #080c14;
    box-shadow: 0 8px 0 #080c14, 0 15px 14px rgba(3, 6, 10, 0.28);
  }

  .sealed-card-browser > .sealed-filter-row {
    position: sticky;
    top: var(--sealed-mobile-filter-sticky-top);
    z-index: 58;
    margin-bottom: 0;
    padding: 8px 0 10px;
    background: #080c14;
    box-shadow: 0 8px 0 #080c14, 0 15px 16px rgba(3, 6, 10, 0.28);
  }

  .sealed-deck-stats {
    position: sticky;
    top: var(--sealed-mobile-deck-stats-sticky-top);
    z-index: 59;
    background: #080c14;
    box-shadow: 0 8px 0 #080c14, 0 15px 16px rgba(3, 6, 10, 0.28);
  }

  .sealed-deck-panel > .sealed-filter-row {
    position: sticky;
    top: var(--sealed-mobile-deck-filter-sticky-top);
    z-index: 58;
    margin-bottom: 0;
    padding: 8px 0 10px;
    background: #080c14;
    box-shadow: 0 8px 0 #080c14, 0 15px 16px rgba(3, 6, 10, 0.28);
  }

  .sealed-deck-panel {
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .sealed-deck-title-row {
    display: grid;
    grid-template-columns: minmax(76px, 1fr) auto minmax(96px, 1fr);
    top: var(--sealed-mobile-deck-title-sticky-top);
    align-items: center;
    gap: 8px;
  }

  .sealed-deck-title-row .sealed-section-title {
    grid-column: 1;
  }

  .sealed-deck-title-row .sealed-mobile-jump-up {
    grid-column: 2;
    position: static;
    margin: 0;
    justify-self: center;
  }

  .sealed-deck-panel > .sealed-filter-row {
    order: 2;
  }

  .sealed-deck-stats {
    order: 1;
  }

  .sealed-deck-list {
    order: 3;
  }

  .sealed-master-status,
  .sealed-deck-status {
    margin-top: 8px;
    text-align: left;
  }

  .sealed-deck-title-row .sealed-deck-status {
    grid-column: 3;
    justify-self: end;
    margin: 0;
    text-align: right;
  }

  .sealed-deck-status.is-mobile-floating {
    position: fixed;
    right: var(--sealed-mobile-deck-status-right, 14px);
    top: var(--sealed-mobile-deck-status-top, auto);
    z-index: 66;
    margin: 0;
    padding: 6px 8px;
    text-align: right;
    pointer-events: none;
  }

  .sealed-deck-status.is-mobile-floating::before {
    content: "";
    position: absolute;
    inset: -12px -14px;
    z-index: -1;
    border-radius: 16px;
    background: radial-gradient(ellipse at center, rgba(5, 8, 14, 0.92) 0%, rgba(5, 8, 14, 0.72) 42%, rgba(5, 8, 14, 0) 78%);
  }

  .sealed-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sealed-pack-row {
    grid-template-columns: minmax(112px, 1fr) 86px 52px;
    gap: 6px;
  }

  .sealed-pack-remove {
    min-width: 52px;
    padding-inline: 0;
  }

  .sealed-pack-count-controls {
    min-width: 86px;
  }

  .sealed-seed-row {
    grid-template-columns: 1fr;
  }

  .sealed-filter-row {
    grid-template-columns: minmax(0, 1fr) minmax(96px, 0.34fr);
    gap: 8px;
  }

  .sealed-filter-control-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .sealed-filter-control-row .sealed-btn {
    padding-inline: 12px;
  }

  .sealed-sort-btn {
    min-width: 0;
    padding-inline: 10px;
  }

  .sealed-deck-stats {
    grid-template-columns: minmax(0, 1fr) minmax(86px, 0.32fr);
    gap: 8px;
    min-height: 86px;
  }

  .sealed-deck-curve-bars {
    gap: 3px;
  }

  .sealed-deck-curve-item {
    grid-template-rows: 14px 24px 15px;
    gap: 3px;
  }

  .sealed-deck-curve-track {
    width: 12px;
    height: 24px;
  }

  .sealed-deck-type-row {
    gap: 5px;
    font-size: 12px;
  }

  .sealed-deck-type-row strong {
    font-size: 13px;
  }

  .sealed-filter-control-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .sealed-card-row,
  .sealed-deck-row {
    grid-template-columns: minmax(0, 1fr) 86px;
    gap: 8px;
    padding-inline: 4px;
  }

  .sealed-count-controls {
    grid-column: auto;
    grid-template-columns: 22px 30px 22px;
    justify-content: flex-end;
    gap: 5px;
    width: 86px;
  }

  .sealed-card-thumb {
    width: 78px;
    height: 32px;
  }

  .sealed-card-cell {
    grid-template-columns: 24px minmax(0, 1fr);
    padding-right: 82px;
  }

  .sealed-mobile-jump-row {
    position: sticky;
    z-index: 18;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    width: 100%;
  }

  .sealed-mobile-jump-row .sealed-mobile-jump {
    flex: 0 0 auto;
  }

  .sealed-mobile-jump {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 148px;
    height: 34px;
    min-height: 34px;
    border: 1px solid rgba(210, 170, 71, 0.56);
    background: #111722 !important;
    color: #f4d06a;
    font-weight: 900;
    line-height: 1;
    padding: 0 16px;
  }

  .sealed-mobile-jump-down {
    bottom: 10px;
    margin: 10px auto 0;
  }

  .sealed-mobile-jump-up {
    margin: 0;
    box-shadow: 0 0 0 6px #080c14, 0 8px 14px rgba(3, 6, 10, 0.42);
  }

  .sealed-deck-share .sealed-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
    width: min(100%, 320px);
  }

  .sealed-deck-share .sealed-action-help {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .sealed-deck-share .sealed-action-help > .sealed-btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .sealed-card-detail {
    width: calc(100vw - 28px);
    max-height: 46vh;
  }

  .sealed-rarity-cards {
    grid-template-columns: 1fr;
  }
}
