﻿.tile-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.tile-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.58);
  cursor: pointer;
}

.tile-modal__panel {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100vw - 28px));
  max-height: min(88vh, 760px);
  overflow: auto;
  border: 1px solid rgba(255, 191, 128, 0.22);
  border-radius: 14px;
  background: rgba(13, 16, 24, 0.98);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.56);
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(300px, 1fr);
  gap: 0.75rem;
  padding: 0.75rem;
}

.tile-modal__close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(4, 6, 11, 0.75);
  color: var(--ink);
  cursor: pointer;
}

.tile-modal__preview {
  align-self: start;
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.tile-modal__media {
  align-self: start;
  width: 100%;
  aspect-ratio: var(--thumb-aspect, 16 / 9);
  max-height: min(54vh, 520px);
  min-height: 0;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 191, 128, 0.12);
  border-radius: 10px;
  background: rgba(7, 9, 16, 0.88);
}

.tile-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tile-modal__media span {
  color: var(--muted);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
}

.tile-modal__media[data-thumbnail-size]::after {
  content: attr(data-thumbnail-size);
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  padding: 0.18rem 0.38rem;
  border-radius: 999px;
  background: rgba(4, 6, 11, 0.72);
  color: var(--muted);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
}

.tile-modal__play {
  width: 100%;
  padding-block: 0.9rem;
  font-size: 1rem;
}

.tile-modal__body {
  display: grid;
  gap: 0.6rem;
  align-content: start;
  min-width: 0;
}

.tile-modal__body h3 {
  font-size: 1.18rem;
}

.tile-modal__header {
  display: grid;
  gap: 0.25rem;
  padding-right: 2rem;
}

.tile-modal__tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.2rem;
  border: 1px solid rgba(255, 191, 128, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.tile-modal__tab {
  flex: 1 1 0;
  border: 0;
  border-radius: 8px;
  padding: 0.46rem 0.55rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
}

.tile-modal__tab.is-active {
  background: rgba(255, 154, 82, 0.12);
  color: var(--ink);
}

.tile-modal__tab-panel {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.tile-detail-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.38rem;
}

.tile-detail-list div {
  min-width: 0;
  padding: 0.46rem 0.52rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 191, 128, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.tile-detail-list dt {
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tile-detail-list dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-modal__actions {
  grid-template-columns: minmax(0, 1fr);
}

.tile-modal__status {
  display: grid;
  gap: 0.25rem;
  padding: 0.58rem 0.62rem;
  border: 1px solid rgba(255, 191, 128, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.tile-modal__status h3 {
  font-size: 0.9rem;
}

.run-history {
  display: grid;
  gap: 0.42rem;
  max-height: 330px;
  overflow: auto;
}

.run-history__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.48rem 0.55rem;
  border: 1px solid rgba(255, 191, 128, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.run-history__row.is-team-colored {
  border-color: color-mix(in srgb, var(--team-border) 34%, transparent);
  background:
    linear-gradient(90deg, var(--team-soft), rgba(255, 255, 255, 0.02) 72%),
    rgba(255, 255, 255, 0.025);
  box-shadow: inset 3px 0 0 var(--team-border);
}

.run-history__rank {
  color: var(--accent-strong);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
}

.run-history__row.is-team-colored .run-history__rank {
  color: color-mix(in srgb, var(--team-border) 78%, white);
}

.run-history__main {
  min-width: 0;
  display: grid;
  gap: 0.05rem;
}

.run-history__main strong,
.run-history__main span,
.run-history__main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-history__main strong {
  font-size: 0.88rem;
}

.run-history__main span,
.run-history__main small {
  color: var(--muted);
  font-size: 0.74rem;
}

.run-history__team {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  min-width: 0;
}

.run-history__team .team-color-dot {
  width: 0.48rem;
  height: 0.48rem;
  box-shadow: none;
}

.run-history__time {
  color: var(--ink);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
}

.run-history__empty {
  padding: 0.85rem;
  border: 1px dashed rgba(255, 191, 128, 0.16);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.map-switch-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 6, 11, 0.72);
  backdrop-filter: blur(10px);
}

.map-switch-dialog {
  width: min(440px, 100%);
  display: grid;
  gap: 0.72rem;
  padding: 1rem;
  border: 1px solid rgba(255, 191, 128, 0.22);
  border-radius: 14px;
  background: rgba(13, 16, 24, 0.98);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.44);
}

.map-switch-dialog h3 {
  font-size: 1.18rem;
}

.map-switch-dialog > p:not(.detail-card__label) {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
}

.map-switch-steps {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.46rem;
  list-style: none;
}

.map-switch-step {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.6rem;
  align-items: start;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(255, 191, 128, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.map-switch-step__icon {
  width: 1.45rem;
  height: 1.45rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 191, 128, 0.2);
  border-radius: 999px;
  color: var(--muted);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
}

.map-switch-step__icon::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: currentColor;
}

.map-switch-step__copy {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.map-switch-step__copy strong {
  color: var(--ink);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.9rem;
  line-height: 1.2;
}

.map-switch-step__copy small {
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.76rem;
}

.map-switch-step.is-active {
  border-color: rgba(255, 154, 82, 0.38);
  background: rgba(255, 154, 82, 0.08);
}

.map-switch-step.is-active .map-switch-step__icon {
  color: var(--accent-strong);
  border-color: rgba(255, 154, 82, 0.48);
}

.map-switch-step.is-active .map-switch-step__icon::before {
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  background: transparent;
  animation: switch-spin 0.8s linear infinite;
}

.map-switch-step.is-complete .map-switch-step__icon {
  color: var(--good);
  border-color: rgba(136, 214, 111, 0.36);
}

.map-switch-step.is-complete .map-switch-step__icon::before {
  content: "âœ“";
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  line-height: 1;
}

.map-switch-step.is-failed .map-switch-step__icon {
  color: var(--bad);
  border-color: rgba(239, 107, 107, 0.42);
}

.map-switch-step.is-failed .map-switch-step__icon::before {
  content: "!";
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  line-height: 1;
}

.map-switch-close {
  width: 100%;
}

.bingo-notifications {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 150;
  width: min(460px, calc(100vw - 2rem));
  display: grid;
  gap: 0.65rem;
  pointer-events: none;
}

.bingo-notification {
  pointer-events: auto;
  cursor: pointer;
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 5.2rem;
  padding: 0.76rem 0.78rem;
  border: 1px solid color-mix(in srgb, var(--team-border) 45%, rgba(255, 255, 255, 0.14));
  border-radius: 14px;
  background:
    linear-gradient(90deg, var(--team-soft), rgba(13, 16, 24, 0.97) 48%),
    rgba(13, 16, 24, 0.98);
  box-shadow:
    inset 4px 0 0 var(--team-border),
    0 18px 46px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.035);
  animation: bingo-notification-in 0.18s ease-out;
}

.bingo-notification:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--team-border) 72%, white);
  outline-offset: 3px;
}

.bingo-notification__icon {
  width: 3.2rem;
  height: 3.2rem;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--team-border) 52%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--team-fill) 84%, rgba(255, 255, 255, 0.04));
  color: var(--ink);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 0 22px var(--team-glow);
}

.bingo-notification__copy {
  min-width: 0;
  display: grid;
  gap: 0.16rem;
}

.bingo-notification__copy p,
.bingo-notification__copy strong,
.bingo-notification__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.bingo-notification__copy p {
  margin: 0;
  color: color-mix(in srgb, var(--team-border) 82%, white);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bingo-notification__copy strong {
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.25;
}

.bingo-notification__copy small {
  color: var(--muted);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.bingo-notification__close {
  align-self: start;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(4, 6, 11, 0.58);
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.bingo-notification__close:hover,
.bingo-notification__close:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--team-border) 45%, rgba(255, 255, 255, 0.18));
}

.room-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.room-settings-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.58);
  cursor: pointer;
}

.room-settings-panel {
  position: relative;
  z-index: 1;
  width: min(780px, calc(100vw - 28px));
  max-height: min(86vh, 760px);
  overflow: auto;
  display: grid;
  gap: 0.85rem;
  padding: 0.95rem;
  border: 1px solid rgba(255, 191, 128, 0.2);
  border-radius: 14px;
  background: rgba(13, 16, 24, 0.98);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.56);
}

.room-settings-panel__close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(4, 6, 11, 0.75);
  color: var(--ink);
  cursor: pointer;
}

.room-settings-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding-right: 2rem;
}

.settings-lock-pill {
  flex: 0 0 auto;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(255, 191, 128, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
}

.settings-lock-pill.is-host {
  border-color: rgba(136, 214, 111, 0.36);
  color: var(--good);
}

.room-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.room-setting {
  display: grid;
  gap: 0.38rem;
  min-width: 0;
  padding: 0.62rem;
  border: 1px solid rgba(255, 191, 128, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.room-setting--wide {
  grid-column: 1 / -1;
}

.room-setting__label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 0.67rem;
  font-weight: 700;
}

.room-setting__value {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-setting__hint {
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.78rem;
}

.room-setting__control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.room-setting input,
.room-setting select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(4, 6, 11, 0.78);
  color: var(--ink);
  padding: 0.58rem 0.68rem;
}

.room-setting input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.room-setting.is-disabled {
  opacity: 0.72;
}

.room-setting.is-disabled input,
.room-setting.is-disabled select {
  cursor: not-allowed;
  opacity: 0.64;
}

@keyframes switch-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes bingo-notification-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 720px) {
  .bingo-notifications {
    top: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }

  .bingo-notification {
    grid-template-columns: 2.75rem minmax(0, 1fr) auto;
    min-height: 4.7rem;
    gap: 0.6rem;
    padding: 0.68rem;
  }

  .bingo-notification__icon {
    width: 2.75rem;
    height: 2.75rem;
  }
}
