body.type-friends #content-inner,
body[class*="friends"] #content-inner,
main#content-inner.layout.hide-aside {
  width: min(98vw, 1760px) !important;
  max-width: none !important;
  margin: 0 auto !important;
  padding: 30px 0 88px !important;
}

body.type-friends #content-inner > #page.friends-redesign-page,
body[class*="friends"] #content-inner > #page.friends-redesign-page,
#page.friends-redesign-page {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

body.type-friends .page-title,
body[class*="friends"] .page-title {
  display: none !important;
}

#body-wrap.type-friends #page-header #nav,
#body-wrap.type-friends #page-header.nav-fixed #nav,
#body-wrap.type-friends #page-header.not-top-img #nav {
  background:
    linear-gradient(
      90deg,
      #6d4b1f 0%,
      #b8893f 20%,
      #f3d27a 50%,
      #c59543 80%,
      #6f4c24 100%
    ) !important;
  box-shadow: 0 4px 18px rgba(120, 85, 30, 0.35) !important;
  border-bottom: 2px solid rgba(255, 220, 150, 0.55) !important;
}

#body-wrap.type-friends #page-header #nav a,
#body-wrap.type-friends #page-header #nav span,
#body-wrap.type-friends #page-header #nav .site-name {
  color: #fff8e3 !important;
  text-shadow: 0 2px 8px rgba(79, 45, 14, 0.28) !important;
}

.friends-redesign-page {
  color: #2c1a09;
}

.friends-hero {
  margin-bottom: 30px;
  padding: 42px 46px;
  border: 6px solid #8a5a2b;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 240, 201, 0.9), transparent 24%),
    linear-gradient(145deg, #d3b277, #f6e3a8);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16);
}

.friends-hero-eyebrow {
  margin: 0 0 10px;
  color: rgba(74, 44, 13, 0.72);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.friends-hero-title {
  margin: 0;
  color: #4f2c0f;
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 900;
  line-height: 1.02;
  text-shadow: 2px 2px 0 rgba(255, 247, 221, 0.5);
}

.friends-hero-subtitle {
  max-width: 780px;
  margin: 16px 0 0;
  color: #634221;
  font-size: 17px;
  line-height: 1.85;
}

.friends-group-card {
  margin-top: 28px;
  padding: 26px 28px 34px;
  border: 6px solid #8a5a2b;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 247, 223, 0.94), rgba(247, 231, 183, 0.92));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.14);
}

.friends-group-head {
  margin-bottom: 22px;
}

.friends-group-title {
  margin: 0 0 8px;
  color: #4f2c0f;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 900;
}

.friends-group-desc {
  margin: 0;
  color: #765230;
  font-size: 15px;
  line-height: 1.8;
}

.card-deck {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}

.duel-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 12px;
  border: 8px solid #8a5a2b;
  border-radius: 14px;
  background: linear-gradient(145deg, #d3b277, #f6e3a8);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  text-decoration: none !important;
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.duel-card:hover,
.duel-card:focus-visible {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 30px 62px rgba(0, 0, 0, 0.24);
  filter: saturate(1.05);
}

.duel-card:focus-visible {
  outline: none;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.card-rarity {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(76, 43, 15, 0.12);
  color: #5a3515;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.card-name {
  flex: 1 1 auto;
  margin: 0;
  padding: 8px 12px;
  min-height: 62px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  background: #a8743d;
  color: #fff7dd;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.card-frame {
  height: 180px;
  padding: 8px;
  border: 3px solid #78603b;
  background: #e8d5b0;
}

.card-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-desc {
  min-height: 110px;
  margin-top: 10px;
  padding: 10px;
  border: 2px solid #b69460;
  background: #f9f0d5;
  line-height: 1.8;
}

.card-type {
  margin-bottom: 6px;
  color: #563517;
  font-size: 12px;
  font-weight: 700;
}

.card-desc p {
  margin: 0;
  color: #694626;
  font-size: 13px;
}

.duel-card.rarity-r {
  background: linear-gradient(145deg, #b98f62, #e4c28d);
}

.duel-card.rarity-r .card-rarity {
  background: rgba(115, 72, 35, 0.18);
}

.duel-card.rarity-sr {
  background:
    linear-gradient(145deg, #c2c7d4, #f4f7ff 44%, #bcc8dd 100%);
  border-color: #7a7f8d;
}

.duel-card.rarity-sr .card-name {
  background: linear-gradient(90deg, #757c8f, #a7b2ca);
}

.duel-card.rarity-sr .card-rarity {
  background: rgba(91, 103, 132, 0.14);
  color: #4f5d83;
}

.duel-card.rarity-ssr {
  background:
    linear-gradient(145deg, #c79a2c, #fff0b2 34%, #d09f31 68%, #ffe495 100%);
  border-color: #8b5e08;
  overflow: hidden;
}

.duel-card.rarity-ssr::after {
  content: "";
  position: absolute;
  inset: -30% auto auto -40%;
  width: 70%;
  height: 180%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  pointer-events: none;
}

.duel-card.rarity-ssr .card-name {
  background: linear-gradient(90deg, #f0d58a 0%, #dca53d 40%, #b7770f 100%);
}

.duel-card.rarity-ssr .card-rarity {
  background: rgba(130, 85, 8, 0.14);
  color: #704909;
}

@media (max-width: 1560px) {
  .card-deck {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body.type-friends #content-inner,
  body[class*="friends"] #content-inner,
  main#content-inner.layout.hide-aside {
    width: 94vw !important;
    padding-top: 20px !important;
  }

  .friends-hero,
  .friends-group-card {
    padding-left: 20px;
    padding-right: 20px;
  }

  .card-deck {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 520px) {
  .friends-hero {
    padding: 28px 20px;
  }

  .friends-group-card {
    padding: 20px 16px 24px;
  }

  .card-deck {
    grid-template-columns: 1fr;
  }
}
