* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #08131f;
  color: #f3f7ff;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

#silk-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

#silk-bg canvas {
  width: 100%;
  height: 100%;
  display: block;
}

button,
input {
  font: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px;
}

.hero-copy h1 {
  margin: 0 0 6px;
  font-size: 34px;
}

.hero-copy p {
  margin: 0 0 18px;
  color: #bfd2ef;
}

.game-shell {
  position: relative;
  width: 100%;
  max-width: 1280px;
  min-height: 720px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  overflow: hidden;
  background: #050b14;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
}

#game {
  position: relative;
  z-index: 1;
}

#game canvas {
  display: block;
}

#toast {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-card {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(8, 14, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  min-width: 220px;
}

.toast-card.success {
  border-color: rgba(107, 213, 146, 0.7);
}

.toast-card.warning {
  border-color: rgba(255, 181, 92, 0.7);
}

.ui-shell {
  margin-top: 16px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(12, 21, 34, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.ui-shell:empty {
  display: none;
}

.menu-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: none;
  pointer-events: none;
}

.menu-overlay.is-active {
  display: block;
}

.turn-overlay {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -8px);
  z-index: 11;
  display: block;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    visibility 0s linear 220ms;
  pointer-events: none;
  text-align: center;
}

.turn-overlay.is-active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    visibility 0s linear 0s;
}

.turn-overlay .turn-banner-image {
  margin: 0;
  width: min(70vw, 440px);
}

.turn-overlay .small-copy {
  margin-top: 6px;
}

.top-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 11;
  display: none;
  pointer-events: none;
}

.top-hud.is-active {
  display: block;
}

.top-hud-stats {
  width: 240px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(6, 14, 24, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.top-hud-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-hud-chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  color: #e8f2ff;
}

.top-hud-xp-wrap {
  margin-top: 8px;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.top-hud-xp-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #68d0ff 0%, #85f2ba 100%);
}

.top-hud-xp-label {
  margin: 6px 0 0;
  font-size: 12px;
  color: #b7cee9;
}

.top-hud-item-slot {
  margin-top: 8px;
  width: 64px;
  height: 12px;
  border-radius: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.04);
}

.party-hud-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 260px;
}

.party-hud-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(6, 14, 24, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.party-hud-card.is-self {
  align-items: flex-start;
  border-color: rgba(255, 220, 120, 0.55);
  background: rgba(20, 18, 8, 0.85);
}

.party-hud-card.is-self .party-hud-icon {
  width: 44px;
  height: 44px;
}

.party-hud-card.is-down {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.party-hud-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  object-fit: cover;
  image-rendering: pixelated;
  flex: 0 0 auto;
}

.party-hud-icon.party-hud-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f3f7ff;
  font-weight: 600;
  font-size: 16px;
}

.party-hud-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.party-hud-name-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.party-hud-nickname {
  font-size: 13px;
  color: #ffffff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.party-hud-classname {
  font-size: 11px;
  color: #9db4d3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.party-hud-hp-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.party-hud-hp-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5cc788 0%, #8ff3b5 100%);
  transition: width 0.2s ease;
}

.party-hud-hp-text {
  margin: 0;
  font-size: 11px;
  color: #cfe0f4;
  line-height: 1.1;
}

.party-hud-self-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.party-hud-self-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.party-hud-self-stats .top-hud-chip {
  font-size: 11px;
  padding: 2px 6px;
}

.party-hud-self-stats .top-hud-xp-wrap {
  margin-top: 2px;
  height: 8px;
}

.party-hud-self-stats .top-hud-xp-label {
  margin: 2px 0 0;
  font-size: 10.5px;
}

.combat-info {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 11;
  width: 440px;
  max-width: calc(100% - 28px);
  display: none;
  pointer-events: none;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(6, 14, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  color: #e8f2ff;
  font-size: 12.5px;
  line-height: 1.3;
}

.combat-info.is-active {
  display: block;
}

.combat-info-empty {
  margin: 0;
  color: #98aac4;
  font-size: 12px;
  font-style: italic;
}

.combat-info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.combat-info-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 auto;
}

.combat-info-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f4f7ff;
  line-height: 1.15;
}

.combat-info-subtitle {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #a9bdd9;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.combat-info-bar {
  margin: 4px 0 2px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.combat-info-bar-fill {
  height: 100%;
  border-radius: inherit;
}

.combat-info-bar-fill.is-hp {
  background: linear-gradient(90deg, #ff8a8a 0%, #ffd180 100%);
}

.combat-info-bar-fill.is-energy {
  background: linear-gradient(90deg, #ffd86b 0%, #ff9b3d 100%);
}

.combat-info-bar-fill.is-mana {
  background: linear-gradient(90deg, #6bb6ff 0%, #b388ff 100%);
}

.combat-info-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px 12px;
  margin: 4px 0 0;
  font-size: 12px;
}

.combat-info-stats span strong {
  color: #ffe28c;
  font-weight: 700;
}

.combat-info-desc {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: #d8e4f5;
}

.combat-info-section-label {
  margin: 6px 0 2px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8aa1c0;
}

.combat-info-chiprow {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.combat-info-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 11px;
  color: #dfeaff;
}

.character-overlay-title {
  margin: 0;
  font-size: 30px;
  color: #f3f8ff;
}

.character-overlay-hint {
  margin: 6px 0 0;
  color: #d5e5fa;
}

.character-select-layout {
  height: 100%;
  padding: 22px 28px 24px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
}

.character-select-header {
  position: relative;
  text-align: center;
  pointer-events: none;
}

.character-layout-toggle {
  position: absolute;
  right: 0;
  top: 0;
  padding: 6px 14px;
  font-size: 12px;
  letter-spacing: 0.04em;
  pointer-events: auto;
}

.character-select-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  min-height: 0;
}

.character-select-body.is-carousel {
  grid-template-columns: minmax(200px, 1fr) auto minmax(200px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 16px;
}

.character-info-card {
  background: rgba(7, 16, 28, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 16px 18px;
  color: #dfeaff;
  width: 100%;
  max-width: 340px;
  justify-self: center;
  pointer-events: auto;
  text-align: center;
}

.character-info-card h3 {
  margin: 0 0 8px;
  color: #ffcf76;
  font-size: 20px;
}

.character-info-card .small-copy {
  margin: 6px 0 0;
}

.character-identity-card .character-preview-title-row {
  justify-content: center;
}

.character-matchup-title {
  margin: 0 0 8px;
  color: #ffcf76;
  font-size: 18px;
}

.character-identity-matchups {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.character-identity-matchup-label {
  margin: 0 0 6px !important;
  color: #ffcf76;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
}

.character-stats-title {
  margin: 0 0 10px;
  color: #ffcf76;
  font-size: 18px;
}

.stat-bar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  text-align: left;
}

.stat-bar {
  position: relative;
  outline: none;
  cursor: help;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 120ms ease;
}

.stat-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  margin-bottom: 4px;
}

.stat-bar-label {
  color: #a7b8d0;
}

.stat-bar-value {
  color: #f3f8ff;
  font-weight: 600;
}

.stat-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7ec8ff, #ffcf76);
  border-radius: 999px;
  transition: width 180ms ease;
}

.stat-bar[data-tooltip]:hover,
.stat-bar[data-tooltip]:focus-visible {
  background: rgba(255, 255, 255, 0.05);
}

.stat-bar[data-tooltip]:hover::after,
.stat-bar[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  background: rgba(7, 16, 28, 0.96);
  color: #dfeaff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  pointer-events: none;
  white-space: normal;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.character-carousel-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  pointer-events: none;
  justify-self: center;
  transform: translateY(-60px);
}

.character-carousel-stage {
  width: 396px;
  height: 524px;
  flex: 0 0 auto;
  pointer-events: none;
}

.character-carousel-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 21, 34, 0.88);
  color: #f3f8ff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, border-color 140ms ease, box-shadow 160ms ease, background 160ms ease;
  pointer-events: auto;
  flex: 0 0 auto;
}

.character-carousel-btn:hover,
.character-carousel-btn:focus-visible {
  border-color: #ffcf76;
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 207, 118, 0.22);
  transform: translateY(-2px);
}

.character-carousel-btn:active {
  transform: translateY(0);
}

.character-select-left {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  align-content: start;
  gap: 10px 6px;
  padding: 12px 10px;
  background: rgba(7, 16, 28, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  pointer-events: auto;
}

.character-category {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.character-category-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cfe1f7;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.character-category-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.character-icon-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.character-icon {
  width: 52px;
  height: 52px;
  padding: 2px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(18, 32, 50, 0.78);
  cursor: pointer;
  overflow: hidden;
  transition: transform 120ms ease, border-color 140ms ease, box-shadow 160ms ease, background 160ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.character-icon-fallback {
  color: #f3f8ff;
  font-weight: 700;
}

.character-icon:hover,
.character-icon.is-hovered,
.character-icon:focus-visible {
  border-color: #d7e7ff;
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(215, 231, 255, 0.18);
}

.character-icon.is-selected {
  border-color: #ffcf76;
  background: rgba(71, 55, 24, 0.56);
  box-shadow: 0 0 0 3px rgba(255, 207, 118, 0.28);
}

.character-select-right {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.character-preview-card {
  width: 100%;
  max-width: 360px;
  padding: 10px 14px;
  background: rgba(7, 16, 28, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  text-align: center;
}

.character-preview-card h3 {
  margin: 0;
  color: #ffcf76;
  font-size: 18px;
}

.character-preview-card .small-copy {
  margin: 4px 0 0;
}

.character-preview-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.character-preview-frame {
  width: 100%;
  max-width: 260px;
  flex: 1;
  min-height: 200px;
}

.character-select-footer {
  display: flex;
  justify-content: stretch;
  pointer-events: none;
}

.character-submit-wrap {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  pointer-events: auto;
}

.character-submit-btn {
  flex: 0 0 auto;
  min-width: 140px;
  padding: 0 24px;
  align-self: flex-end;
}

.character-name-input {
  flex: 0 0 auto;
  width: clamp(220px, 28%, 320px);
  min-width: 0;
  max-width: none;
  text-align: left;
  align-self: flex-end;
}

.panel-title {
  margin: 0 0 10px;
  font-size: 24px;
}

.panel-copy {
  margin: 0 0 16px;
  color: #bfd2ef;
}

.turn-banner-image {
  display: block;
  width: min(100%, 360px);
  height: auto;
  margin: 0 0 10px;
  object-fit: contain;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card h3,
.card h4,
.card p {
  margin: 0;
}

.card p + p,
.card h3 + p,
.card h4 + p {
  margin-top: 8px;
}

.combat-healthbar {
  margin-top: 8px;
  width: 100%;
  max-width: 220px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 22, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.combat-healthbar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5cc788 0%, #8ff3b5 100%);
  transition: width 0.2s ease;
}

.combat-healthbar.is-enemy .combat-healthbar-fill {
  background: linear-gradient(90deg, #d95b5b 0%, #ff8d8d 100%);
}

.wide-card {
  flex: 1 1 320px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.action-btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.action-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled,
.action-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.primary-btn {
  background: linear-gradient(135deg, #ff9658, #ff5b4c);
  color: #fff;
}

.secondary-btn {
  background: linear-gradient(135deg, #6eb8ff, #5476ff);
  color: #fff;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn {
  background: rgba(132, 92, 255, 0.18);
  color: #f5ecff;
  border: 1px solid rgba(162, 131, 255, 0.24);
}

.action-btn.is-selected {
  outline: 2px solid #9d87ff;
}

.action-btn.is-unaffordable {
  color: rgba(255, 200, 200, 0.55);
  border-color: rgba(255, 120, 120, 0.3);
  background: rgba(120, 40, 40, 0.18);
}

.form-input {
  width: 100%;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.status-chip {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dce8fa;
  font-size: 13px;
}

.status-chip.ready {
  background: rgba(107, 213, 146, 0.18);
  color: #b8f5c7;
}

.status-chip.host {
  background: rgba(107, 179, 255, 0.18);
  color: #c7e3ff;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.resource-tile {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.list-reset {
  list-style: none;
  margin: 0;
  padding: 0;
}

.combat-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.targeting-arrow-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 11;
  display: none;
  overflow: visible;
}

.targeting-arrow-overlay.is-active {
  display: block;
}

.targeting-arrow-overlay .targeting-arrow-line {
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  fill: none;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}

.combat-hud {
  --combat-hud-scale: 1.55;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: none;
  align-items: end;
  min-height: calc(118px * var(--combat-hud-scale));
  padding: calc(16px * var(--combat-hud-scale)) calc(24px * var(--combat-hud-scale)) calc(18px * var(--combat-hud-scale));
  pointer-events: none;
  background: linear-gradient(to top, rgba(5, 11, 20, 0.9) 0%, rgba(5, 11, 20, 0.62) 75%, transparent 100%);
}

.combat-hud.is-active {
  display: flex;
}

.combat-hud > * {
  pointer-events: auto;
}

.combat-hud-resources {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  gap: calc(10px * var(--combat-hud-scale));
  min-width: calc(190px * var(--combat-hud-scale));
}

.combat-hud-resources .orb-resource {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(4px * var(--combat-hud-scale));
}

.combat-hud-resources .orb-resource-visual {
  position: relative;
  width: calc(48px * var(--combat-hud-scale));
  height: calc(48px * var(--combat-hud-scale));
}

.combat-hud-resources .orb-resource-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.42));
}

.combat-hud-resources .orb-resource-value {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -54%);
  font-size: calc(18px * var(--combat-hud-scale));
  font-weight: 700;
  line-height: 1;
  color: #f8fbff;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.8),
    0 0 8px rgba(0, 0, 0, 0.45);
}

.combat-hud-resources .orb-resource-label {
  font-size: calc(11px * var(--combat-hud-scale));
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #c3d6ef;
}

.combat-hud-actions {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(10px * var(--combat-hud-scale));
  min-width: 0;
}

.combat-hud-actions .hud-action-row {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  gap: calc(10px * var(--combat-hud-scale));
  justify-content: center;
}

.combat-hud-actions .action-btn,
.combat-hud-actions .ghost-btn {
  padding: calc(6px * var(--combat-hud-scale)) calc(10px * var(--combat-hud-scale));
  font-size: calc(10.5px * var(--combat-hud-scale));
}

.combat-hud-actions .hud-category-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: calc(760px * var(--combat-hud-scale));
  width: min(100%, calc(760px * var(--combat-hud-scale)));
}

.combat-hud-actions .combat-category-btn {
  width: 100%;
  min-height: calc(36px * var(--combat-hud-scale));
  padding: calc(7px * var(--combat-hud-scale)) calc(10px * var(--combat-hud-scale));
  font-size: calc(11px * var(--combat-hud-scale));
  border-radius: calc(12px * var(--combat-hud-scale));
}

.combat-hud-actions .hud-action-row-with-back {
  justify-content: flex-start;
}

.combat-hud-actions .hud-back-btn {
  min-width: calc(90px * var(--combat-hud-scale));
}

.combat-hud-endturn {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: calc(6px * var(--combat-hud-scale));
}

.combat-end-turn-btn {
  width: 100%;
  min-height: calc(36px * var(--combat-hud-scale));
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: calc(6px * var(--combat-hud-scale));
  padding: calc(7px * var(--combat-hud-scale)) calc(10px * var(--combat-hud-scale));
  border-radius: calc(12px * var(--combat-hud-scale));
}

.combat-end-turn-main {
  font-size: calc(11px * var(--combat-hud-scale));
  line-height: 1.1;
}

.combat-end-turn-ready {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: calc(3px * var(--combat-hud-scale)) calc(8px * var(--combat-hud-scale));
  border-radius: 999px;
  font-size: calc(11px * var(--combat-hud-scale));
  letter-spacing: 0.02em;
  background: rgba(7, 12, 28, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f3f8ff;
}

.log-list li + li {
  margin-top: 8px;
}

.small-copy {
  color: #9cb2d3;
  font-size: 14px;
}

.type-chip-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.type-name-row {
  vertical-align: middle;
}

.type-chip-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}

.type-chip-icon-inline {
  width: 20px;
  height: 20px;
}

.type-chip-icon-lg {
  width: 72px;
  height: 72px;
}

.type-matchup-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
  margin: 4px 0;
  white-space: nowrap;
}

.type-matchup-label {
  font-weight: 600;
  white-space: nowrap;
}

.type-matchup-strong .type-matchup-label {
  color: #6dd17c;
}

.type-matchup-weak .type-matchup-label {
  color: #ff7a7a;
}

.type-matchup-chip {
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.type-matchup-chip .type-chip-icon {
  width: 16px;
  height: 16px;
}

@media (max-width: 920px) {
  .character-select-layout {
    padding: 18px 14px 16px;
  }

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

  .character-select-body.is-carousel {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .character-select-right {
    display: none;
  }

  .character-carousel-stage {
    width: 280px;
    height: 380px;
  }

  .character-carousel-center {
    transform: translateY(-30px);
  }

  .character-name-input {
    width: clamp(180px, 40%, 260px);
  }

  .character-carousel-btn {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

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

  .combat-hud.is-active {
    flex-direction: column;
    align-items: stretch;
  }

  .combat-hud {
    --combat-hud-scale: 1.2;
    min-height: auto;
  }

  .combat-hud-resources {
    justify-content: center;
    min-width: 0;
  }

  .combat-hud-actions .combat-category-btn {
    min-height: calc(36px * var(--combat-hud-scale));
    font-size: calc(11px * var(--combat-hud-scale));
  }

  .combat-hud-endturn {
    flex: 0 0 auto;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
  }

  .combat-end-turn-btn {
    width: 100%;
    min-width: 0;
    min-height: calc(36px * var(--combat-hud-scale));
  }

  .top-hud {
    top: 10px;
    left: 10px;
  }

  .top-hud-stats {
    width: 200px;
    padding: 7px 9px;
  }

  .combat-info {
    top: 10px;
    right: 10px;
    width: 220px;
    font-size: 12px;
    padding: 10px 12px;
  }
}
