:root {
  --bg: #07111d;
  --bg-deep: #050d16;
  --surface: #0d1b2a;
  --surface-soft: #0f1e2f;
  --surface-strong: #112235;
  --line: rgba(151, 181, 214, 0.18);
  --line-strong: rgba(95, 168, 211, 0.28);
  --text: #f2f6fa;
  --muted: #9fb0c3;
  --accent: #5fa8d3;
  --accent-strong: #5fa8d3;
  --accent-soft: rgba(95, 168, 211, 0.16);
  --accent-warm: #b9975b;
  --success: #7ef0bc;
  --danger: #ff9191;
  --shadow-lg: 0 18px 38px rgba(0, 0, 0, 0.24);
  --shadow-soft: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --max-width: 1520px;
  --heading-font: Cambria, Georgia, "Palatino Linotype", serif;
  --name-font: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Constantia, Georgia, serif;
  --body-font: "Segoe UI Variable", "Segoe UI", "Bahnschrift", sans-serif;
  --state-awakening: rgba(185, 151, 91, 0.18);
  --state-awakening-border: rgba(185, 151, 91, 0.3);
  --state-succession: rgba(88, 193, 168, 0.16);
  --state-succession-border: rgba(88, 193, 168, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--body-font);
  background:
    radial-gradient(circle at top center, rgba(95, 168, 211, 0.12), transparent 26%),
    linear-gradient(180deg, #081421 0%, var(--bg) 48%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.035), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 55%);
  opacity: 0.55;
}

img {
  display: block;
  max-width: 100%;
}

a,
button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 2.6rem), var(--max-width));
  margin: 0 auto;
  padding-bottom: 3rem;
}

.topbar {
  position: sticky;
  top: 1rem;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.15rem;
  margin-top: 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 19, 31, 0.96);
  box-shadow: var(--shadow-lg), var(--shadow-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, #12304a, #1f5475);
  border: 1px solid rgba(95, 168, 211, 0.28);
  color: #f5fdff;
  font-family: var(--heading-font);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.brand-copy strong {
  font-family: var(--heading-font);
  font-size: 1.08rem;
}

.brand-copy span:last-child {
  color: var(--muted);
  font-size: 0.92rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topnav a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 160ms ease, transform 160ms ease;
}

.topnav a:hover,
.topnav a:focus-visible,
.rank-inline-link:hover,
.rank-inline-link:focus-visible {
  color: var(--accent);
}

.topnav a.is-active {
  color: var(--text);
}

.nav-toggle {
  display: none;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 1.2rem;
  height: 2px;
  margin: 0.34rem auto;
  background: var(--text);
}

.page-main {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-4);
}

.page-intro {
  display: grid;
  gap: 0.7rem;
  max-width: 760px;
}

.rank-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 1.1rem 1.35rem;
  align-items: end;
}

.rank-intro {
  max-width: none;
  padding-right: 1rem;
}

.section-tag,
.section-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 0.45rem 0.82rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(95, 168, 211, 0.22);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-intro h1,
.section-headline h2,
.card-head h2 {
  margin: 0;
  font-family: var(--heading-font);
  line-height: 1.02;
}

.page-intro h1 {
  max-width: 10ch;
  font-size: clamp(2.1rem, 3.8vw, 3.45rem);
  line-height: 1.02;
}

.page-intro p,
.section-headline p,
.rank-card-title p,
.rank-card-footer span,
.profile-editor-copy,
.form-feedback,
.proof-preview-body p,
.auth-user-copy span,
.profile-meta-card span,
.card-head .status-text {
  color: var(--muted);
}

.page-intro p {
  margin: 0;
  max-width: 56ch;
  line-height: 1.72;
  font-size: 1rem;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  align-self: stretch;
}

.summary-card,
.rank-card,
.profile-status-card,
.profile-editor-card,
.profile-meta-card,
.proof-preview-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    var(--surface);
  box-shadow: var(--shadow-lg);
}

.summary-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 118px;
  padding: 1rem 1.05rem;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 0.45rem;
  font-family: var(--heading-font);
  font-size: 1.35rem;
  line-height: 1.2;
}

.leaderboard-section,
.profile-layout {
  display: grid;
  gap: var(--space-2);
}

.section-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.section-headline h1,
.section-headline h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.section-headline p {
  margin: 0;
  max-width: 34ch;
  line-height: 1.55;
  text-align: right;
}

.rank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 372px), 1fr));
  gap: var(--space-2);
  align-items: start;
}

.rank-card {
  --card-accent: var(--accent);
  --card-accent-soft: var(--accent-soft);
  --card-accent-border: rgba(95, 168, 211, 0.3);
  display: grid;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, var(--card-accent-soft), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.008)),
    var(--surface);
  box-shadow: var(--shadow-lg), var(--shadow-soft);
}

.rank-card.is-top-card {
  border-color: var(--card-accent-border);
}

.card-head,
.profile-actions,
.profile-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rank-card-header,
.rank-card-tags,
.rank-card-title-block,
.rank-card-hero,
.rank-card-hero-side,
.rank-proof-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.rank-card-header,
.rank-proof-head {
  justify-content: space-between;
}

.rank-rank-token {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 3.7rem;
  min-height: 3.1rem;
  padding: 0.3rem 0.85rem;
  border-radius: 18px;
  border: 1px solid var(--card-accent-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    var(--card-accent-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--text);
  line-height: 1;
}

.rank-rank-token-prefix {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.78;
}

.rank-rank-token strong {
  font-family: var(--heading-font);
  font-size: 1.35rem;
  font-weight: 700;
}

.rank-rank-token-1 {
  border-color: rgba(185, 151, 91, 0.48);
  background:
    linear-gradient(180deg, rgba(185, 151, 91, 0.14), rgba(185, 151, 91, 0.04)),
    rgba(185, 151, 91, 0.08);
}

.rank-rank-token-2 {
  border-color: rgba(170, 187, 212, 0.42);
  background:
    linear-gradient(180deg, rgba(170, 187, 212, 0.14), rgba(170, 187, 212, 0.04)),
    rgba(170, 187, 212, 0.08);
}

.rank-rank-token-3 {
  border-color: rgba(176, 120, 88, 0.45);
  background:
    linear-gradient(180deg, rgba(176, 120, 88, 0.14), rgba(176, 120, 88, 0.04)),
    rgba(176, 120, 88, 0.08);
}

.rank-card-header-copy {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.rank-card-header-eyebrow,
.rank-proof-title,
.rank-proof-note,
.rank-tag,
.rank-score-card span,
.rank-stat-card span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rank-card-header-eyebrow {
  color: var(--text);
}

.rank-card-header-caption {
  color: var(--muted);
  font-size: 0.78rem;
}

.rank-card-tags {
  flex-wrap: wrap;
  gap: var(--space-1);
}

.rank-tag {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.26rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.rank-tag-accent {
  border-color: var(--card-accent-border);
  background: var(--card-accent-soft);
  color: var(--text);
}

.rank-tag-state-awakening {
  border-color: var(--state-awakening-border);
  background: var(--state-awakening);
  color: var(--text);
}

.rank-tag-state-succession {
  border-color: var(--state-succession-border);
  background: var(--state-succession);
  color: var(--text);
}

.rank-card-header-time {
  color: var(--muted);
  font-size: 0.86rem;
}

.rank-card-hero {
  justify-content: center;
}

.rank-card-title-block {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 6px;
  min-width: 0;
  padding: 0.2rem 0;
}

.rank-card-title-block h2 {
  margin: 0;
  font-family: var(--name-font);
  font-size: clamp(1.55rem, 5vw, 2rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.rank-card-title-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.rank-card-hero-side {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: stretch;
  gap: 12px;
}

.rank-score-card {
  display: grid;
  align-content: center;
  min-width: 108px;
  min-height: 88px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(185, 151, 91, 0.3);
  background: linear-gradient(180deg, rgba(185, 151, 91, 0.08), rgba(185, 151, 91, 0.02));
  text-align: center;
}

.rank-score-card span {
  color: var(--muted);
}

.rank-score-card strong,
.gearscore-badge {
  font-family: var(--heading-font);
}

.rank-score-card strong {
  margin-top: 4px;
  font-size: 2rem;
  line-height: 1;
}

.rank-card-portrait-shell {
  display: grid;
  place-items: center;
  width: 88px;
  min-width: 88px;
  height: 88px;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-accent-border);
  background: linear-gradient(180deg, var(--card-accent-soft), rgba(255, 255, 255, 0.02));
}

button.rank-card-portrait-shell {
  cursor: zoom-in;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

button.rank-card-portrait-shell:hover,
button.rank-card-portrait-shell:focus-visible {
  transform: translateY(-1px);
  border-color: var(--card-accent);
}

.rank-card-portrait-shell-static {
  border-color: var(--line);
  background: var(--surface-strong);
}

.rank-card-portrait {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  background: transparent;
}

.rank-card-portrait-fallback,
.auth-avatar-fallback {
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 700;
}

.rank-stat-grid,
.profile-meta-grid,
.profile-grid {
  display: grid;
  gap: 0.85rem;
}

.rank-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
}

.rank-stat-card,
.profile-meta-card {
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(151, 181, 214, 0.14);
  background: var(--surface-strong);
}

.rank-stat-card span,
.profile-meta-card span {
  display: block;
  color: var(--muted);
}

.rank-stat-card strong,
.profile-meta-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.25rem;
  line-height: 1;
}

.rank-proof-block {
  display: grid;
  gap: 0;
  border: 1px solid rgba(151, 181, 214, 0.14);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  overflow: hidden;
}

.rank-proof-head {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(151, 181, 214, 0.12);
  background: linear-gradient(90deg, var(--card-accent-soft), rgba(255, 255, 255, 0.02));
}

.rank-proof-title {
  color: var(--text);
}

.rank-proof-note {
  color: var(--muted);
}

.rank-proof-media {
  width: 100%;
  padding: 12px;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  transition: background 160ms ease;
}

.rank-proof-media:hover,
.rank-proof-media:focus-visible {
  background: rgba(255, 255, 255, 0.02);
}

.rank-proof-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  max-height: 260px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: linear-gradient(180deg, #0b1623, #0a1320);
}

.rank-proof-placeholder {
  display: grid;
  place-items: center;
  min-height: 160px;
  margin: 12px;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(151, 181, 214, 0.18);
  background: rgba(7, 17, 29, 0.72);
  color: var(--muted);
  text-align: center;
}

.proof-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}

.proof-lightbox.hidden {
  display: none;
}

.proof-lightbox-backdrop {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: rgba(2, 7, 14, 0.86);
  cursor: zoom-out;
}

.proof-lightbox-image {
  position: relative;
  z-index: 1;
  max-width: min(94vw, 1280px);
  max-height: 86vh;
  width: auto;
  height: auto;
  padding: 0.8rem;
  border-radius: 26px;
  border: 1px solid rgba(137, 176, 214, 0.24);
  background: rgba(7, 16, 25, 0.96);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  object-fit: contain;
  cursor: zoom-out;
}

.proof-lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 2;
  min-height: 2.8rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(137, 176, 214, 0.18);
  border-radius: 999px;
  background: rgba(7, 16, 25, 0.92);
  color: var(--text);
  cursor: pointer;
}

.rank-card-footer {
  color: var(--muted);
  font-size: 0.92rem;
  flex-wrap: wrap;
}

.rank-inline-link {
  color: var(--accent);
  font-weight: 600;
}

.empty-state {
  padding: 2.2rem;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 0.7rem;
  font-family: var(--heading-font);
  font-size: 1.8rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.profile-layout {
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
}

.profile-sidebar {
  display: grid;
  gap: 1rem;
}

.profile-status-card,
.profile-editor-card {
  padding: 1.2rem;
  background:
    radial-gradient(circle at top right, rgba(120, 224, 220, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    var(--surface-soft);
}

.card-head {
  align-items: start;
}

.status-text {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-status-card h2,
.profile-editor-card h2 {
  margin: 0.7rem 0 0;
  font-size: 2rem;
}

.profile-status-card p {
  margin: 0.8rem 0 0;
  line-height: 1.7;
  color: var(--muted);
}

.profile-actions {
  margin-top: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.profile-actions .button {
  flex: 1 1 180px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.78rem 1.24rem;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--accent);
  color: #f3fdff;
  box-shadow: var(--shadow-lg);
}

.button-secondary {
  border-color: rgba(137, 176, 214, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.profile-meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.15rem;
}

.profile-user {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  margin-top: 1rem;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(137, 176, 214, 0.14);
  background: rgba(255, 255, 255, 0.035);
}

.auth-avatar {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(137, 176, 214, 0.2);
}

.auth-user-copy {
  display: grid;
  gap: 0.1rem;
}

.auth-user-copy strong {
  font-size: 1rem;
}

.profile-editor-head {
  margin-bottom: 0.9rem;
}

.profile-editor-hero-meta {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.gearscore-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 197, 110, 0.24);
  background: rgba(255, 197, 110, 0.08);
  color: var(--text);
  font-size: 1.05rem;
}

.class-portrait-preview {
  display: grid;
  gap: 6px;
  min-width: 116px;
}

.class-portrait-preview-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.class-portrait-preview-media {
  display: grid;
  place-items: center;
  min-height: 74px;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.class-portrait-preview[data-empty="false"] .class-portrait-preview-media {
  border-color: rgba(95, 168, 211, 0.26);
  background: linear-gradient(180deg, rgba(95, 168, 211, 0.1), rgba(255, 255, 255, 0.02));
}

.class-portrait-preview-media img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.profile-editor-copy {
  margin: 0 0 1rem;
  line-height: 1.68;
}

.profile-form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 1rem;
}

.profile-form fieldset:disabled {
  opacity: 0.62;
}

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

.profile-grid label {
  display: grid;
  gap: 0.45rem;
}

.profile-grid label span {
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-grid input,
.profile-grid select {
  width: 100%;
  padding: 0.84rem 0.92rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(137, 176, 214, 0.16);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.profile-grid select {
  color-scheme: dark;
  background-color: var(--surface-strong);
}

.profile-grid select option,
.profile-grid select optgroup {
  color: var(--text);
  background: var(--surface-strong);
}

.profile-grid input:focus,
.profile-grid select:focus {
  outline: none;
  border-color: rgba(95, 168, 211, 0.34);
  box-shadow: 0 0 0 4px rgba(95, 168, 211, 0.12);
}

input[type="file"]::file-selector-button {
  margin-right: 0.85rem;
  padding: 0.56rem 0.9rem;
  border: 1px solid rgba(137, 176, 214, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
}

.full-width {
  grid-column: 1 / -1;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(137, 176, 214, 0.16);
  background: rgba(255, 255, 255, 0.03);
}

.checkbox-row input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
}

.checkbox-row span {
  color: var(--text) !important;
}

.proof-preview-card {
  padding: 1rem;
}

.proof-preview-body {
  display: grid;
  place-items: center;
  min-height: 240px;
  margin-top: 0.9rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(137, 176, 214, 0.18);
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
}

.proof-preview-body img {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 18px;
}

.preview-stack {
  width: 100%;
}

.preview-stack p {
  margin: 0.8rem 0 0;
}

.profile-submit-row {
  align-items: center;
}

.form-feedback {
  margin: 0;
  min-height: 1.5rem;
}

.form-feedback.success {
  color: var(--success);
}

.form-feedback.error {
  color: var(--danger);
}

@media (max-width: 1080px) {
  .rank-overview,
  .profile-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .app-shell {
    width: min(calc(100% - 1.2rem), var(--max-width));
  }

  .topbar {
    border-radius: 28px;
    padding: 1rem;
  }

  .nav-toggle {
    display: inline-block;
  }

  .topnav {
    position: absolute;
    top: calc(100% + 0.65rem);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.8rem;
    border-radius: 24px;
    border: 1px solid rgba(137, 176, 214, 0.18);
    background: rgba(7, 16, 25, 0.96);
  }

  .topnav.is-open {
    display: flex;
  }

  .topnav a {
    padding: 0.8rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
  }

  .page-main {
    padding-top: 2rem;
  }

  .page-intro h1 {
    max-width: none;
    font-size: clamp(2rem, 9vw, 3.2rem);
  }

  .rank-overview,
  .summary-strip,
  .rank-grid,
  .rank-stat-grid,
  .profile-meta-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .section-headline,
  .rank-card-header,
  .rank-proof-head,
  .card-head,
  .profile-actions,
  .profile-submit-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .rank-card-header,
  .rank-proof-head {
    align-items: stretch;
  }

  .rank-card-hero-side {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 88px;
    justify-content: space-between;
  }

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

  .rank-score-card,
  .rank-card-portrait-shell,
  .button {
    width: 100%;
  }

  .rank-card-portrait-shell {
    height: 112px;
  }

  .profile-editor-hero-meta {
    width: 100%;
    flex-wrap: wrap;
  }

  .class-portrait-preview {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
