body.roman-menu {
  --menu-ink: #230e0b;
  --menu-text: #fff0dd;
  --menu-muted: #e2bfb3;
  --menu-accent: #f0c381;
}

body.roman-menu.home-view {
  background: radial-gradient(ellipse at 75% 45%, #78241e, #3b100e 58%, #230e0b) fixed;
}

body.roman-menu > header,
body.roman-menu.home-view > header {
  display: grid;
  /* Sides never narrower than what's in them (Shop + a big coin balance + profile), so nothing overlaps
     the menu; with room to spare the two sides stay equal and the menu stays centred. */
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px clamp(14px, 3vw, 42px);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.command-brand, .command-shop, .command-tools,
body.roman-menu > header nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0;
}

.command-shop { justify-content: end; }
.command-tools {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 20;
}

.wordmark { display: block; width: 78px; height: auto; }

body.roman-menu > header :is(button, #profile-open, #help, .coin-counter) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  height: auto;
  min-height: 40px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--menu-muted);
  font: 650 .82rem/1.2 system-ui, sans-serif;
  white-space: nowrap;
}

body.roman-menu > header :is(.coin-counter, #profile-open, #help) {
  min-width: 40px;
  background: #471611;
  border-color: #ffffff1a;
}

body.roman-menu > header button:is(:hover:not(:disabled), [aria-current="page"]) {
  background: #91312966;
  color: var(--menu-text);
}

body.roman-menu > header button:disabled { opacity: .72; }
.command-stamp {
  color: var(--menu-accent);
  font-size: .63rem;
  font-weight: 600;
}

.forum-home > .forum-brand {
  justify-items: start;
  text-align: start;
  inset-inline-start: 0;
  gap: 22px;
}

.forum-brand > h1 { width: min(100%, 460px); margin: 0; }

body.roman-menu > header :is(button, a):focus-visible {
  outline: 2px solid var(--menu-accent);
  outline-offset: 3px;
}

@media (max-width: 1000px) {
  body.roman-menu > header,
  body.roman-menu.home-view > header { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  body.roman-menu > header nav {
    grid-area: 2 / 1 / 3 / -1;
    justify-content: center;
    overflow: visible;
    padding-top: 6px;
  }
}

@media (max-width: 760px) {
  .forum-home > .forum-brand { justify-items: center; text-align: center; }
  .forum-home > .home-quotes { order: -1; }
  body.roman-menu.home-view > main { padding-bottom: 65px; }
}


.forum-home > .forum-brand {
  justify-items: center;
  gap: 4px;
}

.forum-brand > .paired-actions {
  display: block;
  position: relative;
  width: min(65%, 338px);
}

.paired-actions > img {
  display: block;
  width: 100%;
  height: auto;
  filter: brightness(.93) contrast(.92) saturate(.89);
}

.forum-brand .paired-actions :is(#home-offline, #home-daily) {
  position: absolute;
  inset: 35% auto auto 6%;
  width: 44%;
  height: 32%;
  min-height: 0;
  border-radius: 16px;
}

.forum-brand .paired-actions #home-daily {
  left: 50%;
}

.forum-brand .paired-actions #home-offline::before {
  content: none;
}

.forum-brand .paired-actions button:is(:hover, :focus-visible, .is-pressed) {
  box-shadow: inset 0 0 16px #ffca7a4d;
  background: #ffd39914;
}

.forum-brand .paired-actions button:focus-visible {
  outline: 2px solid #ffe0a3;
  outline-offset: 2px;
}

.victory-graphic.victory-cleo {
  border-color: #ffe4a0;
  background: linear-gradient(125deg, #4e2c0d, #ac7527 37%, #ffe9a6 51%, #a46a1e 64%, #492605);
  box-shadow: inset 0 0 0 2px #fff0b34d, 0 10px 25px #160900a0;
}

.victory-graphic.victory-cleo::before {
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(112deg, transparent 40%, #fff2b780 49%, transparent 58%) 100% 0 / 240% 100%;
  opacity: .65;
  animation: cleopatra-gold-reflection 1.2s ease-out both;
}

.victory-cleo .victory-copy { position: relative; }

.duel-view .victory-result:has(.victory-cleo) :is(.victory-stats, .rank-result dl) {
  background: linear-gradient(125deg, #51320f, #795018 44%, #372108 80%);
  border-color: #d4a84e;
}

@keyframes cleopatra-gold-reflection {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .victory-graphic.victory-cleo::before { animation: none; }
}

body.roman-menu > header .nav-scroll {
  position: absolute;
  z-index: 25;
  top: calc(100% + 3px);
  left: 50%;
  width: max-content;
  max-width: 45vw;
  min-width: 0;
  box-sizing: border-box;
  padding: 9px 4px;
  border: 0;
  border-radius: 2px 2px 6px 6px;
  background:
    repeating-linear-gradient(90deg, #ffc5900b 0 1px, #18000014 1px 2px, transparent 2px 4px),
    repeating-linear-gradient(0deg, #2c090c15 0 1px, transparent 1px 3px),
    linear-gradient(90deg, #43120f, #69201c 8%, #8d3329 18%, #7b2821 27%, #4f1514 38%, #8c3026 49%, #a04031 56%, #72241e 69%, #551815 81%, #8b3027 92%, #491310);
  box-shadow: inset 0 4px 9px #19030085, 0 10px 18px #12040695;
  transform: translateX(-50%);
  clip-path: inset(0 -16px calc(100% - var(--drop, 0%)) round 0 0 5px 5px);
  visibility: hidden;
  transition: clip-path 180ms ease-in, visibility 0s linear 180ms;
}
body.roman-menu > header #offline-options {
  padding-inline: 8px;
}
body.roman-menu > header .nav-scroll:not([inert]) {
  visibility: visible;
  clip-path: inset(0 -16px calc(100% - var(--drop, 100%)) round 0 0 5px 5px);
  transform: translateX(-50%) translateY(clamp(0px, calc((var(--drop, 100%) - 100%) / 8), 4px));
  transition: none;
}
.nav-scroll::before, .nav-scroll::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  height: 4px;
  background: linear-gradient(#4e2115, #d4a264 36%, #906139 60%, #4b2016);
  border-radius: 4px;
  pointer-events: none;
}
.nav-scroll::before { top: 0; }
.nav-scroll::after { top: clamp(0px, calc(var(--drop, 100%) - 4px), calc(100% - 4px)); }
body.roman-menu > header :is(#offline-options, #learn-options) button {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 4px 3px;
  text-align: center;
  white-space: normal;
  color: #ffe0a6;
  font: 700 .84rem/1.15 Georgia, serif;
  text-shadow: 0 2px 3px #2f0907;
}
@media (prefers-reduced-motion: reduce) {
  body.roman-menu > header .nav-scroll { transition: none; }
}
.learn-page { max-width: 880px; margin-inline: auto; }
body.roman-menu .rank-pass { max-width: 1050px; }
.rank-pass .rank-pass-header {
  flex-wrap: wrap;
  padding: clamp(18px, 4vw, 38px);
  border: 1px solid #b67d485e;
  background: radial-gradient(ellipse at 14% 15%, #923b2b72, transparent 68%), var(--arena-panel);
  box-shadow: 0 16px 38px #16091050, inset 0 0 0 4px #15091040;
}
.rank-pass .rank-pass-header h1 { font: 700 clamp(34px, 6vw, 65px)/1 Georgia, serif; }
.rank-standing { display: flex; align-items: center; gap: 12px; margin-top: 15px; color: var(--arena-text); }
.rank-standing small { display: block; margin-top: 4px; color: #e1c3b1; }
.rank-rewards-heading { margin: 28px 0 0; color: var(--arena-text); font: 700 1.25rem Georgia, serif; }
.rank-pass .rank-track-scroll { padding: 14px 12px; background: #170b1480; border: 1px solid #b67d4844; }
.rank-pass .rank-node {
  width: clamp(122px, 23cqw, 172px);
  min-height: 169px;
  padding: 10px 5px;
  border: 1px solid #bd86454a;
  background: var(--arena-panel);
}
.rank-pass .rank-node strong { color: #ffe3a6; }
.rank-pass .rank-node .rank-prize { color: #efc98c; }
.rank-pass .rank-node[data-state="current"] { border-color: var(--arena-gold); box-shadow: inset 0 0 18px #eab9712f; }
.rank-pass .rank-node[data-state="locked"] .rank-badge { opacity: .64; }
.rank-pass .rank-track .rank-badge { height: 72px; width: 70px; }
.rank-pass .rank-stop[aria-current=step] .rank-badge { filter: drop-shadow(0 0 9px #ffad4566); }
.rank-pass .rank-connector { width: clamp(18px, 4cqw, 44px); margin-top: 43px; }
.rank-pass .rank-track progress { height: 6px; }
.rank-pass .rank-progress-tip { top: 3px; background: #ad712e; border-color: #ffdf9c; width: 12px; height: 12px; box-shadow: none; }
.rank-pass .rank-progress-tip::after { background: #ffdf9c; inset: 2px; }
.rank-pass progress::-webkit-progress-value { background: var(--arena-gold); }
.rank-pass progress::-moz-progress-bar { background: var(--arena-gold); }
.rank-pass #rank-pack { margin-top: 14px; }

.challenge-page {
  width: min(100%, 820px);
  margin-inline: auto;
  padding: clamp(20px, 4vw, 42px);
  box-sizing: border-box;
  border: 1px solid #bd864560;
  background: radial-gradient(ellipse at 75% 0, #82382f75, transparent 62%), var(--arena-panel);
  box-shadow: 0 18px 38px #12090f80;
}
.challenge-page h1 { font-family: Georgia, serif; }
.challenge-page .daily-round,
.challenge-page #study-content {
  margin-top: 24px;
  padding: clamp(14px, 3vw, 28px);
  border: 1px solid #bd864555;
  background: #1b1017;
  color: #fff0dd;
}
.challenge-page input, .rank-choice select {
  background: #26151d;
  color: #fff0dd;
  border: 1px solid #a87952;
}
.rank-choice { margin-top: 16px; }

#account-open {
  display: inline-grid;
  flex: none;
  place-items: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  padding: 0;
  border: 1px solid #967347;
  border-radius: 50%;
  background: #30291f;
  color: #f6d497;
  font-weight: 700;
  cursor: pointer;
}
#account-open:hover { background: #483822; }
#account-open:focus-visible { outline: 2px solid #f6d497; outline-offset: 3px; }
.account-fields { display: grid; gap: .45rem; max-inline-size: 100%; }
.account-fields input {
  max-inline-size: 100%;
  min-inline-size: 0;
  padding: .55rem .7rem;
  border: 1px solid #967347;
  border-radius: .35rem;
  background: #211e19;
  color: #fff3d9;
  font: inherit;
}
#account-status:empty { display: none; }

.account-panel {
  padding: 1rem;
  margin-block: 1rem;
  border: 1px solid #967347;
}
.account-fields label { display: grid; gap: .3rem; }
.account-fields select { max-inline-size: 100%; padding: .5rem; }

.cast-card.cast-archetype { position: relative; }
.cast-card.cast-archetype::after { content: ""; position: absolute; inset: 4px; border: 1px solid #e1c28c88; border-radius: 4px; pointer-events: none; }

.roman-page.champion-picker { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); gap:clamp(.7rem, 2vw, 2rem); align-items:start; width:100%; max-width:none; padding-top:.4rem; }
.champion-picker .picker-roster h1 { margin:0 0 .6rem; font-size:clamp(1.15rem, 3vw, 2rem); }
.champion-picker .cast-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.5rem; }
.champion-picker .cast-card:disabled { cursor:default; }
.picker-preview { position:sticky; top:.5rem; min-width:0; }
.picker-preview h2 { margin:0 0 .65rem; font-size:clamp(1rem, 2.5vw, 1.6rem); }
.picker-slots { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.65rem; }
.picker-slots[data-count="1"] { grid-template-columns:minmax(0,1fr); }
.picker-empty { min-height:clamp(4rem,13vw,10rem); border-bottom:1px solid #d3ad6860; }
.picker-slots .champion-feature { margin:0; min-width:0; }
.picker-slots .champion-feature img { display:block; width:100%; aspect-ratio:2 / 3; object-fit:cover; }
.picker-slots h3 { margin:.2rem 0; }
.picker-preview #start { margin-top:.75rem; }
.picker-preview #start[hidden] { display:none; }
.champion-picker .picker-preview .arena-difficulty { margin:.75rem 0; }
.picker-preview #select-back { display:block; margin-top:.65rem; }
@media (max-width:600px) {
  .roman-page.champion-picker { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .champion-picker .cast-grid { gap:.3rem; }
  .picker-slots { gap:.3rem; }
}
.picker-slots .champion-feature figcaption { padding:1.1rem .5rem .5rem; overflow-wrap:anywhere; } .picker-slots .champion-feature h3 { font-size:clamp(.8rem, 1.9vw, 1.5rem); }

body.roman-menu .champion-picker :is(.picker-roster h1,.picker-preview h2) {
  font-size: clamp(1.15rem,3vw,2rem);
  color: var(--arena-text);
}
.picker-preview .picker-actions {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: .65rem;
  margin-top: .75rem;
}
.picker-preview .picker-actions > .roman-primary {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  text-align: center;
}
.picker-actions select { appearance: none; cursor: pointer; text-align-last: center; }
.picker-actions select option { background: #291916; color: #fff; }
.lan-arena { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid #e8c57f44; }
.lan-arena form { margin-top: .6rem; }
.lan-arena input { max-width: 100%; min-height: 36px; }
.lan-arena [role="status"]:empty { display: none; }

.cast-card[hidden] { display: none; }

.duel-view .arena { background: #26232c; }
.duel-view .stage[data-arena-loading] canvas { visibility: hidden; }
.arena-status { position:absolute; inset:45% 12% auto; padding:.75rem; text-align:center; color:#fff4df; background:#211824; }
