:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #11161d;
  color: #f4f0e6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow: hidden;
}

button {
  border: 0;
  border-radius: 7px;
  color: #10151b;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

button:focus-visible {
  outline: 3px solid #efcf5a;
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

#app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  height: 100vh;
}

#app.is-match-info-collapsed {
  grid-template-columns: minmax(0, 1fr) 54px;
}

.arena-shell {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #18202a;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.camera-controls {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 4;
  display: grid;
  gap: 8px;
  width: 150px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(16, 21, 27, 0.78);
  backdrop-filter: blur(3px);
}

.camera-controls button {
  min-height: 34px;
  background: #dce5eb;
  font-size: 0.82rem;
}

.camera-controls button.is-selected {
  background: #efcf5a;
}

.auto-camera-button {
  width: 100%;
}

.camera-button-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

#cameraUpButton {
  grid-column: 2;
  grid-row: 1;
}

#cameraLeftButton {
  grid-column: 1;
  grid-row: 2;
}

#cameraDownButton {
  grid-column: 2;
  grid-row: 2;
}

#cameraRightButton {
  grid-column: 3;
  grid-row: 2;
}

.zoom-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  background: #171c24;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.side-panel.is-collapsed {
  gap: 0;
  padding: 10px 7px;
}

.side-panel.is-collapsed .hud-header {
  justify-content: center;
}

.side-panel.is-collapsed .hud-header > div,
.side-panel.is-collapsed .status-band,
.side-panel.is-collapsed .panel-section {
  display: none;
}

.hud-header,
.section-title,
.player-topline,
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hud-header h2,
.panel-section h3,
.menu-panel h1 {
  margin: 0;
  letter-spacing: 0;
}

.hud-header h2 {
  font-size: 1.25rem;
}

.eyebrow,
.label,
.section-meta,
.player-meta,
.stat-row,
.roster-card small {
  color: #aeb8c2;
  font-size: 0.76rem;
}

.eyebrow,
.label {
  margin: 0 0 4px;
  text-transform: uppercase;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: #8e6e5f;
}

.icon-button img {
  width: 32px;
  height: 32px;
}

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

.status-band > div,
.panel-section {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.status-band > div {
  padding: 10px;
}

.status-band strong {
  display: block;
  font-size: 1rem;
}

.panel-section {
  padding: 12px;
}

.player-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.player-list.is-minimized {
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.player-card,
.roster-card {
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: rgba(12, 16, 21, 0.72);
  padding: 8px;
}

.roster-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #f4f0e6;
  text-align: center;
  position: relative;
}

.roster-card-button {
  display: grid;
  justify-items: center;
  align-items: center;
  min-width: 0;
  min-height: 66px;
  padding: 0;
  background: transparent;
  color: #f4f0e6;
  text-align: center;
}

.roster-card-button img {
  display: block;
  width: 54px;
  height: 54px;
  margin: 0;
  object-fit: contain;
}

.roster-card.is-selected {
  box-shadow: inset 0 0 0 2px #7e8b96;
}

.roster-card.is-primary-bet {
  box-shadow: inset 0 0 0 2px #efcf5a;
}

.roster-card.is-secondary-bet {
  box-shadow: inset 0 0 0 2px #c9d1d9;
}

.roster-card.is-bet-disabled {
  opacity: 0.58;
}

.bet-indicator {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(8, 12, 16, 0.82);
}

.bet-indicator.primary {
  background: #efcf5a;
}

.bet-indicator.secondary {
  background: #c9d1d9;
}

.card-bet-field {
  display: grid;
  gap: 2px;
}

.card-bet-field input {
  width: 100%;
  min-height: 28px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: #10151b;
  color: #f4f0e6;
  font: inherit;
  font-weight: 800;
  padding: 0 8px;
}

.card-bet-field input.bet-primary {
  border-color: #efcf5a;
  background: rgba(239, 207, 90, 0.18);
}

.card-bet-field input.bet-secondary {
  border-color: #c9d1d9;
  background: rgba(201, 209, 217, 0.16);
}

.card-bet-field input.bet-unavailable {
  border-color: rgba(122, 132, 142, 0.38);
  background: rgba(79, 88, 96, 0.2);
  color: #8e98a3;
}

.card-bet-field input:disabled {
  opacity: 0.54;
}

.player-card.is-dead {
  opacity: 0.48;
}

.player-card.compact {
  padding: 7px;
}

.compact-player {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.compact-player img {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
}

.compact-player strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-topline strong {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.player-topline strong img {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
}

.player-topline span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.player-card-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.status-effect-list {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

.status-effect-icon {
  display: block;
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.compact-player .status-effect-list {
  margin-left: auto;
}

.player-meta {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter {
  width: 100%;
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background-image: url("../../Assets/UI/Status/health_bar.png");
  background-size: 100% 100%;
}

.meter span {
  display: block;
  height: 100%;
  background-image: url("../../Assets/UI/Status/health_fill.png");
  background-size: 100% 100%;
}

.exhaustion-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  color: #e6c56a;
  font-size: 0.72rem;
  font-weight: 800;
}

.meter.exhaustion-meter {
  height: 6px;
  margin-top: 0;
  background: rgba(230, 197, 106, 0.18);
}

.meter.exhaustion-meter span {
  background: linear-gradient(90deg, #f2d06d, #ff8f4d);
}

.stat-row {
  margin-top: 6px;
}

.drop-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.drop-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  padding: 7px 8px;
  background: #dce5eb;
  font-size: 0.82rem;
}

.drop-button .drop-glyph,
.item-glyph {
  display: block;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: contain;
}

.drop-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-mode {
  flex: 0 0 auto;
  color: #3b4652;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.drop-button.is-instant-item {
  background: #efd7b5;
}

.drop-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 99px;
  background: #10151b;
  color: #f4f0e6;
  font-size: 0.72rem;
}

.drop-button.is-selected {
  box-shadow: inset 0 0 0 3px #8e6e5f;
}

.log-section {
  flex: 1;
  min-height: 120px;
  overflow: hidden;
}

.event-log {
  display: flex;
  flex-direction: column;
  gap: 7px;
  height: calc(100% - 28px);
  margin: 10px 0 0;
  overflow: auto;
  padding: 0 0 0 20px;
  color: #dce5eb;
  font-size: 0.84rem;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 13, 18, 0.72);
  backdrop-filter: blur(4px);
}

.overlay.is-visible {
  display: flex;
}

.menu-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  height: min(820px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #171c24;
  padding: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.floating-portrait {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: clamp(132px, 18vw, 230px);
  aspect-ratio: 2 / 3;
  pointer-events: none;
  transition: transform 160ms ease, opacity 160ms ease;
}

.floating-portrait-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(12, 16, 21, 0.58);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.floating-portrait-frame::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.floating-portrait img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.floating-portrait-name {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(16, 21, 27, 0.84);
  color: #f4f0e6;
  font-size: 0.78rem;
  font-weight: 900;
}

.floating-portrait.is-user {
  z-index: 2;
  width: clamp(96px, 11vw, 148px);
  opacity: 0.82;
}

.floating-portrait.is-user .floating-portrait-name {
  display: none;
}

.barracks-menu {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 5px;
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: inline-grid;
  width: 64px;
  height: 64px;
  place-items: center;
  background: #f45b6800;
  color: #10151b;
}

.mini-button {
  min-height: 28px;
  padding: 0 10px;
  background: #dce5eb;
  font-size: 0.76rem;
}

.menu-panel-slot {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.052);
  padding: 9px;
}

.game-title-panel {
  display: grid;
  min-height: 56px;
  place-items: center;
}

.game-title-panel h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  letter-spacing: 0;
  text-align: center;
}

.location-panel {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 34px;
  padding-block: 5px;
}

.location-panel h2 {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: 0;
}

.save-actions,
.core-control-actions,
.menu-tabs,
.shop-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.save-actions button,
.core-control-actions button,
.menu-tabs button,
.shop-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 8px;
  background: #dce5eb;
  font-size: 0.82rem;
}

.save-actions button img,
.menu-tabs button img {
  width: 32px;
  height: 32px;
}

.menu-icon-panel {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 5px;
  overflow-x: auto;
  padding: 6px;
}

.menu-icon-panel button {
  display: inline-flex;
  flex: 1 1 0;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  gap: 4px;
  padding: 0 4px;
  background: #8e6e5f;
  font-size: 0.76rem;
  text-align: left;
  white-space: nowrap;
}

.menu-icon-panel button img {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.menu-icon-panel button.is-selected,
.menu-icon-panel .primary-menu-action {
  background: #db8941;
}

.menu-icon-panel .primary-menu-action {
  background: #3ddc84;
}

.menu-status {
  min-height: 18px;
  margin: 0 0 8px;
  color: #aeb8c2;
  font-size: 0.82rem;
}

.menu-status:empty {
  display: none;
}

.main-info-panel {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.menu-page {
  display: none;
}

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

.menu-roster {
  display: grid;
  grid-template-columns: repeat(4, minmax(82px, 1fr));
  gap: 10px;
  margin: 8px 0 0;
}

.fighters-page .character-details {
  margin-top: 12px;
}

.betting-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.betting-footer button {
  min-height: 30px;
  padding: 0 10px;
  background: #dce5eb;
  font-size: 0.76rem;
}

.map-control-group + .map-control-group {
  margin-top: 18px;
}

.map-size-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

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

.map-size-control button {
  display: block;
  min-width: 0;
  min-height: 58px;
  padding: 9px;
  background: #dce5eb;
  text-align: left;
}

.map-size-control button.is-selected {
  background: #efcf5a;
}

.map-size-control strong,
.map-size-control span {
  display: block;
}

.map-size-control span {
  margin-top: 3px;
  color: #3b4652;
  font-size: 0.74rem;
}

.roster-card strong,
.roster-card span,
.roster-card small {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.roster-card span {
  margin-top: 1px;
  color: #f4f0e6;
  font-size: 0.78rem;
}

.roster-card small {
  margin-top: 2px;
  line-height: 1.18;
}

.character-details {
  margin: 0;
}

.details-panel {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.details-portrait {
  position: relative;
  min-height: 156px;
}

.details-portrait.is-buffer {
  opacity: 0.3;
}

.details-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.details-portrait .portrait-character {
  inset: 28px;
  width: calc(100% - 56px);
  height: calc(100% - 56px);
}

.details-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.details-title h2 {
  margin: 0;
  font-size: 1.3rem;
}

.details-title span {
  color: #aeb8c2;
  font-size: 0.85rem;
}

.details-title > img {
  width: 48px;
  height: 48px;
}

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

.detail-section {
  min-width: 0;
  border-radius: 7px;
  background: rgba(12, 16, 21, 0.56);
  padding: 10px;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 5px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #aeb8c2;
  font-size: 0.76rem;
}

.detail-row strong {
  max-width: 150px;
  color: #f4f0e6;
  text-align: right;
}

.equipment-section {
  grid-column: 1 / -1;
}

.equipment-section h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.equipment-section h3 span {
  color: #aeb8c2;
  font-size: 0.76rem;
}

.equipment-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  overflow: visible;
}

.equipment-card {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 150px;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid var(--item, #7e8b96);
  border-radius: 7px;
  background: rgba(8, 12, 16, 0.54);
  padding: 8px;
}

.equipment-card.is-equipped {
  box-shadow: inset 0 0 0 1px #efcf5a;
}

.equipment-card.is-disabled {
  opacity: 0.56;
}

.equipment-card-muted {
  --item: #7e8b96;
}

.equipment-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.equipment-card strong,
.equipment-card small,
.equipment-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.equipment-card small,
.equipment-card span,
.equipment-empty {
  color: #aeb8c2;
  font-size: 0.74rem;
}

.equipment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.equipment-actions button {
  min-height: 27px;
  padding: 0 8px;
  background: #dce5eb;
  font-size: 0.72rem;
}

.equipment-actions button[data-equip-item] {
  background: #3ddc84;
}

.equipment-actions button[data-remove-item],
.shop-actions .sell-button {
  background: #d86d66;
  color: #10151b;
}

.equipment-empty {
  min-width: 180px;
  margin: 0;
  padding: 12px;
}

.shop-list,
.inventory-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
}

.panel-economy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: #aeb8c2;
  font-size: 0.82rem;
  font-weight: 800;
}

.panel-economy img {
  width: 24px;
  height: 24px;
}

.panel-economy strong {
  color: #efcf5a;
  font-size: 1.05rem;
}

.tab-gold-panel {
  display: flex;
  width: max-content;
  margin-left: auto;
}

.shop-card,
.inventory-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border-left: 4px solid var(--item);
  border-radius: 7px;
  background: rgba(12, 16, 21, 0.72);
  padding: 10px;
}

.shop-main,
.inventory-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.shop-main strong,
.inventory-main strong,
.shop-main small,
.inventory-main small {
  display: block;
}

.shop-main small,
.inventory-main small,
.shop-actions span {
  color: #aeb8c2;
  font-size: 0.76rem;
}

.inventory-mode {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 2px 0;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(239, 207, 90, 0.14);
  color: #efcf5a;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.badge-row .inventory-mode {
  display: inline-block;
  margin: 2px 0;
}

.rarity-badge {
  background: color-mix(in srgb, var(--rarity, #b9c2cf) 18%, transparent);
  color: var(--rarity, #b9c2cf);
}

.shop-category-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #dce5eb;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.shop-category-title span {
  color: #7e8b96;
  font-size: 0.74rem;
}

.item-limit {
  display: block;
  color: #f19a3e;
  font-size: 0.72rem;
  font-weight: 700;
}

.shop-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.shop-actions button {
  background: #3ddc84;
}

.inventory-actions {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 6px;
}

.inventory-card b {
  display: inline-grid;
  flex: 0 0 32px;
  height: 32px;
  place-items: center;
  border-radius: 99px;
  background: #efcf5a;
  color: #10151b;
}

.inventory-actions button {
  min-height: 27px;
  padding: 0 8px;
  background: #db8941;
  font-size: 0.72rem;
}

.empty-state {
  min-height: 80px;
  margin: 12px 0 18px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #aeb8c2;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.settings-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  border-radius: 7px;
  background: rgba(12, 16, 21, 0.56);
  padding: 12px;
}

.settings-card h3 {
  margin: 0 0 4px;
}

.settings-card p {
  margin: 0;
  color: #aeb8c2;
  font-size: 0.82rem;
}

.core-controls-card {
  align-items: flex-start;
}

.core-control-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.core-control-actions button.is-muted {
  background: #efcf5a;
}

.danger-button {
  background: #ef6f61;
}

.volume-control {
  display: grid;
  gap: 5px;
  min-width: 150px;
  color: #dce5eb;
  font-size: 0.74rem;
  font-weight: 800;
}

.volume-control input {
  width: 150px;
  height: 7px;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #efcf5a 0,
    #efcf5a var(--volume-percent, 100%),
    rgba(255, 255, 255, 0.16) var(--volume-percent, 100%),
    rgba(255, 255, 255, 0.16) 100%
  );
  accent-color: #efcf5a;
}

.volume-control input::-webkit-slider-thumb {
  appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #f4f0e6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.volume-control input::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border: 0;
  border-radius: 50%;
  background: #f4f0e6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.confirmation-overlay {
  z-index: 16;
}

.help-overlay {
  z-index: 18;
}

.help-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  width: min(720px, 100%);
  max-height: min(620px, calc(100vh - 32px));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #171c24;
  padding: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.help-header {
  min-height: 42px;
  padding-right: 44px;
}

.help-header h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.help-scroll-panel {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.help-card {
  min-height: 280px;
}

.help-text-box {
  min-height: 260px;
  border-radius: 7px;
  background: rgba(12, 16, 21, 0.56);
}

.confirmation-panel {
  display: grid;
  gap: 18px;
  width: min(460px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #171c24;
  padding: 22px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.confirmation-panel p {
  margin: 0;
  color: #f4f0e6;
  font-size: 1.05rem;
  font-weight: 800;
}

.confirmation-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.confirmation-actions button {
  min-height: 40px;
  padding: 0 16px;
  background: #3ddc84;
}

.confirmation-actions .danger-button {
  background: #ef6f61;
}

.confirmation-actions .secondary {
  background: #dce5eb;
}

.victory-overlay {
  z-index: 12;
}

.victory-panel {
  display: grid;
  justify-items: center;
  width: min(520px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #171c24;
  padding: 24px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.victory-image {
  width: min(256px, 68vw);
  height: min(256px, 68vw);
  object-fit: contain;
  margin: 8px 0 12px;
}

.victory-panel h1 {
  margin: 0;
  font-size: 2.4rem;
  letter-spacing: 0;
}

.victory-text {
  margin: 10px 0 18px;
  color: #dce5eb;
}

.victory-bet-text {
  margin: -6px 0 18px;
  color: #efcf5a;
  font-weight: 800;
}

.victory-panel button {
  min-height: 42px;
  padding: 0 18px;
  background: #3ddc84;
}

.game-over-overlay {
  z-index: 14;
}

.game-over-panel {
  display: grid;
  justify-items: center;
  width: min(500px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #171c24;
  padding: 28px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.game-over-panel h1 {
  margin: 0;
  color: #f45b69;
  font-size: 2.5rem;
  letter-spacing: 0;
}

.game-over-panel p:not(.eyebrow) {
  margin: 10px 0 18px;
  color: #dce5eb;
}

.game-over-panel button {
  min-height: 42px;
  padding: 0 18px;
  background: #efcf5a;
}

.is-hidden {
  display: none;
}

@media (max-width: 940px) {
  body {
    overflow: auto;
  }

  #app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, 62vh) auto;
    height: auto;
    min-height: 100vh;
  }

  #app.is-match-info-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, 62vh) 54px;
  }

  .side-panel {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .menu-panel {
    height: min(820px, calc(100vh - 32px));
  }

  .floating-portrait {
    width: clamp(104px, 17vw, 150px);
  }

  .floating-portrait.is-user {
    width: clamp(84px, 15vw, 116px);
  }

  .menu-icon-panel {
    flex-wrap: wrap;
  }

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

  .shop-list,
  .inventory-list,
  .map-size-control,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .details-panel {
    grid-template-columns: 1fr;
  }

  .details-portrait {
    max-width: 180px;
  }

  .settings-card {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .game-title-panel h1 {
    font-size: 2.2rem;
  }

  .status-band,
  .drop-controls,
  .menu-roster,
  .location-panel {
    grid-template-columns: 1fr;
  }

  .location-panel {
    display: grid;
  }

  .save-actions,
  .menu-tabs {
    flex-wrap: wrap;
  }

  .camera-controls {
    left: 8px;
    bottom: 8px;
    width: 136px;
  }

  .floating-portrait {
    opacity: 0.72;
    width: 92px;
  }

  .floating-portrait.is-user {
    width: 74px;
  }
}
