:root {
  --bg: #080c10;
  --bg-soft: #11181f;
  --panel: #131d26;
  --panel-2: #17242f;
  --line: #2c3a45;
  --text: #e6edf3;
  --muted: #95a8b8;
  --accent: #f1642a;
  --accent-2: #f4bb45;
  --good: #53c98a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  background: var(--bg);
  position: relative;
}

.backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(241, 100, 42, 0.3), transparent 35%),
    radial-gradient(circle at 95% 20%, rgba(244, 187, 69, 0.2), transparent 40%),
    linear-gradient(160deg, #090d11 0%, #0b151d 45%, #090f15 100%);
  z-index: -1;
}

.app {
  width: min(1180px, 94vw);
  margin: 2.25rem auto;
}

.top {
  text-align: center;
  margin-bottom: 1.8rem;
}

.top h1 {
  margin: 0;
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.06em;
  font-size: clamp(2rem, 4.2vw, 3rem);
  text-transform: uppercase;
}

.top p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
  background: linear-gradient(170deg, rgba(19, 29, 38, 0.96), rgba(12, 19, 25, 0.95));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.card h2 {
  margin: 0 0 0.35rem;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.45rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.form {
  display: grid;
  gap: 0.75rem;
}

label {
  display: grid;
  gap: 0.32rem;
  font-size: 0.95rem;
  color: #bfd0dd;
}

input {
  width: 100%;
  background: #0d141b;
  border: 1px solid #324451;
  border-radius: 10px;
  padding: 0.72rem 0.8rem;
  color: var(--text);
  font-size: 1rem;
}

input:focus {
  outline: 2px solid rgba(241, 100, 42, 0.7);
  border-color: var(--accent);
}

button {
  border: none;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #ef7b2a);
  color: #fff;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.75rem 0.95rem;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

button.secondary {
  background: linear-gradient(135deg, #25384a, #1f2f3d);
}

.create-result {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.7rem;
}

.quick-enter {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr 1fr;
}

.pin-block {
  border: 1px solid #425569;
  border-radius: 12px;
  background: #0d151d;
  padding: 0.65rem;
  color: #bfd0dd;
}

#viewerRole {
  color: #d0deea;
}

.pin-block strong {
  display: block;
  font-family: "Rajdhani", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.14em;
  color: var(--accent-2);
}

#createdObsUrl {
  margin-top: 0.45rem;
  font-size: 0.9rem;
}

#copyObsUrl {
  margin-top: 0.45rem;
  width: 100%;
}

.room {
  background: linear-gradient(170deg, rgba(16, 26, 35, 0.94), rgba(9, 15, 21, 0.94));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  animation: fadeIn 220ms ease;
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid #2a3946;
  padding-bottom: 0.8rem;
}

.room-title h2 {
  margin: 0;
  font-family: "Rajdhani", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.room-title p {
  margin: 0.22rem 0 0;
  color: #a3b7c8;
}

.room-actions {
  display: flex;
  gap: 0.5rem;
}

.team-strip {
  margin: 0.9rem 0 1rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.8rem;
  align-items: center;
}

.team {
  border: 1px solid #374754;
  background: linear-gradient(180deg, #162430, #101a23);
  border-radius: 12px;
  padding: 0.8rem;
}

.team span {
  color: #8ca2b3;
  font-size: 0.84rem;
}

.team strong {
  display: block;
  margin-top: 0.16rem;
  font-size: 1.2rem;
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.team em {
  display: block;
  margin-top: 0.2rem;
  color: #a4bac9;
  font-style: normal;
  font-size: 0.85rem;
}

.turn-pill {
  border: 1px solid #415361;
  background: #101821;
  border-radius: 999px;
  padding: 0.48rem 0.9rem;
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.05em;
  color: #d6e2eb;
  text-transform: uppercase;
}

.winner-report {
  margin: 0 0 1rem;
  border: 1px solid #3c5163;
  background: #111b25;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.winner-report span {
  color: #c2d3df;
  font-size: 0.92rem;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.map-card {
  border-radius: 12px;
  min-height: 130px;
  border: 1px solid #324351;
  background:
    linear-gradient(170deg, rgba(37, 57, 73, 0.55), rgba(15, 23, 30, 0.75)),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.04) 0 9px,
      rgba(255, 255, 255, 0.01) 9px 18px
    );
  display: flex;
  align-items: flex-end;
  padding: 0.75rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}

.map-card:hover {
  border-color: #506679;
  transform: translateY(-1px);
}

.map-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(241, 100, 42, 0.22), transparent 50%);
  pointer-events: none;
}

.map-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
}

.map-card strong {
  z-index: 1;
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.map-card.banned-a {
  border-color: rgba(241, 100, 42, 0.8);
  background:
    linear-gradient(170deg, rgba(112, 44, 23, 0.65), rgba(33, 14, 9, 0.86)),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 0 9px, rgba(255, 255, 255, 0.01) 9px 18px);
}

.map-card.banned-b {
  border-color: rgba(83, 201, 138, 0.82);
  background:
    linear-gradient(170deg, rgba(22, 82, 58, 0.58), rgba(6, 22, 15, 0.87)),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 0 9px, rgba(255, 255, 255, 0.01) 9px 18px);
}

.map-card.locked {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.6;
}

.map-card.selected {
  border-color: rgba(244, 187, 69, 0.88);
  box-shadow: inset 0 0 0 1px rgba(244, 187, 69, 0.3);
}

.map-meta {
  position: absolute;
  top: 0.4rem;
  left: 0.45rem;
  border: 1px solid rgba(199, 214, 224, 0.22);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.74rem;
  color: #c4d2dd;
  background: rgba(7, 12, 16, 0.7);
  z-index: 1;
}

.map-note {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  z-index: 1;
  border: 1px solid rgba(199, 214, 224, 0.2);
  border-radius: 999px;
  padding: 0.1rem 0.42rem;
  font-size: 0.7rem;
  color: #d7e3eb;
  background: rgba(7, 12, 16, 0.72);
  max-width: calc(100% - 0.8rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #0d151d;
  border: 1px solid #3e5263;
  color: #d9e6ef;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .team-strip {
    grid-template-columns: 1fr;
  }

  .turn-pill {
    justify-self: center;
  }
}

@media (max-width: 700px) {
  .map-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .map-grid {
    grid-template-columns: 1fr;
  }
}
