@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=Cormorant+Garamond:wght@700&family=Inter:wght@500;600;700;800;900&display=swap");

:root {
  color-scheme: dark;
  --font-ui: "Inter", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --font-title: "Cinzel", "Trajan Pro", Georgia, serif;
  --font-logo: "Cormorant Garamond", Georgia, serif;
  --bg: #111318;
  --panel: #191d24;
  --panel-2: #202631;
  --ink: #f3efe6;
  --muted: #aab2bf;
  --gold: #f0b84f;
  --red: #ef6262;
  --green: #67d99a;
  --blue: #6db4ff;
  --violet: #b37cff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 20% 10%, #253041 0, #111318 36%, #0b0d11 100%);
  color: var(--ink);
  font-family: var(--font-ui);
}

body {
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-x: hidden;
}

.shell {
  width: min(1180px, 100%);
  display: grid;
  gap: 12px;
}

.hud,
.controls {
  background: rgba(25, 29, 36, .92);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .34);
}

.hud {
  min-height: 78px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 2fr;
  gap: 14px;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sigil {
  width: 64px;
  height: 64px;
  display: block;
  border-radius: 7px;
  object-fit: contain;
  background: #000;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  flex: 0 0 auto;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: 0;
}

.brand p,
.hint,
.stats span {
  color: var(--muted);
  font-size: 13px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(108px, 1fr));
  gap: 8px;
}

.stats div {
  min-height: 48px;
  padding: 8px 10px;
  background: var(--panel-2);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 7px;
  display: grid;
  align-content: center;
  gap: 2px;
}

.stats b {
  font-size: 15px;
  white-space: nowrap;
}

.game-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 178px);
  min-height: 360px;
  background: #090b0f;
  border: 1px solid rgba(255, 255, 255, .1);
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: auto;
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

body.app-fullscreen {
  padding: 0;
  overflow: hidden;
}

body.app-fullscreen .shell {
  width: 100vw;
  height: 100dvh;
  gap: 0;
}

body.app-fullscreen .hud,
body.app-fullscreen .controls {
  display: none;
}

body.app-fullscreen .game-wrap {
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  max-height: none;
  border: 0;
}

.mobile-stick,
.mobile-actions {
  display: none;
  position: absolute;
  pointer-events: none;
  z-index: 3;
}

.mobile-stick {
  left: 18px;
  bottom: 18px;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 2px solid rgba(187, 247, 208, .34);
  background: rgba(9, 13, 18, .34);
}

.mobile-stick span {
  position: absolute;
  inset: 35px;
  border-radius: 50%;
  background: rgba(240, 184, 79, .55);
  box-shadow: 0 0 24px rgba(240, 184, 79, .35);
}

.mobile-actions {
  right: 16px;
  bottom: 16px;
  grid-template-columns: 62px 62px 62px;
  grid-template-rows: 62px 62px;
  gap: 10px;
  align-items: center;
}

.mobile-actions button {
  pointer-events: auto;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(240, 184, 79, .9);
  color: #14171d;
  font-size: 11px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .36);
}

#mobileAttackBtn {
  grid-row: 1 / span 2;
  width: 74px;
  height: 74px;
  align-self: end;
  background: rgba(239, 98, 98, .92);
  color: #fff;
}

#mobileDashBtn {
  background: rgba(103, 217, 154, .92);
}

#mobileAbilityBtn {
  background: rgba(179, 124, 255, .94);
  color: #fff;
}

#mobileInteractBtn {
  grid-column: 3;
  grid-row: 1 / span 2;
  background: rgba(240, 184, 79, .94);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  justify-items: center;
  align-items: center;
  padding: 18px;
  background: rgba(7, 9, 13, .58);
  backdrop-filter: blur(3px);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.overlay:has(.character-panel) {
  padding: clamp(8px, 1.4vh, 18px);
  overflow: hidden;
  touch-action: none;
}

.overlay.hidden {
  display: none;
}

.panel {
  width: min(700px, 100%);
  max-height: calc(100% - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px;
  background: rgba(25, 29, 36, .96);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .52);
}

.panel h2 {
  font-size: 30px;
  line-height: 1.05;
  margin-bottom: 10px;
}

.panel p,
.overlay-text {
  color: #d7dbe2;
  line-height: 1.55;
  margin-bottom: 18px;
}

.loading-screen {
  position: relative;
  min-height: 280px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.loading-mark {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 4px solid rgba(240, 184, 79, .18);
  border-top-color: var(--gold);
  border-right-color: var(--green);
  box-shadow: 0 0 34px rgba(240, 184, 79, .22);
  animation: loading-spin .9s linear infinite;
}

.loading-copy {
  display: grid;
  gap: 8px;
  max-width: 520px;
}

.loading-copy b {
  color: var(--ink);
  font-size: 18px;
}

.loading-copy span {
  color: #bfc7d4;
  font-size: 14px;
}

.loading-bar {
  width: min(420px, 100%);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.loading-bar span {
  display: block;
  width: 44%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
  animation: loading-sweep 1.25s ease-in-out infinite;
}

.loading-corner {
  position: fixed;
  right: 24px;
  bottom: 18px;
  color: #f3efe6;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .65);
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

@keyframes loading-sweep {
  0% { transform: translateX(-115%); }
  55%, 100% { transform: translateX(235%); }
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.panel.auth-panel {
  width: min(430px, 100%);
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(147, 116, 72, .44);
  background:
    linear-gradient(180deg, rgba(10, 12, 17, .86), rgba(6, 7, 10, .96)),
    url("assets/lobby_lord_seven_gates_bg.png?v=20260701ftl1") center / cover;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .78), inset 0 0 70px rgba(120, 18, 24, .18);
}

.panel.auth-panel .overlay-text {
  margin: 0;
}

.login-frame {
  min-height: 430px;
  padding: 20px 34px;
  display: grid;
  align-content: center;
  gap: 13px;
  background:
    radial-gradient(circle at 50% 0, rgba(188, 142, 72, .20), transparent 34%),
    linear-gradient(180deg, rgba(5, 6, 9, .48), rgba(5, 6, 9, .88));
}

.login-emblem {
  width: 72px;
  height: 72px;
  margin: 0 auto 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 184, 79, .18), rgba(8, 10, 15, .92) 62%);
  border: 1px solid rgba(188, 142, 72, .48);
  box-shadow: 0 0 34px rgba(120, 18, 24, .36), inset 0 0 28px rgba(0, 0, 0, .42);
}

.login-emblem span {
  color: #f4e8ca;
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 900;
}

.login-copy {
  display: grid;
  gap: 6px;
  text-align: center;
}

.login-copy span {
  color: #bc8e48;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-copy b {
  color: #f3efe6;
  font-family: var(--font-logo);
  font-size: 36px;
  line-height: .95;
  font-weight: 700;
  text-shadow: 0 8px 26px rgba(0, 0, 0, .82);
}

.login-copy small {
  color: #bfc7d4;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.38;
}

.login-form {
  margin-top: 2px;
  gap: 9px;
}

.login-form label {
  display: grid;
  gap: 6px;
}

.login-form label span {
  color: #bc8e48;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-form input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 7px;
  background: #111722;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}

.auth-panel .auth-form input {
  min-height: 42px;
  border-color: rgba(147, 116, 72, .26);
  background: rgba(7, 9, 13, .82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.auth-panel .auth-form input:focus {
  outline: none;
  border-color: rgba(240, 184, 79, .74);
  box-shadow: 0 0 0 3px rgba(240, 184, 79, .12);
}

.auth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-panel .auth-row {
  gap: 10px;
}

.auth-panel .auth-row button {
  min-height: 40px;
  color: #0b0d11;
  background: linear-gradient(135deg, #b9904d, #f0b84f);
}

.auth-panel .auth-row button:last-child {
  color: #f3efe6;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .12);
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.class-card {
  min-height: 104px;
  padding: 10px;
  background: #202631;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .1);
  text-align: left;
}

.class-card-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}

.class-card-head b {
  font-size: 14px;
}

.class-card.active {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.class-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

.character-select {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

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

.character-card {
  min-height: 88px;
  padding: 12px;
  background: #202631;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .1);
  text-align: left;
}

.character-card.active {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.character-card b,
.character-card span,
.character-card small {
  display: block;
}

.character-card span {
  margin-top: 6px;
  color: #d7dbe2;
  font-size: 13px;
}

.character-card small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.character-actions {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px;
  align-items: center;
}

.character-actions button {
  min-height: 38px;
  padding: 0 14px;
  background: #252d39;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .1);
}

.character-actions button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.character-actions span {
  color: var(--muted);
  font-size: 13px;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 10px;
}

.character-slot {
  min-height: 238px;
  padding: 12px;
  background: #202631;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 7px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
}

.character-slot.empty {
  align-content: center;
  border-style: dashed;
}

.slot-title {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.empty-slot {
  min-height: 122px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.character-slot-main {
  display: grid;
  grid-template-columns: 98px 1fr;
  gap: 10px;
  align-items: start;
}

.character-slot-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.character-slot-info b {
  font-size: 17px;
}

.character-slot-info span {
  color: #d7dbe2;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.character-sprite {
  width: 70px;
  height: 92px;
  position: relative;
  border-radius: 7px;
  background: rgba(9, 13, 18, .7);
  border: 1px solid rgba(255, 255, 255, .1);
  image-rendering: auto;
}

.skin-preview {
  display: inline-block;
  border-radius: 7px;
  background-color: rgba(9, 13, 18, .7);
  background-repeat: no-repeat;
  image-rendering: auto;
  border: 1px solid rgba(255, 255, 255, .1);
  flex: 0 0 auto;
}

.skin-preview.small {
  background-color: rgba(9, 13, 18, .45);
}

.skin-preview.large {
  width: 95px;
  height: 69px;
  align-self: start;
}

.character-sprite::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 13px;
  width: 20px;
  height: 18px;
  background: #d9a679;
  box-shadow: 0 18px 0 #f0b84f, 0 36px 0 #4a515d, -14px 22px 0 #d9a679, 14px 22px 0 #d9a679, -8px 55px 0 #242936, 8px 55px 0 #242936;
}

.character-sprite::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 32px;
  width: 38px;
  height: 34px;
  background: rgba(240, 184, 79, .28);
  border: 2px solid rgba(240, 184, 79, .75);
}

.character-sprite.mage::after {
  background: rgba(179, 124, 255, .32);
  border-color: rgba(179, 124, 255, .82);
}

.character-sprite.hunter::after {
  background: rgba(103, 217, 154, .28);
  border-color: rgba(103, 217, 154, .78);
}

.character-sprite.priest::after {
  background: rgba(255, 224, 131, .30);
  border-color: rgba(255, 224, 131, .85);
}

.character-sprite.necromancer::after {
  background: rgba(143, 88, 214, .32);
  border-color: rgba(184, 242, 210, .78);
}

.character-sprite.paladin::after {
  background: rgba(109, 180, 255, .30);
  border-color: rgba(215, 239, 255, .85);
}

.character-sprite span {
  position: absolute;
  right: 9px;
  bottom: 13px;
  width: 8px;
  height: 34px;
  background: #d1c4a5;
  transform: rotate(38deg);
}

.character-sprite.mage span {
  width: 7px;
  height: 44px;
  background: #b37cff;
  transform: rotate(18deg);
}

.character-sprite.hunter span {
  width: 34px;
  height: 8px;
  right: 5px;
  bottom: 28px;
  background: #67d99a;
  transform: rotate(-32deg);
}

.character-sprite.priest span {
  width: 8px;
  height: 38px;
  background: #ffe083;
  transform: rotate(10deg);
}

.character-sprite.necromancer span {
  width: 7px;
  height: 42px;
  background: #b8f2d2;
  transform: rotate(24deg);
}

.character-sprite.paladin span {
  width: 14px;
  height: 30px;
  right: 7px;
  bottom: 14px;
  background: #d7efff;
  transform: rotate(42deg);
}

.slot-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.slot-actions button,
.create-slot-btn {
  min-height: 38px;
  padding: 0 12px;
}

button.danger {
  background: var(--red);
  color: #fff;
}

.slot-footer {
  color: var(--muted);
  font-size: 13px;
}

.panel.character-panel {
  width: min(1180px, 100%);
  height: calc(100% - 4px);
  max-height: calc(100% - 4px);
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 225, 225, .30);
  background: #05050a;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .82), inset 0 0 86px rgba(190, 28, 35, .16);
}

.panel.character-panel h2,
.panel.character-panel > button {
  display: none !important;
}

.panel.character-panel .overlay-text {
  height: 100%;
  margin-bottom: 0;
  overflow: hidden;
}

.stage-select {
  height: 100%;
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 286px);
  gap: 0;
}

.select-stage {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(24, 6, 8, .70), rgba(24, 6, 8, .10) 44%, rgba(24, 6, 8, .70)),
    linear-gradient(180deg, rgba(15, 8, 8, .16), rgba(18, 5, 7, .66)),
    url("assets/lobby_seven_colored_gates_lord_clean_bg.png?v=20260701ftl1") center / cover;
}

.select-stage::before {
  display: none;
}

.select-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 55%;
  width: min(430px, 52%);
  height: 210px;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(8, 4, 5, .96) 0%, rgba(12, 4, 5, .90) 38%, rgba(23, 5, 7, .52) 68%, transparent 100%);
  filter: blur(2px);
}

.select-title {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 22px;
  z-index: 5;
  color: #f3efe6;
  font-family: var(--font-logo);
  font-size: clamp(30px, 4.4vw, 58px);
  font-weight: 700;
  line-height: .95;
  letter-spacing: 0;
  text-align: center;
  text-transform: none;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .96), 0 0 22px rgba(255, 225, 225, .30);
}

.select-panel {
  background: linear-gradient(135deg, rgba(26, 10, 12, .84), rgba(76, 18, 24, .56));
  border: 1px solid rgba(255, 225, 225, .24);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255, 255, 255, .055), 0 0 22px rgba(190, 28, 35, .14);
  backdrop-filter: blur(8px);
}

.select-hero-copy {
  position: absolute;
  left: 28px;
  top: 106px;
  width: min(310px, calc(100% - 56px));
  padding: 0;
  z-index: 4;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.select-hero-copy span,
.select-account span,
.selected-hero-panel span {
  display: block;
  color: #f3efe6;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  font-family: var(--font-title);
  letter-spacing: 0;
}

.select-hero-copy span,
.selected-hero-panel span {
  color: #f3efe6;
}

.select-hero-copy span {
  font-size: clamp(24px, 3.2vw, 42px);
  line-height: .98;
  text-transform: none;
  text-shadow: 0 5px 22px rgba(0, 0, 0, .95), 0 0 22px rgba(255, 238, 238, .32);
}

.select-hero-copy b {
  display: block;
  margin-top: 8px;
  color: #fff7df;
  font-family: var(--font-title);
  font-size: 30px;
  line-height: 1.02;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .86);
}

.select-hero-copy small {
  display: none;
}

.select-circle {
  position: absolute;
  left: 50%;
  top: 63%;
  width: 240px;
  height: 260px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  z-index: 3;
}

.select-ring {
  display: none;
}

.select-hero {
  position: relative;
  left: auto;
  top: auto;
  width: 168px;
  min-height: 210px;
  padding: 0;
  transform: scale(var(--hero-scale));
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 8px;
  color: #f3efe6;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  animation: heroIdle 3.6s ease-in-out infinite;
  animation-delay: calc(var(--hero-x) * -0.006s);
}

.select-hero.active {
  filter: drop-shadow(0 0 18px rgba(255, 225, 225, .42));
}

.select-hero-sigil {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 44px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 225, 225, .24), transparent 70%);
  z-index: -1;
}

.select-hero .skin-preview.large {
  width: 95px !important;
  height: 69px !important;
  background-color: transparent;
  background-repeat: no-repeat;
  border: 0;
  overflow: hidden;
  transform: scale(1.58);
  margin: 28px 0 28px;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .54));
}

.select-hero b {
  display: block;
  max-width: 190px;
  color: #f3efe6;
  font-family: var(--font-title);
  font-size: 24px;
  line-height: 1;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow: 0 5px 22px rgba(0, 0, 0, .95), 0 0 18px rgba(255, 238, 238, .28);
}

.select-hero small {
  display: none;
}

@keyframes heroIdle {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -6px; }
}

.selected-hero-panel {
  display: none;
}

.selected-hero-panel b {
  display: block;
  font-family: var(--font-title);
  font-size: 28px;
  line-height: 1.05;
}

.selected-hero-panel small,
.select-account small {
  color: #f3efe6;
  font-weight: 800;
}

.selected-hero-panel p {
  margin-top: 7px;
  color: #f3efe6;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.42;
  max-width: 660px;
}

.selected-stat-row {
  display: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.selected-stat-row span {
  min-height: 28px;
  padding: 7px 9px;
  color: #f3efe6;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: 6px;
  text-transform: none;
  font-family: var(--font-ui);
  white-space: nowrap;
}

.select-roster {
  min-height: 0;
  padding: 18px 16px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 12px;
  background: linear-gradient(180deg, rgba(12, 7, 9, .95), rgba(28, 8, 11, .94));
  border-left: 1px solid rgba(255, 225, 225, .18);
}

.select-account {
  padding: 10px 12px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 225, 225, .16);
  border-radius: 8px;
}

.select-account b {
  display: block;
  color: #f3efe6;
  font-family: var(--font-title);
  font-size: 18px;
  line-height: 1;
}

.select-name-list {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 0;
  overflow: hidden;
}

.select-name-row {
  min-height: 40px;
  padding: 6px 10px;
  display: grid;
  align-content: center;
  gap: 2px;
  text-align: left;
  color: #f3efe6;
  background: linear-gradient(135deg, rgba(255, 255, 255, .052), rgba(120, 18, 24, .045));
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: 7px;
}

.select-name-row.active {
  border-color: rgba(255, 225, 225, .60);
  background: linear-gradient(135deg, rgba(190, 28, 35, .24), rgba(92, 18, 22, .18));
}

.select-name-row.empty {
  border-style: dashed;
  color: #aab2bf;
}

.select-name-row b {
  font-family: var(--font-title);
  font-size: 14px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.select-name-row small {
  color: #aab2bf;
  font-size: 9px;
  font-weight: 800;
}

.select-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.select-actions button:first-child {
  grid-column: 1 / -1;
  min-height: 40px;
  background: linear-gradient(135deg, rgba(145, 22, 28, .92), rgba(255, 238, 238, .22));
  color: #f7f2ff;
  border: 1px solid rgba(255, 238, 238, .28);
}

.select-actions button {
  min-height: 36px;
  color: #f7f2ff;
  background: linear-gradient(135deg, rgba(42, 12, 16, .94), rgba(84, 20, 25, .88));
  border: 1px solid rgba(255, 225, 225, .18);
}

.select-actions button.danger {
  background: linear-gradient(135deg, rgba(42, 12, 16, .94), rgba(84, 20, 25, .88));
  color: #f7f2ff;
  border: 1px solid rgba(255, 225, 225, .18);
}

.select-empty-stage {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  color: #d7dbe2;
  font-weight: 900;
}

.select-no-characters {
  padding: 14px;
  color: #aab2bf;
  font-weight: 800;
  background: rgba(255, 255, 255, .045);
  border: 1px dashed rgba(255, 255, 255, .12);
  border-radius: 7px;
}

.auth-error {
  min-height: 20px;
  color: #ffb4b4;
  font-size: 13px;
}

button {
  border: 0;
  border-radius: 7px;
  color: #14171d;
  background: var(--gold);
  font-weight: 800;
  cursor: pointer;
}

#primaryBtn {
  min-width: 136px;
  min-height: 44px;
  padding: 0 18px;
  font-size: 15px;
}

.controls {
  min-height: 52px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 34px;
  background: #252d39;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .1);
  font-size: 13px;
}

.hint {
  margin-left: 4px;
  overflow-wrap: anywhere;
}

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

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

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

  .game-wrap {
    min-height: min(78dvh, 560px);
    aspect-ratio: 16 / 9;
    max-height: none;
  }

  .panel {
    padding: 18px;
  }

  .panel.character-panel {
    padding: 0;
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    max-height: calc(100% - 6px);
  }

  .stage-select {
    height: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .select-stage {
    min-height: 0;
    height: 100%;
  }

  .select-title {
    left: 16px;
    right: 16px;
    top: 12px;
    font-size: clamp(26px, 8vw, 34px);
  }

  .select-hero-copy {
    left: 16px;
    top: 50px;
    width: calc(100% - 32px);
    padding: 0;
  }

  .select-hero-copy span {
    font-size: 22px;
  }

  .select-hero-copy small {
    font-size: 11px;
  }

  .select-circle {
    left: 50%;
    width: 150px;
    height: 210px;
    top: 60%;
    transform: translate(-50%, -50%);
    gap: 6px;
  }

  .select-hero {
    width: 132px;
    min-height: 176px;
  }

  .select-hero .skin-preview.large {
    width: 95px !important;
    height: 69px !important;
    transform: scale(1.18);
    margin: 10px 0 14px;
  }

  .select-hero b {
    display: block;
    font-size: 18px;
  }

  .select-hero small {
    font-size: 9px;
  }

  .selected-hero-panel {
    display: none;
  }

  .selected-hero-panel b {
    font-size: 19px;
  }

  .selected-hero-panel p {
    font-size: 10px;
    line-height: 1.28;
  }

  .selected-stat-row {
    display: none;
  }

  .select-roster {
    max-height: 210px;
    padding: 10px 12px;
    border-left: 0;
    border-top: 1px solid rgba(255, 225, 225, .18);
  }

  .select-name-list {
    display: none;
  }

  .select-actions {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .select-actions button:first-child {
    grid-column: auto;
  }

  .panel h2 {
    font-size: 24px;
  }

  .class-grid,
  .character-grid,
  .slot-grid {
    grid-template-columns: 1fr;
  }

  .character-actions {
    grid-template-columns: 1fr;
  }
}

@media (pointer: coarse) {
  .mobile-stick {
    display: block;
  }

  .mobile-actions {
    display: grid;
  }
}
