.tcg-gallery {
  --tcg-gold: #e0b66c;
  --tcg-brick: #6f281c;
  --tcg-stone: #554640;
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2rem);
  color: var(--parchment);
  background-color: #38251e;
  background-image:
    linear-gradient(90deg, transparent 0 49.6%, rgb(242 220 192 / 4%) 49.8% 50.2%, transparent 50.4%),
    linear-gradient(0deg, transparent 0 49.6%, rgb(242 220 192 / 4%) 49.8% 50.2%, transparent 50.4%),
    linear-gradient(135deg, rgb(255 250 243 / 2%), transparent 50%);
  background-size: 104px 58px, 104px 58px, auto;
  border-block: 5px solid var(--maroon);
}

.tcg-gallery-inner {
  width: min(1400px, 100%);
  margin: 0 auto;
}

.tcg-gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem .35rem;
}

.tcg-gallery-heading h2 {
  margin: 0;
  color: var(--parchment);
}

.tcg-eyebrow {
  margin: 0 0 .4rem;
  color: var(--flame);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.tcg-carousel {
  position: relative;
  height: clamp(430px, 43vw, 580px);
  min-height: 430px;
  overflow: hidden;
  isolation: isolate;
  background: var(--tower);
  border: 9px ridge var(--tcg-brick);
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--tcg-gold), inset 0 0 0 7px rgb(27 18 16 / 65%), 0 18px 50px rgb(0 0 0 / 42%);
}

.tcg-slides,
.tcg-slide {
  position: absolute;
  inset: 0;
}

.tcg-slide {
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s ease;
}

.tcg-slide.is-active {
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
}

.tcg-slide::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgb(12 11 12 / 88%) 0%, rgb(12 11 12 / 68%) 24%, rgb(12 11 12 / 18%) 62%, rgb(12 11 12 / 4%) 100%), linear-gradient(0deg, rgb(12 11 12 / 46%) 0%, transparent 28%);
}

.tcg-slide > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.015);
}

.tcg-slide.is-active > img {
  animation: tcg-image-drift 8s ease-out both;
}

@keyframes tcg-image-drift {
  from { transform: scale(1.015); }
  to { transform: scale(1.08); }
}

.tcg-slide-copy {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: clamp(2rem, 7vw, 6rem);
  width: min(27%, 310px);
  padding: .65rem .8rem .75rem;
  transform: translateY(-54%);
  text-shadow: 0 2px 14px rgb(0 0 0 / 38%);
  background: linear-gradient(90deg, rgb(36 20 15 / 42%), rgb(36 20 15 / 16%) 78%, transparent);
  border-block: 1px solid rgb(224 182 108 / 22%);
  border-left: 2px solid rgb(224 182 108 / 60%);
  box-shadow: 0 8px 20px rgb(0 0 0 / 9%);
}

.tcg-slide-kicker {
  display: block;
  margin-bottom: .35rem;
  color: #f3bd66;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.tcg-slide-copy h3 {
  margin: 0 0 .55rem;
  color: var(--parchment);
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(1.65rem, 3.2vw, 2.65rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: .98;
  text-transform: none;
}

.tcg-shop-link {
  display: inline-flex;
  min-height: 2.3rem;
  align-items: center;
  gap: .65rem;
  padding: .4rem .7rem;
  color: var(--parchment);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  text-shadow: none;
  background: linear-gradient(180deg, rgb(164 59 36 / 88%), rgb(104 35 27 / 88%));
  border: 1px solid rgb(209 161 94 / 75%);
  border-radius: 5px;
  box-shadow: 0 3px 0 rgb(27 18 16 / 58%), inset 0 1px rgb(255 250 243 / 14%);
  transition: background .2s ease, transform .2s ease;
}

.tcg-shop-link:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #bd4a2c, #8f2a1d);
}

.tcg-tabs {
  position: absolute;
  z-index: 4;
  top: 50%;
  right: 1.15rem;
  display: grid;
  width: clamp(150px, 16%, 190px);
  grid-template-columns: minmax(0, 1fr);
  gap: .3rem;
  padding: .4rem;
  transform: translateY(-50%);
  background:
    linear-gradient(90deg, rgb(255 255 255 / 7%), transparent 24%),
    linear-gradient(145deg, rgb(81 68 60 / 52%), rgb(40 27 23 / 58%));
  border: 1px solid rgb(224 182 108 / 36%);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgb(224 182 108 / 13%), 0 8px 20px rgb(0 0 0 / 30%);
  backdrop-filter: blur(7px);
}

.tcg-tab {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 50px;
  flex-direction: column;
  justify-content: center;
  gap: .25rem;
  overflow: hidden;
  padding: .35rem .4rem .35rem 2.25rem;
  color: #e6d4bc;
  font: inherit;
  text-align: left;
  cursor: pointer;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 8%), transparent 48%),
    linear-gradient(180deg, rgb(85 70 64 / 42%), rgb(48 35 30 / 48%));
  border: 1px solid rgb(226 190 139 / 15%);
  border-radius: 4px;
  box-shadow: inset 0 1px rgb(255 250 243 / 8%), 0 3px 6px rgb(0 0 0 / 20%);
  transition: background .25s ease, color .25s ease, border-color .25s ease;
  backdrop-filter: blur(4px);
}

.tcg-tab::before {
  position: absolute;
  top: 50%;
  left: .75rem;
  content: "";
  color: #e0b66c;
  font-family: var(--font-display, Georgia, serif);
  font-size: .9rem;
  transform: translateY(-50%);
}

.tcg-tab::after {
  position: absolute;
  top: .55rem;
  bottom: .55rem;
  left: .45rem;
  width: 3px;
  height: auto;
  content: "";
  background: var(--flame);
  opacity: .3;
  transform: scaleY(0);
  transform-origin: top;
}

.tcg-tab:nth-child(1)::before { content: "I"; }
.tcg-tab:nth-child(2)::before { content: "II"; }
.tcg-tab:nth-child(3)::before { content: "III"; }
.tcg-tab:nth-child(4)::before { content: "IV"; }
.tcg-tab:nth-child(5)::before { content: "V"; }

.tcg-tab.is-active {
  color: var(--paper);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 9%), transparent 45%),
    linear-gradient(180deg, rgb(119 51 35 / 78%), rgb(72 31 25 / 82%));
  border-color: rgb(213 165 82 / 68%);
  box-shadow: inset 0 1px rgb(255 250 243 / 13%), 0 3px 8px rgb(0 0 0 / 24%);
}

.tcg-tab.is-active::after {
  opacity: 1;
  animation: tcg-tab-timer 6s linear forwards;
}

@keyframes tcg-tab-timer {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

.tcg-tab-game {
  overflow: hidden;
  color: #e1bb83;
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tcg-tab strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 700px) {
  .tcg-gallery { padding: 1.5rem .7rem; }
  .tcg-gallery-heading { margin-left: .2rem; }
  .tcg-carousel { height: 500px; min-height: 0; border-width: 6px; border-radius: 10px; }
  .tcg-slide > img { object-position: 56% center; }
  .tcg-slide::after {
    background: linear-gradient(180deg, rgb(12 11 12 / 42%) 0%, rgb(12 11 12 / 8%) 35%, rgb(12 11 12 / 78%) 69%, rgb(12 11 12 / 85%) 100%);
  }
  .tcg-slide-copy {
    top: 50%;
    left: .65rem;
    width: calc(100% - clamp(96px, 29%, 120px) - 1.8rem);
    padding: .5rem .45rem .55rem;
    transform: translateY(-50%);
  }
  .tcg-slide-kicker { font-size: .58rem; letter-spacing: .08em; }
  .tcg-slide-copy h3 { margin-bottom: .4rem; font-size: clamp(1.2rem, 5vw, 1.7rem); overflow-wrap: anywhere; }
  .tcg-shop-link { min-height: 2rem; gap: .35rem; padding: .35rem .45rem; font-size: .62rem; }
  .tcg-tabs { top: 50%; right: .45rem; bottom: auto; left: auto; width: clamp(96px, 29%, 120px); gap: .22rem; padding: .3rem; transform: translateY(-50%); }
  .tcg-tab { min-height: 42px; padding: .3rem .25rem .3rem 1.8rem; gap: .1rem; }
  .tcg-tab::before { left: .4rem; font-size: .75rem; }
  .tcg-tab::after { top: .3rem; bottom: .3rem; left: .18rem; width: 2px; }
  .tcg-tab-game { font-size: .45rem; letter-spacing: .03em; }
  .tcg-tab strong { font-size: .62rem; }
}

@media (max-width: 380px) {
  .tcg-carousel { height: 460px; }
  .tcg-tab { min-height: 39px; padding-left: 1.65rem; }
  .tcg-tab::before { left: .35rem; font-size: .7rem; }
  .tcg-tab-game { font-size: .4rem; }
  .tcg-tab strong { font-size: .58rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tcg-slide,
  .tcg-shop-link,
  .tcg-tab { transition: none; }
  .tcg-slide.is-active > img { animation: none; }
  .tcg-tab.is-active::after { animation: none; transform: scaleY(1); }
}
