@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;600;700&display=swap");

:root {
  color-scheme: light dark;
  --bg-gradient-start: #151f2d;
  --bg-gradient-end: #0b1220;
  --card-bg: rgba(19, 27, 41, 0.78);
  --card-border: rgba(93, 136, 255, 0.3);
  --accent: #6ba4ff;
  --accent-strong: #3f83ff;
  --success: #62d39c;
  --warning: #f5b759;
  --font-main: "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --text-primary: #f5f7ff;
  --text-secondary: rgba(245, 247, 255, 0.72);
  --shadow: 0 24px 60px rgba(5, 12, 25, 0.4);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, var(--bg-gradient-start), var(--bg-gradient-end));
  font-family: var(--font-main);
  color: var(--text-primary);
}

.app-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.app-header,
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(16, 24, 38, 0.65);
  border: 1px solid rgba(128, 168, 255, 0.2);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.app-header h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 1px;
}

.app-header p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.branding {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: inline-flex;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  background: rgba(99, 139, 255, 0.25);
  font-size: 1.6rem;
}

.app-main {
  flex: 1;
  display: flex;
  justify-content: center;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 28px 32px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.sign-in-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sign-in-status {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.sign-in-bonus {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(67, 102, 214, 0.18);
  border: 1px solid rgba(108, 143, 255, 0.35);
}

.sign-in-bonus strong {
  font-size: 1.2rem;
  color: var(--accent);
}

.sign-in-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.sign-in-card .feedback {
  min-height: 20px;
}

.sign-in-card.disabled {
  opacity: 0.6;
}

.weather-banner {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
}

.weather-banner .weather-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.weather-banner .weather-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.weather-banner .weather-current {
  display: flex;
  gap: 16px;
  align-items: center;
}

.weather-banner .weather-meta {
  display: flex;
  flex-direction: column;
}

.weather-banner .weather-countdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

@media (min-width: 900px) {
  .weather-banner {
    flex-direction: row;
    align-items: center;
  }
  .weather-banner .weather-header {
    flex-direction: row;
    align-items: center;
    width: 100%;
  }
  .weather-banner .weather-controls {
    margin-left: auto;
  }
}

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

.tianji-status {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.tianji-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(83, 107, 214, 0.16);
  border: 1px solid rgba(108, 143, 255, 0.3);
  font-size: 0.95rem;
}

.tianji-meta strong {
  font-size: 1.2rem;
  color: var(--accent);
}

.tianji-meta span {
  color: var(--text-secondary);
}

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

.tianji-slot {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(108, 143, 255, 0.3);
  background: rgba(83, 107, 214, 0.12);
  font-size: 0.86rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease,
    color 0.15s ease;
}

.tianji-slot--center {
  background: rgba(99, 139, 255, 0.2);
  color: var(--accent);
  font-weight: 600;
  border: 1px solid rgba(108, 143, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(99, 139, 255, 0.3);
}

.tianji-slot.active {
  color: #fff;
  background: linear-gradient(135deg, #4361ee, #3a86ff);
  border-color: transparent;
  box-shadow: 0 0 14px rgba(58, 134, 255, 0.45);
  transform: scale(1.06);
}

.tianji-slot.final {
  color: #fff;
  background: linear-gradient(135deg, #ff7e5f, #feb47b);
  border-color: transparent;
  box-shadow: 0 0 18px rgba(255, 135, 97, 0.55);
  transform: scale(1.08);
}

@media (max-width: 680px) {
  .tianji-slot {
    font-size: 0.78rem;
    min-height: 46px;
  }
}

.tianji-bonus,
.tianji-last {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.tianji-card .feedback {
  min-height: 20px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 24px;
  background: rgba(22, 33, 53, 0.7);
  border-radius: 16px;
  padding: 6px;
}

.tab-button {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 12px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-button.active {
  color: var(--text-primary);
  background: rgba(99, 143, 255, 0.32);
  box-shadow: 0 8px 24px rgba(82, 121, 255, 0.4);
}

.form {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.form.active {
  display: flex;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

input {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(134, 165, 255, 0.35);
  background: rgba(9, 15, 28, 0.6);
  color: var(--text-primary);
  font-size: 1rem;
}

input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 143, 255, 0.3);
}

.primary-button,
.secondary-button {
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--text-primary);
  box-shadow: 0 12px 30px rgba(79, 136, 255, 0.5);
}

.secondary-button {
  background: rgba(20, 32, 52, 0.75);
  color: var(--text-secondary);
  border: 1px solid rgba(108, 143, 255, 0.4);
}

.small-button {
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: 10px;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(79, 136, 255, 0.4);
}

.primary-button:disabled,
.secondary-button:disabled,
.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.feedback {
  min-height: 22px;
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--warning);
}

.hidden {
  display: none !important;
}

.game .grid {
  display: grid;
  gap: 24px;
}

.card-pair {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .card-pair {
    grid-column: span 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card-pair > .card {
  height: 100%;
}

@media (min-width: 900px) {
  .game .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
  }
  .hero-card {
    grid-column: span 2;
  }
  .log-card {
    grid-column: span 2;
  }
}

.hero-card h2 {
  margin: 0;
  font-size: 1.8rem;
}

.realm {
  margin: 8px 0 20px;
  color: var(--success);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ascension-icon {
  font-size: 1.3rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
}

.realm button {
  font-size: 0.85rem;
  padding: 4px 12px;
  line-height: 1.2;
}

.metrics {
  display: flex;
  gap: 16px;
  margin-bottom: 22px;
}

.metric {
  flex: 1;
  background: rgba(23, 35, 58, 0.6);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(116, 162, 255, 0.2);
}

.metric .label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.metric .value {
  font-size: 1.2rem;
  font-weight: 600;
}

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

.progress-text {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

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

@media (min-width: 720px) {
  .weather-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.weather-current {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weather-icon {
  font-size: 2.4rem;
}

.weather-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.weather-meta strong {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.weather-meta small {
  color: rgba(205, 218, 255, 0.72);
  font-size: 0.78rem;
}

.weather-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.weather-region {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: rgba(205, 218, 255, 0.74);
}

.weather-region select {
  min-width: 140px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(18, 28, 48, 0.68);
  border: 1px solid rgba(112, 150, 255, 0.35);
  color: inherit;
}

.weather-countdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
  color: rgba(205, 218, 255, 0.74);
}

.weather-countdown strong {
  font-size: 1rem;
  color: rgba(230, 240, 255, 0.88);
}

.weather-highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.weather-highlights li {
  font-size: 0.82rem;
  color: rgba(205, 218, 255, 0.82);
  display: flex;
  align-items: center;
  gap: 6px;
}

.weather-highlights li::before {
  content: "•";
  color: rgba(130, 180, 255, 0.9);
}

.weather-feedback {
  font-size: 0.78rem;
  color: rgba(205, 218, 255, 0.6);
}

.weather-shenyuan-ticker {
  margin-top: 12px;
  max-height: 72px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  color: #fcefe3;
  background: rgba(38, 45, 62, 0.45);
  border: 1px solid rgba(255, 181, 92, 0.4);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weather-shenyuan-ticker::before,
.weather-shenyuan-ticker::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  pointer-events: none;
}

.weather-shenyuan-ticker::before {
  top: 0;
  background: linear-gradient(180deg, rgba(18, 21, 30, 0.85), rgba(18, 21, 30, 0));
}

.weather-shenyuan-ticker::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(18, 21, 30, 0.85), rgba(18, 21, 30, 0));
}

.shenyuan-ticker-entry {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(38, 52, 84, 0.8);
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(99, 143, 255, 0.8), rgba(61, 215, 255, 0.9));
  transition: width 0.3s ease;
}

.actions {
  display: grid;
  gap: 16px;
}

.action-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background: rgba(24, 39, 66, 0.7);
  border: 1px solid rgba(108, 164, 255, 0.25);
  border-radius: 18px;
  padding: 16px 20px;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
  min-height: 88px;
  position: relative;
}

.action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(75, 123, 255, 0.35);
}

.action-button small {
  font-weight: 500;
  color: var(--text-secondary);
}

.action-weather {
  color: rgba(160, 205, 255, 0.82);
  font-size: 0.78rem;
}

.log-card {
  max-height: 360px;
  overflow-y: auto;
}

.log-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
}

.log-list li {
  background: rgba(18, 29, 49, 0.7);
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(86, 136, 255, 0.2);
  line-height: 1.5;
}

.log-list time {
  display: block;
  font-size: 0.8rem;
  color: rgba(220, 228, 255, 0.6);
  margin-bottom: 4px;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.map-reset-badge {
  font-size: 0.74rem;
  color: rgba(200, 214, 255, 0.7);
  background: rgba(26, 42, 70, 0.62);
  border: 1px solid rgba(118, 160, 255, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
}

.map-tile {
  position: relative;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  border: 1px solid rgba(104, 148, 255, 0.35);
  background: rgba(24, 38, 65, 0.7);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.map-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(80, 134, 255, 0.35);
}

.map-tile.claimed {
  background: rgba(54, 80, 135, 0.65);
  border-color: rgba(146, 186, 255, 0.45);
}

.map-tile.disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.map-tile-label {
  font-size: 0.85rem;
  color: rgba(205, 218, 255, 0.72);
}

.map-tile-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.map-feedback {
  min-height: 20px;
  font-size: 0.9rem;
  color: rgba(200, 220, 255, 0.8);
}

.map-empty {
  text-align: center;
  padding: 18px;
  border-radius: 14px;
  border: 1px dashed rgba(120, 160, 255, 0.35);
  color: rgba(205, 218, 255, 0.7);
  background: rgba(20, 30, 52, 0.45);
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leaderboard-sections {
  display: grid;
  gap: 1.5rem;
}

.leaderboard-section header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
}

.leaderboard-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.leaderboard-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(24, 36, 62, 0.65);
  border: 1px solid rgba(98, 142, 255, 0.3);
}

.leaderboard-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.leaderboard-rank {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74, 116, 255, 0.28);
  color: var(--text-primary);
  font-weight: 600;
}

.leaderboard-name {
  font-weight: 600;
}

.leaderboard-meta {
  display: flex;
  gap: 10px;
  font-size: 0.85rem;
  color: rgba(205, 218, 255, 0.75);
}

.leaderboard-empty {
  text-align: center;
  padding: 16px;
  color: rgba(200, 214, 255, 0.7);
}

.arena-card .panel-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.arena-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.arena-status-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.arena-message {
  margin: 0;
  color: var(--text-secondary);
  white-space: pre-line;
}

.arena-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.arena-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.arena-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(98, 142, 255, 0.15);
}

.arena-list li:last-child {
  border-bottom: none;
}

.arena-player {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.arena-meta {
  display: flex;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.arena-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 1rem 0;
}

.arena-history .arena-list li {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.4rem;
}

.arena-match-meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.arena-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(98, 142, 255, 0.18);
  color: rgba(98, 142, 255, 0.95);
  font-size: 0.75rem;
}

.arena-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .leaderboard-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .arena-content {
    flex-direction: row;
  }

  .arena-status,
  .arena-top,
  .arena-history {
    flex: 1;
  }
}

.inventory-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 6px;
  flex: 1 1 auto;
  min-height: 0;
}


.inventory-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(96, 144, 255, 0.3);
  background: rgba(24, 36, 62, 0.6);
  gap: 12px;
}

.inventory-item-equipment {
  border: 1px solid rgba(96, 144, 255, 0.35);
  border-left: 3px solid rgba(118, 176, 255, 0.55);
  background: rgba(30, 42, 70, 0.62);
}

.inventory-item-equipment[data-refine-grade] {
  border-left-color: var(--equipment-grade-color, rgba(135, 196, 255, 0.85));
}

.inventory-actions-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid rgba(118, 160, 255, 0.35);
  background: rgba(20, 32, 60, 0.6);
  flex: 0 0 auto;
}

.inventory-actions-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inventory-actions-summary > span {
  font-size: 0.9rem;
  color: rgba(210, 225, 255, 0.85);
}

.inventory-feedback {
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(255, 235, 190, 0.9);
  background: rgba(255, 200, 120, 0.08);
  border: 1px solid rgba(255, 200, 120, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
}

.inventory-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inventory-actions-note {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: rgba(200, 214, 255, 0.68);
}

.inventory-select-wrapper {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
}

.inventory-select-input {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  accent-color: rgba(118, 160, 255, 0.85);
}

.inventory-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inventory-filter-row select {
  min-width: 120px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(118, 160, 255, 0.4);
  background: rgba(14, 24, 46, 0.65);
  color: var(--text-primary);
}

.inventory-filter-row button {
  white-space: nowrap;
}

.inventory-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inventory-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inventory-name {
  font-weight: 600;
  color: var(--text-primary);
}

.inventory-detail {
  font-size: 0.8rem;
  color: rgba(205, 218, 255, 0.7);
}

.inventory-qty {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(200, 220, 255, 0.9);
}

.inventory-item-equipment .inventory-qty {
  color: rgba(150, 208, 255, 0.95);
}

.inventory-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inventory-price {
  font-size: 0.82rem;
  color: rgba(255, 212, 160, 0.85);
}

.inventory-actions input {
  width: 64px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(108, 143, 255, 0.4);
  background: rgba(14, 22, 40, 0.6);
  color: var(--text-primary);
}

.inventory-empty {
  text-align: center;
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed rgba(100, 150, 255, 0.35);
  color: rgba(205, 218, 255, 0.7);
  background: rgba(20, 30, 54, 0.45);
}

.store-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: rgba(205, 218, 255, 0.85);
}

.store-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding-right: 8px;
  flex: 1 1 auto;
  min-height: 0;
}

.store-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(120, 162, 255, 0.35);
  background: rgba(24, 36, 62, 0.6);
  gap: 12px;
}

.market-item {
  border: 1px solid rgba(120, 162, 255, 0.35);
  border-left: 3px solid rgba(118, 160, 255, 0.45);
  background: rgba(24, 36, 62, 0.6);
}

.market-item[style*="--equipment-grade-color"] {
  border-left-color: var(--equipment-grade-color, rgba(135, 196, 255, 0.85));
}

.store-item-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.store-item-title {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.store-market-name {
  font-weight: 600;
  margin-right: 6px;
}

.store-market-slot {
  margin-left: auto;
  font-size: 0.78rem;
  color: rgba(200, 214, 255, 0.72);
  text-transform: uppercase;
}

.store-item-detail {
  font-size: 0.82rem;
  color: rgba(205, 218, 255, 0.72);
}

.store-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.store-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.85rem;
  color: rgba(205, 218, 255, 0.8);
  grid-column: 1 / -1;
  flex: 0 0 auto;
}

.store-section-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(205, 225, 255, 0.85);
  padding: 6px 4px;
  text-align: left;
  grid-column: 1 / -1;
  flex: 0 0 auto;
}

.store-item-actions input {
  width: 64px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(108, 143, 255, 0.4);
  background: rgba(14, 22, 40, 0.6);
  color: var(--text-primary);
}

.store-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
  flex: 0 0 auto;
}

.store-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.store-filter-bar > * {
  flex: 1 1 220px;
}

.store-search-input {
  width: 100%;
  max-width: 320px;
  min-width: 200px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(118, 160, 255, 0.35);
  background: rgba(14, 22, 40, 0.7);
  color: var(--text-primary);
}

.store-filter-group select {
  min-width: 140px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(118, 160, 255, 0.35);
  background: rgba(14, 22, 40, 0.7);
  color: var(--text-primary);
}

.store-list .inventory-empty {
  grid-column: 1 / -1;
}

@media (min-width: 1080px) {
  .game .grid .store-card {
    grid-column: auto;
  }
}

.store-feedback {
  min-height: 20px;
  font-size: 0.9rem;
  color: rgba(205, 218, 255, 0.8);
}

.equipment-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  grid-column: auto;
}

.equipment-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  flex: 0 0 auto;
}

.equipment-slot {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(112, 152, 255, 0.35);
  background: rgba(26, 38, 62, 0.65);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.equipment-slot-title {
  font-weight: 600;
  color: var(--text-primary);
}

.equipment-slot-content {
  font-size: 0.85rem;
  color: rgba(205, 218, 255, 0.86);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.equipment-slot-name {
  display: flex;
  align-items: center;
  gap: 6px;
}

.equipment-slot-power {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(210, 225, 255, 0.92);
}

.equipment-slot-detail {
  font-size: 0.8rem;
  color: rgba(205, 218, 255, 0.7);
}

.equipment-slot-attrs {
  font-size: 0.78rem;
  color: rgba(205, 218, 255, 0.74);
}

.equipment-slot-desc {
  font-size: 0.78rem;
  color: rgba(200, 214, 255, 0.64);
  line-height: 1.4;
}

.equipment-slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.equipment-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.equipment-slot-highlight {
  border-color: rgba(146, 190, 255, 0.78);
  box-shadow: 0 12px 28px rgba(34, 64, 120, 0.32);
}

.equipment-item-highlight {
  border-color: rgba(146, 190, 255, 0.78);
  border-left-color: rgba(146, 190, 255, 0.88);
  box-shadow: 0 12px 28px rgba(34, 64, 120, 0.28);
}

.equipment-set-block {
  border-radius: 12px;
  border: 1px solid rgba(104, 150, 255, 0.22);
  background: rgba(18, 28, 50, 0.58);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.equipment-set-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(210, 222, 255, 0.9);
}

.equipment-set-summary {
  font-size: 0.78rem;
  color: rgba(205, 218, 255, 0.74);
}

.equipment-set-note {
  font-size: 0.76rem;
  color: rgba(200, 214, 255, 0.64);
}

.equipment-attribute-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
  color: rgba(205, 218, 255, 0.78);
}

.equipment-attribute-list li {
  position: relative;
}

.equipment-attribute-list li.is-locked::after {
  content: "（锁定）";
  color: rgba(255, 214, 120, 0.92);
  margin-left: 2px;
  font-size: 0.74rem;
}

.equipment-action-btn {
  align-self: flex-start;
}

.equipment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding-right: 8px;
  flex: 1 1 auto;
  min-height: 0;
}

.equipment-card .panel-content .equipment-list,
.equipment-card .panel-content .equipment-feedback {
  display: none;
}

.equipment-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(104, 150, 255, 0.28);
  border-left: 3px solid rgba(104, 150, 255, 0.38);
  background: rgba(24, 36, 64, 0.62);
  gap: 10px;
}

.equipment-item[data-refine-grade] {
  border-left-color: var(--equipment-grade-color, rgba(135, 196, 255, 0.85));
}

.equipment-item-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.equipment-item-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.equipment-name {
  font-weight: 600;
  color: var(--text-primary);
}

.equipment-power {
  margin-left: auto;
  font-size: 0.85rem;
  color: rgba(210, 220, 255, 0.85);
  font-weight: 600;
}

.equipment-refine-badge,
.inventory-refine-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(166, 196, 255, 0.92);
  margin-left: 6px;
}

.equipment-detail {
  font-size: 0.82rem;
  color: rgba(200, 214, 255, 0.72);
}

.equipment-compare,
.inventory-compare {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 2px;
}

.equipment-compare.positive,
.inventory-compare.positive {
  color: var(--success);
}

.equipment-compare.negative,
.inventory-compare.negative {
  color: #ff8f8f;
}

.equipment-compare.neutral,
.inventory-compare.neutral {
  color: rgba(200, 214, 255, 0.72);
}

.equipment-equipped-flag {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  font-size: 0.76rem;
  border-radius: 8px;
  background: rgba(106, 164, 255, 0.18);
  color: rgba(208, 226, 255, 0.92);
  border: 1px solid rgba(106, 164, 255, 0.36);
  width: fit-content;
}

.equipment-item-actions {
  flex: 0 0 auto;
}

.equipment-feedback {
  min-height: 20px;
  font-size: 0.9rem;
  color: rgba(205, 218, 255, 0.8);
}

.equipment-empty {
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(104, 150, 255, 0.35);
  background: rgba(18, 30, 50, 0.5);
  color: rgba(205, 218, 255, 0.72);
  text-align: center;
}

.attributes-card,
.skills-card,
.sect-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.store-card .panel-content,
.inventory-card .panel-content,
.equipment-card .panel-content,
.skills-card .panel-content,
.sect-card .panel-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.skills-card .panel-content {
  gap: 10px;
  min-height: 0;
}

.skill-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}

.skill-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(90, 130, 180, 0.35);
  background: rgba(26, 36, 58, 0.6);
  color: rgba(210, 222, 255, 0.85);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.skill-tab.active,
.skill-tab[aria-selected="true"] {
  background: rgba(92, 138, 255, 0.35);
  border-color: rgba(120, 168, 255, 0.6);
  color: rgba(235, 244, 255, 0.95);
  box-shadow: 0 8px 18px rgba(80, 132, 255, 0.25);
}

.skill-tab-panels {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.skill-tab-panel {
  display: block;
}

.skill-tab-panel.hidden {
  display: none;
}

.alchemy-card .panel-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.alchemy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.alchemy-progress {
  flex: 1 1 120px;
  height: 8px;
  border-radius: 999px;
  background: rgba(80, 110, 160, 0.25);
  overflow: hidden;
}

.alchemy-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(126, 214, 255, 0.85), rgba(54, 122, 255, 0.9));
  transition: width 0.3s ease;
}

.alchemy-message {
  min-height: 20px;
  color: rgba(200, 220, 255, 0.85);
}

.alchemy-section h4 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: rgba(226, 238, 255, 0.9);
}

.alchemy-recipe-list,
.alchemy-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alchemy-codex-summary {
  font-size: 0.85rem;
  color: rgba(206, 222, 255, 0.85);
  line-height: 1.5;
  min-height: 1.2em;
}

.alchemy-achievement-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alchemy-achievement-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(96, 140, 255, 0.25);
  background: rgba(20, 32, 56, 0.6);
  color: rgba(210, 225, 255, 0.85);
}

.alchemy-achievement-item[data-achieved="true"] {
  border-color: rgba(126, 214, 255, 0.55);
  background: rgba(30, 60, 95, 0.7);
  box-shadow: 0 0 12px rgba(126, 214, 255, 0.15);
}

.alchemy-achievement-item strong {
  font-size: 0.9rem;
  color: rgba(226, 238, 255, 0.92);
}

.alchemy-achievement-item span {
  font-size: 0.82rem;
  color: rgba(198, 214, 255, 0.78);
}

.alchemy-achievement-status {
  color: rgba(180, 205, 255, 0.8);
}

.alchemy-achievement-item[data-achieved="true"] .alchemy-achievement-status {
  color: #7ed6ff;
}

.alchemy-codex-titles {
  font-size: 0.82rem;
  color: rgba(222, 236, 255, 0.85);
}

.alchemy-recipe-list li {
  border: 1px solid rgba(90, 130, 180, 0.35);
  border-radius: 14px;
  padding: 14px;
  background: rgba(22, 32, 52, 0.75);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alchemy-recipe-mastered {
  border-color: rgba(126, 214, 255, 0.45) !important;
  box-shadow: 0 0 12px rgba(126, 214, 255, 0.12);
  position: relative;
}

.alchemy-recipe-mastered::after {
  content: "已炼成";
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.72rem;
  color: #7ed6ff;
  border: 1px solid rgba(126, 214, 255, 0.6);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(18, 36, 60, 0.8);
}

.alchemy-recipe-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.alchemy-recipe-meta {
  font-size: 0.85rem;
  color: rgba(200, 214, 255, 0.75);
}

.alchemy-recipe-cost {
  font-size: 0.82rem;
  color: rgba(169, 190, 255, 0.8);
}

.alchemy-recipe-actions {
  display: flex;
  justify-content: flex-end;
}

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

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

.alchemy-custom-grid span {
  font-size: 0.82rem;
  color: rgba(185, 205, 255, 0.75);
  display: block;
  margin-bottom: 4px;
}

.alchemy-custom-form input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(90, 130, 180, 0.35);
  background: rgba(18, 26, 44, 0.7);
  color: var(--text-primary);
}

.alchemy-custom-form select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(90, 130, 180, 0.35);
  background: rgba(18, 26, 44, 0.7);
  color: var(--text-primary);
}

.alchemy-hint {
  font-size: 0.82rem;
  color: rgba(190, 206, 255, 0.7);
}

.alchemy-history-list li {
  border: 1px dashed rgba(90, 130, 180, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(200, 214, 255, 0.85);
}

.skill-tree-section {
  margin-top: 12px;
  border-top: 1px solid rgba(90, 130, 180, 0.25);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-tree-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.skill-tree-header strong {
  display: block;
  margin-bottom: 4px;
}

.skill-tree-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tree-tabs button {
  border: 1px solid rgba(90, 130, 180, 0.35);
  border-radius: 999px;
  background: rgba(26, 36, 58, 0.7);
  color: rgba(210, 222, 255, 0.85);
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.skill-tree-tabs button[aria-selected="true"] {
  background: rgba(92, 138, 255, 0.35);
  border-color: rgba(120, 168, 255, 0.6);
  color: rgba(235, 244, 255, 0.95);
}

.skill-tree-node-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skill-tree-node {
  border: 1px solid rgba(90, 130, 180, 0.35);
  border-radius: 14px;
  padding: 14px;
  background: rgba(22, 30, 48, 0.7);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-tree-node[data-status="unlocked"] {
  border-color: rgba(126, 214, 255, 0.6);
  background: rgba(28, 42, 68, 0.85);
}

.skill-tree-node-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.skill-tree-node-meta {
  font-size: 0.82rem;
  color: rgba(190, 206, 255, 0.75);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skill-tree-node-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.skill-tree-message {
  min-height: 18px;
  font-size: 0.82rem;
  color: rgba(190, 206, 255, 0.75);
}

.sect-card .panel-content {
  gap: 14px;
}

.store-list,
.inventory-list,
.equipment-list,
.skill-list,
.sect-list {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow-y: auto;
}

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

.attribute-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(118, 160, 255, 0.35);
  background: rgba(24, 34, 58, 0.6);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attribute-label {
  font-size: 0.85rem;
  color: rgba(205, 218, 255, 0.7);
}

.attribute-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.attribute-toggle {
  align-self: flex-start;
  margin-top: 4px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 24, 0.68);
  backdrop-filter: blur(2px);
  z-index: 3200;
}

.attribute-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3210;
  padding: 20px;
}

.attribute-modal[hidden],
.modal-overlay[hidden] {
  display: none;
}

.attribute-modal-content {
  width: min(540px, 100%);
  max-height: min(560px, 100%);
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid rgba(118, 160, 255, 0.32);
  background: linear-gradient(160deg, rgba(20, 30, 52, 0.95), rgba(10, 18, 36, 0.94));
  box-shadow: 0 18px 46px rgba(6, 12, 30, 0.48);
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.attribute-modal-content:focus {
  outline: 2px solid rgba(116, 168, 255, 0.72);
  outline-offset: 3px;
}

.attribute-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.attribute-modal-header h4 {
  margin: 0;
  font-size: 1.1rem;
  color: rgba(214, 224, 255, 0.96);
}

.modal-close-button {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(214, 224, 255, 0.88);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.modal-close-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.equipment-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3210;
  padding: 20px;
}

.equipment-modal[hidden] {
  display: none;
}

.equipment-modal-content {
  width: min(640px, 100%);
  max-height: min(600px, 100%);
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid rgba(118, 160, 255, 0.28);
  background: linear-gradient(155deg, rgba(20, 28, 48, 0.96), rgba(10, 16, 34, 0.94));
  box-shadow: 0 18px 46px rgba(6, 12, 30, 0.48);
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.equipment-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.equipment-modal-header h4 {
  margin: 0;
  font-size: 1.1rem;
  color: rgba(214, 224, 255, 0.96);
}

.equipment-modal-subtitle {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: rgba(200, 214, 255, 0.72);
}

.equipment-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.equipment-modal-section {
  border-radius: 14px;
  border: 1px solid rgba(110, 154, 255, 0.22);
  background: rgba(16, 26, 46, 0.68);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.equipment-modal-section h5 {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(214, 224, 255, 0.92);
}

.equipment-modal-section p {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(200, 214, 255, 0.72);
  line-height: 1.5;
}

.equipment-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.equipment-modal-cost {
  font-size: 0.78rem;
  color: rgba(199, 212, 255, 0.75);
}

.equipment-modal-feedback {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(255, 214, 134, 0.88);
}

.equipment-attribute-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.equipment-attribute-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(120, 160, 255, 0.28);
  background: rgba(18, 28, 48, 0.58);
  font-size: 0.78rem;
  color: rgba(205, 218, 255, 0.86);
}

.equipment-attribute-option input {
  accent-color: rgba(120, 168, 255, 0.86);
}

.equipment-lock-note {
  font-size: 0.74rem;
  color: rgba(212, 222, 255, 0.62);
}

.tribulation-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3220;
  padding: 20px;
}

.tribulation-modal[hidden] {
  display: none;
}

.tribulation-modal-content {
  width: min(420px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(126, 178, 255, 0.38);
  background: linear-gradient(165deg, rgba(17, 26, 44, 0.98), rgba(6, 12, 26, 0.95));
  box-shadow: 0 18px 48px rgba(8, 12, 28, 0.55);
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tribulation-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tribulation-modal-header h4 {
  margin: 0;
  font-size: 1.2rem;
  color: rgba(224, 234, 255, 0.95);
}

.tribulation-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
  color: rgba(205, 216, 255, 0.85);
}

.tribulation-summary strong {
  color: rgba(255, 255, 255, 0.95);
}

.tribulation-bonus {
  font-size: 0.78rem;
  color: rgba(144, 200, 255, 0.9);
}

.tribulation-cost {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 0.9rem;
  color: rgba(205, 216, 255, 0.86);
}

.tribulation-cost strong {
  color: rgba(255, 255, 255, 0.92);
}

.tribulation-cost small {
  color: rgba(140, 210, 255, 0.86);
  font-size: 0.78rem;
}

.tribulation-message {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: rgba(255, 190, 150, 0.88);
}

.tribulation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.tribulation-actions .primary-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.tribulation-modal-content:focus {
  outline: 2px solid rgba(126, 176, 255, 0.8);
  outline-offset: 4px;
}

.attribute-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weather-forecast-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3210;
  padding: 20px;
}

.weather-forecast-modal[hidden] {
  display: none;
}

.weather-forecast-content {
  width: min(520px, 100%);
  max-height: min(520px, 100%);
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid rgba(108, 152, 255, 0.3);
  background: linear-gradient(160deg, rgba(18, 26, 48, 0.96), rgba(10, 18, 36, 0.94));
  box-shadow: 0 18px 46px rgba(6, 12, 30, 0.48);
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.weather-forecast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.weather-forecast-header h4 {
  margin: 0;
  font-size: 1.1rem;
  color: rgba(218, 228, 255, 0.95);
}

.weather-forecast-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.weather-forecast-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(110, 160, 255, 0.25);
  background: rgba(16, 24, 44, 0.68);
}

.weather-forecast-item.rare {
  border-color: rgba(255, 210, 120, 0.6);
  box-shadow: 0 0 18px rgba(255, 210, 120, 0.22);
}

.weather-forecast-item .forecast-icon {
  font-size: 1.8rem;
}

.weather-forecast-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.weather-forecast-body strong {
  color: rgba(220, 230, 255, 0.92);
}

.weather-forecast-body span {
  font-size: 0.8rem;
  color: rgba(205, 218, 255, 0.72);
}

.weather-forecast-feedback {
  font-size: 0.78rem;
  color: rgba(205, 218, 255, 0.62);
}

.attribute-section h4 {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(205, 218, 255, 0.84);
}

.attribute-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attribute-list-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(110, 150, 255, 0.25);
  background: rgba(15, 24, 42, 0.64);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attribute-list-item strong {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.attribute-list-item span {
  font-size: 0.82rem;
  color: rgba(205, 218, 255, 0.72);
}

.attribute-item-desc {
  color: rgba(205, 218, 255, 0.6);
}

.attribute-item-detail {
  color: rgba(205, 218, 255, 0.68);
  font-size: 0.8rem;
}

body.modal-open {
  overflow: hidden;
}

.skill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.skill-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(110, 150, 255, 0.35);
  background: rgba(24, 36, 62, 0.6);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-title {
  font-weight: 600;
  color: var(--text-primary);
}

.skill-detail {
  font-size: 0.82rem;
  color: rgba(205, 218, 255, 0.72);
}

.skill-progress {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(195, 210, 255, 0.75);
}

.skill-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(40, 60, 90, 0.6);
  overflow: hidden;
}

.skill-progress-inner {
  height: 100%;
  background: linear-gradient(90deg, rgba(116, 160, 255, 0.9), rgba(86, 230, 255, 0.9));
  transition: width 0.3s ease;
}

.sect-info {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(110, 150, 255, 0.35);
  background: rgba(24, 38, 64, 0.6);
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 0 0 auto;
}

.sect-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sect-header .icon-button {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 6px 10px;
}

.sect-header #sectInfo {
  flex: 1 1 auto;
}

.sect-header .icon-button:hover,
.sect-header .icon-button:focus-visible {
  background: rgba(86, 180, 255, 0.18);
}

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

.sect-info-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sect-level-badge {
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(120, 180, 255, 0.5);
  background: rgba(30, 60, 110, 0.6);
  font-size: 0.85rem;
  color: rgba(200, 220, 255, 0.9);
}

.sect-info-desc {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(205, 218, 255, 0.76);
  line-height: 1.5;
}

.sect-info-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: rgba(210, 225, 255, 0.85);
}

.sect-passive-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.82rem;
  color: rgba(205, 218, 255, 0.82);
}

.sect-passive-summary strong {
  color: rgba(226, 236, 255, 0.95);
}

.sect-contribution-board {
  border: 1px dashed rgba(118, 160, 255, 0.35);
  background: rgba(16, 28, 52, 0.5);
  padding: 10px 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sect-contribution-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: rgba(210, 225, 255, 0.9);
}

.sect-contribution-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sect-contribution-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(24, 38, 66, 0.55);
  border-left: 3px solid rgba(118, 160, 255, 0.4);
}

.sect-contribution-item[data-rank="1"] {
  border-left-color: #ffd54f;
}

.sect-contribution-item[data-rank="2"] {
  border-left-color: #90caf9;
}

.sect-contribution-item[data-rank="3"] {
  border-left-color: #ce93d8;
}

.sect-contribution-rank {
  font-weight: 700;
  color: rgba(210, 225, 255, 0.9);
  min-width: 40px;
}

.sect-contribution-name {
  font-weight: 600;
  color: rgba(215, 225, 255, 0.9);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sect-contribution-amount {
  margin-left: auto;
  font-size: 0.82rem;
  color: rgba(210, 225, 255, 0.8);
}

.sect-contribution-bonus {
  font-size: 0.78rem;
  color: var(--success);
  margin-left: 6px;
}

.sect-contribution-empty {
  text-align: center;
  padding: 6px;
  font-size: 0.82rem;
  color: rgba(200, 214, 255, 0.7);
  background: rgba(24, 38, 66, 0.45);
  border-radius: 10px;
}

.sect-contribution-bonus-hint {
  font-size: 0.78rem;
  color: rgba(200, 214, 255, 0.68);
}

.sect-contribution-self {
  font-size: 0.82rem;
  color: rgba(210, 225, 255, 0.85);
}

.sect-skill-board {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(112, 158, 255, 0.3);
  background: rgba(18, 30, 52, 0.58);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sect-skill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  color: rgba(215, 228, 255, 0.86);
}

.sect-skill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sect-skill-item {
  border-radius: 12px;
  border: 1px solid rgba(112, 158, 255, 0.32);
  background: rgba(16, 28, 52, 0.6);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sect-skill-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: rgba(235, 240, 255, 0.95);
}

.sect-skill-tier {
  font-size: 0.75rem;
  color: rgba(200, 214, 255, 0.68);
  background: rgba(28, 44, 78, 0.75);
  border-radius: 999px;
  padding: 2px 8px;
}

.sect-skill-badge {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid rgba(118, 160, 255, 0.35);
}

.sect-skill-badge.locked {
  color: rgba(255, 200, 130, 0.86);
  border-color: rgba(255, 200, 130, 0.4);
  background: rgba(58, 42, 24, 0.6);
}

.sect-skill-badge.unlocked {
  color: rgba(118, 200, 255, 0.88);
  border-color: rgba(118, 200, 255, 0.45);
  background: rgba(24, 50, 78, 0.6);
}

.sect-skill-badge.learned {
  color: rgba(120, 210, 145, 0.92);
  border-color: rgba(120, 210, 145, 0.45);
  background: rgba(22, 44, 30, 0.6);
}

.sect-skill-desc {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(205, 218, 255, 0.75);
  line-height: 1.5;
}

.sect-skill-effects {
  list-style: disc;
  margin: 0 0 0 18px;
  padding: 0;
  font-size: 0.78rem;
  color: rgba(200, 214, 255, 0.68);
}

.sect-skill-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sect-skill-status {
  font-size: 0.82rem;
  color: rgba(200, 214, 255, 0.7);
}

.sect-skill-empty {
  font-size: 0.82rem;
  color: rgba(205, 218, 255, 0.7);
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(112, 158, 255, 0.25);
  background: rgba(16, 28, 52, 0.45);
}

.trial-status {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(112, 158, 255, 0.28);
  background: rgba(20, 32, 58, 0.55);
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(215, 225, 255, 0.85);
}

.trial-summary {
  margin-top: 16px;
}

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

.trial-summary-item {
  border-radius: 12px;
  border: 1px solid rgba(110, 154, 255, 0.3);
  background: rgba(18, 30, 54, 0.6);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trial-summary-label {
  font-size: 0.78rem;
  color: rgba(200, 214, 255, 0.68);
  letter-spacing: 0.5px;
}

.trial-summary-value {
  font-size: 1.12rem;
  color: rgba(235, 242, 255, 0.95);
}

.trial-auto-log {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(108, 156, 255, 0.32);
  background: rgba(22, 34, 62, 0.6);
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(220, 230, 255, 0.9);
}

.trial-auto-log p {
  margin: 4px 0;
}

.trial-actions {
  margin: 18px 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trial-auto-control {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(24, 36, 62, 0.6);
  border: 1px solid rgba(120, 162, 255, 0.28);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: rgba(215, 225, 255, 0.85);
}

.trial-auto-control span {
  white-space: nowrap;
}

.trial-auto-control input {
  width: 64px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(128, 168, 255, 0.35);
  background: rgba(12, 18, 36, 0.75);
  color: inherit;
  font: inherit;
}

.trial-note {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(205, 218, 255, 0.68);
}

.trial-history {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trial-history-item {
  border-radius: 12px;
  border: 1px solid rgba(110, 154, 255, 0.28);
  background: rgba(18, 30, 54, 0.52);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trial-history-item[data-outcome="success"] {
  border-left: 3px solid rgba(120, 210, 145, 0.65);
}

.trial-history-item[data-outcome="failure"] {
  border-left: 3px solid rgba(255, 138, 128, 0.5);
}

.trial-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  color: rgba(215, 225, 255, 0.85);
}

.trial-history-head time {
  font-size: 0.78rem;
  color: rgba(200, 214, 255, 0.65);
}

.trial-history-outcome {
  font-size: 0.86rem;
  color: rgba(215, 232, 255, 0.82);
}

.trial-history-summary {
  margin: 6px 0 4px;
  font-size: 0.84rem;
  line-height: 1.4;
  color: rgba(215, 225, 255, 0.85);
}

.trial-history-rewards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: rgba(210, 226, 255, 0.72);
}

.trial-history-empty {
  padding: 12px 0;
  font-size: 0.85rem;
  color: rgba(198, 212, 255, 0.7);
  text-align: center;
}

.team-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-summary-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
}

.team-summary-header strong {
  font-size: 1.05rem;
  color: rgba(235, 242, 255, 0.95);
}

.team-code-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.team-summary-code,
.team-summary-capacity {
  font-size: 0.78rem;
  color: rgba(200, 214, 255, 0.68);
  background: rgba(25, 40, 70, 0.6);
  border-radius: 999px;
  padding: 2px 10px;
}

.team-message {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(205, 218, 255, 0.7);
}

.team-message.warning {
  color: rgba(255, 200, 130, 0.82);
}

.team-code-copy {
  border: 1px solid rgba(112, 158, 255, 0.4);
  background: rgba(28, 44, 78, 0.6);
  color: rgba(215, 230, 255, 0.9);
  border-radius: 999px;
  padding: 2px 10px;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.team-code-copy:hover {
  border-color: rgba(140, 188, 255, 0.8);
  color: #fff;
  background: rgba(42, 62, 102, 0.72);
}

.team-actions {
  margin: 10px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.team-create-form,
.team-join-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.team-create-field,
.team-join-field {
  flex: 1 1 220px;
  display: inline-flex;
  align-items: center;
}

.team-create-field input,
.team-join-field input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(118, 160, 255, 0.35);
  background: rgba(14, 24, 46, 0.68);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.team-invites {
  border: 1px dashed rgba(118, 160, 255, 0.35);
  border-radius: 12px;
  background: rgba(20, 32, 60, 0.5);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.team-invite-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(215, 230, 255, 0.82);
}

.team-invite-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: rgba(205, 218, 255, 0.78);
}

.team-invite-actions {
  display: flex;
  gap: 6px;
}

.team-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-member-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(110, 154, 255, 0.3);
  background: rgba(18, 30, 54, 0.55);
}

.team-member-name {
  font-weight: 600;
  color: rgba(230, 238, 255, 0.96);
}

.team-member-badge {
  font-size: 0.74rem;
  color: rgba(200, 224, 255, 0.86);
  background: rgba(32, 52, 88, 0.8);
  border-radius: 999px;
  padding: 2px 8px;
}

.team-member-power {
  font-size: 0.78rem;
  color: rgba(200, 214, 255, 0.68);
}

.team-member-status {
  font-size: 0.78rem;
  color: rgba(200, 214, 255, 0.7);
  margin-left: auto;
}

.team-member-item[data-status="online"] .team-member-status {
  color: rgba(120, 210, 145, 0.9);
}

.team-member-item[data-status="offline"] .team-member-status {
  color: rgba(200, 214, 255, 0.55);
}

.team-member-empty {
  padding: 12px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(200, 214, 255, 0.7);
  background: rgba(18, 30, 52, 0.48);
  border-radius: 12px;
  border: 1px dashed rgba(110, 154, 255, 0.28);
}

.tiny-button {
  font-size: 0.75rem;
  padding: 4px 10px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sect-tasks {
  border: 1px solid rgba(120, 160, 255, 0.35);
  border-radius: 14px;
  background: rgba(18, 30, 60, 0.55);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sect-tasks-header {
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(215, 225, 255, 0.9);
}

.sect-task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sect-task-item {
  border: 1px solid rgba(120, 170, 255, 0.28);
  background: rgba(24, 38, 70, 0.6);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sect-task-item[data-status="completed"] {
  border-color: rgba(110, 210, 140, 0.45);
  background: rgba(24, 52, 38, 0.55);
}

.sect-task-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.sect-task-main strong {
  font-size: 0.9rem;
}

.sect-task-expire {
  font-size: 0.78rem;
  color: rgba(195, 210, 255, 0.68);
}

.sect-task-reward {
  font-size: 0.82rem;
  color: rgba(215, 225, 255, 0.82);
}

.sect-task-detail {
  font-size: 0.78rem;
  color: rgba(195, 208, 255, 0.7);
}

.sect-task-attributes {
  font-size: 0.78rem;
  color: rgba(210, 220, 255, 0.75);
}

.sect-task-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sect-task-status {
  font-size: 0.82rem;
  color: rgba(120, 210, 145, 0.95);
}

.sect-task-empty {
  font-size: 0.82rem;
  color: rgba(205, 218, 255, 0.7);
  text-align: center;
  padding: 8px 0;
}

#sectFeedback {
  flex: 0 0 auto;
}

.sect-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.sect-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(112, 152, 255, 0.35);
  background: rgba(22, 32, 58, 0.6);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sect-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sect-title {
  font-weight: 600;
  color: var(--text-primary);
}

.sect-detail,
.sect-benefits {
  font-size: 0.82rem;
  color: rgba(205, 218, 255, 0.72);
}

.sect-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sect-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sect-progress.small {
  gap: 4px;
}

.sect-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(200, 215, 255, 0.78);
}

.sect-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(40, 60, 90, 0.6);
  overflow: hidden;
}

.sect-progress-inner {
  height: 100%;
  background: linear-gradient(90deg, rgba(110, 180, 255, 0.9), rgba(120, 236, 255, 0.9));
  transition: width 0.3s ease;
}

.sect-progress-foot {
  font-size: 0.75rem;
  color: rgba(195, 210, 255, 0.7);
}

.sect-contribute {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sect-contribute input {
  width: 150px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(120, 160, 255, 0.45);
  background: rgba(18, 26, 44, 0.65);
  color: var(--text-primary);
}

.app-footer {
  justify-content: center;
  font-size: 0.9rem;
  color: rgba(205, 218, 255, 0.7);
}

@media (max-width: 640px) {
  .card {
    padding: 24px 20px;
  }
  .app-header,
  .app-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .metrics {
    flex-direction: column;
  }
  .action-button {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

.panel {
  border-radius: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 0;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.panel[open] {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 92vw);
  height: min(940px, 94vh);
  max-height: 94vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  z-index: 2001;
}

.panel[open] .panel-content {
  overflow-y: auto;
  padding: 24px;
}

.panel summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  list-style: none;
}

 .panel summary span.feature-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.panel summary span.feature-label {
  gap: 4px;
}

.panel summary > span {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.6rem;
  background: rgba(67, 97, 238, 0.18);
  color: #a5b4ff;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.panel-close-button {
  margin-left: auto;
  border: none;
  background: transparent;
  color: rgba(215, 226, 255, 0.85);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.panel-close-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}


.panel[open] summary {
  position: sticky;
  top: 0;
  background: rgba(16, 26, 48, 0.92);
  border-bottom: 1px solid rgba(108, 143, 255, 0.25);
  z-index: 1;
}

.panel summary::-webkit-details-marker {
  display: none;
}

.panel summary strong {
  font-size: 1.1rem;
}

.panel summary small {
  display: block;
  margin-top: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.panel .panel-content {
  padding: 0 24px 20px;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  flex: 1 1 auto;
}

.panel .panel-content > * + * {
  margin-top: 16px;
}

.panel .panel-content::-webkit-scrollbar,
.store-list::-webkit-scrollbar,
.inventory-list::-webkit-scrollbar,
.equipment-list::-webkit-scrollbar,
.sect-list::-webkit-scrollbar,
.sect-contribution-list::-webkit-scrollbar,
.skill-list::-webkit-scrollbar {
  width: 6px;
}

.panel .panel-content::-webkit-scrollbar-thumb,
.store-list::-webkit-scrollbar-thumb,
.inventory-list::-webkit-scrollbar-thumb,
.equipment-list::-webkit-scrollbar-thumb,
.sect-list::-webkit-scrollbar-thumb,
.sect-contribution-list::-webkit-scrollbar-thumb,
.skill-list::-webkit-scrollbar-thumb {
  background: rgba(130, 170, 255, 0.32);
  border-radius: 999px;
}

/* let individual panels control scroll via shared rules above */

.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.58);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.panel-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 4000;
  pointer-events: none;
}

.toast-message {
  min-width: 220px;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(120, 160, 255, 0.4);
  background: rgba(16, 24, 44, 0.86);
  color: rgba(230, 236, 255, 0.92);
  font-size: 0.9rem;
  box-shadow: 0 10px 28px rgba(8, 12, 28, 0.45);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.25s ease;
}

.toast-message[data-tone="success"] {
  border-color: rgba(120, 210, 145, 0.55);
  background: rgba(20, 40, 36, 0.9);
  color: rgba(210, 245, 220, 0.95);
}

.toast-message[data-tone="error"] {
  border-color: rgba(245, 155, 115, 0.6);
  background: rgba(50, 20, 20, 0.9);
  color: rgba(255, 220, 210, 0.95);
}

.toast-message button {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
  margin-left: auto;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.panel-open {
  overflow: hidden;
}
.panel:not([open]) .panel-close-button {
  display: none;
}

.panel[open] .panel-close-button {
  display: inline-flex;
}
#heroName {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leaderboard-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.store-item-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.store-item-price {
  font-size: 0.78rem;
  color: rgba(205, 228, 255, 0.75);
  background: rgba(40, 70, 110, 0.4);
  padding: 2px 10px;
  border-radius: 999px;
}

.vip-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  margin-left: 6px;
  background: linear-gradient(135deg, #52a7ff, #6cfffb);
  box-shadow: 0 0 18px rgba(108, 240, 255, 0.45);
  --glow: rgba(108, 240, 255, 0.45);
  font-size: 1.1rem;
}

.vip-badge::after {
  content: attr(data-tier);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: rgba(18, 30, 52, 0.85);
  border-radius: 999px;
  padding: 1px 6px;
  border: 1px solid rgba(120, 200, 255, 0.6);
  font-size: 0.7rem;
}

.vip-badge[data-level="vip1"],
.vip-badge[data-level="vip2"],
.vip-badge[data-level="vip3"] {
  background: radial-gradient(circle at 30% 30%, #61b5ff, #3a7dff);
  box-shadow: 0 0 16px rgba(90, 170, 255, 0.5);
}

.vip-badge[data-level="vip4"],
.vip-badge[data-level="vip5"],
.vip-badge[data-level="vip6"] {
  background: radial-gradient(circle at 30% 30%, #9c6dff, #563bff);
  box-shadow: 0 0 18px rgba(147, 103, 255, 0.55);
}

.vip-badge[data-level="vip7"],
.vip-badge[data-level="vip8"] {
  background: radial-gradient(circle at 30% 30%, #ff7adc, #ff3d78);
  box-shadow: 0 0 20px rgba(255, 118, 205, 0.6);
}

.vip-badge[data-level="vip9"] {
  background: radial-gradient(circle at 30% 30%, #ffd86a, #ff9b00);
  box-shadow: 0 0 22px rgba(255, 200, 80, 0.65);
}

.spirit-card .panel-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.spirit-section {
  background: rgba(18, 26, 43, 0.55);
  border: 1px solid rgba(129, 170, 255, 0.18);
  border-radius: 16px;
  padding: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.spirit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.spirit-header strong {
  font-size: 1.1rem;
}

.spirit-header small {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.spirit-progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.spirit-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.3s ease;
}

.spirit-stats,
.summon-stats {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.spirit-stats li span,
.summon-stats li span {
  margin-left: 4px;
  color: var(--text-primary);
  font-weight: 600;
}

.spirit-feed {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.spirit-feed label {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.spirit-feed select {
  border-radius: 12px;
  border: 1px solid rgba(120, 160, 255, 0.3);
  padding: 8px 10px;
  background: rgba(11, 18, 32, 0.8);
  color: var(--text-primary);
}

.spirit-feed-preview,
.spirit-feed-info,
.summon-train-info,
.spirit-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.spirit-feed-preview {
  min-height: 1em;
  color: rgba(225, 235, 255, 0.9);
}

.summon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 0.75rem;
}

.summon-train-levels {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.summon-train-levels input {
  width: 4.5rem;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(129, 170, 255, 0.25);
  background: rgba(11, 18, 32, 0.85);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.summon-train-levels input:focus {
  outline: none;
  border-color: rgba(159, 200, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.15);
}

.summon-gear {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summon-gear-item {
  flex: 1 1 140px;
  background: rgba(12, 20, 34, 0.65);
  border: 1px solid rgba(129, 170, 255, 0.16);
  border-radius: 12px;
  padding: 10px 12px;
}

.summon-gear-item strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.summon-gear-item small {
  display: block;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.summon-gear-stats {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.summon-abilities h4 {
  margin: 12px 0 8px;
  font-size: 0.95rem;
}

.summon-skill-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.summon-skill-list li strong {
  color: var(--text-primary);
  margin-right: 6px;
}

.summon-apl {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.forge-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.forge-branch {
  flex: 1 1 240px;
  background: rgba(16, 24, 38, 0.6);
  border: 1px solid rgba(129, 170, 255, 0.18);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.forge-branch h4 {
  margin: 0;
}

.forge-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

.forge-count-input {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.forge-count-input input {
  width: 4.5rem;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(129, 170, 255, 0.25);
  background: rgba(11, 18, 32, 0.85);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.forge-count-input input:focus {
  outline: none;
  border-color: rgba(159, 200, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.15);
}

.forge-progress-bar {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.forge-progress-inner {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, #ffb673, #ff7d4d);
  transition: width 0.3s ease;
}

.forge-synergy {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(26, 36, 52, 0.6);
  border: 1px solid rgba(129, 170, 255, 0.16);
}

.forge-synergy strong {
  display: block;
  margin-bottom: 4px;
}

.forge-synergy small {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.forge-message {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@media (max-width: 720px) {
  .summon-gear-item {
    flex: 1 1 100%;
  }
  .forge-grid {
    flex-direction: column;
  }
}

.feature-label strong {
  display: block;
}
.feature-label small {
  display: block;
  opacity: 0.8;
}
@media (max-width: 640px) {
  .panel summary {
    flex-direction: column;
    align-items: flex-start;
  }
  .panel summary > span {
    width: 100%;
  }
  .feature-icon {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 1rem;
  }
}

.spirit-hunt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.spirit-hunt-header strong {
  font-size: 1.05rem;
  color: var(--text-primary);
}

.spirit-hunt-header small {
  display: block;
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.spirit-hunt-feedback {
  min-height: 1em;
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.spirit-hunt-stages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spirit-hunt-stage {
  border: 1px solid rgba(129, 170, 255, 0.16);
  border-radius: 14px;
  padding: 12px;
  background: rgba(12, 20, 35, 0.68);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spirit-hunt-stage[aria-disabled="true"] {
  opacity: 0.58;
  pointer-events: none;
}

.spirit-hunt-stage .stage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.spirit-hunt-stage .stage-header strong {
  font-size: 1rem;
  color: var(--text-primary);
}

.spirit-hunt-stage .stage-header small,
.spirit-hunt-stage .stage-desc,
.spirit-hunt-stage .stage-drop {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.spirit-hunt-stage .stage-desc {
  line-height: 1.4;
}

.spirit-hunt-stage .stage-drop {
  color: rgba(206, 220, 255, 0.85);
}

.spirit-hunt-stage .stage-gear {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.78rem;
  color: rgba(209, 223, 255, 0.86);
}

.spirit-hunt-stage .stage-gear span {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(68, 102, 164, 0.32);
  border: 1px solid rgba(110, 152, 255, 0.26);
}

.spirit-hunt-stage .stage-actions {
  display: flex;
  justify-content: flex-end;
}

.spirit-hunt-stage button {
  align-self: flex-end;
}

.spirit-hunt-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(129, 170, 255, 0.28);
  background: rgba(10, 18, 32, 0.6);
  color: rgba(220, 230, 255, 0.92);
  font-size: 0.82rem;
  line-height: 1.5;
}

.spirit-hunt-result[hidden] {
  display: none;
}

.spirit-hunt-stage .stage-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.spirit-hunt-stage .stage-meta .stage-status-cleared {
  color: rgba(120, 232, 188, 0.92);
}

.spirit-hunt-stage .stage-meta .stage-status-locked {
  color: rgba(255, 178, 164, 0.88);
}

.spirit-hunt-result[data-success="true"] {
  border-color: rgba(120, 220, 180, 0.4);
}

.spirit-hunt-result[data-success="false"] {
  border-color: rgba(255, 150, 140, 0.35);
  color: rgba(255, 210, 210, 0.92);
}

.sanctum-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.sanctum-progress {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sanctum-progress-bar {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, #76f7ff 0%, #6a9cff 100%);
  transition: width 0.3s ease;
}

.sanctum-message {
  margin: 0 0 8px;
  min-height: 1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78);
}

.sanctum-status-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sanctum-status-block strong {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.sanctum-status-block small {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.64);
}

.sanctum-mode-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.sanctum-mode-selector button {
  width: 100%;
}

.sanctum-mode-selector button[data-active="true"] {
  box-shadow: 0 0 0 2px rgba(118, 247, 255, 0.35);
}

.sanctum-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  justify-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.sanctum-actions button[data-active="true"] {
  box-shadow: 0 0 0 2px rgba(118, 247, 255, 0.35);
}

.sanctum-preview {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78);
}

.sanctum-last-result {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.sanctum-next-hint {
  display: block;
  margin: -4px 0 12px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.62);
}

.sanctum-last-result h4 {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.78);
}

.sanctum-last-result p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

.trial-card .panel-content {
  display: grid;
  gap: 20px;
}

.trial-main-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.trial-team-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.trial-team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.trial-team-header strong {
  display: block;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.92);
}

.trial-team-header small {
  display: block;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
}

@media (min-width: 1024px) {
  .trial-card .panel-content {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: start;
  }
}
