/* ARCHIVE MARRON (fond actuel cuir/donjon) — fallback si aucun data-decor. Ne pas supprimer. */
:root {
  --bg: #1a120c;
  --ink: #eadcc8;
  --muted: #9a8470;
  --gold: #c9b48a;
  --steel: #c4a070;
  --purple: #6a6cff;
  --deep: #120c08;
  --red: #e23b4a;
  --sys: #e7c56a;
  --edge: rgba(201, 180, 138, 0.32);
  --menu-glow: rgba(201, 150, 70, 0.22);
  --menu-ember: rgba(120, 40, 16, 0.28);
  --menu-top: #2a1c12;
  --menu-mid: #1a120c;
  --menu-bot: #120c08;
  --grid: rgba(231, 197, 106, 0.05);
  --h1: #eadcc8;
  --h1-glow: rgba(231, 197, 106, 0.28);
  --panel-a: rgba(22, 16, 12, 0.94);
  --panel-b: rgba(8, 6, 4, 0.96);
  --btn-fill: rgba(18, 12, 8, 0.88);
  --view-fill: #1a1410;
  --overlay: rgba(12, 8, 6, 0.78);
  --sys-glow: rgba(231, 197, 106, 0.35);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Rajdhani", "Segoe UI", "Helvetica Neue", sans-serif;
}

.hidden {
  display: none !important;
}

#menu {
  position: relative;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.menu-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% -10%, var(--menu-glow) 0%, transparent 52%),
    radial-gradient(circle at 12% 92%, var(--menu-ember) 0%, transparent 40%),
    linear-gradient(180deg, var(--menu-top) 0%, var(--menu-mid) 55%, var(--menu-bot) 100%);
  z-index: -1;
}

.menu-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, transparent 18%, transparent 82%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, transparent 22%, transparent 78%, rgba(0, 0, 0, 0.7) 100%);
  pointer-events: none;
}

.menu-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.brand {
  text-align: center;
}

.sys {
  color: var(--sys);
  letter-spacing: 0.42em;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 0 0 12px var(--sys-glow);
}

h1 {
  font-family: "Cinzel", serif;
  font-size: clamp(42px, 10vw, 78px);
  margin: 6px 0 0;
  letter-spacing: 0.16em;
  color: var(--h1);
  text-shadow: 0 0 28px var(--h1-glow), 0 8px 40px rgba(0, 0, 0, 0.8);
}

h1 span {
  color: var(--gold);
}

.speed-test {
  margin: 8px 0 0;
  font: 800 12px "Rajdhani", sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #c9b48a;
}

.tag {
  max-width: 440px;
  margin: 10px auto 0;
  color: var(--muted);
  letter-spacing: 0.06em;
  font-size: 15px;
}

.name-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--steel);
}

.name-field input {
  min-height: 48px;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--edge);
  color: var(--ink);
  font: 700 20px "Rajdhani", sans-serif;
  padding: 12px 14px;
  outline: none;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 18px rgba(90, 212, 255, 0.08);
}

.name-field input:focus {
  border-color: rgba(90, 212, 255, 0.55);
  box-shadow: 0 0 18px rgba(90, 212, 255, 0.18);
}

input,
textarea {
  user-select: text;
  -webkit-user-select: text;
}

.hunter-code {
  width: min(860px, 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hunter-code-label {
  margin: 0;
  font: 700 11px "Rajdhani", sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel);
}

.hunter-code-help {
  margin: 0;
  font: 600 13px "Rajdhani", sans-serif;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: none;
  line-height: 1.35;
}

.hunter-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: stretch;
}

.hunter-code-row input {
  min-height: 42px;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--edge);
  color: var(--ink);
  font: 600 12px "Consolas", "Rajdhani", monospace;
  letter-spacing: 0;
  padding: 8px 12px;
  outline: none;
  overflow-x: auto;
}

.hunter-code-row button {
  min-height: 42px;
  padding: 0 14px;
  font: 800 11px "Rajdhani", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--btn-fill);
  border: 1px solid var(--edge);
  cursor: pointer;
}

.hunter-code-msg {
  margin: 0;
  min-height: 1.1em;
  font: 600 12px "Rajdhani", sans-serif;
  color: var(--muted);
}

.hunter-code-msg.ok {
  color: #7dffb0;
}

.hunter-code-msg.err {
  color: #ff8a8a;
}

@media (max-width: 560px) {
  .hunter-code-row {
    grid-template-columns: 1fr 1fr;
  }
  .hunter-code-row input {
    grid-column: 1 / -1;
  }
}

.hunter-bar {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.hunter-profile {
  width: auto;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
}

.profile-stats {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: 48px;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--edge);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.profile-stats li {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 72px;
  padding: 8px 14px 7px;
  font: 700 9px "Rajdhani", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.profile-stats li + li {
  border-left: 1px solid var(--edge);
}

.profile-stats b {
  font: 800 16px "Rajdhani", sans-serif;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1;
}

@media (max-width: 560px) {
  .hunter-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .profile-stats {
    width: 100%;
  }

  .profile-stats li {
    flex: 1;
    text-align: center;
    align-items: center;
  }
}

.class-picks,
.class-pick {
  display: none !important;
}

.modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(860px, 100%);
  align-items: stretch;
}

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

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  min-height: 148px;
  text-align: left;
  background: linear-gradient(165deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--edge);
  color: inherit;
  padding: 16px 18px;
  cursor: pointer;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  box-shadow: inset 0 1px 0 rgba(180, 210, 240, 0.08), 0 12px 40px rgba(0, 0, 0, 0.45);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mode-card:hover,
.mode-card:focus {
  border-color: rgba(90, 212, 255, 0.55);
  box-shadow: 0 0 24px rgba(90, 212, 255, 0.16), inset 0 1px 0 rgba(180, 210, 240, 0.12);
}

.mode-kicker {
  color: var(--sys);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.mode-card strong {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 20px;
  line-height: 1.25;
  min-height: 1.25em;
  margin: 8px 0 10px;
  color: var(--h1);
}

.mode-card p {
  margin: auto 0 0;
  min-height: 2.6em;
  color: var(--muted);
  line-height: 1.35;
  font-size: 14px;
}

.howto {
  width: min(860px, 100%);
  padding: 0;
  margin: 8px 0 0;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
}

.howto li {
  padding: 5px 0 5px 16px;
  position: relative;
  border-bottom: 1px solid rgba(138, 168, 196, 0.08);
}

.howto li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 1px;
  background: var(--sys);
  box-shadow: 0 0 8px var(--sys);
}

.howto em {
  color: var(--ink);
  font-style: normal;
  font-weight: 700;
}

.hint {
  color: #5a6470;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.online-hint {
  margin: 8px 0 0;
  max-width: 42ch;
  color: #8a93a0;
  font-size: 12px;
  line-height: 1.45;
}

.online-hint em {
  color: #d6c48a;
  font-style: normal;
}

.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 30;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

.panel {
  width: min(480px, 100%);
  margin: auto 0;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--edge);
  padding: 28px 24px;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 14px) 100%, 0 100%, 0 12px);
  box-shadow: 0 0 0 1px rgba(90, 212, 255, 0.08), 0 24px 80px #000;
}

.panel h2 {
  font-family: "Cinzel", serif;
  margin: 0 0 8px;
  letter-spacing: 0.08em;
}

#lobby-count {
  font-size: 48px;
  margin: 0;
  color: var(--sys);
  text-shadow: 0 0 18px rgba(90, 212, 255, 0.35);
}

#lobby-list,
#end-board {
  padding-left: 18px;
  color: var(--muted);
  max-height: min(36vh, 260px);
  overflow-y: auto;
}

#game {
  position: fixed;
  inset: 0;
  touch-action: none;
}

#view {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--view-fill);
  touch-action: none;
}

#vignette {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 4;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 38%, rgba(0, 0, 0, 0.55) 78%, rgba(0, 0, 0, 0.88) 100%);
}

#hud {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 6;
}

#sys-window {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 300px;
  padding: 12px 14px 14px;
  background: linear-gradient(180deg, rgba(8, 12, 18, 0.88), rgba(4, 6, 10, 0.9));
  border: 1px solid var(--edge);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(180, 210, 240, 0.08), 0 12px 40px rgba(0, 0, 0, 0.45);
}

.sys-title {
  margin: 0 0 8px;
  color: var(--sys);
  letter-spacing: 0.28em;
  font-size: 10px;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(90, 212, 255, 0.4);
}

#sys-window p {
  margin: 3px 0;
  letter-spacing: 0.04em;
}

#hud-power,
#hud-stance {
  color: var(--gold);
  line-height: 1.25;
}

#hud-power {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

#hud-power .wep-on {
  display: block;
  font-size: 1em;
  letter-spacing: 0.04em;
  color: var(--gold);
  line-height: 0.95;
}

#hud-power .wep-off {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}

#hud-name {
  color: #9ad8ff;
  font-weight: 700;
  letter-spacing: 0.08em;
}

#hud-hp {
  color: #c9d4e0;
  font-size: 12px;
  font-weight: 700;
}

#hud-xp {
  color: #9ad8ff;
  font-size: 11px;
  font-weight: 700;
}

.bar.xp {
  height: 8px;
  margin: 4px 0 2px;
}

.bar.xp i {
  background: linear-gradient(90deg, #1a4a6a, #5ad4ff 55%, #d4f4ff);
  box-shadow: 0 0 10px rgba(90, 212, 255, 0.35);
}

#hud-stance {
  font-size: 12px;
}

#hud-duel {
  margin: 4px 0 0;
  color: var(--sys);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-stats {
  width: min(920px, 100%);
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 12px;
}

.menu-stats > div,
.loot-odds {
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, rgba(10, 14, 20, 0.92), rgba(6, 8, 12, 0.94));
  border: 1px solid rgba(138, 168, 196, 0.22);
}

.orb-guide {
  width: min(920px, 100%);
}

.orb-guide-note {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.orb-guide table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.orb-guide th,
.orb-guide td {
  text-align: left;
  padding: 7px 6px;
  border-bottom: 1px solid rgba(138, 168, 196, 0.1);
  color: var(--muted);
  vertical-align: top;
}

.orb-guide th {
  color: var(--sys);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.orb-guide td:first-child {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.orb-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 8px currentColor;
}

.orb-dot.force { background: #e23b4a; color: #e23b4a; }
.orb-dot.vital { background: #5cff9a; color: #5cff9a; }
.orb-dot.haste { background: #6ee0ff; color: #6ee0ff; }
.orb-dot.shadow { background: #9b8cff; color: #9b8cff; }

.menu-stats .sys-title {
  margin: 0 0 10px;
}

.menu-stats table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.menu-stats th,
.menu-stats td {
  text-align: left;
  padding: 5px 6px;
  border-bottom: 1px solid rgba(138, 168, 196, 0.1);
  color: var(--muted);
}

.menu-stats th {
  color: var(--sys);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.menu-stats td:first-child {
  color: var(--ink);
  font-weight: 700;
}

.menu-stats .stat-desc {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

@media (max-width: 760px) {
  .menu-stats {
    grid-template-columns: 1fr;
  }
}

.loot-odds {
  width: min(920px, 100%);
  margin-top: 8px;
}

.loot-odds .sys-title {
  margin: 0 0 10px;
}

#chest-odds {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 18px;
}

#chest-odds li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid rgba(138, 168, 196, 0.08);
  padding: 4px 0;
}

#chest-odds li strong {
  color: var(--ink);
  font-weight: 700;
}

#chest-odds li span {
  color: var(--sys);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#chest-odds li.rare strong,
#chest-odds li.rare span {
  color: #5ad4ff;
}

@media (max-width: 560px) {
  #chest-odds {
    grid-template-columns: 1fr;
  }
}

.bar {
  height: 12px;
  background: #0a0e14;
  margin: 8px 0;
  border: 1px solid rgba(180, 205, 225, 0.4);
  box-shadow: inset 0 0 0 1px #000, 0 0 12px rgba(90, 212, 255, 0.12);
  position: relative;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 3px), calc(100% - 4px) 100%, 0 100%, 0 3px);
}

.bar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--sys);
  box-shadow: 0 0 8px var(--sys);
}

.bar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 50%);
}

.bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #1f6a48, #5ad48a 55%, #c9e8c0);
  box-shadow: 0 0 10px rgba(90, 212, 140, 0.35);
  transition: width 0.18s linear;
}

.bar.boss {
  height: 12px;
  background: #12080c;
  border-color: rgba(226, 59, 74, 0.4);
}

.bar.boss i {
  background: linear-gradient(90deg, #4a1018, #e23b4a, #c9b48a);
  box-shadow: 0 0 12px rgba(226, 59, 74, 0.4);
}

#hud-right {
  position: absolute;
  top: 12px;
  right: 12px;
  text-align: right;
  max-width: 240px;
  z-index: 50;
  pointer-events: auto;
}

#timer,
#alive {
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 13px;
  color: #cfd8e4;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 8px rgba(90, 212, 255, 0.15);
}

#minimap {
  display: block;
  margin-left: auto;
  margin-top: 8px;
  width: 220px;
  height: 220px;
  background: rgba(2, 8, 12, 0.9);
  border: 1px solid rgba(90, 212, 255, 0.45);
  border-radius: 14px;
  box-shadow: 0 0 18px rgba(90, 212, 255, 0.18), inset 0 0 28px rgba(0, 30, 40, 0.55);
}

#radar-legend {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  font: 700 11px "Rajdhani", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #cfd8e4;
}

#radar-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

#radar-legend li::before {
  content: "";
  display: block;
}

#radar-legend .leg-you::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b8fbff;
  box-shadow: 0 0 0 2px #e8ffff, 0 0 8px #5ad4ff;
  animation: you-blink 0.7s ease-in-out infinite;
}

@keyframes you-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.2; transform: scale(0.7); }
}

#radar-legend .leg-hunter::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6b73;
  box-shadow: 0 0 0 1.5px #fff0f0;
}

#radar-legend .leg-portal::before {
  width: 10px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 1.5px #e7c56a;
  transform: none;
}

#radar-legend .leg-boss::before {
  width: 8px;
  height: 8px;
  background: #c56bff;
}

#radar-legend .leg-malakor::before {
  width: 10px;
  height: 10px;
  background: #ff4d5a;
  transform: rotate(45deg);
  box-shadow: 0 0 0 1.5px #fff2c8;
}

#boss-bar {
  position: absolute;
  left: 50%;
  top: calc(62px + env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 360px));
  z-index: 40;
  pointer-events: none;
  text-align: center;
}

#boss-bar.hidden {
  display: none;
}

#boss-bar span {
  display: block;
  margin: 0 0 4px;
  font: 800 12px "Rajdhani", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ff6a74;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.85);
}

@media (max-width: 900px) {
  #boss-bar {
    top: calc(70px + env(safe-area-inset-top, 0px));
    width: min(88vw, 380px);
  }
}

#alert,
#spectate {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 22px;
  border: 1px solid var(--red);
  color: #ff6a74;
  font-family: "Cinzel", serif;
  letter-spacing: 0.16em;
  background: linear-gradient(180deg, rgba(40, 6, 10, 0.82), rgba(8, 2, 4, 0.86));
  animation: pulse 1.2s ease-in-out infinite;
  pointer-events: none;
  text-align: center;
  width: min(520px, 88vw);
  z-index: 7;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

#spectate {
  position: static;
  transform: none;
  width: auto;
  margin: 0;
  animation: none;
  top: auto;
  left: auto;
  bottom: auto;
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(8, 8, 10, 0.82);
}

#duel-banner {
  position: absolute;
  top: calc(52px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border: 1px solid rgba(90, 212, 255, 0.55);
  color: var(--sys);
  font: 800 13px "Rajdhani", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: rgba(6, 14, 22, 0.9);
  pointer-events: none;
  text-align: center;
  width: max-content;
  max-width: min(520px, 88vw);
  z-index: 9;
}

#dead-ui {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 14;
  pointer-events: auto;
  width: min(560px, calc(100vw - 16px));
  padding: 8px;
}

.dead-pass {
  margin: 0;
  font: 800 16px "Rajdhani", sans-serif;
  letter-spacing: 0.08em;
  color: #e7c56a;
}

#dead-ui:not(.hidden) ~ #touch-move,
#dead-ui:not(.hidden) ~ #joy,
#dead-ui:not(.hidden) ~ #atk-wrap,
#dead-ui:not(.hidden) ~ #btn-attack,
#dead-ui:not(.hidden) ~ #btn-dodge,
#dead-ui:not(.hidden) ~ #btn-merge,
#dead-ui:not(.hidden) ~ #btn-duel,
#dead-ui:not(.hidden) ~ #btn-recall {
  visibility: hidden !important;
  pointer-events: none !important;
}

.dead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.dead-actions button {
  pointer-events: auto;
  padding: 10px 14px;
  font: 700 13px "Rajdhani", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--edge);
  background: #10161e;
  color: var(--ink);
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

#btn-restart {
  background: #1a2440;
  border-color: rgba(90, 212, 255, 0.45);
  color: var(--sys);
}

#btn-dead-menu {
  background: #16141a;
  border-color: rgba(201, 180, 138, 0.45);
  color: var(--gold);
}

@keyframes pulse {
  50% {
    opacity: 0.55;
  }
}

#joy {
  pointer-events: auto;
  position: absolute;
  left: 24px;
  bottom: 24px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 1px solid rgba(138, 168, 196, 0.28);
  background: rgba(6, 8, 12, 0.45);
  z-index: 7;
}

#stick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #4a5a70, #121820);
  border: 1px solid rgba(90, 212, 255, 0.35);
}

#atk-wrap {
  pointer-events: none;
  position: absolute;
  right: 22px;
  bottom: 148px;
  width: 100px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#btn-attack {
  pointer-events: auto;
  position: relative;
  right: auto;
  bottom: auto;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 1px solid rgba(226, 59, 74, 0.7);
  background: radial-gradient(circle at 40% 30%, #5a1220, #0a0608);
  color: var(--ink);
  font: 800 10px "Cinzel", serif;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(226, 59, 74, 0.28);
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px 9px;
  line-height: 1.05;
}

#btn-attack .atk-main {
  display: block;
}

#btn-attack .atk-swap {
  display: block;
  margin-top: 4px;
  max-width: 82px;
  font: 700 8px "Rajdhani", sans-serif;
  letter-spacing: 0.01em;
  line-height: 1.12;
  text-transform: none;
  color: #ffe7a8;
  text-shadow: 0 1px 4px #000;
}

#btn-dodge {
  pointer-events: auto;
  position: absolute;
  right: 128px;
  bottom: 148px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 1px solid rgba(90, 212, 160, 0.65);
  background: radial-gradient(circle at 40% 30%, #123a2a, #070a08);
  color: var(--ink);
  font: 800 11px "Cinzel", serif;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(90, 212, 160, 0.28);
  z-index: 7;
  overflow: visible;
  --dodge-off: 0;
}

#btn-dodge .dodge-ring {
  position: absolute;
  inset: -7px;
  width: calc(100% + 14px);
  height: calc(100% + 14px);
  transform: rotate(-90deg);
  pointer-events: none;
}

#btn-dodge .dodge-track,
#btn-dodge .dodge-fill {
  fill: none;
  stroke-width: 6;
}

#btn-dodge .dodge-track {
  stroke: rgba(90, 212, 160, 0.22);
}

#btn-dodge .dodge-fill {
  stroke: #8fe8c0;
  stroke-linecap: round;
  stroke-dasharray: 289;
  stroke-dashoffset: var(--dodge-off);
  filter: drop-shadow(0 0 4px rgba(143, 232, 192, 0.7));
}

#btn-dodge span {
  display: block;
  margin-top: 4px;
  font: 700 10px "Rajdhani", sans-serif;
  color: #8fe8c0;
}

#btn-dodge.ready {
  border-color: #7ff0c0;
  box-shadow: 0 0 22px rgba(90, 212, 160, 0.5);
}

#btn-dodge #dodge-verb {
  display: block;
  margin: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

#btn-dodge.sprint {
  border-color: rgba(255, 196, 70, 0.7);
  background: radial-gradient(circle at 40% 30%, #3a2a10, #0a0806);
}

#btn-dodge.sprint .dodge-fill {
  stroke: #ffd24a;
}

#btn-dodge.sprint.ready {
  border-color: #ffd24a;
  box-shadow: 0 0 22px rgba(255, 210, 70, 0.45);
}

#btn-dodge:disabled {
  opacity: 0.35;
  cursor: default;
}

#btn-merge {
  pointer-events: auto;
  position: absolute;
  right: 128px;
  bottom: 36px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 1px solid rgba(122, 76, 255, 0.7);
  background: radial-gradient(circle at 40% 30%, #2a1450, #080610);
  color: var(--ink);
  font: 800 11px "Cinzel", serif;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(122, 76, 255, 0.32);
  z-index: 7;
}

#btn-merge span {
  display: block;
  margin-top: 4px;
  font: 700 10px "Rajdhani", sans-serif;
  color: #c0b8e8;
}

#btn-merge.ready {
  border-color: #b080ff;
  color: #efe7d6;
  box-shadow: 0 0 22px rgba(176, 128, 255, 0.5);
}

#btn-merge:disabled {
  opacity: 0.35;
  cursor: default;
}

#btn-duel {
  pointer-events: auto;
  position: absolute;
  right: 228px;
  bottom: 48px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 1px solid rgba(231, 197, 106, 0.65);
  background: radial-gradient(circle at 40% 30%, #3a2a10, #0a0806);
  color: var(--gold);
  font: 800 11px "Cinzel", serif;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(231, 197, 106, 0.28);
  z-index: 7;
}

#btn-duel span {
  display: block;
  margin-top: 4px;
  font: 700 10px "Rajdhani", sans-serif;
  color: #e7c56a;
}

#btn-duel.ask {
  border-color: #5ad4ff;
  color: var(--sys);
  box-shadow: 0 0 22px rgba(90, 212, 255, 0.45);
}

#btn-recall {
  pointer-events: auto;
  position: absolute;
  right: 22px;
  bottom: 28px;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 1px solid rgba(90, 212, 255, 0.55);
  background: radial-gradient(circle at 40% 30%, #1a2848, #080a10);
  color: var(--ink);
  font: 800 13px "Cinzel", serif;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(90, 212, 255, 0.28);
  z-index: 7;
}

#btn-recall span {
  display: block;
  margin-top: 4px;
  font: 700 11px "Rajdhani", sans-serif;
  color: var(--gold);
}

#btn-recall.guard {
  border-color: #5ad4ff;
  color: #5ad4ff;
}

.end-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  position: sticky;
  bottom: 0;
}

.end-actions button {
  flex: 1;
  margin-top: 0;
  width: auto;
  padding: 12px 8px;
  font: 700 15px "Rajdhani", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

#btn-end-restart {
  background: linear-gradient(180deg, #1c2838, #10161e);
  color: var(--sys);
  border: 1px solid rgba(90, 212, 255, 0.45);
}

#btn-menu {
  background: linear-gradient(180deg, #2a2218, #14100c);
  color: var(--gold);
  border: 1px solid rgba(201, 180, 138, 0.4);
}

#end-sub {
  color: var(--gold);
}

.end-pass {
  margin: 12px 0 16px;
  padding: 12px 14px 14px;
  background: linear-gradient(180deg, rgba(42, 30, 12, 0.72), rgba(12, 8, 4, 0.88));
  border: 1px solid rgba(201, 180, 138, 0.38);
}

.end-pass-kicker {
  margin: 0;
  font: 700 10px "Rajdhani", sans-serif;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

.end-pass-gain {
  margin: 6px 0 2px;
  font: 800 30px "Rajdhani", sans-serif;
  letter-spacing: 0.04em;
  color: #c9b48a;
  text-shadow: 0 0 8px rgba(180, 150, 80, 0.18);
  line-height: 1;
}

.end-pass-gain.pop {
  animation: endGainPop 0.5s ease-out;
}

@keyframes endGainPop {
  from {
    transform: scale(0.82);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.end-pass-rank,
.end-pass-next {
  margin: 0;
  font: 600 13px "Rajdhani", sans-serif;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.end-pass-bar {
  position: relative;
  height: 12px;
  margin: 10px 0 8px;
  background: #120e08;
  border: 1px solid rgba(90, 212, 255, 0.3);
  overflow: hidden;
}

.end-pass-bar i {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  height: 100%;
  width: 0;
}

.end-pass-bar .pass-bar-old,
.pass-bar .pass-bar-old {
  z-index: 1;
  background: linear-gradient(90deg, #1a4a68, #5ad4ff);
}

.end-pass-bar .pass-bar-gain,
.pass-bar .pass-bar-gain {
  z-index: 2;
  background: linear-gradient(90deg, #6a5428, #b89a62 55%, #c9b48a);
}

.end-pass-unlocks {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.end-pass-unlocks li {
  margin: 4px 0 0;
  font: 800 13px "Rajdhani", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c9b48a;
}

#btn-pass {
  margin: 0 0 14px;
  padding: 10px 18px;
  font: 800 13px "Rajdhani", sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid rgba(90, 212, 255, 0.45);
  background: linear-gradient(180deg, #1c2838, #10161e);
  color: var(--sys);
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.pass-panel {
  width: min(860px, 100%);
  padding: 12px;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--edge);
}

.guide-bot {
  width: min(860px, 100%);
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--edge);
}

.guide-bot .sys-title {
  margin: 0 0 8px;
}

.guide-log {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--edge);
}

.guide-line {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}

.guide-line.me {
  color: var(--muted);
}

.guide-line.bot {
  color: var(--sys);
}

.guide-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.guide-chips button {
  padding: 6px 10px;
  font: 700 11px "Rajdhani", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--btn-fill);
  border: 1px solid var(--edge);
  cursor: pointer;
}

.guide-row {
  display: flex;
  gap: 8px;
}

.guide-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font: 600 14px "Rajdhani", sans-serif;
  color: var(--ink);
  background: var(--btn-fill);
  border: 1px solid var(--edge);
  outline: none;
}

.guide-row button {
  padding: 10px 14px;
  font: 800 12px "Rajdhani", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sys);
  background: var(--btn-fill);
  border: 1px solid var(--edge);
  cursor: pointer;
}

.pass-next,
.pass-lv {
  margin: 2px 0 6px;
  font-size: 13px;
  color: var(--muted);
}

.pass-lv strong,
.pass-next em {
  color: var(--sys);
  font-style: normal;
}

.pass-bar {
  position: relative;
  height: 8px;
  background: #0a0e14;
  border: 1px solid rgba(90, 212, 255, 0.3);
  margin: 6px 0 10px;
  overflow: hidden;
}

.pass-bar i {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  height: 100%;
  width: 0;
}

.pass-gain-flash {
  margin: 4px 0 2px;
  font: 800 22px "Rajdhani", sans-serif;
  letter-spacing: 0.04em;
  color: #c9b48a;
  text-shadow: 0 0 8px rgba(180, 150, 80, 0.16);
  animation: endGainPop 0.55s ease-out;
}

.pass-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}

.pass-tab {
  flex: 1 1 0;
  min-width: 72px;
  padding: 8px 6px;
  font: 700 12px "Rajdhani", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  background: #0a1016;
  border: 1px solid rgba(138, 168, 196, 0.22);
  cursor: pointer;
}

.pass-tab.on {
  color: #05070a;
  background: linear-gradient(180deg, #8fe8ff, #5ad4ff);
  border-color: #5ad4ff;
}

.pass-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.pass-page {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 16px;
  color: var(--sys);
  background: #0a1016;
  border: 1px solid rgba(90, 212, 255, 0.35);
  cursor: pointer;
}

.pass-page:disabled {
  opacity: 0.35;
  cursor: default;
}

.pass-track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 8px;
}

.skin-preview {
  display: block;
  width: 100%;
  height: 152px;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0e141c;
  position: relative;
  overflow: hidden;
  pointer-events: none;
}

.pass-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  padding: 8px;
  background: #0a1016;
  border: 1px solid rgba(138, 168, 196, 0.2);
  color: var(--ink);
  cursor: pointer;
  min-height: 236px;
}

.pass-item:disabled {
  cursor: pointer;
}

.pass-item.locked {
  opacity: 0.82;
  cursor: pointer;
}

.pass-item.on {
  border-color: rgba(90, 212, 255, 0.35);
}

.pass-item.next {
  border-color: rgba(231, 197, 106, 0.7);
  box-shadow: 0 0 14px rgba(231, 197, 106, 0.18);
}

.pass-item.eq {
  border-color: #5ad4ff;
  box-shadow: 0 0 14px rgba(90, 212, 255, 0.25);
}

.pass-item.locked canvas.skin-preview {
  filter: grayscale(0.35) brightness(0.72);
}

.pass-item .pk {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a8494;
}

.pass-item strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.2;
}

.pass-item .ps {
  margin-top: auto;
  font-size: 11px;
  color: #8a94a4;
}

.pass-item .pv {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sys);
}

.pass-loadout {
  margin: 4px 0 6px;
  font-size: 13px;
  color: var(--muted);
}

.pass-loadout strong {
  color: var(--sys);
  font-weight: 800;
}

.pass-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}

#skin-peek {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 12, 0.72);
  padding: 16px;
}

#skin-peek.hidden {
  display: none;
}

.skin-peek-card {
  width: min(460px, 100%);
  padding: 14px 14px 16px;
  background: linear-gradient(180deg, rgba(10, 16, 24, 0.96), rgba(6, 8, 12, 0.98));
  border: 1px solid rgba(90, 212, 255, 0.35);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

#skin-peek-title {
  margin: 0 0 4px;
  font: 800 18px "Rajdhani", sans-serif;
  color: #e8eef6;
}

#skin-peek-status {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}

#skin-peek-view {
  display: block;
  width: 100%;
  height: 300px;
  background: #0e141c;
  border: 1px solid rgba(90, 212, 255, 0.25);
}

.skin-peek-nav {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.skin-peek-nav button {
  flex: 1;
  padding: 8px 10px;
  font: 800 12px "Rajdhani", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid rgba(90, 212, 255, 0.35);
  background: #10161e;
  color: var(--ink);
  cursor: pointer;
}

.skin-peek-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.skin-peek-actions button {
  flex: 1;
  padding: 10px 12px;
  font: 800 13px "Rajdhani", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(90, 212, 255, 0.4);
  background: #121820;
  color: var(--sys);
  cursor: pointer;
}

#skin-peek-eq:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
  margin-top: auto;
  padding-top: 6px;
  font-size: 11px;
  color: var(--gold);
}

.menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.music-credit {
  margin-top: auto;
  padding-top: 20px;
  width: min(860px, 100%);
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0.85;
  pointer-events: auto;
}

.music-credit a {
  color: inherit;
  text-decoration: none;
}

.music-credit a:hover {
  text-decoration: underline;
}

#btn-fs,
#btn-fs-menu,
#btn-mute,
#btn-mute-game,
#btn-sfx,
#btn-sfx-game,
#btn-theme,
#btn-theme-game,
#btn-lang,
#btn-lang-game,
#btn-zoom-game {
  pointer-events: auto;
  touch-action: manipulation;
  border: 1px solid rgba(90, 212, 255, 0.45);
  background: var(--btn-fill);
  color: var(--ink);
  font: 800 12px "Rajdhani", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

#btn-fs-menu,
#btn-mute,
#btn-sfx,
#btn-theme,
#btn-lang {
  padding: 12px 22px;
  font-size: 14px;
}

#top-controls {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  top: calc(8px + env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 8px;
  max-width: min(920px, calc(100vw - 24px));
}

#hud > #btn-fs,
#btn-fs,
#btn-mute-game,
#btn-sfx-game,
#btn-theme-game,
#btn-lang-game,
#btn-zoom-game {
  pointer-events: auto;
  display: block;
  position: relative;
  left: auto;
  top: auto;
  right: auto;
  bottom: auto;
  transform: none;
  z-index: auto;
  margin: 0;
  padding: 6px 14px 5px;
  min-width: 104px;
  width: auto;
  border: 1px solid rgba(90, 212, 255, 0.45);
  background: rgba(6, 14, 22, 0.92);
  color: var(--sys);
  font: 700 11px "Rajdhani", sans-serif;
  letter-spacing: 0.18em;
  text-shadow: 0 0 8px rgba(90, 212, 255, 0.45);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), inset 0 0 12px rgba(90, 212, 255, 0.08);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

#btn-fs span {
  display: block;
  margin-top: 1px;
  font: 700 8px "Rajdhani", sans-serif;
  letter-spacing: 0.16em;
  color: #7ec8e8;
  text-shadow: none;
}

#touch-move {
  display: none;
}

@media (pointer: coarse), (max-width: 900px) {
  .hint,
  #btn-fs span,
  #btn-dodge > span:not(#dodge-verb),
  #btn-merge span,
  #btn-duel span,
  #btn-recall span {
    display: none !important;
  }

  #touch-move {
    display: block;
    position: absolute;
    left: 0;
    top: 22%;
    width: 46%;
    bottom: 0;
    z-index: 6;
    pointer-events: auto;
    touch-action: none;
  }

  #sys-window {
    width: min(156px, 36vw);
    padding: 6px 8px 8px;
    font-size: 10px;
    top: calc(8px + env(safe-area-inset-top));
    left: 8px;
    max-height: 44vh;
    overflow: hidden;
  }

  #sys-title {
    display: none;
  }

  #hud-army,
  #hud-stance {
    display: none;
  }

  #hud-power {
    font-size: 13px;
  }

  #hud-power .wep-on {
    font-size: 1em;
  }

  #hud-right {
    top: calc(8px + env(safe-area-inset-top));
    right: 8px;
    width: 78px;
    max-width: 22vw;
  }

  #top-controls {
    left: 50%;
    top: calc(8px + env(safe-area-inset-top));
    transform: translateX(-50%);
    z-index: 60;
  }

  #sys-window #btn-fs,
  #hud > #btn-fs,
  #btn-fs,
  #btn-mute-game,
  #btn-sfx-game,
  #btn-theme-game,
  #btn-lang-game,
  #btn-zoom-game {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: auto;
    min-width: 72px;
    margin: 0;
    padding: 6px 12px 5px;
    font-size: 11px;
    letter-spacing: 0.16em;
    z-index: auto;
  }

  #timer,
  #alive {
    font-size: 10px;
    letter-spacing: 0.04em;
    line-height: 1.2;
  }

  .timer-label,
  .alive-label {
    display: none;
  }

  #minimap {
    width: 68px;
    height: 68px;
    margin-top: 4px;
  }

  #radar-legend {
    display: none;
  }

  #joy {
    left: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: 96px;
    height: 96px;
    z-index: 7;
  }

  #atk-wrap {
    right: 10px;
    bottom: calc(122px + env(safe-area-inset-bottom));
    width: 72px;
  }

  #btn-attack {
    width: 72px;
    height: 72px;
    font-size: 7px;
    padding: 5px 4px;
  }

  #btn-attack .atk-swap {
    max-width: 62px;
    font-size: 6px;
    margin-top: 2px;
  }

  #btn-dodge {
    right: 80px;
    bottom: calc(122px + env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    font-size: 8px;
  }

  #btn-merge {
    right: 80px;
    bottom: calc(52px + env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    font-size: 8px;
  }

  #btn-duel {
    right: 148px;
    bottom: calc(52px + env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    font-size: 8px;
  }

  #btn-recall {
    right: 10px;
    bottom: calc(52px + env(safe-area-inset-bottom));
    width: 64px;
    height: 64px;
    font-size: 9px;
  }

  #dead-ui {
    bottom: 8px;
  }

  body.is-fs #joy,
  #game:fullscreen #joy,
  #game:-webkit-full-screen #joy {
    left: 16px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: 124px;
    height: 124px;
  }

  body.is-fs #atk-wrap,
  #game:fullscreen #atk-wrap,
  #game:-webkit-full-screen #atk-wrap {
    right: 14px;
    bottom: calc(118px + env(safe-area-inset-bottom));
    width: 86px;
  }

  body.is-fs #btn-attack,
  #game:fullscreen #btn-attack,
  #game:-webkit-full-screen #btn-attack {
    width: 86px;
    height: 86px;
  }

  body.is-fs #btn-dodge,
  #game:fullscreen #btn-dodge,
  #game:-webkit-full-screen #btn-dodge {
    right: 106px;
    bottom: calc(118px + env(safe-area-inset-bottom));
    width: 70px;
    height: 70px;
  }

  body.is-fs #btn-merge,
  #game:fullscreen #btn-merge,
  #game:-webkit-full-screen #btn-merge {
    right: 106px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: 70px;
    height: 70px;
  }

  body.is-fs #btn-duel,
  #game:fullscreen #btn-duel,
  #game:-webkit-full-screen #btn-duel {
    right: 186px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: 64px;
    height: 64px;
  }

  body.is-fs #btn-recall,
  #game:fullscreen #btn-recall,
  #game:-webkit-full-screen #btn-recall {
    right: 14px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: 78px;
    height: 78px;
  }

  body.is-fs #hud-right,
  #game:fullscreen #hud-right,
  #game:-webkit-full-screen #hud-right {
    width: min(272px, 38vw);
    max-width: 42vw;
  }

  body.is-fs #minimap,
  #game:fullscreen #minimap,
  #game:-webkit-full-screen #minimap {
    width: min(272px, 38vw, calc(100dvh - 220px));
    height: min(272px, 38vw, calc(100dvh - 220px));
  }
}

/* GIVRE */
body[data-decor="givre"] {
  --bg: #071820;
  --ink: #d5eef8;
  --muted: #7aa4b8;
  --steel: #8ec8e0;
  --deep: #041018;
  --sys: #7ce8ff;
  --edge: rgba(120, 210, 255, 0.32);
  --menu-glow: rgba(90, 200, 255, 0.22);
  --menu-ember: rgba(20, 70, 110, 0.32);
  --menu-top: #123044;
  --menu-mid: #0a1c28;
  --menu-bot: #061018;
  --grid: rgba(140, 220, 255, 0.07);
  --h1: #e8f6ff;
  --h1-glow: rgba(120, 210, 255, 0.3);
  --panel-a: rgba(10, 28, 40, 0.94);
  --panel-b: rgba(4, 12, 18, 0.96);
  --btn-fill: rgba(8, 22, 32, 0.9);
  --view-fill: #061018;
  --overlay: rgba(4, 10, 16, 0.8);
  --sys-glow: rgba(124, 232, 255, 0.4);
}

/* MARRON */
body[data-decor="marron"],
body[data-decor="archive-marron"] {
  --bg: #1a120c;
  --ink: #eadcc8;
  --muted: #9a8470;
  --steel: #c4a070;
  --deep: #120c08;
  --sys: #e7c56a;
  --edge: rgba(201, 180, 138, 0.32);
  --menu-glow: rgba(201, 150, 70, 0.22);
  --menu-ember: rgba(120, 40, 16, 0.28);
  --menu-top: #2a1c12;
  --menu-mid: #1a120c;
  --menu-bot: #120c08;
  --grid: rgba(231, 197, 106, 0.05);
  --h1: #eadcc8;
  --h1-glow: rgba(231, 197, 106, 0.28);
  --panel-a: rgba(22, 16, 12, 0.94);
  --panel-b: rgba(8, 6, 4, 0.96);
  --btn-fill: rgba(18, 12, 8, 0.88);
  --view-fill: #1a1410;
  --overlay: rgba(12, 8, 6, 0.78);
  --sys-glow: rgba(231, 197, 106, 0.35);
}

/* CLAIR */
body[data-decor="clair"],
body[data-decor="archive-clair"],
body.theme-light {
  --bg: #6e7786;
  --ink: #e6edf4;
  --muted: #c2cad4;
  --gold: #c9b48a;
  --steel: #9eb0c4;
  --deep: #5a6372;
  --sys: #5ad4ff;
  --edge: rgba(90, 212, 255, 0.28);
  --menu-glow: rgba(90, 212, 255, 0.16);
  --menu-ember: rgba(201, 180, 138, 0.1);
  --menu-top: #5c6574;
  --menu-mid: #4a5260;
  --menu-bot: #3e4552;
  --grid: rgba(90, 212, 255, 0.08);
  --h1: #e8eef6;
  --h1-glow: rgba(90, 212, 255, 0.22);
  --panel-a: rgba(90, 99, 112, 0.94);
  --panel-b: rgba(70, 78, 90, 0.96);
  --btn-fill: rgba(52, 60, 72, 0.92);
  --view-fill: #4a5360;
  --overlay: rgba(40, 46, 56, 0.78);
  --sys-glow: rgba(90, 212, 255, 0.4);
  color: var(--ink);
  background: var(--bg);
}

body[data-decor="clair"] .skin-peek-card,
body[data-decor="archive-clair"] .skin-peek-card,
body.theme-light .skin-peek-card {
  background: linear-gradient(180deg, #5a6370, #464e5a);
  border-color: rgba(90, 212, 255, 0.28);
}

body[data-decor="clair"] .pass-tab,
body[data-decor="clair"] .pass-page,
body[data-decor="clair"] .pass-item,
body[data-decor="archive-clair"] .pass-tab,
body[data-decor="archive-clair"] .pass-page,
body[data-decor="archive-clair"] .pass-item,
body.theme-light .pass-tab,
body.theme-light .pass-page,
body.theme-light .pass-item {
  background: #3e4650;
  border-color: rgba(90, 212, 255, 0.28);
}

body[data-decor="clair"] .pass-tab.on,
body[data-decor="archive-clair"] .pass-tab.on,
body.theme-light .pass-tab.on {
  color: #0a1016;
  background: linear-gradient(180deg, #b8f0ff, #5ad4ff);
}

body[data-decor="clair"] #minimap,
body[data-decor="archive-clair"] #minimap,
body.theme-light #minimap {
  background: rgba(50, 58, 68, 0.92);
  border-color: rgba(90, 212, 255, 0.4);
}

body[data-decor="clair"] #hud-name,
body[data-decor="clair"] #hud-class,
body[data-decor="clair"] #hud-power,
body[data-decor="clair"] #hud-lvl,
body[data-decor="clair"] #hud-hp,
body[data-decor="clair"] #hud-xp,
body[data-decor="clair"] #hud-army,
body[data-decor="clair"] #hud-stance,
body[data-decor="clair"] #radar-legend,
body[data-decor="clair"] #timer,
body[data-decor="clair"] #alive,
body[data-decor="archive-clair"] #hud-name,
body[data-decor="archive-clair"] #hud-class,
body[data-decor="archive-clair"] #hud-power,
body[data-decor="archive-clair"] #hud-lvl,
body[data-decor="archive-clair"] #hud-hp,
body[data-decor="archive-clair"] #hud-xp,
body[data-decor="archive-clair"] #hud-army,
body[data-decor="archive-clair"] #hud-stance,
body[data-decor="archive-clair"] #radar-legend,
body[data-decor="archive-clair"] #timer,
body[data-decor="archive-clair"] #alive,
body.theme-light #hud-name,
body.theme-light #hud-class,
body.theme-light #hud-power,
body.theme-light #hud-lvl,
body.theme-light #hud-hp,
body.theme-light #hud-xp,
body.theme-light #hud-army,
body.theme-light #hud-stance,
body.theme-light #radar-legend,
body.theme-light #timer,
body.theme-light #alive {
  color: #e8eef6;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.45);
}
