/* ===== Header ===== */
.header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header .gear {
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px;
  transition: color 0.2s;
}
.header .gear:hover { color: var(--text); }

.header .logo {
  font-weight: 700;
  font-size: 1.25rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header .level {
  font-size: 0.813rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--bg-card);
  border-radius: 20px;
}

.header .back-btn {
  cursor: pointer;
  padding: 8px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.header .back-btn:hover { color: var(--text); }

.header-left {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 1200;
}

.active-slot-badge {
  font-size: 0.688rem;
  color: rgba(255, 255, 255, 0.4);
  padding: 2px 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  line-height: 1.4;
  white-space: nowrap;
}

.guest-gear-hint {
  position: absolute;
  top: 44px;
  left: 8px;
  width: min(230px, calc(100vw - 24px));
  padding: 10px 12px;
  background: rgba(15, 15, 20, 0.96);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 1300;
}

.guest-gear-hint::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 16px;
  width: 12px;
  height: 12px;
  background: rgba(15, 15, 20, 0.96);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  transform: rotate(45deg);
}

.guest-gear-hint__text {
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text-muted);
  padding-right: 18px;
}

.guest-gear-hint__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.guest-gear-hint__close:hover {
  color: var(--text);
}

.language-selector {
  margin-top: 12px;
}

.language-selector__options {
  display: flex;
  gap: 8px;
}

.language-option {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
}

.language-option.is-active {
  color: var(--text);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.scenario-unlock-toast {
  position: fixed;
  top: 68px;
  right: 16px;
  width: min(280px, calc(100vw - 24px));
  padding: 10px 34px 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  z-index: 1400;
}

.scenario-unlock-toast__text {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.scenario-unlock-toast__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.scenario-unlock-toast__close:hover {
  color: var(--text);
}

@media (max-width: 640px) {
  .header {
    height: auto;
    min-height: 56px;
    padding: 10px 12px;
    gap: 8px;
  }
  .header .logo {
    font-size: 1rem;
    text-align: center;
    flex: 1;
    min-width: 0;
  }
  .header .level {
    font-size: 0.75rem;
    padding: 5px 9px;
    flex-shrink: 0;
  }
  .header .back-btn,
  .header .gear {
    padding: 10px 8px;
  }
  .active-slot-badge {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 640px) {
  .guest-gear-hint {
    top: 46px;
    left: 0;
    width: min(220px, calc(100vw - 24px));
  }

  .scenario-unlock-toast {
    top: 62px;
    right: 12px;
    width: min(250px, calc(100vw - 24px));
  }
}
