:root {
  --black: #05040b;
  --stone-900: #080713;
  --stone-800: #0e1020;
  --stone-700: #17172d;
  --stone-600: #242743;
  --silver: #f7fbff;
  --silver-dim: #aeb7d7;
  --red: #ff2f7d;
  --red-bright: #ff48d7;
  --gold: #ffc857;
  --gold-soft: #ffe7a3;
  --green: #54ffd0;
  --blue-steel: #22d8ff;
  --line: rgba(151, 220, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.28);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  --font-display: "Orbitron", "Rajdhani", sans-serif;
  --font-serif: "Exo 2", "Rajdhani", sans-serif;
  --font-ui: "Exo 2", "Rajdhani", Verdana, sans-serif;
  --cb-cyan: #1be7ff;
  --cb-blue: #2d78ff;
  --cb-pink: #ff37e7;
  --cb-violet: #8a48ff;
  --cb-ink: #05040b;
  --cb-panel: rgba(7, 8, 22, 0.72);
  --cb-panel-strong: rgba(10, 12, 30, 0.9);
}

html {
  background: #05040b;
}

body {
  padding-top: 104px;
  color: var(--silver);
  background: #05040b;
  font-family: var(--font-ui);
  letter-spacing: 0;
}

body.home-page {
  padding-top: 0;
}

.page-bg {
  background: #05040b;
}

.page-bg__image {
  background-image:
    linear-gradient(90deg, rgba(5, 4, 11, 0.5), rgba(5, 4, 11, 0.08) 46%, rgba(5, 4, 11, 0.58)),
    linear-gradient(180deg, rgba(5, 4, 11, 0.12), #05040b 96%),
    url("assets/img/bg-comeback.webp");
  background-position: center top;
  background-size: cover;
  opacity: 1;
  filter: saturate(1.2) contrast(1.04) brightness(0.78);
  transform: none;
}

.page-bg__stained {
  opacity: 0.92;
  background:
    linear-gradient(105deg, transparent 0 18%, rgba(27, 231, 255, 0.12) 18% 18.4%, transparent 18.4% 43%, rgba(255, 55, 231, 0.14) 43% 43.35%, transparent 43.35%),
    linear-gradient(62deg, transparent 0 58%, rgba(255, 200, 87, 0.14) 58% 58.4%, transparent 58.4%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 110px);
}

.page-bg__grain {
  opacity: 0.16;
  background-image:
    linear-gradient(0deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 12px 12px;
}

.page-bg__vignette {
  background:
    linear-gradient(180deg, rgba(5, 4, 11, 0.08), rgba(5, 4, 11, 0.72) 78%, #05040b),
    radial-gradient(ellipse at 50% 20%, transparent 0 42%, rgba(5, 4, 11, 0.48) 88%);
}

.topbar {
  top: 16px;
  left: 50%;
  right: auto;
  width: min(1240px, calc(100% - 48px));
  min-height: 74px;
  padding: 10px 14px;
  transform: translateX(-50%);
  border: 1px solid rgba(151, 220, 255, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(27, 231, 255, 0.08), rgba(255, 55, 231, 0.08)),
    rgba(5, 6, 17, 0.74);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(22px);
}

.topbar--home {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}

.topbar--home .topbar__main {
  width: 100%;
  min-height: 0;
  padding: 0;
}

.topbar::before {
  inset: auto 18px -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cb-cyan), var(--cb-pink), var(--gold), transparent);
  opacity: 0.95;
}

.brand {
  min-width: 220px;
  gap: 10px;
}

.brand__mark {
  width: 74px;
  height: 52px;
  object-fit: contain;
  animation: comeback-logo-pulse 4s ease-in-out infinite;
}

@keyframes comeback-logo-pulse {
  50% {
    transform: translateY(-1px) scale(1.04);
    filter: drop-shadow(0 0 18px rgba(27, 231, 255, 0.55)) drop-shadow(0 0 18px rgba(255, 55, 231, 0.45));
  }
}

.brand__name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.03em;
}

.brand__season {
  color: var(--cb-cyan);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.topbar__nav {
  gap: 2px;
}

.nav-link {
  min-height: 40px;
  padding-inline: 12px;
  border-radius: 12px;
  color: rgba(247, 251, 255, 0.72);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
  border-color: rgba(27, 231, 255, 0.38);
  background: linear-gradient(135deg, rgba(27, 231, 255, 0.13), rgba(255, 55, 231, 0.1));
}

.nav-link--siege {
  color: var(--gold-soft);
  border-color: rgba(255, 200, 87, 0.32);
  background: linear-gradient(135deg, rgba(255, 200, 87, 0.14), rgba(255, 55, 231, 0.08));
}

.button,
.icon-button,
.tab,
input,
select,
textarea {
  border-radius: 12px;
}

.button,
.icon-button {
  border-color: rgba(151, 220, 255, 0.22);
  background: rgba(8, 10, 25, 0.82);
}

.button--primary {
  color: #041018;
  border-color: rgba(27, 231, 255, 0.74);
  background:
    linear-gradient(135deg, #70f6ff, #1be7ff 45%, #ff63ef);
  box-shadow: 0 18px 52px rgba(27, 231, 255, 0.25), 0 0 26px rgba(255, 55, 231, 0.16);
}

.button--gold {
  color: #130b03;
  border-color: rgba(255, 231, 163, 0.74);
  background: linear-gradient(135deg, #fff0a8, #ffc857 48%, #ff7bdc);
  box-shadow: 0 18px 44px rgba(255, 200, 87, 0.2);
}

.button--ghost {
  color: #f7fbff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(27, 231, 255, 0.08));
}

.button:hover,
.icon-button:hover {
  border-color: rgba(255, 55, 231, 0.62);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38), 0 0 24px rgba(27, 231, 255, 0.18);
}

main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.reveal {
  opacity: 1;
  transform: none;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.hero {
  order: 1;
  width: 100%;
  min-height: 100svh;
  grid-template-columns: minmax(420px, 0.92fr) minmax(520px, 1.08fr);
  align-items: center;
  gap: clamp(24px, 4vw, 70px);
  padding: 136px max(32px, calc((100vw - 1240px) / 2)) 70px;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 4, 11, 0.9) 0%, rgba(5, 4, 11, 0.42) 42%, rgba(5, 4, 11, 0.76) 100%),
    linear-gradient(180deg, transparent 0 68%, #05040b 100%);
}

.hero__left {
  max-width: 620px;
  min-width: 0;
}

.eyebrow {
  color: var(--gold-soft);
  font-size: 13px;
  letter-spacing: 0.11em;
}

.eyebrow svg {
  color: var(--cb-cyan);
}

.hero h1 {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: 80px;
  line-height: 0.9;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero h1 span {
  background: linear-gradient(100deg, #fff, #8ff7ff 30%, #ff4ee8 72%, #ffe7a3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 24px rgba(255, 55, 231, 0.26));
}

.hero h1 small {
  margin-top: 12px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 42px;
  letter-spacing: 0.16em;
  text-shadow: 0 0 22px rgba(27, 231, 255, 0.5);
}

.hero__lead {
  max-width: 590px;
  color: rgba(247, 251, 255, 0.82);
  font-family: var(--font-serif);
  font-size: clamp(19px, 2vw, 25px);
}

.hero__stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 520px;
}

.hero__stats span {
  border-color: rgba(151, 220, 255, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(27, 231, 255, 0.09), rgba(255, 55, 231, 0.07)),
    rgba(6, 8, 22, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero__stats b {
  color: var(--cb-cyan);
  letter-spacing: 0.12em;
}

.hero__stats em {
  color: var(--gold-soft);
}

.hero__actions {
  margin-top: 28px;
}

.hero__right {
  min-height: 620px;
  min-width: 0;
  width: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  order: initial;
}

.crest-stage {
  width: min(680px, 47vw, 100%);
  aspect-ratio: 1.45;
}

.crest-stage::before {
  content: "";
  position: absolute;
  inset: 9% 4%;
  border: 1px solid rgba(27, 231, 255, 0.34);
  border-radius: 28px;
  transform: skewX(-8deg);
  background:
    linear-gradient(135deg, rgba(27, 231, 255, 0.1), transparent 34%, rgba(255, 55, 231, 0.12)),
    rgba(5, 4, 11, 0.08);
  filter: blur(0.2px);
}

.crest-stage__ring {
  inset: 4% 12%;
  border-color: rgba(27, 231, 255, 0.32);
  box-shadow:
    0 0 50px rgba(27, 231, 255, 0.18),
    inset 0 0 70px rgba(255, 55, 231, 0.18);
}

.crest-stage__logo {
  width: min(760px, 100%);
  max-height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 0 26px rgba(27, 231, 255, 0.45))
    drop-shadow(0 0 34px rgba(255, 55, 231, 0.35));
}

.crest-stage__beam {
  opacity: 0.42;
}

.hero-status {
  width: min(680px, 100%);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 !important;
  border: 0;
  background: transparent;
  overflow: visible;
}

.hero-status .server-strip__item {
  min-height: 66px;
  border: 1px solid rgba(151, 220, 255, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(27, 231, 255, 0.1), rgba(255, 55, 231, 0.07)),
    rgba(5, 6, 17, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero-status .server-strip__item svg {
  color: var(--cb-cyan);
}

.hero-status .server-strip__item span {
  color: rgba(247, 251, 255, 0.62);
  letter-spacing: 0.08em;
}

.hero-status .server-strip__item strong {
  color: #fff;
}

.edict-slider {
  order: 8;
}

.edict-slider.reveal {
  opacity: 1;
  transform: none;
}

.ranking-section {
  order: 2;
}

#clases {
  order: 3;
}

.benefits-section {
  order: 4;
}

.event-section {
  order: 5;
}

#galeria {
  order: 6;
}

.download-section {
  order: 7;
}

.section,
.edict-slider,
.footer {
  width: min(1240px, calc(100% - 48px));
}

.section {
  padding-top: 88px;
}

.section__head {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(260px, 0.28fr);
  gap: 18px;
  align-items: end;
  margin-bottom: 28px;
}

.section__head .eyebrow,
.section__head h2 {
  grid-column: 1;
}

.section__head p {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
  color: rgba(247, 251, 255, 0.7);
  font-family: var(--font-serif);
  font-size: 18px;
}

.section__head h2,
.download h2,
.siege h2,
.siege-loren h2,
.edict h2,
.system-hero h1,
.system-panel h2,
.admin-panel h1,
.admin-panel h2 {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.section__head h2 {
  font-size: clamp(40px, 5vw, 76px);
  line-height: 0.9;
  background: linear-gradient(95deg, #fff, #a6f8ff 38%, #ff65ef);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ranking-panel,
.podium,
.benefit-panel,
.event-card,
.siege,
.gallery,
.download,
.system-panel,
.system-card,
.wallet-panel,
.profile-banner,
.market-card,
.shop-card,
.pack-card,
.admin-panel,
.modal__panel {
  border: 1px solid rgba(151, 220, 255, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(27, 231, 255, 0.06), rgba(255, 55, 231, 0.055)),
    rgba(7, 8, 22, 0.78);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.ranking-layout {
  grid-template-columns: minmax(280px, 0.34fr) minmax(0, 0.66fr);
}

.podium {
  overflow: hidden;
}

.podium::before {
  background:
    linear-gradient(135deg, rgba(27, 231, 255, 0.18), transparent 40%),
    linear-gradient(315deg, rgba(255, 55, 231, 0.2), transparent 44%);
}

.podium__label,
.tab.is-active,
.event-card__state {
  color: #07111c;
}

.tabs {
  gap: 10px;
}

.tab {
  border-color: rgba(151, 220, 255, 0.18);
  color: rgba(247, 251, 255, 0.68);
  background: rgba(255, 255, 255, 0.045);
}

.tab.is-active {
  border-color: rgba(27, 231, 255, 0.74);
  background: linear-gradient(135deg, #8df7ff, #ff65ef);
}

.ranking-table th {
  color: var(--cb-cyan);
}

.ranking-table td {
  color: rgba(247, 251, 255, 0.86);
}

.class-card {
  border-color: rgba(151, 220, 255, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(27, 231, 255, 0.08), rgba(255, 55, 231, 0.06)),
    rgba(7, 8, 22, 0.76);
}

.class-card:hover {
  border-color: rgba(255, 55, 231, 0.46);
  transform: translateY(-7px);
}

.event-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.event-card {
  min-height: 250px;
}

.event-card img {
  opacity: 0.72;
  filter: saturate(1.15) contrast(1.05) drop-shadow(0 0 22px rgba(27, 231, 255, 0.2));
}

.event-card::before {
  background:
    linear-gradient(90deg, rgba(5, 4, 11, 0.88) 0%, rgba(5, 4, 11, 0.42) 60%, rgba(5, 4, 11, 0.18)),
    linear-gradient(135deg, rgba(27, 231, 255, 0.13), rgba(255, 55, 231, 0.08));
}

.event-card__state {
  border-color: rgba(27, 231, 255, 0.72);
  background: linear-gradient(135deg, #91fbff, #ff75ed);
}

.event-card[data-event-status="active"] .event-card__state {
  background: linear-gradient(135deg, #65ffd0, #8df7ff);
}

.event-card__progress-track {
  background: rgba(255, 255, 255, 0.12);
}

.event-card__progress {
  background: linear-gradient(90deg, #ff65ef, #8df7ff, #ffe7a3);
}

.siege-section {
  display: grid;
  gap: 24px;
}

.siege-loren {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --glare-x: 50%;
  --glare-y: 50%;
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(22px, 4vw, 44px);
  align-items: center;
  min-height: 270px;
  padding: clamp(24px, 4vw, 40px);
  overflow: hidden;
  border: 1px solid rgba(151, 220, 255, 0.24);
  border-top: 4px solid var(--cb-cyan);
  border-radius: 18px;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 55, 231, 0.22), transparent 35%),
    linear-gradient(135deg, rgba(13, 35, 62, 0.92), rgba(32, 14, 59, 0.94) 58%, rgba(43, 12, 34, 0.92)),
    rgba(5, 4, 11, 0.94);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.58),
    0 0 38px rgba(27, 231, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: perspective(1300px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transform-style: preserve-3d;
  transition: transform 140ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.siege-loren.reveal,
.siege-loren.reveal.is-visible {
  transform: perspective(1300px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
}

.siege-loren:hover {
  border-color: rgba(255, 200, 87, 0.5);
  box-shadow:
    0 42px 100px rgba(0, 0, 0, 0.66),
    0 0 46px rgba(255, 55, 231, 0.16),
    0 0 34px rgba(27, 231, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.siege-loren::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(141, 247, 255, 0.12), transparent),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 88px);
  opacity: 0.42;
}

.siege-loren__glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  background: radial-gradient(circle at var(--glare-x) var(--glare-y), rgba(141, 247, 255, 0.22), rgba(255, 55, 231, 0.08) 22%, transparent 48%);
  transition: opacity 220ms ease;
}

.siege-loren:hover .siege-loren__glare {
  opacity: 1;
}

.siege-loren__mark,
.siege-loren__info {
  position: relative;
  z-index: 2;
}

.siege-loren__mark {
  width: min(200px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 1px solid rgba(255, 200, 87, 0.34);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 55, 231, 0.16), transparent 42%),
    rgba(0, 0, 0, 0.68);
  box-shadow:
    inset 0 0 34px rgba(0, 0, 0, 0.8),
    0 18px 34px rgba(0, 0, 0, 0.5);
  transform: translateZ(42px);
}

.siege-loren__mark-img,
.siege-loren__mark-empty {
  width: 78%;
  height: 78%;
  object-fit: contain;
  image-rendering: pixelated;
}

.siege-loren__mark-empty {
  display: grid;
  place-items: center;
  color: rgba(141, 247, 255, 0.52);
}

.siege-loren__mark-empty svg {
  width: 82px;
  height: 82px;
  stroke-width: 1.4;
  filter: drop-shadow(0 0 16px rgba(27, 231, 255, 0.24));
}

.siege-loren__crown {
  position: absolute;
  top: -24px;
  left: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--gold-soft);
  transform: translateX(-50%);
  filter: drop-shadow(0 0 16px rgba(255, 200, 87, 0.62));
}

.siege-loren__info {
  transform: translateZ(26px);
}

.siege-loren h2 {
  margin: 10px 0 8px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 0.98;
  color: #fff;
  text-shadow: 0 0 24px rgba(27, 231, 255, 0.26), 0 6px 16px rgba(0, 0, 0, 0.8);
}

.siege-loren p {
  margin: 0 0 24px;
  color: rgba(247, 251, 255, 0.68);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.siege-loren p span {
  color: var(--gold-soft);
}

.siege-loren__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 1px;
  padding: 14px;
  border: 1px solid rgba(151, 220, 255, 0.16);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.38);
}

.siege-loren__stats span {
  display: grid;
  gap: 5px;
  min-height: 58px;
  padding: 8px 14px;
  border-right: 1px solid rgba(151, 220, 255, 0.12);
}

.siege-loren__stats span:last-child {
  border-right: 0;
}

.siege-loren__stats small {
  color: rgba(247, 251, 255, 0.46);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.siege-loren__stats b {
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.1;
}

.siege-loren__stats span:nth-child(n+3) b {
  color: var(--gold-soft);
  text-shadow: 0 0 14px rgba(255, 200, 87, 0.28);
}

.siege-next-panel,
.siege-guilds-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid rgba(151, 220, 255, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(27, 231, 255, 0.08), rgba(255, 55, 231, 0.08)),
    rgba(7, 8, 22, 0.82);
  box-shadow:
    0 28px 74px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
}

.siege-next-panel::before,
.siege-guilds-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cb-cyan), var(--cb-pink), transparent);
  opacity: 0.76;
}

.siege-timer-frame {
  width: min(660px, 100%);
  margin: 0 auto 66px;
  padding: 22px clamp(18px, 4vw, 40px);
  text-align: center;
  border: 2px solid rgba(255, 55, 231, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 55, 231, 0.1), rgba(27, 231, 255, 0.08)),
    rgba(0, 0, 0, 0.42);
  box-shadow:
    0 16px 42px rgba(0, 0, 0, 0.48),
    inset 0 0 22px rgba(0, 0, 0, 0.38);
}

.siege-timer-frame span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(247, 251, 255, 0.66);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.siege-timer-frame span svg {
  color: var(--cb-cyan);
}

.siege-timer-frame strong {
  display: block;
  margin-top: 10px;
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-shadow: 0 0 20px rgba(255, 200, 87, 0.34);
}

.siege-timer-frame strong.is-live {
  color: var(--green);
  text-shadow: 0 0 28px rgba(84, 255, 208, 0.5);
  animation: siege-live-pulse 900ms ease-in-out infinite alternate;
}

@keyframes siege-live-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.035); }
}

.siege-roadmap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 0 clamp(8px, 4vw, 42px) 30px;
}

.siege-roadmap::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(27, 231, 255, 0.1), rgba(255, 55, 231, 0.3), rgba(255, 200, 87, 0.28));
}

.siege-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 14px;
  min-width: 122px;
  color: rgba(247, 251, 255, 0.54);
  text-align: center;
}

.siege-step > svg {
  width: 60px;
  height: 60px;
  padding: 17px;
  border: 2px solid rgba(151, 220, 255, 0.15);
  border-radius: 999px;
  background: rgba(12, 10, 28, 0.96);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(0, 0, 0, 0.48);
}

.siege-step.is-active > svg {
  color: var(--gold-soft);
  border-color: rgba(255, 200, 87, 0.8);
  box-shadow: 0 0 28px rgba(255, 200, 87, 0.24), inset 0 0 18px rgba(255, 200, 87, 0.1);
  transform: scale(1.1);
}

.siege-step.is-war > svg {
  color: var(--cb-pink);
  border-color: rgba(255, 55, 231, 0.78);
}

.siege-step span {
  display: grid;
  gap: 3px;
  color: rgba(247, 251, 255, 0.78);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.siege-step small {
  color: rgba(247, 251, 255, 0.44);
  font-size: 10px;
}

.siege-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px dashed rgba(151, 220, 255, 0.18);
}

.siege-panel-title span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
}

.siege-panel-title svg {
  color: var(--cb-cyan);
}

.siege-panel-title small {
  color: rgba(247, 251, 255, 0.46);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.siege-table-wrap {
  overflow-x: auto;
}

.siege-guild-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.siege-guild-table th {
  padding: 16px 14px;
  border-bottom: 2px solid rgba(27, 231, 255, 0.72);
  background: linear-gradient(90deg, rgba(8, 15, 34, 0.95), rgba(30, 16, 52, 0.9), rgba(8, 15, 34, 0.95));
  color: var(--cb-cyan);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-align: left;
  text-transform: uppercase;
}

.siege-guild-table th:first-child,
.siege-rank {
  text-align: center;
}

.siege-guild-table th:last-child,
.siege-marks {
  text-align: right;
}

.siege-guild-table td {
  padding: 15px 14px;
  border-bottom: 1px dashed rgba(151, 220, 255, 0.1);
  color: rgba(247, 251, 255, 0.78);
  font-weight: 800;
}

.siege-guild-table tr:hover td {
  background: rgba(27, 231, 255, 0.055);
  color: #fff;
}

.siege-rank,
.siege-marks {
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-weight: 900;
  text-shadow: 0 0 14px rgba(255, 200, 87, 0.24);
}

.siege-guild-name {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
}

.siege-guild-name img {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 200, 87, 0.32);
  border-radius: 5px;
  background: #05040b;
  image-rendering: pixelated;
}

.siege-empty {
  padding: 34px !important;
  color: rgba(247, 251, 255, 0.46) !important;
  font-style: italic;
  text-align: center !important;
}

body[data-system-page="castle"] .system-main {
  width: min(1320px, calc(100% - 48px));
  padding-top: 38px;
}

body[data-system-page="castle"] [data-mu-castle] {
  display: grid;
  gap: 28px;
}

body[data-system-page="castle"] .siege-loren {
  width: 100%;
}

@media (max-width: 980px) {
  .siege-loren {
    grid-template-columns: 1fr;
    text-align: center;
    transform: none !important;
  }

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

  .siege-loren__stats span:nth-child(2) {
    border-right: 0;
  }

  .siege-roadmap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0;
  }

  .siege-roadmap::before {
    display: none;
  }

  .siege-step {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .siege-loren,
  .siege-next-panel,
  .siege-guilds-panel {
    border-radius: 14px;
    padding: 20px;
  }

  .siege-loren__mark {
    width: 160px;
  }

  .siege-loren__stats {
    grid-template-columns: 1fr;
  }

  .siege-loren__stats span {
    border-right: 0;
    border-bottom: 1px solid rgba(151, 220, 255, 0.12);
  }

  .siege-loren__stats span:last-child {
    border-bottom: 0;
  }

  .siege-timer-frame {
    margin-bottom: 34px;
  }

  .siege-timer-frame strong {
    letter-spacing: 0.05em;
  }

  .siege-roadmap {
    grid-template-columns: 1fr;
  }

  .siege-panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-system-page="castle"] .system-main {
    width: min(100% - 28px, 1320px);
  }
}

.edict {
  min-height: 250px;
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(27, 231, 255, 0.18), rgba(255, 55, 231, 0.12)),
    rgba(7, 8, 22, 0.76);
}

.edict h2 {
  color: #fff;
}

.siege {
  align-items: center;
  background:
    linear-gradient(120deg, rgba(255, 200, 87, 0.12), rgba(255, 55, 231, 0.1)),
    rgba(7, 8, 22, 0.78);
}

.siege__timer span {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.gallery {
  padding: 16px;
}

.gallery__item {
  border-radius: 16px;
}

.lightbox {
  border-radius: 28px 10px 28px 10px;
}

.lightbox img {
  border-color: rgba(37, 232, 255, 0.3);
  border-radius: 26px 10px 26px 10px;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.62),
    0 0 42px rgba(37, 232, 255, 0.15);
}

.lightbox__nav {
  border-color: rgba(37, 232, 255, 0.32);
  background:
    linear-gradient(135deg, rgba(37, 232, 255, 0.18), rgba(255, 66, 221, 0.16)),
    rgba(5, 8, 20, 0.92);
  color: #ffffff;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.42);
}

.lightbox__nav:hover {
  border-color: rgba(255, 214, 107, 0.72);
  color: #ffe894;
}

.download {
  background:
    linear-gradient(110deg, rgba(27, 231, 255, 0.18), rgba(255, 55, 231, 0.14), rgba(255, 200, 87, 0.1)),
    rgba(7, 8, 22, 0.82);
}

.footer {
  margin-top: 76px;
  border-top: 1px solid rgba(151, 220, 255, 0.16);
}

.footer img {
  width: 104px;
  height: 64px;
  object-fit: contain;
}

.mobile-drawer {
  z-index: 97;
  background:
    linear-gradient(155deg, rgba(27, 231, 255, 0.12), rgba(255, 55, 231, 0.12)),
    rgba(5, 4, 11, 0.96);
  filter: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.drawer-backdrop {
  z-index: 96;
  background:
    linear-gradient(135deg, rgba(27, 231, 255, 0.08), rgba(255, 55, 231, 0.06)),
    rgba(3, 4, 11, 0.72);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.mobile-drawer__head img {
  width: 88px;
  object-fit: contain;
}

.system-main {
  padding-top: 62px;
}

.system-hero {
  min-height: 310px;
  align-items: end;
}

.system-hero h1 {
  background: linear-gradient(95deg, #fff, #9af8ff 42%, #ff63ef);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.system-hero p {
  color: rgba(247, 251, 255, 0.76);
}

input,
select,
textarea {
  color: #f7fbff;
  border-color: rgba(151, 220, 255, 0.2);
  background: rgba(5, 6, 17, 0.72);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(27, 231, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(27, 231, 255, 0.12), 0 0 24px rgba(255, 55, 231, 0.13);
}

.admin-shell {
  background: transparent;
}

.admin-panel {
  color: #f7fbff;
}

.admin-tab.is-active,
.system-tab.is-active {
  color: #07111c;
  background: linear-gradient(135deg, #8df7ff, #ff65ef);
}

@media (max-width: 1220px) {
  body {
    padding-top: 90px;
  }

  body.home-page {
    padding-top: 0;
  }

  .topbar {
    width: min(100% - 24px, 1240px);
    top: 10px;
  }

  .topbar--home .topbar__main {
    padding-inline: 0;
  }

  .brand {
    min-width: 0;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 120px;
  }

  .hero h1 {
    font-size: 70px;
  }

  .hero h1 small {
    font-size: 34px;
  }

  .hero__right {
    min-height: auto;
    order: -1;
  }

  .crest-stage {
    width: min(720px, 92vw);
  }

  .section__head {
    grid-template-columns: 1fr;
  }

  .section__head p {
    grid-column: 1;
    grid-row: auto;
  }

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

@media (max-width: 760px) {
  body {
    padding-top: 82px;
  }

  body.home-page {
    padding-top: 0;
  }

  .topbar {
    min-height: 62px;
    border-radius: 14px;
    padding: 8px 10px;
  }

  .topbar--home {
    min-height: 62px;
  }

  .brand__mark {
    width: 58px;
    height: 42px;
  }

  .brand__name {
    font-size: 15px;
  }

  .brand__season {
    font-size: 10px;
  }

  .hero {
    min-height: auto;
    padding: 104px 16px 48px;
    gap: 10px;
  }

  .hero__left,
  .hero__right {
    width: 100%;
    max-width: 100%;
    justify-self: stretch;
  }

  .hero__right {
    gap: 8px;
  }

  .crest-stage {
    width: min(520px, calc(100vw - 32px));
  }

  .hero h1 {
    font-size: 52px;
    line-height: 0.9;
  }

  .hero h1 small {
    font-size: 24px;
  }

  .hero__lead {
    font-size: 18px;
  }

  .hero__stats,
  .hero-status,
  .event-grid,
  .ranking-layout,
  .class-grid,
  .benefit-grid {
    grid-template-columns: 1fr;
  }

  .hero-status .server-strip__item {
    min-height: 54px;
  }

  .hero-status {
    width: min(100%, calc(100vw - 32px));
    max-width: 100%;
    margin-inline: auto;
    padding: 0 !important;
    overflow: visible;
  }

  .section,
  .edict-slider,
  .footer {
    width: min(100% - 24px, 1240px);
  }

  .section {
    padding-top: 58px;
  }

  .section__head h2 {
    font-size: 38px;
  }

  .event-card {
    min-height: 230px;
  }

  .system-main {
    padding: 92px 12px 48px;
  }
}

/* Comeback QA pass: keep systems usable above the fold. */
@media (min-width: 1181px) {
  .topbar {
    top: 20px;
    height: calc(100svh - 40px);
    min-height: 0;
  }

  .brand {
    padding-bottom: 12px;
  }

  .brand__mark {
    width: 68px;
    height: 48px;
  }

  .topbar__nav {
    gap: 4px;
    padding-block: 10px;
  }

  .nav-link {
    min-height: 36px;
    font-size: 12px;
  }

  .topbar:not(.topbar--home) {
    overflow: visible;
  }

  .topbar:not(.topbar--home) > .topbar__nav {
    align-content: center;
    padding-block: 14px;
  }

  .topbar:not(.topbar--home) > .topbar__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .topbar:not(.topbar--home) > .topbar__actions > .icon-button,
  .topbar:not(.topbar--home) > .topbar__actions > a.icon-button {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
  }

  .topbar:not(.topbar--home) > .topbar__actions .session-chip,
  .topbar:not(.topbar--home) > .topbar__actions .button {
    width: 100%;
    max-width: 100%;
  }

  .topbar:not(.topbar--home) > .topbar__actions .button {
    justify-content: center;
  }
}

body[data-system-page] .system-main {
  min-height: 100svh;
  padding-top: 36px;
  overflow: visible;
}

body[data-system-page] .system-hero {
  min-height: 220px;
  gap: 22px;
  margin-bottom: 18px;
  padding: 10px 0 0;
  align-items: end;
}

body[data-system-page] .system-hero h1 {
  max-width: 100%;
  margin: 8px 0 10px;
  font-size: clamp(48px, 6vw, 92px);
  line-height: 0.84;
}

body[data-system-page] .system-hero p {
  max-width: 720px;
  font-size: clamp(18px, 1.7vw, 23px);
}

.system-hero__actions--admin {
  margin-top: 16px;
}

body[data-system-page] .system-panel {
  position: relative;
  z-index: 2;
}

.mu-state {
  min-height: 160px;
  display: grid;
  align-content: center;
  gap: 10px;
  border-radius: 24px 8px 24px 8px;
  border-color: rgba(37, 232, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(37, 232, 255, 0.12), rgba(255, 66, 221, 0.08)),
    rgba(4, 7, 20, 0.7);
}

.mu-state .system-actions {
  margin-top: 8px;
}

.event-card {
  min-height: 280px;
}

.event-card img,
.event-card img[data-event-managed] {
  inset: auto 18px auto auto;
  top: 50%;
  right: 18px;
  left: auto;
  bottom: auto;
  width: auto;
  height: auto;
  max-width: min(46%, 300px);
  max-height: calc(100% - 36px);
  padding: 0;
  margin: 0;
  object-fit: contain;
  object-position: center;
  transform: translateY(-50%);
  opacity: 0.92;
}

.event-card:hover img,
.event-card.is-expanded img {
  transform: translateY(-50%) scale(1.04);
}

.event-card__content {
  max-width: 64%;
}

.event-card:nth-child(1) .event-card__content,
.event-card:nth-child(8) .event-card__content {
  max-width: 58%;
}

.event-card:nth-child(1) img,
.event-card:nth-child(8) img {
  max-width: min(42%, 340px);
}

.market-card,
.shop-card {
  min-height: 260px;
}

.shop-grid,
.market-grid,
.warehouse-grid {
  align-items: stretch;
}

@media (max-width: 1180px) {
  body[data-system-page] .system-main {
    padding-top: 96px;
  }

  body[data-system-page] .system-hero {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  body[data-system-page] .system-main {
    padding-top: 88px;
  }

  body[data-system-page] .system-hero h1 {
    font-size: clamp(42px, 13vw, 58px);
  }

  .event-card {
    min-height: 270px;
  }

  .event-card img,
  .event-card img[data-event-managed] {
    right: 10px;
    max-width: 58%;
    max-height: calc(100% - 42px);
    opacity: 0.72;
  }

  .event-card__content,
  .event-card:nth-child(1) .event-card__content,
  .event-card:nth-child(8) .event-card__content {
    max-width: 84%;
  }
}

/* Comeback visual rebuild v2: arena HUD, visible world art, brand-neutral motor. */
:root {
  --cb-night: #03040b;
  --cb-glass: rgba(5, 8, 20, 0.58);
  --cb-glass-strong: rgba(5, 8, 20, 0.78);
  --cb-cyan: #25e8ff;
  --cb-pink: #ff42dd;
  --cb-gold: #ffd66b;
  --cb-lime: #7dffbd;
  --cb-text: #f7fbff;
  --cb-muted: rgba(230, 239, 255, 0.72);
  --cb-line: rgba(173, 230, 255, 0.22);
  --cb-hard-line: rgba(255, 255, 255, 0.34);
  --cb-panel-shadow: 0 34px 120px rgba(0, 0, 0, 0.48);
}

html {
  scroll-padding-top: 32px;
}

body {
  min-width: 320px;
  color: var(--cb-text);
  background: #03040b;
  font-family: "Rajdhani", "Exo 2", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 214, 107, 0.2), transparent 22%),
    radial-gradient(circle at 20% 28%, rgba(37, 232, 255, 0.18), transparent 26%),
    linear-gradient(180deg, transparent 0 68%, rgba(3, 4, 11, 0.84) 100%);
}

.page-bg__image {
  background-image:
    linear-gradient(90deg, rgba(3, 4, 11, 0.18) 0%, rgba(3, 4, 11, 0.02) 38%, rgba(3, 4, 11, 0.1) 74%, rgba(3, 4, 11, 0.34) 100%),
    linear-gradient(180deg, rgba(3, 4, 11, 0.06) 0%, rgba(3, 4, 11, 0.18) 56%, rgba(3, 4, 11, 0.72) 100%),
    url("assets/img/bg-comeback.webp");
  background-position: center top;
  background-size: cover;
  opacity: 1;
  filter: saturate(1.16) contrast(1.03) brightness(0.98);
}

.page-bg__stained {
  opacity: 0.45;
  background:
    linear-gradient(115deg, transparent 0 15%, rgba(37, 232, 255, 0.22) 15% 15.22%, transparent 15.22% 52%, rgba(255, 66, 221, 0.2) 52% 52.24%, transparent 52.24%),
    linear-gradient(64deg, transparent 0 63%, rgba(255, 214, 107, 0.18) 63% 63.22%, transparent 63.22%);
}

.page-bg__grain {
  opacity: 0.08;
}

.page-bg__vignette {
  background:
    radial-gradient(ellipse at 50% 28%, transparent 0 46%, rgba(3, 4, 11, 0.36) 88%),
    linear-gradient(180deg, rgba(3, 4, 11, 0.02), rgba(3, 4, 11, 0.72) 88%, #03040b);
}

.seal-field,
.cursor-forge {
  display: none;
}

.topbar {
  top: 28px;
  left: 28px;
  right: auto;
  width: 236px;
  height: calc(100svh - 56px);
  min-height: 620px;
  padding: 18px;
  transform: none;
  border-radius: 28px;
  border: 1px solid rgba(173, 230, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(37, 232, 255, 0.12), rgba(255, 66, 221, 0.09) 44%, rgba(255, 214, 107, 0.08)),
    rgba(2, 5, 16, 0.62);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.44),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(24px);
}

.topbar::before {
  inset: 18px auto 18px -1px;
  width: 2px;
  height: auto;
  background: linear-gradient(180deg, var(--cb-cyan), var(--cb-pink), var(--cb-gold));
}

.topbar--home,
.topbar__main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.topbar__main {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
}

.brand {
  min-width: 0;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(173, 230, 255, 0.18);
}

.brand__mark {
  width: 74px;
  height: 54px;
  object-fit: contain;
}

.brand__name {
  font-family: "Orbitron", sans-serif;
  font-size: 16px;
  line-height: 1;
}

.brand__season {
  margin-top: 5px;
  color: var(--cb-cyan);
  font-size: 11px;
}

.topbar__nav {
  flex: 1;
  display: grid;
  align-content: center;
  gap: 8px;
  padding-block: 22px;
}

.nav-link {
  min-height: 44px;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: rgba(247, 251, 255, 0.76);
  font-family: "Exo 2", sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  transition:
    transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.22s ease,
    background 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease;
}

.nav-link::before {
  content: "";
  width: 9px;
  height: 9px;
  min-width: 9px;
  border-radius: 999px;
  background: rgba(37, 232, 255, 0.62);
  box-shadow: 0 0 14px rgba(37, 232, 255, 0.34);
  transform: scale(0.72);
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
  border-color: rgba(37, 232, 255, 0.38);
  background: linear-gradient(90deg, rgba(37, 232, 255, 0.16), rgba(255, 66, 221, 0.1));
  box-shadow: 0 14px 38px rgba(37, 232, 255, 0.12);
  transform: translateX(12px);
}

.nav-link:hover::before,
.nav-link.is-active::before {
  background: var(--cb-gold);
  box-shadow: 0 0 18px rgba(255, 214, 107, 0.5);
  transform: scale(1);
}

.nav-link--siege {
  color: var(--cb-gold);
  border-color: rgba(255, 214, 107, 0.28);
  background: rgba(255, 214, 107, 0.06);
}

.topbar__actions {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(173, 230, 255, 0.18);
}

.topbar__actions .session-chip {
  grid-column: 1 / -1;
}

.topbar__actions .button {
  min-width: 0;
  width: 100%;
}

.hamburger {
  grid-column: 1 / -1;
  width: 100%;
}

main,
.footer {
  position: relative;
  z-index: 1;
}

.hero,
.section,
.edict-slider,
.footer {
  width: auto;
  max-width: none;
  margin-left: 300px;
  margin-right: clamp(20px, 3vw, 52px);
}

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(360px, 0.76fr) minmax(430px, 1.24fr);
  grid-template-areas: "copy crest";
  align-items: center;
  gap: clamp(28px, 5vw, 86px);
  padding: 64px 0 74px;
}

.hero::before {
  opacity: 0.68;
  background:
    linear-gradient(90deg, rgba(3, 4, 11, 0.6), transparent 32%, rgba(3, 4, 11, 0.38) 100%),
    linear-gradient(180deg, transparent 0 75%, rgba(3, 4, 11, 0.78) 100%);
}

.hero__left {
  grid-area: copy;
  max-width: 620px;
  align-self: end;
  padding-bottom: 44px;
}

.hero__right {
  grid-area: crest;
  min-height: 0;
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: 18px;
}

.hero .eyebrow,
.section__head .eyebrow,
.system-hero .eyebrow {
  color: var(--cb-gold);
  text-shadow: 0 0 18px rgba(255, 214, 107, 0.28);
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(66px, 7vw, 122px);
  line-height: 0.78;
  letter-spacing: 0.015em;
}

.hero h1 span {
  background: linear-gradient(100deg, #f7fbff 0%, #76f4ff 26%, #ff53df 62%, #ffd66b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(37, 232, 255, 0.34));
}

.hero h1 small {
  margin-top: 18px;
  color: #fff;
  font-size: clamp(27px, 3.6vw, 54px);
  letter-spacing: 0.22em;
}

.hero__lead {
  max-width: 560px;
  color: rgba(247, 251, 255, 0.88);
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.18;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 150px));
  gap: 10px;
  margin-top: 26px;
}

.hero__stats span {
  min-width: 0;
  min-height: 76px;
  border: 1px solid rgba(173, 230, 255, 0.24);
  border-radius: 22px 8px 22px 8px;
  background:
    linear-gradient(135deg, rgba(37, 232, 255, 0.12), rgba(255, 66, 221, 0.12)),
    rgba(4, 8, 22, 0.56);
  backdrop-filter: blur(14px);
}

.hero__stats b {
  color: var(--cb-cyan);
}

.hero__actions {
  margin-top: 28px;
}

.button,
.icon-button,
.tab,
input,
select,
textarea {
  border-radius: 14px;
}

.button--primary {
  color: #031018;
  background: linear-gradient(100deg, #59f2ff, #25e8ff 38%, #ff61e7 100%);
  box-shadow: 0 18px 56px rgba(37, 232, 255, 0.28);
}

.button--gold {
  color: #120b03;
  background: linear-gradient(100deg, #fff5b7, #ffd66b 44%, #ff8fea 100%);
}

.crest-stage {
  width: min(760px, 100%);
  justify-self: stretch;
  aspect-ratio: 1.7;
  filter: drop-shadow(0 24px 80px rgba(37, 232, 255, 0.22));
}

.crest-stage::before {
  inset: 5% -2%;
  border: 0;
  border-radius: 999px;
  transform: none;
  background:
    radial-gradient(ellipse at center, rgba(37, 232, 255, 0.24), transparent 58%),
    radial-gradient(ellipse at 68% 42%, rgba(255, 66, 221, 0.2), transparent 48%);
  filter: blur(4px);
}

.crest-stage__ring {
  display: none;
}

.crest-stage__logo {
  width: min(760px, 100%);
  transform: translateX(-2%);
}

.crest-stage__beam {
  display: none;
}

.hero-status {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hero-status .server-strip__item {
  min-height: 78px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px 10px;
  padding: 12px 14px;
  border: 1px solid rgba(173, 230, 255, 0.24);
  border-radius: 8px 24px 8px 24px;
  background:
    linear-gradient(145deg, rgba(37, 232, 255, 0.14), rgba(255, 66, 221, 0.1)),
    rgba(3, 6, 18, 0.62);
}

.hero-status .server-strip__item svg {
  grid-row: 1 / span 2;
  color: var(--cb-cyan);
}

.hero-status .server-strip__item span {
  color: rgba(247, 251, 255, 0.62);
  font-size: 11px;
}

.hero-status .server-strip__item strong {
  margin: 0;
  font-size: 17px;
}

.section,
.edict-slider {
  padding-top: 78px;
}

.section__head {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(260px, 0.58fr);
  gap: 18px;
  align-items: end;
  margin-bottom: 24px;
}

.section__head h2 {
  max-width: 520px;
  font-size: clamp(48px, 6vw, 86px);
  line-height: 0.8;
  background: linear-gradient(100deg, #fff 0%, #7df3ff 38%, #ff51df 76%, #ffd66b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section__head p {
  grid-column: 2;
  grid-row: 1 / span 2;
  max-width: 460px;
  color: rgba(247, 251, 255, 0.76);
  font-size: 20px;
}

.ranking-panel,
.podium,
.benefit-panel,
.event-card,
.siege,
.gallery,
.download,
.system-panel,
.system-card,
.wallet-panel,
.profile-banner,
.market-card,
.shop-card,
.pack-card,
.admin-panel,
.modal__panel {
  border: 1px solid rgba(173, 230, 255, 0.22);
  border-radius: 28px 10px 28px 10px;
  background:
    linear-gradient(145deg, rgba(37, 232, 255, 0.09), rgba(255, 66, 221, 0.09)),
    rgba(4, 7, 20, 0.58);
  box-shadow: var(--cb-panel-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.event-section {
  order: 5;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.event-card {
  grid-column: span 2;
  min-height: 280px;
  overflow: hidden;
  border-radius: 28px;
  isolation: isolate;
}

.event-card:nth-child(1),
.event-card:nth-child(8) {
  grid-column: span 3;
}

.event-card img {
  width: 58%;
  height: 100%;
  left: auto;
  right: 0;
  object-fit: contain;
  object-position: right center;
  opacity: 0.94;
  filter: saturate(1.18) contrast(1.06) drop-shadow(0 0 26px rgba(37, 232, 255, 0.24));
}

.event-card::before {
  background:
    linear-gradient(90deg, rgba(3, 4, 11, 0.94) 0%, rgba(3, 4, 11, 0.72) 48%, rgba(3, 4, 11, 0.18) 100%),
    linear-gradient(145deg, rgba(37, 232, 255, 0.18), rgba(255, 66, 221, 0.1));
}

.event-card__content {
  max-width: 72%;
}

.event-card__state {
  color: #051018;
  background: linear-gradient(100deg, #7dffbd, #25e8ff);
}

.event-card h3 {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(22px, 2vw, 32px);
}

.ranking-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.32fr) minmax(0, 0.68fr);
  gap: 18px;
}

.podium {
  min-height: 470px;
  display: grid;
  align-content: end;
}

.podium img {
  width: min(270px, 80%);
  justify-self: center;
  filter: drop-shadow(0 28px 44px rgba(37, 232, 255, 0.2));
}

.ranking-panel {
  padding: 18px;
}

.ranking-table th {
  color: var(--cb-cyan);
}

.ranking-table td {
  color: rgba(247, 251, 255, 0.86);
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 12px;
}

.class-card {
  min-height: 310px;
  border-radius: 12px 32px 12px 32px;
  background:
    linear-gradient(180deg, rgba(37, 232, 255, 0.08), rgba(255, 66, 221, 0.12)),
    rgba(3, 7, 22, 0.6);
}

.class-card:nth-child(even) {
  transform: translateY(28px);
}

.class-card:hover {
  transform: translateY(-8px) scale(1.02);
}

.class-card:nth-child(even):hover {
  transform: translateY(18px) scale(1.02);
}

.benefit-panel {
  padding: 18px;
}

.benefit-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.edict-slider {
  order: 8;
  padding-top: 72px;
}

.edict {
  min-height: 300px;
  display: grid;
  align-content: center;
  border-radius: 36px 12px 36px 12px;
  background:
    linear-gradient(100deg, rgba(37, 232, 255, 0.16), rgba(255, 66, 221, 0.2), rgba(255, 214, 107, 0.1)),
    rgba(4, 7, 20, 0.64);
}

.siege {
  min-height: 300px;
  border-radius: 12px 36px 12px 36px;
}

.gallery {
  padding: 18px;
}

.gallery__item {
  min-height: 260px;
  border-radius: 20px;
}

@media (max-width: 760px) {
  .lightbox__nav--prev {
    left: clamp(12px, 3vw, 22px);
  }

  .lightbox__nav--next {
    right: clamp(12px, 3vw, 22px);
  }
}

.download {
  min-height: 290px;
  border-radius: 36px;
  background:
    linear-gradient(100deg, rgba(37, 232, 255, 0.2), rgba(255, 66, 221, 0.2) 54%, rgba(255, 214, 107, 0.18)),
    rgba(4, 7, 20, 0.72);
}

.footer {
  margin-top: 92px;
  padding-bottom: 42px;
}

.system-main {
  padding: 72px clamp(20px, 3vw, 52px) 64px 300px;
}

.system-hero {
  min-height: 460px;
  display: grid;
  grid-template-columns: minmax(0, 0.64fr) minmax(260px, 0.36fr);
  align-items: center;
}

.system-hero h1 {
  font-size: clamp(76px, 9vw, 150px);
  line-height: 0.82;
}

.admin-shell {
  min-height: 100svh;
  background: transparent;
}

.admin-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(3, 4, 11, 0.28), rgba(3, 4, 11, 0.68)),
    url("assets/img/bg-comeback.webp") center top / cover no-repeat;
  filter: saturate(1.12);
}

@media (max-width: 1180px) {
  .topbar {
    top: 12px;
    left: 12px;
    width: calc(100% - 24px);
    height: auto;
    min-height: 66px;
    border-radius: 20px;
    padding: 10px 12px;
  }

  .topbar--home,
  .topbar__main {
    flex-direction: row;
    align-items: center;
  }

  .brand {
    width: auto;
    min-width: 230px;
    padding: 0;
    border: 0;
  }

  .topbar__nav {
    display: none;
  }

  .topbar__actions {
    margin-left: auto;
    grid-template-columns: 44px auto 48px;
    padding: 0;
    border: 0;
  }

  .topbar__actions .button {
    width: auto;
  }

  .hamburger {
    grid-column: auto;
    width: 48px;
  }

  .hero,
  .section,
  .edict-slider,
  .footer {
    margin-left: clamp(16px, 4vw, 36px);
    margin-right: clamp(16px, 4vw, 36px);
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas: "crest" "copy";
    padding-top: 108px;
  }

  .hero__left {
    align-self: start;
    padding-bottom: 0;
  }

  .system-main {
    padding: 104px clamp(16px, 4vw, 36px) 56px;
  }

  .system-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-bg__image {
    background-position: 45% top;
  }

  .topbar {
    min-height: 60px;
  }

  .brand {
    min-width: 0;
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .brand__mark {
    width: 54px;
    height: 42px;
  }

  .brand__copy {
    display: none;
  }

  .topbar__actions {
    grid-template-columns: 42px 42px;
  }

  .topbar__actions .button {
    display: none;
  }

  .hero {
    min-height: auto;
    gap: 18px;
    padding-top: 94px;
    padding-bottom: 44px;
  }

  .crest-stage {
    width: 100%;
    aspect-ratio: 1.42;
  }

  .crest-stage__logo {
    width: 112%;
    max-width: none;
    transform: translateX(-6%);
  }

  .hero h1 {
    font-size: 52px;
    line-height: 0.86;
  }

  .hero h1 small {
    font-size: 23px;
    letter-spacing: 0.16em;
  }

  .hero__lead {
    font-size: 19px;
  }

  .hero__stats,
  .hero-status,
  .event-grid,
  .ranking-layout,
  .class-grid,
  .benefit-grid {
    grid-template-columns: 1fr;
  }

  .hero-status {
    width: 100%;
  }

  .hero-status .server-strip__item {
    min-height: 58px;
    border-radius: 18px;
  }

  .section,
  .edict-slider {
    padding-top: 58px;
  }

  .section__head {
    grid-template-columns: 1fr;
  }

  .section__head h2 {
    font-size: 42px;
  }

  .section__head p {
    grid-column: 1;
    grid-row: auto;
    font-size: 17px;
  }

  .event-card,
  .event-card:nth-child(1),
  .event-card:nth-child(8) {
    grid-column: span 1;
    min-height: 250px;
  }

  .event-card img {
    width: 66%;
    opacity: 0.82;
  }

  .event-card__content {
    max-width: 82%;
  }

  .class-card,
  .class-card:nth-child(even) {
    min-height: 230px;
    transform: none;
  }

  .class-card:hover,
  .class-card:nth-child(even):hover {
    transform: translateY(-4px);
  }

  .system-hero h1 {
    font-size: 58px;
  }
}

/* Comeback v2 polish: internal rails, readable titles, mobile card cleanup. */
@media (min-width: 1181px) {
  .topbar:not(.topbar--home) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  .topbar:not(.topbar--home) > .brand {
    width: 100%;
    flex: 0 0 auto;
  }

  .topbar:not(.topbar--home) > .topbar__nav {
    flex: 1 1 auto;
  }

  .topbar:not(.topbar--home) > .topbar__actions {
    flex: 0 0 auto;
  }
}

.hero {
  grid-template-columns: minmax(440px, 0.92fr) minmax(420px, 1.08fr);
}

.hero h1 {
  font-size: clamp(58px, 4.85vw, 82px);
  line-height: 0.84;
}

.section__head {
  grid-template-columns: minmax(0, 0.68fr) minmax(260px, 0.32fr);
  width: 100%;
  max-width: none;
}

.section__head h2,
.system-hero h1 {
  max-width: none;
  overflow: visible;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.section__head h2 {
  font-size: clamp(40px, 4.55vw, 68px);
  line-height: 0.88;
}

.class-card__reveal {
  max-height: 0;
  opacity: 0;
}

.class-card:hover .class-card__reveal {
  max-height: 190px;
  opacity: 1;
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: clamp(56px, 11vw, 84px);
  }
}

@media (max-width: 760px) {
  .hero h1 {
    font-size: 52px;
  }

  .section__head {
    display: block !important;
    width: 100% !important;
  }

  .section__head h2 {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    font-size: 36px;
    line-height: 0.94;
  }

  .section__head p {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 10px;
  }

  .class-card {
    min-height: 178px;
    padding: 14px;
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: end;
    align-content: end;
    gap: 10px;
  }

  .class-card img {
    position: relative;
    top: auto;
    left: auto;
    width: 112px;
    height: 150px;
    align-self: end;
    transform: none;
  }

  .class-card:hover img {
    transform: none;
  }

  .class-card__content {
    align-self: end;
  }

  .class-card h3 {
    font-size: 20px;
  }

  .class-card__role {
    font-size: 11px;
  }

  .class-card__reveal,
  .class-card:hover .class-card__reveal {
    display: none;
  }
}

/* Final layout guard: this block intentionally stays last. */
@media (min-width: 1181px) {
  .topbar {
    top: 20px;
    height: calc(100svh - 40px);
    min-height: 0;
  }

  .topbar--home .topbar__nav,
  .topbar__nav {
    gap: 4px;
    padding-block: 10px;
  }

  .topbar--home .nav-link,
  .nav-link {
    min-height: 36px;
    font-size: 12px;
  }

  .topbar--home .brand,
  .brand {
    padding-bottom: 12px;
  }

  .topbar--home .brand__mark,
  .brand__mark {
    width: 68px;
    height: 48px;
  }

  .topbar--home .topbar__actions,
  .topbar:not(.topbar--home) > .topbar__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 10px;
  }

  .topbar--home .topbar__actions > .icon-button,
  .topbar--home .topbar__actions > a.icon-button,
  .topbar:not(.topbar--home) > .topbar__actions > .icon-button,
  .topbar:not(.topbar--home) > .topbar__actions > a.icon-button {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
  }

  .topbar--home .topbar__actions .session-chip,
  .topbar--home .topbar__actions .button,
  .topbar:not(.topbar--home) > .topbar__actions .session-chip,
  .topbar:not(.topbar--home) > .topbar__actions .button {
    width: 100%;
    max-width: 100%;
  }

  .topbar--home .topbar__actions .button,
  .topbar:not(.topbar--home) > .topbar__actions .button {
    justify-content: center;
  }

  body[data-system-page] .system-hero h1 {
    font-size: clamp(48px, 6vw, 92px);
  }
}

/* Comeback v8 rebuild: readable systems, competitive ranking, complete event cards. */
.ranking-panel .tabs {
  flex-wrap: wrap;
}

.ranking-table th,
.ranking-table td {
  white-space: nowrap;
}

.ranking-table td:nth-child(2) {
  min-width: 210px;
}

.ranking-empty {
  display: grid;
  gap: 6px;
  padding: 28px 14px;
  color: rgba(247, 251, 255, 0.72);
  text-align: center;
}

.ranking-empty strong {
  color: #fff;
  font-family: "Orbitron", sans-serif;
  font-size: 18px;
  text-transform: uppercase;
}

.ranking-empty span {
  color: rgba(247, 251, 255, 0.62);
  font-weight: 700;
}

.rank-player {
  min-width: 0;
}

.rank-player img {
  flex: 0 0 auto;
}

#clases {
  padding-bottom: clamp(44px, 6vw, 96px);
}

.class-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: stretch;
  gap: 18px;
}

.class-card,
.class-card:nth-child(even) {
  min-height: 355px;
  transform: none;
}

.class-card:hover,
.class-card:nth-child(even):hover {
  transform: translateY(-8px);
}

.class-card img {
  max-height: 250px;
  object-fit: contain;
}

.benefit-panel {
  padding: clamp(18px, 3vw, 34px);
}

.benefit-grid {
  display: block;
}

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

.benefit-table-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(173, 230, 255, 0.24);
  border-radius: 26px 10px 26px 10px;
  background:
    linear-gradient(135deg, rgba(37, 232, 255, 0.12), rgba(255, 214, 107, 0.08) 48%, rgba(255, 66, 221, 0.1)),
    rgba(3, 7, 20, 0.7);
}

.benefit-table-card header {
  padding: 20px 22px 12px;
}

.benefit-table-card header span {
  display: block;
  color: var(--cb-gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.benefit-table-card h3 {
  margin: 5px 0 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1;
}

.benefit-table-wrap {
  overflow-x: auto;
}

.benefit-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.benefit-table th,
.benefit-table td {
  padding: 14px 18px;
  border-top: 1px solid rgba(173, 230, 255, 0.14);
  text-align: left;
}

.benefit-table th {
  color: var(--cb-cyan);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.benefit-table td {
  color: rgba(247, 251, 255, 0.86);
  font-weight: 800;
}

.benefit-table td:nth-child(3) {
  color: #fff0a6;
}

.event-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.event-card,
.event-card:nth-child(1),
.event-card:nth-child(8),
.event-card.event-card--schedule {
  grid-column: auto;
  min-height: 0;
  display: grid;
  grid-template-rows: 230px minmax(0, auto);
  overflow: hidden;
  padding: 0;
  border-radius: 28px 10px 28px 10px;
}

.event-card::before {
  background:
    linear-gradient(180deg, rgba(3, 4, 11, 0.08), rgba(3, 4, 11, 0.82) 64%, rgba(3, 4, 11, 0.96)),
    linear-gradient(135deg, rgba(37, 232, 255, 0.15), rgba(255, 66, 221, 0.13), rgba(255, 214, 107, 0.08));
}

.event-card__media {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  height: 230px;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 44%, rgba(37, 232, 255, 0.16), transparent 58%),
    rgba(2, 5, 16, 0.38);
}

.event-card .event-card__media img,
.event-card .event-card__media img[data-event-managed],
.event-card:nth-child(1) .event-card__media img,
.event-card:nth-child(8) .event-card__media img {
  position: relative !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 194px !important;
  margin: auto;
  object-fit: contain !important;
  object-position: center !important;
  opacity: 1;
  transform: none !important;
  filter: saturate(1.18) contrast(1.06) drop-shadow(0 0 24px rgba(37, 232, 255, 0.2));
}

.event-card:hover .event-card__media img,
.event-card.is-expanded .event-card__media img {
  transform: scale(1.03) !important;
}

.event-card__content,
.event-card:nth-child(1) .event-card__content,
.event-card:nth-child(8) .event-card__content {
  position: relative;
  z-index: 2;
  max-width: none;
  padding: 18px 18px 22px;
}

.event-card__meta {
  flex-wrap: wrap;
}

.event-card__info {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.event-card__info div {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(173, 230, 255, 0.14);
  border-radius: 14px;
  background: rgba(247, 251, 255, 0.045);
}

.event-card__info dt {
  color: var(--cb-cyan);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.event-card__info dd {
  margin: 0;
  color: rgba(247, 251, 255, 0.84);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.event-card__charge {
  left: 18px;
  right: 18px;
  bottom: 12px;
  width: auto;
}

body[data-system-page] .system-main {
  overflow-x: clip;
}

body[data-system-page="webshop"] .system-hero,
body[data-system-page="market"] .system-hero {
  max-width: 1240px;
  min-height: 0;
  margin: 0 auto 28px;
  padding-top: clamp(22px, 5vh, 52px);
  grid-template-columns: minmax(520px, 1fr) minmax(280px, 340px);
  align-items: start;
}

body[data-system-page="profile"] .system-hero,
body[data-system-page="castle"] .system-hero {
  max-width: 1240px;
  min-height: 0;
  margin: 0 auto 28px;
  padding-top: clamp(22px, 5vh, 52px);
  grid-template-columns: 1fr;
  align-items: start;
}

body[data-system-page="webshop"] .system-hero > div,
body[data-system-page="market"] .system-hero > div {
  min-width: 0;
}

body[data-system-page="webshop"] .system-hero h1,
body[data-system-page="market"] .system-hero h1,
body[data-system-page="profile"] .system-hero h1,
body[data-system-page="castle"] .system-hero h1 {
  font-size: clamp(46px, 5vw, 78px);
  line-height: 1.08;
  padding-bottom: 0.04em;
  width: auto;
  overflow: visible;
}

.hero h1,
.section__head h2,
.edict h2 {
  line-height: 1.02;
  padding-bottom: 0.04em;
}

body[data-system-page="webshop"] .system-hero p,
body[data-system-page="market"] .system-hero p {
  max-width: 620px;
}

body[data-system-page="webshop"] .wallet-panel,
body[data-system-page="market"] .wallet-panel {
  width: 100%;
  align-self: start;
}

body[data-system-page="webshop"] .system-panel,
body[data-system-page="market"] .system-panel,
body[data-system-page="profile"] [data-profile-root] {
  width: min(1240px, 100%);
  max-width: 1240px;
  margin-inline: auto;
}

.shop-grid,
.market-grid,
.warehouse-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 18px;
}

.shop-card,
.market-card {
  min-height: 0;
  min-width: 0;
  display: grid;
  gap: 14px;
  align-content: start;
  padding: clamp(20px, 3vw, 30px);
}

.shop-card figure,
.market-card figure {
  min-height: 130px;
  margin-bottom: 0;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 40%, rgba(37, 232, 255, 0.12), transparent 56%),
    rgba(2, 5, 16, 0.42);
}

.shop-card .option-row {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.shop-card .system-form,
.shop-card .option-row label {
  min-width: 0;
}

.shop-card .option-row label.shop-select-field {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 7px;
  min-height: 74px;
  overflow: hidden;
}

.shop-card .shop-select-field select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.shop-card [data-shop-exc] {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.shop-excellent-field small {
  display: block;
  margin-top: 3px;
  color: rgba(247, 251, 255, 0.58);
  font-size: 11px;
  line-height: 1.15;
}

.market-card__price {
  display: inline-grid;
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid rgba(255, 214, 107, 0.28);
  border-radius: 999px;
  color: #fff0a6;
  background: rgba(255, 214, 107, 0.08);
}

.profile-layout {
  max-width: 1240px;
  margin-inline: auto;
  grid-template-columns: minmax(460px, 0.95fr) minmax(500px, 1.05fr);
  align-items: start;
}

.profile-panel {
  min-width: 0;
}

.profile-banner {
  padding: 18px;
  border-radius: 26px 10px 26px 10px;
}

.profile-dashboard {
  display: grid;
  gap: 16px;
}

.profile-metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profile-metric-strip article,
.profile-stat-card,
.profile-actions-card {
  border: 1px solid rgba(173, 230, 255, 0.18);
  border-radius: 22px 8px 22px 8px;
  background:
    linear-gradient(135deg, rgba(37, 232, 255, 0.1), rgba(255, 66, 221, 0.08)),
    rgba(3, 7, 20, 0.56);
}

.profile-metric-strip article {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 16px;
}

.profile-metric-strip small,
.profile-stat-card h3,
.profile-actions-card__head span {
  color: var(--cb-cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-metric-strip strong {
  color: #fff;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1;
}

.profile-metric-strip span {
  color: rgba(247, 251, 255, 0.62);
  font-weight: 700;
}

.profile-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
}

.profile-stat-card {
  padding: 18px;
}

.profile-stat-card h3 {
  margin: 0 0 12px;
}

.profile-stat-list {
  display: grid;
  gap: 8px;
}

.profile-stat-list span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(173, 230, 255, 0.13);
}

.profile-stat-list small,
.profile-attribute-table th {
  color: rgba(247, 251, 255, 0.62);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile-stat-list b,
.profile-attribute-table td {
  color: #fff;
  font-weight: 900;
}

.profile-attribute-table {
  width: 100%;
  border-collapse: collapse;
}

.profile-attribute-table tr {
  border-top: 1px solid rgba(173, 230, 255, 0.13);
}

.profile-attribute-table th,
.profile-attribute-table td {
  padding: 10px 0;
  text-align: left;
}

.profile-attribute-table td {
  text-align: right;
  font-family: "Orbitron", sans-serif;
}

.profile-location {
  margin-top: 18px;
}

.profile-actions-card {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
}

.profile-actions-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.profile-actions-card__head strong {
  color: var(--cb-gold);
  font-weight: 900;
}

.profile-actions-card .system-form {
  display: grid;
  gap: 12px;
}

.profile-action-message {
  min-height: 22px;
  margin: 0;
  color: rgba(247, 251, 255, 0.72);
  font-weight: 800;
}

.profile-action-message.is-ok {
  color: var(--cb-lime);
}

.profile-action-message.is-error {
  color: #ff9eb5;
}

.profile-actions-card .option-row {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.profile-panel--equipment {
  min-height: 620px;
}

.equipment-showcase {
  grid-template-columns: minmax(320px, 420px) minmax(260px, 1fr);
}

.equipment-board {
  max-width: 420px;
}

.equipment-list {
  max-height: 560px;
}

.castle-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1180px) {
  body[data-system-page="webshop"] .system-hero,
  body[data-system-page="market"] .system-hero,
  .profile-layout,
  .equipment-showcase,
  .benefit-comparison-grid {
    grid-template-columns: 1fr;
  }

  .class-card,
  .class-card:nth-child(even) {
    min-height: 300px;
  }
}

@media (max-width: 760px) {
  .ranking-table th,
  .ranking-table td {
    white-space: normal;
  }

  .class-grid,
  .event-grid,
  .profile-metric-strip,
  .profile-detail-grid,
  .castle-grid {
    grid-template-columns: 1fr;
  }

  .class-card,
  .class-card:nth-child(even) {
    min-height: 210px;
  }

  .event-card,
  .event-card:nth-child(1),
  .event-card:nth-child(8),
  .event-card.event-card--schedule {
    grid-template-rows: 210px auto;
  }

  .event-card__media {
    height: 210px;
  }

  .event-card .event-card__media img,
  .event-card .event-card__media img[data-event-managed],
  .event-card:nth-child(1) .event-card__media img,
  .event-card:nth-child(8) .event-card__media img {
    max-height: 174px !important;
  }

  .benefit-table {
    min-width: 460px;
  }

  body[data-system-page="webshop"] .system-hero h1,
  body[data-system-page="market"] .system-hero h1 {
    font-size: clamp(40px, 13vw, 58px);
  }
}

.nicolas-credit {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 99989;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(151, 220, 255, 0.24);
  border-radius: 12px;
  color: rgba(247, 251, 255, 0.86);
  background:
    linear-gradient(135deg, rgba(27, 231, 255, 0.12), rgba(255, 55, 231, 0.1)),
    rgba(5, 6, 17, 0.82);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-decoration: none;
  backdrop-filter: blur(16px);
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body > .nicolas-credit {
  position: fixed !important;
  z-index: 99989 !important;
}

.nicolas-credit span,
.nicolas-credit strong {
  display: block;
  line-height: 1;
}

.nicolas-credit span {
  color: rgba(247, 251, 255, 0.56);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nicolas-credit strong {
  margin-top: 3px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
}

.nicolas-credit::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cb-cyan), var(--cb-pink));
  box-shadow: 0 0 16px rgba(27, 231, 255, 0.62);
}

.nicolas-credit:hover {
  color: #fff;
  border-color: rgba(255, 55, 231, 0.54);
  transform: translateY(-2px);
}

@media (max-width: 560px) {
  .nicolas-credit {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    min-height: 38px;
    padding: 7px 10px;
  }

  .nicolas-credit span {
    font-size: 9px;
  }

  .nicolas-credit strong {
    font-size: 11px;
  }
}

/* Castle Siege page: use the full playable viewport instead of a narrow content island. */
body[data-system-page="castle"] .system-main {
  width: auto;
  max-width: none;
  min-height: 100svh;
  margin: 0;
}

body[data-system-page="castle"] [data-mu-castle] {
  width: 100%;
  max-width: none;
  display: grid;
  gap: clamp(22px, 2.6vw, 34px);
}

body[data-system-page="castle"] .siege-loren,
body[data-system-page="castle"] .siege-next-panel,
body[data-system-page="castle"] .siege-guilds-panel {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

body[data-system-page="castle"] .siege-loren {
  min-height: clamp(300px, 34vh, 420px);
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  border-radius: 34px 10px 34px 10px;
}

body[data-system-page="castle"] .siege-loren h2 {
  font-size: clamp(48px, 5.6vw, 96px);
}

body[data-system-page="castle"] .siege-next-panel {
  min-height: clamp(330px, 38vh, 460px);
  display: grid;
  align-content: center;
  border-radius: 10px 34px 10px 34px;
}

body[data-system-page="castle"] .siege-timer-frame {
  width: min(920px, 100%);
  margin-bottom: clamp(48px, 7vh, 88px);
}

body[data-system-page="castle"] .siege-timer-frame strong {
  font-size: clamp(38px, 4vw, 64px);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

body[data-system-page="castle"] .siege-guilds-panel {
  min-height: 280px;
}

@media (min-width: 1181px) {
  body[data-system-page="castle"] .system-main {
    padding: clamp(44px, 5vh, 72px) clamp(28px, 4vw, 64px) 82px 300px;
  }
}

@media (max-width: 1180px) {
  body[data-system-page="castle"] .system-main {
    padding: 104px clamp(16px, 4vw, 36px) 56px;
  }
}

@media (max-width: 780px) {
  body[data-system-page="castle"] .siege-loren {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  body[data-system-page="castle"] .siege-timer-frame strong {
    font-size: clamp(30px, 10vw, 48px);
    white-space: normal;
  }
}
