/* «Το δίκτυό μας μεγαλώνει» */
.center {
  text-align: center;
}

.present-link {
  display: block;
  margin-top: 22px;
  text-align: center;
  font-weight: 700;
  color: var(--night-muted);
}

.loc-dot {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 28%, transparent);
}

.invite-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(0, 176, 202, 0.14);
  color: #8be6f3;
  font-size: 0.93rem;
}

/* Intro */
.intro-form {
  display: grid;
  gap: 20px;
}

.locations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.locations legend {
  margin-bottom: 10px;
  padding: 0;
  font-weight: 700;
}

.loc {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 12px;
  border: 2px solid var(--night-line);
  border-radius: var(--radius);
  background: var(--night-2);
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.loc input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.loc:has(input:checked) {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, var(--night-2));
}

.loc:has(input:focus-visible) {
  outline: 3px solid var(--warn);
  outline-offset: 2px;
}

.field {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.field input {
  min-height: 50px;
  padding: 0 14px;
  border: 2px solid var(--night-line);
  border-radius: var(--radius);
  background: var(--night-2);
  font-weight: 400;
}

.field input:focus {
  border-color: var(--vf-red);
  outline: none;
}

.field small {
  font-weight: 400;
}

/* Memory */
.topbar .chip .loc-dot {
  width: 9px;
  height: 9px;
}

.mem-hud {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
  perspective: 900px;
}

@media (min-width: 480px) {
  .cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

.card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.35s;
}

.card.is-open .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 16px;
  backface-visibility: hidden;
}

.card-back {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60' fill='none' stroke='white' stroke-opacity='.45' stroke-width='1.6'%3E%3Cpath d='M16 18 42 22 24 44zM42 22l6 20M24 44l24-2'/%3E%3Cg fill='white' fill-opacity='.75' stroke='none'%3E%3Ccircle cx='16' cy='18' r='3.2'/%3E%3Ccircle cx='42' cy='22' r='3.2'/%3E%3Ccircle cx='24' cy='44' r='3.2'/%3E%3Ccircle cx='48' cy='42' r='2.4'/%3E%3C/g%3E%3C/svg%3E") center / 62% no-repeat,
    linear-gradient(135deg, #ff1f1f, var(--vf-red) 50%, #a30000);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.card-front {
  transform: rotateY(180deg);
  border: 2px solid var(--night-line);
  background: var(--night-2);
}

.card-front .icon {
  width: 46%;
  height: 46%;
}

.card.is-matched .card-front {
  border-color: var(--ok);
  color: var(--ok);
}

.card.is-wrong .card-front {
  border-color: #ff5c5c;
  animation: shake 0.35s;
}

.card.is-pop .card-inner {
  animation: pop 0.35s;
}

@keyframes pop {
  50% {
    transform: rotateY(180deg) scale(1.08);
  }
}

/* Result */
.result-grow {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.result-grow h1 {
  font-size: clamp(1.9rem, 8vw, 2.4rem);
}

.node-num {
  color: var(--c, var(--vf-red));
  white-space: nowrap;
}

.node-badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 16px 0 6px;
}

.node-badge::before,
.node-badge::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--c);
  animation: ring 2s infinite ease-out;
}

.node-badge::after {
  animation-delay: 1s;
}

.node-badge span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--c);
  border: 4px solid #fff;
}

@keyframes ring {
  from {
    transform: scale(0.35);
    opacity: 1;
  }
  to {
    transform: scale(1);
    opacity: 0;
  }
}

.invite-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  justify-self: stretch;
  margin: 8px 0;
  padding: 18px 16px;
  border: 1px solid var(--night-line);
  border-radius: var(--radius-lg);
  background: var(--night-2);
  text-align: left;
}

.invite-box h2 {
  font-size: 1.2rem;
}

.invite-box p {
  font-size: 0.93rem;
  color: var(--night-muted);
}

.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 6px 6px 6px 12px;
  border-radius: 12px;
  background: var(--night);
}

.link-row code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}

.result-grow > .btn {
  justify-self: stretch;
}

/* Live map */
body.is-live {
  background: var(--night) radial-gradient(80% 60% at 50% 40%, #1f1416 0%, var(--night) 70%) no-repeat fixed;
}

.live {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px var(--gutter) 24px;
}

.live-map {
  order: 3;
  height: 58vh;
  min-height: 340px;
  margin: 0 calc(var(--gutter) * -1);
}

.live-map canvas {
  display: block;
}

.panel {
  border-radius: var(--radius);
}

.live-head {
  order: 1;
  display: grid;
  gap: 4px;
  justify-items: start;
}

.live-head h1 {
  font-size: 1.6rem;
}

.live-stats {
  order: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat {
  display: grid;
  padding: 12px 14px;
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  background: var(--night-2);
}

.stat strong {
  font-size: 1.9rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat span {
  font-size: 0.85rem;
  color: var(--night-muted);
}

.goal {
  order: 5;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(254, 203, 0, 0.35);
  background: rgba(254, 203, 0, 0.07);
}

.goal-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffe27a;
}

.goal-bar {
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.goal-bar span {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #eb9700, var(--warn));
  transition: width 0.6s ease-out;
}

.goal-left {
  font-size: 0.85rem;
}

.legend {
  order: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend strong {
  color: var(--night-muted);
  font-variant-numeric: tabular-nums;
}

.feed {
  order: 6;
  padding: 14px;
  border: 1px solid var(--night-line);
  background: var(--night-2);
}

.feed h2 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.feed ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
}

.feed li.is-new {
  animation: toast-in 0.3s ease-out;
}

.feed li .loc-dot {
  grid-row: span 2;
}

.feed-name {
  font-weight: 700;
}

.feed-meta {
  font-size: 0.8rem;
  color: var(--night-muted);
}

.feed li.is-you,
.feed li.is-via {
  background: rgba(255, 255, 255, 0.08);
}

.live-actions {
  order: 7;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tv-cta {
  font-size: 0.95rem;
}

/* Large screens and office TVs: the map fills the screen, panels float on top. */
@media (min-width: 900px) {
  .live {
    position: relative;
    display: block;
    max-width: none;
    height: 100vh;
    min-height: 600px;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  .live-map {
    position: absolute;
    inset: 0;
    height: auto;
    margin: 0;
  }

  .live > .panel,
  .live-actions {
    position: absolute;
  }

  .live-head {
    top: 24px;
    left: 32px;
  }

  .live-head h1 {
    font-size: 2rem;
  }

  .live-stats {
    top: 24px;
    right: 24px;
    width: 336px;
  }

  .feed {
    top: 140px;
    right: 24px;
    width: 336px;
    background: rgba(27, 30, 33, 0.85);
    backdrop-filter: blur(6px);
  }

  .goal {
    left: 32px;
    bottom: 24px;
    width: min(520px, calc(100vw - 440px));
    background: rgba(40, 34, 12, 0.85);
    backdrop-filter: blur(6px);
  }

  .legend {
    left: calc(32px + min(520px, 100vw - 440px) + 24px);
    bottom: 34px;
    flex-direction: column;
    gap: 6px;
  }

  .live-actions {
    right: 24px;
    bottom: 24px;
    width: 336px;
    justify-content: flex-end;
  }

  .is-tv .live-head h1 {
    font-size: 2.6rem;
  }

  .is-tv .stat strong {
    font-size: 2.6rem;
  }
}
