@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Golos+Text:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #100f0e;
  --panel: #181512;
  --panel-deep: #13110f;
  --line: #3c3026;
  --light: #f0e4d2;
  --muted: #b6a28e;
  --gold: #dfad72;
  --copper: #b67c50;
  --red: #d46c61;
  --green: #a7bd95;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Golos Text", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--light); background: var(--bg); font: 14px/1.5 var(--sans); }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { font-family: var(--serif); line-height: 1.05; }
.header { max-width: 1512px; padding: 0 5%; margin: auto; height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font: 700 24px/.79 var(--serif); white-space: nowrap; letter-spacing: .015em; }
.sigil { display: grid; place-items: center; width: 37px; height: 39px; color: var(--gold); border: 1px solid #825d40; font: 24px/1 Georgia,serif; clip-path: polygon(0 0,100% 0,100% 78%,50% 100%,0 78%); background: #312219; }
.header nav { display: flex; align-self: stretch; gap: 19px; }
.header nav button { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 0 9px; color: var(--muted); white-space: nowrap; }
.header nav button span { margin-right: 4px; color: var(--copper); }
.header nav button[aria-pressed=true] { color: var(--gold); border-bottom-color: var(--copper); }
.account { display: flex; gap: 15px; align-items: center; white-space: nowrap; }
.coins { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.coins > span:first-child { color: #f4c387; margin-right: 3px; }
.record { color: var(--muted); font-size: 12px; border-left: 1px solid var(--line); padding-left: 13px; }
#main { width: min(90%, 1300px); margin: 0 auto; min-height: calc(100vh - 145px); padding-block: 24px 36px; }
.footer { width: min(90%, 1300px); margin: auto; padding: 14px 0; border-top: 1px solid #302820; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.footer span:first-child { color: var(--gold); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 20px; align-items: start; }
.stack { display: grid; gap: 13px; }
.panel { border: 1px solid var(--line); background: linear-gradient(145deg,#1d1814,var(--panel-deep)); }
.panel-pad { padding: 17px; }
.panel h2 { font-size: 29px; }
.panel h3 { font-size: 23px; }
.caption { color: var(--muted); font-size: 12px; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .19em; font-size: 10px; font-weight: 700; }
.eyebrow::before { content: '◆'; margin-right: 7px; font-size: 8px; }
.lobby-stage { min-height: 538px; position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; isolation: isolate; border: 1px solid #4b3829; background: #251b15 url('arena.webp') center 55% / cover; }
.lobby-stage::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg,#0b0907ed 0%,#100c08b5 40%,#0b090722 77%),linear-gradient(0deg,#0d0907 0%,transparent 53%); }
.intro { position: relative; z-index: 3; padding: clamp(23px,4vw,51px) clamp(23px,4vw,45px) 22px; max-width: 71%; pointer-events: none; }
.intro h1 { font-size: clamp(48px,7.15vw,112px); letter-spacing: -.055em; font-weight: 700; margin: 8px 0 13px; line-height: .84; text-shadow: 0 6px 22px #000; }
.intro p:last-child { color: #ead7c0; max-width: 260px; }
.lobby-fighter { position: absolute; bottom: 15%; right: 5%; width: 44%; height: 85%; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 20px 20px #000b); z-index: 1; pointer-events: none; }
.lobby-stage[data-armour=plate] .lobby-fighter { filter: contrast(1.12) saturate(.85) drop-shadow(0 20px 20px #000b); }
.lobby-stage[data-armour=leather] .lobby-fighter { filter: saturate(1.16) drop-shadow(0 20px 20px #000b); }
.mode-area { position: relative; z-index: 3; padding: 15px clamp(14px,3vw,30px) clamp(14px,3vw,28px); }
.mode-area > .eyebrow { margin-bottom: 9px; }
.modes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.mode { min-width: 0; text-align: left; padding: 12px; color: var(--light); border: 1px solid #645042; background: #16110ee8; }
.mode[aria-pressed=true] { border-color: #ce9568; background: #3b281fef; box-shadow: inset 0 2px var(--copper); }
.mode-top { display: flex; justify-content: space-between; align-items: center; color: var(--gold); font-size: 12px; }
.mode strong { display: block; margin: 3px 0; font: 700 clamp(19px,2.1vw,32px)/1.05 var(--serif); overflow-wrap: anywhere; }
.mode small { color: #d5bea7; font-size: 11px; line-height: 1.2; display: block; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button { border: 1px solid #67503d; background: #231b15; color: var(--light); padding: 9px 13px; min-height: 40px; }
.button:hover:not(:disabled) { border-color: var(--gold); }
.primary { background: linear-gradient(150deg,#a85639,#74341f); color: #fff1dc; border-color: #cf8b63; font-weight: 700; }
.primary:hover:not(:disabled) { background: #a9583d; }
.wide { width: 100%; }
.choices { display: grid; gap: 6px; margin-top: 10px; }
.choices button { min-width: 0; width: 100%; display: flex; justify-content: space-between; text-align: left; gap: 8px; border: 1px solid var(--line); background: #181410; padding: 7px 9px; }
.choices button[aria-pressed=true] { border-color: var(--copper); background: #322218; color: var(--gold); }
.choices small { color: var(--muted); font-size: 11px; }
.scout { margin-top: 9px; }
.scout summary { color: var(--gold); cursor: pointer; font-size: 12px; }
.history-hint { margin-top: 7px; }
.match-panel .primary { margin-top: 11px; }
.metrics { margin: 7px 0 10px; }
.metric { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 1px solid #34291f; padding: 4px 0; }
.metric span:first-child { color: var(--muted); font-size: 12px; }
.metric strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.metric strong.good { color: var(--green); }
.metric strong.bad { color: #e08b7d; }
.page-title { margin-bottom: 20px; }
.page-title h1 { font-size: clamp(47px,7vw,79px); }
.page-title p:last-child { margin-top: 6px; color: var(--muted); }
.build-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 14px; }
.portrait { min-height: 382px; display: grid; place-items: end center; overflow: hidden; position: relative; background: radial-gradient(ellipse at 45% 53%, #62442b66,transparent 68%), #19140f; }
.portrait img { display: block; width: 90%; height: 355px; object-fit: contain; object-position: bottom; filter: drop-shadow(0 6px 13px #000); }
.portrait .caption { padding: 6px 10px 11px; text-align: center; }
.stat-row { padding: 9px 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 7px; border-bottom: 1px solid #34291f; }
.stat-row strong { display: block; }
.stat-row .caption { line-height: 1.35; display: block; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { min-width: 34px; min-height: 36px; padding: 0; }
.stepper b { min-width: 25px; text-align: center; font-variant-numeric: tabular-nums; }
.gear-row { display: grid; gap: 3px; margin: 8px 0; }
select { border: 1px solid #624a37; background: #15110f; width: 100%; min-height: 38px; padding: 6px 8px; }
.shop-filters { margin-bottom: 10px; }
.shop-filters button[aria-pressed=true] { border-color: var(--gold); color: var(--gold); background: #302117; }
.items { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.item { background: radial-gradient(ellipse at 60% 0%,#3a291b,transparent 60%),var(--panel); padding: 14px; display: grid; align-content: start; min-height: 151px; gap: 6px; }
.item.is-preview { border-color: var(--copper); }
.item .slot-icon { color: #d8a771; font-size: 23px; line-height: 1; }
.item .caption { min-height: 2.4em; }
.item .price { color: var(--gold); font-size: 12px; }
.item .button { text-align: left; margin-top: 2px; }
.message { min-height: 1.5em; color: #e9b18a; margin-top: 6px; font-size: 12px; }
.combat-stage { min-height: 440px; position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; background: #231a15 url('arena.webp') center 54%/cover; border: 1px solid #4b3829; }
.combat-stage::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg,#100b08c9, transparent 35%, transparent 62%,#120c09eb); }
.combat-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; gap: 9px; }
.combat-top h1 { font-size: clamp(30px,5vw,63px); }
.combat-top .button { background: #1a120ed9; }
.sides { padding: 0 12px; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 4vw; align-self: end; width: 100%; }
.side { display: flex; justify-content: center; align-items: flex-end; min-width: 0; }
.avatar { position: relative; width: 33%; text-align: center; align-self: end; min-width: 0; }
.sides.duel .avatar { width: 80%; }
.sprite { display: block; width: 100%; height: clamp(170px,27vw,332px); object-fit: contain; object-position: center bottom; filter: drop-shadow(0 11px 10px #000b); transform-origin: center 87%; }
.avatar.ally .sprite { transform: scaleX(-1); }
.avatar.ally.player .sprite { transform: none; }
.avatar.ally.player.mirrored .sprite { transform: scaleX(-1); }
.avatar.enemy.unmirrored .sprite { transform: scaleX(-1); }
.avatar.is-out .sprite { filter: grayscale(1); opacity: .23; }
.avatar.is-out .avatar-text { opacity: .45; }
.avatar-text { background: #150e0bdc; border: 1px solid #543c2c; padding: 4px 5px 6px; text-align: left; }
.avatar.is-target .avatar-text { border-color: var(--gold); }
.avatar-text b { display: block; overflow-wrap: anywhere; }
.avatar-text small { color: var(--muted); font-size: 10px; }
.avatar.ally .avatar-text b { color: #cce2b5; }
.avatar.enemy .avatar-text b { color: #f0a498; }
.bar { height: 4px; background: #473628; margin-top: 4px; }
.bar i { display: block; height: 100%; background: #9cab70; transition: width .25s; }
.avatar.enemy .bar i { background: #c56a56; }
.arena-foot { padding: 6px 12px 9px; color: var(--muted); font-size: 11px; }
.combat-actions { padding: 14px; }
.combat-actions .actions { margin: 8px 0; }
.combat-actions .actions button[aria-pressed=true] { border-color: var(--gold); color: var(--gold); background: #37251b; }
.fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.fields label { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }
.round-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.round-footer span { color: var(--gold); }
.log { max-height: 400px; overflow: auto; }
.log details { margin-top: 8px; }
.log summary { color: var(--gold); cursor: pointer; }
.log li { margin-bottom: 5px; }
.log ul { margin: 5px 0; padding-left: 17px; }
.log li small { display: block; }
.result { position: absolute; z-index: 5; inset: 0; display: grid; align-content: center; justify-items: center; gap: 9px; background: #130c08df; padding: 22px; text-align: center; }
.result h2 { font-size: clamp(56px,10vw,104px); color: var(--gold); }
.result .actions { justify-content: center; }
.avatar.hit .sprite { animation: hit .31s ease-out; }
.avatar.lunge .sprite { animation: lunge .31s ease-out; }
@keyframes hit { 40% { translate: 6px 2px; opacity: .56; } }
@keyframes lunge { 43% { translate: 10px -5px; } }
#notice { position: fixed; right: 18px; bottom: 18px; border: 1px solid #8c6345; background: #241914; color: var(--light); z-index: 10; padding: 9px 14px; max-width: calc(100% - 36px); box-shadow: 0 9px 30px #0009; }
#notice:empty { display: none; }
@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0,1fr) 253px; gap: 13px; }
  .lobby-stage { min-height: 490px; }
  .panel-pad { padding: 13px; }
}
@media (max-width: 770px) {
  .layout, .build-grid { grid-template-columns: 1fr; }
  .header { padding: 0 4%; gap: 10px; height: 63px; }
  .header nav { gap: 1px; }
  .header nav button { padding: 0 6px; }
  .header nav button span, .record { display: none; }
  #main { width: 94%; padding-top: 13px; }
  .footer { width: 94%; }
  .lobby-stage { min-height: 444px; }
  .lobby-fighter { height: 76%; right: 1%; bottom: 21%; width: 49%; }
  .combat-stage { min-height: 339px; }
}
@media (max-width: 420px) {
  body { font-size: 13px; }
  .brand { font-size: 18px; gap: 4px; }
  .sigil { width: 25px; height: 30px; font-size: 17px; }
  .header nav button { font-size: 11px; padding-inline: 4px; }
  .account { font-size: 12px; }
  .lobby-stage { min-height: 395px; }
  .intro { padding: 22px 15px; }
  .intro h1 { font-size: 52px; }
  .mode { padding: 7px 5px; }
  .modes { gap: 4px; }
  .mode small { font-size: 10px; }
  .fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .combat-top { padding: 8px; }
  .sides { padding: 0 4px; gap: 8px; }
  .avatar-text { padding-inline: 2px; }
  .avatar-text b { font-size: 10px; }
  .avatar-text small { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.header-level { color: var(--muted); font-size: 12px; white-space: nowrap; }
.brand { background: none; border: 0; padding: 0; text-align: left; }
.room-route { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.room-route button { border: 0; padding: 3px 0; background: transparent; color: var(--gold); }
.room-route button:hover { text-decoration: underline; }
.hall-stage {
  display: flex; flex-direction: column; justify-content: space-between; min-height: 530px; isolation: isolate;
  position: relative; border: 1px solid #4b3829; overflow: hidden;
  background: #211711 url('hall.webp') center 45% / cover;
}
.hall-stage::before, .room-scene::before {
  content: ''; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(90deg,#090706ec,#0d090762 76%),linear-gradient(0deg,#110b08f2,transparent 65%);
}
.hall-intro { padding: clamp(24px,5vw,58px); }
.hall-intro h1 { font-size: clamp(57px,9vw,119px); line-height: .86; letter-spacing: -.055em; margin-top: 8px; }
.room-doors { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; padding: 14px clamp(12px,3vw,29px) clamp(12px,3vw,29px); }
.room-door {
  text-align: left; min-height: 118px; padding: 9px; display: flex; flex-direction: column; justify-content: end;
  border: 1px solid #825d42; color: var(--light);
  background: linear-gradient(0deg,#100b09 8%,#1a100c61),var(--room-art) center 45% / cover,#211813;
}
.room-build { background-position: center 24%; }
.room-door:hover { border-color: var(--gold); }
.room-door strong { font: 700 clamp(17px,2.15vw,27px)/.98 var(--serif); }
.room-door span { color: #dcc6ad; font-size: 11px; line-height: 1.25; margin-top: 5px; }
.room-scene { position: relative; isolation: isolate; border: 1px solid #4b3829; background: #211711 center 45%/cover; display: flex; align-items: flex-end; }
.merchant-scene { min-height: 173px; margin-bottom: 17px; background-image: url('merchant.webp'); background-position: center 36%; }
.infirmary-scene { min-height: 374px; background-image: url('infirmary.webp'); }
.room-title { padding: clamp(17px,3vw,32px); width: 100%; }
.room-title h1 { font-size: clamp(43px,6vw,76px); }
.room-title p:not(.eyebrow) { color: #e5d4be; max-width: 34em; margin-top: 6px; }
.room-title .button { margin-top: 13px; }
.progression-label, .condition-status { margin-top: 6px; }
.xp-bar { height: 5px; margin: 7px 0 1px; }
.xp-bar i { background: var(--gold); }
.progress-action { margin-top: 12px; }
.equipment-grid { display: grid; gap: 0 10px; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 5px 0 8px; }
.level-earned { color: #f6c389; font-weight: 700; }
@media (max-width: 770px) {
  .hall-stage { min-height: 450px; }
  .infirmary-scene { min-height: 300px; }
  .room-door { min-height: 96px; }
}
@media (max-width: 490px) {
  .hall-stage { min-height: 410px; }
  .room-doors { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .room-door { min-height: 71px; }
  .header-level { font-size: 10px; }
  .account { gap: 5px; }
}
