html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0e0e0e;
}

.app {
  position: fixed;
  inset: 0;
}

.app.hidden,
.hidden,
.ui-screen-content.hidden,
.pwd.hidden {
  display: none !important;
}

#mapCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #0e0e0e;
  cursor: grab;
  touch-action: none;
}

#mapCanvas.dragging {
  cursor: grabbing;
}

/* ===== Settings dialog: MUI switch (small) ===== */
.MuiSwitch-root {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 18px;
  padding: 0;
  flex-shrink: 0;
  overflow: visible;
  box-sizing: border-box;
  vertical-align: middle;
  pointer-events: auto !important;
}

.MuiSwitch-switchBase {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  padding: 2px;
  transition: transform .2s, color .2s;
  color: #fafafa;
  pointer-events: none;
}

.MuiSwitch-input {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  pointer-events: auto !important;
}

.MuiSwitch-thumb {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

.MuiSwitch-track {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  background: rgba(255, 255, 255, .28);
  opacity: 1;
  transition: background-color .2s, opacity .2s;
}

.MuiSwitch-switchBase.Mui-checked {
  transform: translateX(16px);
  color: #26bbff;
}

.MuiSwitch-root.Mui-checked .MuiSwitch-track,
.MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track {
  background-color: rgba(38, 187, 255, .55);
  opacity: 1;
}

/* ===== Settings dialog: MUI slider ===== */
.setting-card .setting-card-content .setting-item.col .setting-item-value {
  height: auto !important;
  width: calc(100% - 10px);
  justify-content: stretch;
}

/* 覆盖 radar-base 的 pointer-events:none，保证滑条可拖。
   注意：只能给 .setting-content.show，不能给全部 .setting-content，
   否则后面绝对定位的隐藏面板会挡住当前面板点击。 */
.setting.show .setting-content.show .MuiSlider-root,
.setting.show .setting-content.show .MuiSlider-thumb,
.setting.show .setting-content.show .MuiSlider-input,
.setting.show .setting-content.show {
  pointer-events: auto !important;
}

.MuiSlider-root {
  position: relative;
  display: block;
  width: 100%;
  height: 28px;
  padding: 10px 0;
  box-sizing: border-box;
  color: #26bbff;
  cursor: pointer;
  touch-action: none;
  pointer-events: auto !important;
}

.MuiSlider-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 2px;
  background-color: #575757 !important;
  opacity: 1;
  pointer-events: none;
}

.MuiSlider-track {
  position: absolute;
  left: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 2px;
  background-color: #26bbff !important;
  border: none !important;
  pointer-events: none;
}

.MuiSlider-thumb {
  position: absolute;
  top: 50%;
  width: 13px !important;
  height: 13px !important;
  margin-left: -6.5px;
  margin-top: -6.5px;
  border-radius: 50%;
  background-color: #fff !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
  pointer-events: none !important;
  z-index: 1;
}

.MuiSlider-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
  pointer-events: auto !important;
  touch-action: none;
}

.setting-select {
  appearance: none;
  -webkit-appearance: none;
  background: #222;
  color: #fff;
  border: 1px solid oklch(1 0 0 / 10%);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  max-width: 160px;
}

.setting-select:focus {
  border-color: #26bbff66;
}

/* masonry: use original flex columns from radar-base; ensure card fills column */
.user-container .my-masonry-grid,
.point-container .my-masonry-grid {
  display: flex;
  margin-left: -12px;
  width: auto;
  box-sizing: border-box;
  padding-bottom: 8px;
}

.user-container .my-masonry-grid_column,
.point-container .my-masonry-grid_column {
  background-clip: padding-box;
  padding-left: 12px;
  flex: 1 1 0;
  min-width: 0;
}

.user-container .setting-card,
.point-container .setting-card {
  width: 100% !important;
  height: auto !important;
}

.setting .setting-tab,
.setting.tab-hidden .setting-tab,
#bottomTabs[hidden] {
  display: none !important;
}

.setting .setting-header-logo {
  object-fit: cover;
  border-radius: 4px;
  background: #111;
}

/* camera / chrome */
.camera-button .hero {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  background: #1a1a1a;
}

.camera-button .hero img,
.list .hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.list .hero {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.camera-button .icon,
.settings-button .icon,
.player-list-settings-button .icon {
  font-size: 16px;
  line-height: 1;
}

.pwd-brand {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  animation: pwd-brand-in .7s cubic-bezier(.22, 1, .36, 1) both;
}

.pwd-input-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwd-input-box.filled {
  border-color: #26bbff;
  background: rgba(38, 187, 255, .12);
  box-shadow: 0 0 0 1px rgba(38, 187, 255, .25);
}

/* ===== Login gate redesign ===== */
.pwd {
  --pwd-accent: #26bbff;
  --pwd-ink: #f4f7fb;
  --pwd-muted: rgba(244, 247, 251, .62);
  font-family: "Sora", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(38, 187, 255, .18), transparent 55%),
    radial-gradient(900px 600px at 88% 110%, rgba(20, 90, 130, .28), transparent 50%),
    linear-gradient(160deg, #0a1218 0%, #0e0e0e 45%, #111820 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.pwd-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  animation: pwd-grid-drift 18s linear infinite;
  opacity: .55;
}

.pwd-container {
  position: relative;
  z-index: 1;
  width: min(92vw, 400px);
  padding: 36px 32px 28px;
  background: linear-gradient(180deg, rgba(22, 30, 38, .88), rgba(14, 18, 24, .92));
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
  animation: pwd-card-in .65s cubic-bezier(.22, 1, .36, 1) .08s both;
}

.pwd-header {
  margin-bottom: 28px;
  text-align: center;
}

.pwd .pwd-h1 {
  display: none;
}

.pwd-brand-name {
  margin-top: 18px;
  font-family: "Orbitron", "Sora", sans-serif;
  font-size: clamp(2rem, 6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--pwd-ink);
  line-height: 1;
  text-transform: uppercase;
  animation: pwd-fade-up .6s ease .18s both;
}

.pwd-brand-tag {
  margin-top: 6px;
  font-family: "Orbitron", sans-serif;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .42em;
  text-indent: .42em;
  color: var(--pwd-accent);
  text-transform: uppercase;
  animation: pwd-fade-up .6s ease .28s both;
}

.pwd-lead {
  margin: 18px 0 0;
  font-size: .95rem;
  font-weight: 400;
  color: var(--pwd-muted);
  animation: pwd-fade-up .6s ease .36s both;
}

.pwd-title,
.pwd-subtitle {
  display: none;
}

.pwd-input-group {
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}

.pwd .pwd-input-box {
  width: 3.25rem;
  height: 3.6rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(8, 12, 16, .65);
  font-family: "Orbitron", monospace;
  font-size: 1.45rem;
  letter-spacing: .05em;
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}

.pwd .pwd-input-box.filled {
  transform: translateY(-2px);
}

.pwd-confirm-btn {
  border-radius: 12px;
  padding: 15px;
  font-family: "Sora", sans-serif;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .45);
}

.pwd-confirm-btn.active {
  background: linear-gradient(135deg, #1aa8ef, #26bbff 50%, #5ad0ff);
  color: #041018;
  box-shadow: 0 10px 28px rgba(38, 187, 255, .35);
}

.pwd-confirm-btn.active:hover {
  background: linear-gradient(135deg, #26bbff, #5ad0ff);
  transform: translateY(-2px);
}

.pwd-status {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .06);
  color: var(--pwd-muted);
  font-size: .82rem;
}

/* ===== Password error dialog ===== */
.pwd-error-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 8, 12, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pwd-error-overlay.hidden {
  display: none !important;
}

.pwd-error-overlay.show .pwd-error-card {
  animation: pwd-error-in .32s cubic-bezier(.22, 1, .36, 1) both;
}

.pwd-error-card {
  width: min(92vw, 340px);
  padding: 28px 24px 22px;
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(180deg, #1a222b, #12161c);
  border: 1px solid rgba(255, 90, 90, .28);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  font-family: "Sora", "Segoe UI", sans-serif;
}

.pwd-error-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Orbitron", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #ff8d8f;
  background: rgba(255, 77, 77, .12);
  border: 1px solid rgba(255, 77, 77, .35);
}

.pwd-error-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.pwd-error-desc {
  margin: 8px 0 20px;
  font-size: .9rem;
  color: rgba(255, 255, 255, .65);
  line-height: 1.45;
}

.pwd-error-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  cursor: pointer;
  font-family: "Sora", sans-serif;
  font-size: .95rem;
  font-weight: 700;
  color: #041018;
  background: linear-gradient(135deg, #ff6b6b, #ff8d8f);
  transition: transform .15s, filter .15s;
}

.pwd-error-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.pwd-error-btn:active {
  transform: scale(.98);
}

@keyframes pwd-brand-in {
  from { opacity: 0; transform: scale(.86) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes pwd-card-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pwd-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pwd-grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 48px 48px, 48px 48px; }
}

@keyframes pwd-error-in {
  from { opacity: 0; transform: translateY(12px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
  .pwd-container {
    padding: 28px 20px 22px;
  }

  .pwd .pwd-input-box {
    width: 2.75rem;
    height: 3.1rem;
    font-size: 1.2rem;
  }
}

/* item cards — only for 物资 list (img tags), not container div wrappers */
.item-container .item-list .item-card > .item-card-image {
  width: 70% !important;
  max-height: 55%;
  margin: 4px auto 8px !important;
  display: block;
  object-fit: contain;
}

.item-card-checked.checked {
  background-image: url("../assets/media/e98fc6fe0f6e09903bf1.png");
  background-size: 8px 8px;
  background-repeat: no-repeat;
  background-position: center;
}

.item-container .item-list .item-card .item-card-content .item-card-checked:after {
  background-image: url("../assets/media/e98fc6fe0f6e09903bf1.png") !important;
}

.player-lists-empty {
  color: hsla(0, 0%, 100%, 0.45);
  font-size: 12px;
  padding: 24px 8px;
  text-align: center;
}

.player-item.teammate {
  box-shadow: inset 2px 0 0 #26bbff;
}

.weapon-icon.primary,
.weapon-icon.secondary {
  display: block;
}

/* player list scroll */
.player-lists-content {
  overflow-y: auto !important;
  touch-action: pan-y !important;
  max-height: calc(100vh - 220px);
}

.hero-avatar {
  object-fit: cover;
}

@media (max-width: 600px) {
  .ui-title { font-size: 36px !important; }
  .ui-desc { font-size: 18px !important; }
  .player-lists {
    width: calc(100% - 72px) !important;
  }
}

.timeout-warning-container[hidden] {
  display: none !important;
}

/* item panel: keep list area scrollable inside settings */
.item-container > .setting-card {
  min-width: 0;
  max-height: calc(100vh - 160px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.item-container > .setting-card > .setting-card-content.no-padding {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* container panel: keep list area scrollable inside settings */
.containers > .setting-card {
  min-width: 0;
  max-height: calc(100vh - 160px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.containers > .setting-card > .setting-card-content.no-padding {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.item-container .item-list .item-card-image[src^="http"] {
  background: rgba(0, 0, 0, 0.2);
}
