body {
  min-height: 0;
  overflow-x: hidden;
}
main {
  width: 100%;
  min-height: none;
  max-width: none;
  flex: none;
  background: url("../img/bg_bottom.png") no-repeat 50% 100%, url("../img/bg_pattern.png") 0 0;
  background-size: cover;
  background-attachment: fixed, scroll;
}
#cardlist-page > div {
  border: none;
  box-shadow: none;
  background-color: transparent;
  padding: 0;
  margin: 0;
  max-width: none;
  width: 100%;
  box-sizing: content-box;
}
#cardlist-page {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  min-height: calc(100vh - var(--nav-offset, 6rem) - 140px);
}
#cardlist-page > #cardlist-content {
  max-width: 1350px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}
.cardlist-menu-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: calc(128px + 0.6rem);
  padding-left: max(0.8rem, calc(50vw - 600px));
  padding-right: max(0.8rem, calc(50vw - 600px));
  background: transparent;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
}
.cardlist-menu-wrap.is-at-bottom {
  background: linear-gradient(180deg, rgba(0,0,0,0), #000 100%);
}
.cardlist-menu-wrap.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.cardlist-menu-wrap.is-hidden #megami-select-area {
  pointer-events: none;
}
.cardlist-menu-wrap.is-hidden .megami-select-grid {
  pointer-events: none;
}
#megami-select-area {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}
.cardlist-mode-select {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: calc(50% + var(--megami-grid-half-width, 340px) + 1rem - 30px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}
.mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 9rem;
  padding: 0.6rem 1.8rem 0.6rem 0.8rem;
  font-family: 'Noto Serif JP', serif;
  font-size: 0.95rem;
  font-weight: bold;
  color: rgba(255,255,255,0.5);
  background: linear-gradient(to bottom, #5a5a5a 0%, #1a1a1a 100%);
  border: none;
  clip-path: polygon(0% 0%, calc(100% - var(--mode-btn-slope, 37.5%)) 0%, 100% 100%, 0% 100%);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.mode-btn:hover {
  color: rgba(255,255,255,0.85);
  background: linear-gradient(to bottom, #6e6e6e 0%, #222 100%);
}
.mode-btn.is-active {
  color: #fff;
  background: linear-gradient(to bottom, #62381c 0%, #111 100%);
}
.mode-btn-wrap {
  display: inline-flex;
  transition: filter 0.2s;
}
.mode-btn-wrap:has(.mode-btn.is-active) {
  filter: drop-shadow(0 2px 8px rgba(255,79,209,0.7)) drop-shadow(0 0 5px rgba(255,79,209,0.4));
}
.megami-select-grid {
  display: grid;
  grid-template-rows: repeat(2, 64px);
  grid-auto-flow: column;
  grid-auto-columns: 40px;
  align-items: center;
  justify-content: center;
  column-gap: 0;
  row-gap: 0.6rem;
  pointer-events: auto;
}
.megami-select-item {
  width: 64px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}
.megami-select-item:nth-child(3n + 1) {
  grid-row: 1;
}
.megami-select-item:nth-child(3n + 2) {
  grid-row: 2;
}
.megami-select-item:nth-child(3n) {
  grid-row: 1/span 2;
  align-self: center;
}
.megami-select-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
  aspect-ratio: 1/1;
  object-fit: cover;
  transition: filter 0.2s, transform 0.15s;
}
.megami-select-item:hover img {
  filter: brightness(1.3) saturate(1.2);
  transform: scale(1.08);
}
.megami-select-item.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.megami-select-item.is-disabled img {
  filter: grayscale(1);
}
.megami-select-item.is-active img {
  filter: brightness(1.1) drop-shadow(0 0 0.5rem #ff4fd1) drop-shadow(0 0 0.5rem #ff4fd1);
}
.back-to-megami-btn {
  position: fixed;
  top: 0.7rem;
  left: 1rem;
  z-index: 101;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem 0.5rem 1.5rem;
  font-family: 'Noto Serif JP', serif;
  font-size: 0.95rem;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(to bottom, #62381c 0%, #111 100%);
  border: none;
  clip-path: polygon(100% 0%, 16% 0%, 0% 50%, 16% 100%, 100% 100%);
  cursor: pointer;
  transition: opacity 0.2s;
}
.back-to-megami-btn[hidden] {
  display: none;
}
.back-to-megami-btn:hover {
  opacity: 0.85;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid #999;
  background: #fff;
  color: #353535;
  cursor: pointer;
  transition: background 0.15s;
}
.back-btn:hover {
  background: #f0f0f0;
}
.origin-toggle-bar {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.2rem 0;
}
.origin-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 3px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: opacity 0.15s;
  opacity: 0.55;
}
.origin-toggle-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 0.15s;
}
.origin-toggle-btn:hover {
  opacity: 0.8;
}
.origin-toggle-btn.is-active {
  opacity: 1;
}
.origin-toggle-btn.is-active img {
  filter: drop-shadow(0 2px 8px rgba(255,79,209,0.7)) drop-shadow(0 0 5px rgba(255,79,209,0.4));
}
.card-area-wrapper {
  position: relative;
  z-index: 0;
  overflow: visible;
  padding: 1rem;
  border-radius: 8px;
  flex: 1;
}
.card-area-bg {
  position: absolute;
  top: 0;
  right: -15px;
  height: 700px;
  width: auto;
  object-fit: contain;
  object-position: right top;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 88%, transparent 100%);
}
.card-area-wrapper .card-grid {
  position: relative;
  z-index: 1;
}
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.card-cell {
  position: relative;
}
.card-thumb {
  width: 100%;
  height: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  border-radius: 4px;
  transition: transform 0.15s;
  cursor: pointer;
}
.card-thumb:hover {
  transform: scale(1.03);
}
.card-hex-sp {
  display: none;
}
.card-grid-separator {
  grid-column: 1/-1;
  border-top: 2px solid #ccc;
  margin: 0.5rem 0;
}
.card-fan-group {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.card-fans-wrap.is-entering {
  animation: fans-slide-in 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.card-fans-wrap.is-leaving {
  animation: fans-slide-out 0.2s cubic-bezier(0.4, 0, 1, 1) both;
  pointer-events: none;
}
.card-preview-img.is-entering {
  animation: fans-slide-in 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.card-preview-img.is-leaving {
  animation: fans-slide-out 0.2s cubic-bezier(0.4, 0, 1, 1) both;
}
@media (min-width: 851px) {
  main:has(#btn-megami-goto.is-active) {
    min-height: 730px;
  }
  #cardlist-page:has(#btn-megami-goto.is-active) {
    min-height: max(730px, calc(100vh - var(--nav-offset, 6rem) - 140px));
  }
  #btn-two-chars {
    clip-path: polygon(0% 0%, 100% 0%, calc(100% - var(--mode-btn-slope, 37.5%)) 100%, 0% 100%);
  }
  .card-area-wrapper {
    min-height: 560px;
  }
  .card-layout > .card-grid {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
    flex: 0 0 auto;
  }
  .card-name-origin-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .card-name-origin-wrap .origin-toggle-bar {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    flex-shrink: 0;
    gap: 0.4rem;
    padding: 0;
  }
  .card-fans-wrap {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    padding: 0 2rem;
  }
  .card-fan-n {
    height: 235px;
    position: relative;
  }
  .card-fan-n::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("/re/img/normal_card.png") no-repeat 50% 100%;
    pointer-events: none;
  }
  .card-fan-s {
    height: 230px;
    margin-top: 22px;
    position: relative;
  }
  .card-fan-s::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("/re/img/sp_card.png") no-repeat 50% 100%;
    pointer-events: none;
  }
  .card-fans-wrap.is-entering .card-fan-n::before,
  .card-fans-wrap.is-entering .card-fan-s::before {
    animation: fans-slide-in-bg-fix 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  }
  .card-fan-n .card-cell,
  .card-fan-s .card-cell {
    position: relative;
    width: 112px;
    flex-shrink: 0;
    cursor: pointer;
  }
  .card-fan-n .card-cell .card-thumb,
  .card-fan-s .card-cell .card-thumb {
    width: 112px;
    height: auto;
    display: block;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.3);
    border-radius: 4px;
    transition: transform 0.2s, filter 0.2s;
  }
  .card-fan-n .card-cell:nth-child(2) {
    margin-left: -66px;
  }
  .card-fan-n .card-cell:nth-child(3) {
    margin-left: -62px;
  }
  .card-fan-n .card-cell:nth-child(4) {
    margin-left: -61px;
  }
  .card-fan-n .card-cell:nth-child(5) {
    margin-left: -61px;
  }
  .card-fan-n .card-cell:nth-child(6) {
    margin-left: -62px;
  }
  .card-fan-n .card-cell:nth-child(7) {
    margin-left: -66px;
  }
  .card-fan-s .card-cell + .card-cell {
    margin-left: -44px;
  }
  .card-fan-n .card-cell:nth-child(1) {
    transform: translate3d(0, 44px, 0) rotate(-33deg);
  }
  .card-fan-n .card-cell:nth-child(2) {
    transform: translate3d(0, 19px, 0) rotate(-22deg);
  }
  .card-fan-n .card-cell:nth-child(3) {
    transform: translate3d(0, 5px, 0) rotate(-11deg);
  }
  .card-fan-n .card-cell:nth-child(4) {
    transform: translate3d(0, 0px, 0) rotate(0deg);
  }
  .card-fan-n .card-cell:nth-child(5) {
    transform: translate3d(0, 5px, 0) rotate(11deg);
  }
  .card-fan-n .card-cell:nth-child(6) {
    transform: translate3d(0, 19px, 0) rotate(22deg);
  }
  .card-fan-n .card-cell:nth-child(7) {
    transform: translate3d(0, 44px, 0) rotate(33deg);
  }
  .card-fan-s .card-cell:nth-child(1) {
    transform: translate3d(0, 19px, 0) rotate(-22deg);
  }
  .card-fan-s .card-cell:nth-child(2) {
    transform: translate3d(0, 5px, 0) rotate(-7.5deg);
  }
  .card-fan-s .card-cell:nth-child(3) {
    transform: translate3d(0, 5px, 0) rotate(7.5deg);
  }
  .card-fan-s .card-cell:nth-child(4) {
    transform: translate3d(0, 19px, 0) rotate(22deg);
  }
  .tc-col .card-fan-n .card-cell:hover,
  .tc-col .card-fan-s .card-cell:hover {
    z-index: 10;
  }
  .card-fan-n .card-cell:hover .card-thumb,
  .card-fan-s .card-cell:hover .card-thumb {
    transform: translateY(-10px);
    filter: drop-shadow(0 0 8px #ff4fd1);
  }
  .card-fan-n .card-thumb:hover,
  .card-fan-s .card-thumb:hover {
    transform: none;
  }
}
.card-layout {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: center;
  min-height: 540px;
}
.extra-section-container {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 2;
}
.extra-card-btn {
  background: none;
  border: none;
  padding: 0.15rem;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}
.extra-card-btn:hover {
  filter: drop-shadow(0 0 6px #ff4fd1);
  transform: translateY(-3px);
}
.extra-card-btn-icon {
  width: 51px;
  height: 51px;
  object-fit: contain;
  display: block;
}
.card-preview-area {
  flex: 0 0 auto;
  width: 502px;
  height: 544px;
  position: sticky;
  top: 1rem;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.card-preview-area::before {
  content: '';
  position: absolute;
  top: 6px;
  right: -14px;
  bottom: -34px;
  left: -14px;
  background: url("/re/img/card_bg.png") no-repeat center/cover;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.card-preview-img {
  position: relative;
  z-index: 1;
  width: 308px;
  height: auto;
  max-height: 480px;
  transition: opacity 0.2s ease;
}
.card-preview-img.is-wide {
  width: 370px;
}
.card-preview-area.is-switching::before {
  opacity: 0;
}
.card-preview-area.is-entering::before {
  animation: fans-slide-in 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.card-faq {
  position: relative;
  z-index: 1;
  display: block;
  cursor: default;
  pointer-events: none;
}
.card-faq img {
  display: block;
  height: auto;
  filter: grayscale(1);
  opacity: 0.4;
  transition: filter 0.15s, opacity 0.15s;
}
.card-faq.is-active {
  cursor: pointer;
  pointer-events: auto;
}
.card-faq.is-active img {
  filter: none;
  opacity: 1;
}
.card-faq .card-faq-img-sp {
  display: none;
}
.card-preview-area .card-faq {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}
.card-preview-area .card-faq .card-faq-img-pc {
  width: 308px;
}
.card-layout > .card-grid {
  flex: 1 1 0%;
  min-width: 0;
}
.card-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  cursor: pointer;
}
.card-modal-overlay img {
  max-width: 90vw;
  max-height: calc(90vh - 3rem);
  object-fit: contain;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  border-radius: 6px;
}
.card-modal-hint {
  margin-top: 0.75rem;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.two-chars-instruction {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 1rem;
  min-height: 1.5em;
}
.megami-col-name-img {
  display: block;
  height: 7rem;
  width: auto;
  margin: 0 0 0.5rem;
}
.tc-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  flex: 1;
  align-items: start;
  position: relative;
}
.tc-dialogue-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: max-content;
  max-width: calc(100% - 2rem);
  text-align: center;
  z-index: 20;
  pointer-events: none;
  font-size: 1rem;
  color: rgba(80,60,55,0.856);
  letter-spacing: 0.08em;
  opacity: 1;
  white-space: nowrap;
}
.tc-dialogue-progress {
  width: 100%;
  height: 2px;
  margin-top: 0.35rem;
  background: currentColor;
  opacity: 0.72;
  transform-origin: center center;
  animation: tc-dialogue-progress-shrink var(--tc-dialogue-progress-duration) linear forwards;
}
.tc-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  --tc-dialogue-header-height: 220px;
  --tc-dialogue-gradient-overlap: 72px;
}
.tc-col.is-dialogue {
  background: #f5ebe8;
  border-radius: 6px;
}
.tc-col.is-dialogue .tc-col-header {
  background: transparent;
  overflow: visible;
}
.tc-col.is-dialogue .tc-col-header-img {
  visibility: hidden;
}
.tc-col.is-dialogue .tc-col-header-name {
  visibility: hidden;
}
.tc-col.is-dialogue .tc-col-header-weapon {
  visibility: hidden;
}
.tc-col.is-dialogue .tc-col-header::before {
  height: calc(100% + var(--tc-dialogue-gradient-overlap));
  background-position: right calc(50% - var(--tc-dialogue-gradient-overlap) / 2);
  mask-image: linear-gradient(to bottom, #000 var(--tc-dialogue-header-height), transparent calc(var(--tc-dialogue-header-height) + var(--tc-dialogue-gradient-overlap)));
  -webkit-mask-image: linear-gradient(to bottom, #000 var(--tc-dialogue-header-height), transparent calc(var(--tc-dialogue-header-height) + var(--tc-dialogue-gradient-overlap)));
}
.tc-col-header {
  position: relative;
  height: 220px;
  overflow: hidden;
  border-radius: 6px 6px 0 0;
  background: #f5ebe8;
  flex-shrink: 0;
  cursor: pointer;
}
.tc-col-header-img {
  position: absolute;
  top: 0;
  left: 50%;
  width: auto;
  max-width: 100%;
  height: auto;
  pointer-events: none;
  z-index: 1;
}
.tc-col-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("../img/bg_bottom.png") center/cover no-repeat;
  pointer-events: none;
  z-index: 0;
}
.tc-col-header::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  -webkit-backdrop-filter: blur(8px) brightness(0.9);
  backdrop-filter: blur(8px) brightness(0.9);
  transform: translateZ(0);
  background: rgba(245,235,232,0.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tc-col-header-name {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tc-col-header-name img {
  height: 90px;
  width: auto;
  filter: drop-shadow(0 1px 6px rgba(255,255,255,0.9));
}
.tc-col-header-weapon {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 72px;
  height: auto;
  object-fit: contain;
  transform-origin: left top;
  pointer-events: none;
  filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 5px #fff) drop-shadow(0 0 6px #fff);
}
.tc-col-header-ability {
  position: absolute;
  left: 0;
  right: 0;
  top: 0.5rem;
  z-index: 4;
  text-align: center;
  pointer-events: none;
  padding: 0 0.6rem;
  transform: translateY(calc(var(--tc-dialogue-header-height) - 100% - 1rem));
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.tc-col-header-extra {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tc-col-header.is-extra-open::after {
  opacity: 1;
}
.tc-col-header.is-extra-open .tc-col-header-name {
  visibility: hidden;
}
.tc-col-header.is-extra-open .tc-col-header-weapon {
  visibility: hidden;
}
.tc-col-header.is-extra-open .tc-col-header-extra {
  opacity: 1;
  pointer-events: auto;
}
.tc-col-header.is-extra-open .tc-extra-toggle-btn-wrap {
  visibility: hidden;
}
.tc-col-header.is-extra-open .tc-col-header-ability-name-wrap {
  visibility: hidden;
}
.tc-extra-close-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: 50%;
  color: rgba(255,255,255,0.92);
  font-size: 0.95rem;
  font-family: sans-serif;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}
.tc-extra-close-btn:hover {
  background: rgba(0,0,0,0.65);
}
.tc-extra-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 4px;
}
.tc-extra-toggle-btn-wrap {
  position: absolute;
  top: 0.5rem;
  right: 8px;
  z-index: 4;
  display: inline-block;
  filter: drop-shadow(0 2px 8px rgba(255,255,255,0.5));
  transform: translateY(calc(var(--tc-dialogue-header-height) - 100% - 1rem));
}
.tc-extra-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.4rem;
  font-family: 'Noto Serif JP', serif;
  font-size: 0.75rem;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(to bottom, #1e2a5e 0%, #111 100%);
  border: none;
  clip-path: polygon(0% 50%, 15.7% 0%, 84.3% 0%, 100% 50%, 84.3% 100%, 15.7% 100%);
  line-height: 1.3;
  width: 4.5rem;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: filter 0.15s;
}
.tc-extra-toggle-btn:hover {
  filter: brightness(1.3);
}
.tc-col-header.is-flipped .tc-extra-toggle-btn-wrap,
.tc-col.is-dialogue .tc-extra-toggle-btn-wrap {
  visibility: hidden;
}
.tc-umbrella-toggle-btn {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5));
  transition: filter 0.15s, transform 0.15s;
}
.tc-umbrella-toggle-btn:hover {
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.7)) brightness(1.1);
  transform: scale(1.06);
}
.tc-umbrella-toggle-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
}
.tc-col-header.is-flipped .tc-umbrella-toggle-btn,
.tc-col.is-dialogue .tc-umbrella-toggle-btn {
  visibility: hidden;
}
.tc-col-header-ability-name-wrap {
  display: inline-block;
  filter: drop-shadow(0 2px 8px rgba(255,255,255,0.7));
}
.tc-col-header-ability-name {
  display: inline-block;
  background: linear-gradient(to bottom, #62381c 0%, #111 100%);
  color: #fff;
  font-family: 'Noto Serif JP', serif;
  font-weight: bold;
  font-size: 0.75rem;
  padding: 0.22rem 0.4rem;
  clip-path: polygon(0% 50%, 15.7% 0%, 84.3% 0%, 100% 50%, 84.3% 100%, 15.7% 100%);
  line-height: 1.3;
  width: 4.5rem;
  white-space: nowrap;
  overflow: hidden;
}
.tc-col-header-ability-text {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.79rem;
  color: #000;
  text-shadow: 0 0 6px #fff, 0 0 7px #fff, 0 0 8px #fff, 0 0 9px #fff, 0 0 10px #fff, 0 1px 3px rgba(0,0,0,0.5);
  margin-top: 0.4rem;
  line-height: 1.4;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  -webkit-text-stroke: 2px #fff;
  text-stroke: 2px #fff;
  paint-order: stroke;
  display: none;
  max-width: 180px;
  margin: 0 auto;
}
.tc-col.is-dialogue .tc-col-header::after {
  opacity: 0;
}
.tc-col-header.is-flipped::after {
  opacity: 1;
}
.tc-col-header.is-flipped .tc-col-header-name {
  visibility: hidden;
}
.tc-col-header.is-flipped .tc-col-header-weapon {
  visibility: hidden;
}
.tc-col-header.is-flipped .tc-col-header-ability {
  transform: translateY(0);
}
.tc-col-header.is-flipped .tc-col-header-ability-text {
  display: block;
  white-space: normal;
}
.megami-origin-popup {
  position: fixed;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: rgba(255,255,255,0.97);
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transform: translateX(-50%);
  animation: origin-popup-in 0.18s ease-out both;
}
.megami-origin-popup-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  opacity: 0.55;
  padding: 3px;
  transition: opacity 0.15s, background 0.15s;
}
.megami-origin-popup-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.megami-origin-popup-btn:hover {
  opacity: 1;
  background: #f0ede9;
}
.tc-card-body {
  background: #fff;
  border: 1px solid #dddad5;
  border-top: none;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  position: relative;
}
.tc-card-body.is-dialogue {
  min-height: 360px;
  background: transparent;
  border-color: transparent;
}
.tc-dialogue-full-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  opacity: 0;
  transition: opacity 0.45s ease;
  overflow: hidden;
  cursor: pointer;
  pointer-events: none;
}
.tc-dialogue-full-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.tc-dialogue-full-img {
  position: absolute;
  top: 0;
  left: 50%;
  width: auto;
  max-width: 100%;
  height: auto;
  pointer-events: none;
  z-index: 1;
}
.tc-dialogue-full-gradient {
  position: absolute;
  top: calc(var(--tc-dialogue-header-height) - var(--tc-dialogue-gradient-overlap));
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.82) 17%, #fff 34%, #fff 100%);
  pointer-events: none;
  z-index: 2;
}
.tc-dialogue-text {
  position: absolute;
  top: calc(128px + 30%);
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  font-family: 'Noto Serif JP', serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.9;
  color: #333;
  padding: 0.8rem 1.5rem 1.5rem;
  text-align: center;
  overflow-y: auto;
}
.tc-dialogue-char {
  animation: tc-char-in 0.5s ease-out both;
}
.tc-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 3px;
  background: linear-gradient(to bottom, #62381c 0%, #111 100%);
  border-bottom: 1px solid #e8e5e0;
}
.tc-section-label-text {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #e2e2e2;
  text-transform: uppercase;
  white-space: nowrap;
}
.tc-section-label-line {
  flex: 1;
  height: 1px;
  background: #e3e0db;
}
.tc-card-row {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #e8e5e0;
  cursor: pointer;
  transition: background 0.1s;
}
.tc-card-row:last-child {
  border-bottom: none;
}
.tc-card-row:hover {
  background: #f0ede9;
}
.tc-card-row-main {
  display: grid;
  grid-template-columns: 42px calc(11.5rem) 1px 1fr;
  align-items: stretch;
  width: 100%;
  min-height: 50px;
}
.tc-card-hex-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 2px 6px 5px;
}
.tc-hex-cell {
  width: 34px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.45));
}
.tc-hex-cell-label {
  font-family: 'Noto Serif JP', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #333;
  line-height: 1;
  user-select: none;
}
.tc-card-left-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 6px 6px 6px 4px;
  overflow: hidden;
}
.tc-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #2c2a27;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.tc-card-name-sub {
  color: #999;
}
.tc-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: calc(1.76rem + 6px);
}
.tc-card-meta-row {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.tc-card-type {
  font-size: 0.55rem;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  line-height: 1.6;
}
.tc-t-atk {
  background: #fde8e8;
  color: #8b2020;
}
.tc-t-act {
  background: #e8eafd;
  color: #20288b;
}
.tc-t-gnt {
  background: #e8fded;
  color: #1a7a30;
}
.tc-t-rsp {
  background: #f0e8fc;
  color: #5a1f80;
}
.tc-t-ful {
  background: #fdf3e0;
  color: #7a5208;
}
.tc-card-range {
  font-size: 0.65rem;
  color: #464646;
  white-space: nowrap;
}
.tc-card-dmg {
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}
.tc-dmg-val {
  color: #333;
}
.tc-dmg-sep {
  color: #9e9c97;
  font-weight: 400;
  margin: 0 1px;
}
.tc-nou-val {
  color: #333;
}
.tc-card-nou {
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  white-space: nowrap;
  line-height: 1;
}
.tc-nou-label {
  font-size: 0.55rem;
  color: #9e9c97;
  font-weight: 400;
}
.tc-card-cost {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  gap: 0px;
}
.tc-card-cost-flare {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}
.tc-card-cost-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #000;
  font-size: 0.7rem;
  font-weight: 700;
  color: #000;
  line-height: 1;
  margin-left: -4px;
  font-family: 'Noto Serif JP', serif;
  font-weight: 700;
}
.tc-card-divider {
  width: 1px;
  background: #e8e5e0;
  align-self: stretch;
  margin: 7px 0;
}
.tc-card-text-pane {
  display: flex;
  align-items: center;
  padding: 6px 8px 6px 10px;
  min-width: 0;
}
.tc-card-text-summary {
  font-size: 0.68rem;
  color: #464646;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
@media (max-width: 850px) {
  .tc-two-cols {
    padding-top: 3.5rem;
  }
}
@media (max-width: 750px) {
  .tc-card-row-main {
    grid-template-columns: 42px calc(11.5rem + 10px);
  }
  .tc-card-text-pane,
  .tc-card-divider {
    display: none;
  }
}
@media (min-width: 851px) and (max-width: 1099px) {
  .card-layout {
    gap: 0;
  }
  .card-preview-area {
    width: 320px;
  }
  .card-preview-img {
    width: 260px;
  }
  .card-preview-img.is-wide {
    width: 310px;
  }
  .card-fans-wrap {
    padding: 0;
  }
  .card-preview-area .card-faq .card-faq-img-pc {
    width: 260px;
  }
  .card-preview-area::before {
    background-size: 100% auto;
    background-position: center top;
  }
}
@media (max-width: 850px) {
  main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  #cardlist-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .card-fan-group {
    display: contents;
  }
  .cardlist-menu-wrap {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .cardlist-mode-select {
    position: static;
    transform: none;
    flex-direction: row;
    gap: 0.4rem;
  }
  #megami-select-area {
    position: static;
    width: 100%;
    pointer-events: auto;
  }
  .megami-select-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  .megami-select-item {
    width: 64px;
  }
  .mode-btn {
    padding: 0.6rem 1.4rem 0.6rem 0.8rem;
    width: 9rem;
  }
  #btn-megami-goto {
    clip-path: polygon(100% 0%, var(--mode-btn-slope, 37.5%) 0%, 0% 100%, 100% 100%);
    padding: 0.6rem 0.8rem 0.6rem 1.4rem;
  }
  .cardlist-top {
    flex-direction: column;
    align-items: flex-start;
  }
  #cardlist-content {
    position: relative;
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  .back-btn {
    position: sticky;
    top: 6rem;
    z-index: 120;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }
  .card-area-wrapper {
    position: relative;
    border-radius: 0;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .card-area-bg {
    opacity: 0.25;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
  }
  .card-layout {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .back-to-megami-btn {
    top: calc(var(--nav-offset, 6rem) + 0.3rem);
    font-size: 0.85rem;
    padding: 0.6rem 0.6rem 0.6rem 1.3rem;
  }
  .card-preview-area {
    position: relative;
    width: 100%;
    margin: 0;
    padding-top: 3rem;
    height: auto;
    flex: 1;
    z-index: 1;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .card-preview-area::before {
    display: none;
  }
  .card-preview-img {
    flex: 1;
    width: auto;
    min-width: 0;
    max-height: 55vh;
    object-fit: contain;
  }
  .card-preview-area .card-faq {
    position: static;
    transform: none;
    left: auto;
    bottom: auto;
    pointer-events: auto;
    order: -1;
    flex: 0 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .card-preview-area .extra-section-container {
    position: static;
    transform: none;
    order: 1;
    flex: 0 0 50px;
    align-self: center;
    justify-content: center;
  }
  .card-faq .card-faq-img-pc {
    display: none;
  }
  .card-faq .card-faq-img-sp {
    display: block;
    height: clamp(140px, 42vh, 320px);
    width: auto;
    filter: none;
    opacity: 1;
  }
  .card-layout > .card-grid,
  .card-area-wrapper .card-grid {
    position: relative;
    flex-shrink: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    padding: 4px 2%;
    background: rgba(0,0,0,0.15);
    gap: 0;
    min-width: auto;
  }
  .card-thumb {
    display: none;
  }
  .card-hex-sp {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 3px 0;
    cursor: pointer;
  }
  .card-hex-sp .tc-hex-cell {
    width: clamp(34px, 11vw, 54px);
    height: clamp(38px, calc(11vw * 1.12), 60px);
  }
  .card-hex-sp .tc-hex-cell .tc-hex-cell-label {
    font-size: clamp(1.2rem, 5vw, 1.5rem);
  }
  .card-hex-sp.is-selected {
    filter: drop-shadow(0 0 5px #ff4fd1) drop-shadow(0 0 10px rgba(255,79,209,0.5));
  }
  .card-cell {
    width: 14.2%;
    flex-shrink: 0;
  }
  .card-fans-wrap {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
    width: 100%;
  }
  .card-grid .megami-col-name-img {
    display: none;
  }
  .card-grid-separator {
    display: none;
  }
  .origin-toggle-bar {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 3;
    flex-direction: row;
    justify-content: flex-end;
    gap: 0.2rem;
    padding: 0.3rem;
    background: transparent;
    border-radius: 0;
  }
  .origin-toggle-btn {
    width: 42px;
    height: 42px;
    padding: 2px;
  }
  .tc-col {
    --tc-dialogue-header-height: 140px;
    --tc-dialogue-gradient-overlap: 52px;
  }
  .tc-col-header {
    height: 140px;
  }
  .tc-col-header-name img {
    height: 58px;
  }
  .tc-col-header-weapon {
    width: 54px;
  }
  .tc-col-header-ability {
    max-width: calc(100% - 1.2rem);
  }
  .tc-col-header-ability-name {
    font-size: 0.7rem;
  }
  .tc-dialogue-text {
    top: calc(88px + 30%);
  }
  .tc-card-row-main {
    grid-template-columns: 40px 1fr;
  }
  .tc-card-hex-wrap {
    padding: 4px 2px 4px 3px;
  }
  .tc-card-name {
    font-size: 0.75rem;
  }
  .tc-card-meta {
    gap: 3px;
  }
  .tc-card-text-summary {
    font-size: 0.63rem;
  }
  .extra-card-btn-icon {
    width: 44px;
    height: 44px;
  }
  .tc-extra-toggle-btn-wrap {
    right: 6px;
  }
  .tc-extra-toggle-btn {
    font-size: 0.65rem;
    width: 3.8rem;
  }
  .tc-col-header.has-extra-btn .tc-col-header-ability-name-wrap {
    margin-right: calc(3.8rem + 6px);
  }
  .tc-umbrella-toggle-img {
    width: 44px;
    height: 44px;
  }
}
@-moz-keyframes fans-slide-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@-webkit-keyframes fans-slide-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@-o-keyframes fans-slide-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fans-slide-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@-moz-keyframes fans-slide-in-bg-fix {
  from {
    transform: translateY(-28px);
  }
  to {
    transform: translateY(0);
  }
}
@-webkit-keyframes fans-slide-in-bg-fix {
  from {
    transform: translateY(-28px);
  }
  to {
    transform: translateY(0);
  }
}
@-o-keyframes fans-slide-in-bg-fix {
  from {
    transform: translateY(-28px);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes fans-slide-in-bg-fix {
  from {
    transform: translateY(-28px);
  }
  to {
    transform: translateY(0);
  }
}
@-moz-keyframes fans-slide-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(28px);
  }
}
@-webkit-keyframes fans-slide-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(28px);
  }
}
@-o-keyframes fans-slide-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(28px);
  }
}
@keyframes fans-slide-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(28px);
  }
}
@-moz-keyframes tc-dialogue-progress-shrink {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}
@-webkit-keyframes tc-dialogue-progress-shrink {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}
@-o-keyframes tc-dialogue-progress-shrink {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}
@keyframes tc-dialogue-progress-shrink {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}
@-moz-keyframes origin-popup-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
@-webkit-keyframes origin-popup-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
@-o-keyframes origin-popup-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
@keyframes origin-popup-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
@-moz-keyframes tc-char-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@-webkit-keyframes tc-char-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@-o-keyframes tc-char-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes tc-char-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
