.match-wait-dock {
  position: fixed;
  z-index: 120;
  top: max(2px, env(safe-area-inset-top));
  left: 50%;
  width: min(268px, calc(100vw - max(20px, env(safe-area-inset-left)) - max(20px, env(safe-area-inset-right))));
  min-width: 0;
  color: #f6f7f9;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Pretendard, sans-serif;
  pointer-events: none;
  transform: translateX(-50%);
}

.match-wait-dock[hidden],
.match-wait-dock [hidden] {
  display: none !important;
}

.match-wait-dock__toggle {
  position: relative;
  isolation: isolate;
  display: flex;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 5px;
  margin: 0 auto;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: rgba(255, 255, 255, .86);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  pointer-events: auto;
  touch-action: manipulation;
}

.match-wait-dock__toggle::before {
  position: absolute;
  z-index: -1;
  inset: 8px 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: inherit;
  background: rgba(7, 9, 12, .34);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  content: "";
  -webkit-backdrop-filter: blur(8px) saturate(1.02);
  backdrop-filter: blur(8px) saturate(1.02);
}

.match-wait-dock[data-open="true"] .match-wait-dock__toggle::before {
  background: rgba(7, 9, 12, .46);
}

.match-wait-dock__dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: rgba(132, 174, 255, .9);
  box-shadow: 0 0 0 2px rgba(106, 155, 248, .1);
}

.match-wait-dock[data-status="waiting"] .match-wait-dock__dot {
  animation: match-wait-breathe 2.8s ease-in-out infinite;
}

.match-wait-dock[data-status="starting"] .match-wait-dock__dot,
.match-wait-dock[data-status="playing"] .match-wait-dock__dot {
  background: #63d69a;
  box-shadow: 0 0 0 2px rgba(99, 214, 154, .1);
}

.match-wait-dock[data-status="expired"] .match-wait-dock__dot,
.match-wait-dock[data-status="cancelled"] .match-wait-dock__dot,
.match-wait-dock[data-status="ended"] .match-wait-dock__dot {
  background: #929aa6;
  box-shadow: none;
}

.match-wait-dock__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-wait-dock__count {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, .58);
  font-size: 10px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.match-wait-dock__panel {
  width: 100%;
  min-width: 0;
  max-height: calc(100svh - max(64px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom)));
  margin-top: 0;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 8px;
  background: rgba(7, 9, 12, .54);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .18);
  pointer-events: auto;
  touch-action: pan-y;
  -webkit-backdrop-filter: blur(10px) saturate(1.02);
  backdrop-filter: blur(10px) saturate(1.02);
}

.match-wait-dock__game {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, .86);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-wait-dock__detail,
.match-wait-dock__leader,
.match-wait-dock__error {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, .52);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.match-wait-dock__error {
  color: rgba(255, 188, 193, .9);
}

.match-wait-dock__actions {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 7px;
}

.match-wait-dock__action {
  display: inline-flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 7px;
  background: rgba(255, 255, 255, .035);
  color: rgba(255, 255, 255, .74);
  cursor: pointer;
  font: inherit;
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
}

.match-wait-dock__action--primary {
  border-color: rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .065);
  color: rgba(255, 255, 255, .86);
}

.match-wait-dock__action--danger {
  color: rgba(255, 188, 193, .86);
}

.match-wait-dock__action:disabled {
  cursor: wait;
  opacity: .58;
}

.match-wait-dock__toggle:focus-visible,
.match-wait-dock__action:focus-visible {
  outline: 3px solid rgba(106, 155, 248, .58);
  outline-offset: 2px;
}

body[data-match-wait-dock-visible="true"] .play-hud-screen .play-hud-notice-stack {
  top: calc(max(10px, env(safe-area-inset-top)) + 34px);
}

body[data-match-wait-dock-visible="true"] .play-hud-screen .hud-menu {
  top: calc(max(10px, env(safe-area-inset-top)) + 38px);
}

@keyframes match-wait-breathe {
  0%, 100% { opacity: .38; transform: scale(.86); }
  50% { opacity: 1; transform: scale(1); }
}

@media (max-width: 360px) {
  .match-wait-dock {
    width: calc(100vw - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right)));
  }
}

@media (max-height: 430px) {
  .match-wait-dock__panel {
    padding: 8px;
  }

  .match-wait-dock__actions {
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .match-wait-dock[data-status="waiting"] .match-wait-dock__dot {
    animation: none;
  }
}
