#cfwar-room-list-root {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 2147483000;
  display: none;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #f8e7a8;
  -webkit-tap-highlight-color: transparent;
}

#cfwar-room-list-root.is-visible {
  display: block;
}

#cfwar-room-list-toggle {
  min-width: 104px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid #e7ba4f;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(40, 70, 121, .98), rgba(22, 38, 77, .98));
  box-shadow: 0 5px 16px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .16);
  color: #ffe9a3;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

#cfwar-room-list-panel {
  position: absolute;
  right: 0;
  bottom: 52px;
  width: min(370px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 100px));
  overflow: hidden;
  border: 1px solid rgba(231, 186, 79, .78);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 37, 72, .99), rgba(10, 22, 48, .99));
  box-shadow: 0 14px 38px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .1);
  display: none;
}

#cfwar-room-list-panel.is-open {
  display: flex;
  flex-direction: column;
}

.cfwar-room-list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 10px 0 15px;
  border-bottom: 1px solid rgba(231, 186, 79, .28);
  background: rgba(7, 16, 39, .72);
}

.cfwar-room-list-title {
  flex: 1;
  color: #ffe9a3;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
}

.cfwar-room-list-action {
  min-width: 44px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(231, 186, 79, .62);
  border-radius: 6px;
  background: rgba(45, 75, 124, .78);
  color: #f8e7a8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.cfwar-room-list-action:disabled {
  cursor: default;
  opacity: .55;
}

.cfwar-room-list-status {
  padding: 12px 15px;
  color: #cbd7ef;
  font-size: 13px;
  line-height: 1.45;
}

.cfwar-room-list-items {
  min-height: 76px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
}

.cfwar-room-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
  margin-bottom: 7px;
  padding: 11px 12px;
  border: 1px solid rgba(133, 165, 218, .32);
  border-radius: 8px;
  background: rgba(37, 61, 104, .64);
}

.cfwar-room-row:last-child {
  margin-bottom: 0;
}

.cfwar-room-id {
  color: #fff3bd;
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.cfwar-room-meta {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #b9cae8;
  font-size: 12px;
}

.cfwar-room-tag {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .08);
}

.cfwar-room-tag.is-playing {
  color: #ffd77b;
}

.cfwar-room-join {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 66px;
  height: 36px;
  border: 1px solid #e7ba4f;
  border-radius: 7px;
  background: linear-gradient(180deg, #d95b35, #a63225);
  color: #fff3ca;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.cfwar-room-join:disabled {
  border-color: rgba(255, 255, 255, .18);
  background: rgba(100, 110, 128, .55);
  color: rgba(255, 255, 255, .55);
  cursor: default;
}

@media (max-width: 520px) {
  #cfwar-room-list-root {
    right: 12px;
    bottom: 14px;
  }

  #cfwar-room-list-toggle {
    min-width: 92px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }

  #cfwar-room-list-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 64px;
    width: auto;
    max-height: calc(100vh - 90px);
  }
}
