/* «Δίκτυο για δύο»: dark "network operations" look. */
/* Home */
.steps {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  background: var(--night-2);
}

.steps p {
  margin-top: 2px;
  font-size: 0.93rem;
  color: var(--night-muted);
}

.step-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--vf-red);
  font-weight: 700;
}

.prize {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(254, 203, 0, 0.1);
  color: #ffe27a;
  font-size: 0.93rem;
  font-weight: 700;
}

.actions {
  display: grid;
  gap: 10px;
}

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

/* Join */
.join-form {
  display: grid;
  gap: 14px;
}

.code-input {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--night-line);
  border-radius: var(--radius);
  background: var(--night-2);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-align: center;
  text-indent: 0.4em;
}

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

.form-error {
  color: #ff8a8a;
  font-weight: 700;
}

/* Map: share box */
.share {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px dashed var(--night-line);
  border-radius: var(--radius-lg);
  text-align: center;
  font-size: 0.93rem;
}

.code-big {
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.12em;
}

.share .btn {
  margin-top: 6px;
}

.map-tip {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--night-muted);
}

/* Map board */
.board-card {
  border: 1px solid var(--night-line);
  border-radius: var(--radius-lg);
  background: var(--night-2);
  overflow: hidden;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--night-line);
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 50px;
  padding: 0 4px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--night-muted);
}

.tab[aria-selected='true'] {
  border-bottom-color: var(--vf-red);
  color: var(--night-text);
}

.is-follow .tab {
  cursor: default;
}

.tab-num {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--night-3);
  font-size: 0.75rem;
}

.tab[aria-selected='true'] .tab-num {
  background: var(--vf-red);
}

.board-body {
  padding: 18px 16px 20px;
}

.board-hint,
.round-hint {
  margin-bottom: 16px;
  font-size: 0.93rem;
  color: var(--night-muted);
}

.wiring {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wiring-row {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  align-items: center;
}

.plug-chip,
.port-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--night-3);
  font-weight: 700;
}

.plug-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent);
}

.port-chip .icon {
  width: 22px;
  height: 22px;
}

.wiring-arrow {
  height: 3px;
  margin: 0 4px;
  background: linear-gradient(90deg, var(--night-line), var(--night-text));
  position: relative;
}

.wiring-arrow::after {
  content: '';
  position: absolute;
  right: -2px;
  top: -5px;
  border: 6px solid transparent;
  border-left-color: var(--night-text);
  border-right: 0;
}

.sequence {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.seq-tile {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--night-3);
}

.seq-tile .icon {
  width: 62%;
  height: 62%;
}

.seq-num {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--night-muted);
}

.route-text {
  margin-bottom: 10px;
  font-weight: 700;
}

.map-done {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 30px 0;
  text-align: center;
}

.map-done .icon {
  width: 56px;
  height: 56px;
  padding: 12px;
  border-radius: 50%;
  background: var(--ok);
  color: var(--night);
}

/* Route map (SVG units: 100 x 120) */
.route-map {
  display: block;
  width: 100%;
  max-height: 58vh;
  margin: 0 auto;
  overflow: visible;
}

.route-map .mesh line {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 0.5;
  stroke-dasharray: 1.2 1.2;
}

.route-map .route-line {
  fill: none;
  stroke: var(--vf-red);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-map text {
  fill: var(--night-text);
  font-size: 4.1px;
  font-weight: 700;
  pointer-events: none;
}

.route-map .city .hit {
  fill: transparent;
}

.route-map .city .dot {
  fill: #fff;
  stroke: var(--night);
  stroke-width: 0.8;
}

.route-map .city.is-done .dot {
  fill: var(--vf-red);
  stroke: #fff;
}

.route-map .city .num {
  font-size: 3.2px;
  fill: #fff;
}

.route-map.is-interactive .city {
  cursor: pointer;
  outline: none;
}

.route-map.is-interactive .city:hover .hit,
.route-map.is-interactive .city:focus-visible .hit {
  fill: rgba(255, 255, 255, 0.12);
}

.route-map .special circle {
  fill: var(--night-3);
  stroke: var(--vf-red);
  stroke-width: 0.7;
}

.route-map .special svg {
  color: #fff;
}

/* Technician */
.brief {
  display: grid;
  gap: 14px;
  padding: 22px 18px;
  border: 1px solid var(--night-line);
  border-radius: var(--radius-lg);
  background: var(--night-2);
}

.brief .chip {
  justify-self: start;
}

.brief h2 {
  font-size: 1.7rem;
}

.brief-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.brief-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--night-muted);
}

.brief-list strong {
  min-width: 70px;
  color: var(--night-text);
}

.hud {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 14px;
}

.hud-round {
  display: grid;
  gap: 6px;
  font-size: 0.93rem;
}

.round-dots {
  display: flex;
  gap: 6px;
}

.round-dots i {
  width: 26px;
  height: 6px;
  border-radius: 3px;
  background: var(--night-3);
}

.round-dots i.done {
  background: var(--ok);
}

.round-dots i.now {
  background: var(--vf-red);
}

.penalty {
  position: absolute;
  right: 0;
  top: -6px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #ff5c5c;
  opacity: 0;
  pointer-events: none;
}

.penalty.is-on {
  animation: penalty 0.9s ease-out;
}

@keyframes penalty {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-28px);
  }
}

.hud.is-next .hud-round {
  animation: next-round 0.6s ease-out;
}

@keyframes next-round {
  0% {
    transform: scale(1.08);
    color: var(--ok);
  }
}

/* Round 1: patch panel */
.patch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 26%;
}

.patch-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}

.patch-col {
  display: grid;
  gap: 12px;
}

.wire,
.port {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 60px;
  border: 2px solid var(--night-line);
  border-radius: 14px;
  background: var(--night-2);
  -webkit-tap-highlight-color: transparent;
}

.wire {
  justify-content: space-between;
  padding: 0 0 0 12px;
  border-left: 8px solid var(--c);
  font-weight: 700;
}

.wire-plug {
  width: 16px;
  height: 16px;
  margin-right: -9px;
  border-radius: 50%;
  background: var(--c);
  border: 3px solid var(--night);
}

.port {
  justify-content: center;
}

.port .icon {
  width: 30px;
  height: 30px;
}

.port-socket {
  position: absolute;
  left: -9px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--night);
  border: 3px solid var(--night-muted);
}

.wire.is-sel,
.port.is-sel {
  border-color: #fff;
  border-left-color: var(--c, #fff);
  background: var(--night-3);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.wire.is-done,
.port.is-done {
  opacity: 0.55;
  cursor: default;
}

.port.is-done .port-socket {
  border-color: var(--ok);
}

/* Round 2: frequency keypad */
.slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.slot {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 2px dashed var(--night-line);
  border-radius: 12px;
  color: var(--night-muted);
  font-weight: 700;
}

.slot.is-filled {
  border-style: solid;
  border-color: var(--night-muted);
  color: var(--night-text);
}

.slot .icon {
  width: 60%;
  height: 60%;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.key {
  display: grid;
  place-items: center;
  aspect-ratio: 1.15;
  border: 2px solid var(--night-line);
  border-radius: 14px;
  background: var(--night-2);
  -webkit-tap-highlight-color: transparent;
}

.key:active {
  background: var(--night-3);
}

.key .icon {
  width: 52%;
  height: 52%;
}

.del {
  display: flex;
  margin-left: auto;
}

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

.result h2 {
  font-size: 1.9rem;
}

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

.result-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-top: 10px;
  border-radius: 50%;
  font-size: 2.6rem;
  font-weight: 700;
}

.result-icon .icon {
  width: 40px;
  height: 40px;
  stroke-width: 3;
}

.is-win .result-icon {
  background: var(--ok);
  color: var(--night);
  box-shadow: 0 0 0 10px rgba(143, 184, 0, 0.15);
}

.is-lose .result-icon {
  background: var(--vf-red);
  box-shadow: 0 0 0 10px rgba(230, 0, 0, 0.15);
}

.is-lose p {
  color: var(--night-muted);
}

.result-time {
  color: var(--night-muted);
}

.result-time strong {
  font-size: 1.3rem;
  color: var(--night-text);
}

.leaderboard {
  justify-self: stretch;
  padding: 14px;
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  background: var(--night-2);
  text-align: left;
}

.leaderboard h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 1rem;
}

.leaderboard ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 0.93rem;
}

.leaderboard li.is-you {
  background: var(--vf-red);
  font-weight: 700;
}

.lb-rank {
  color: var(--night-muted);
}

.is-you .lb-rank {
  color: #fff;
}

.lb-time {
  font-variant-numeric: tabular-nums;
}

.raffle {
  display: grid;
  gap: 4px;
  justify-self: stretch;
  padding: 14px;
  border: 2px dashed rgba(254, 203, 0, 0.5);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.raffle strong {
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  color: #ffe27a;
}

/* Both roles on one screen */
body.is-both {
  background: var(--night) radial-gradient(90% 70% at 50% 0%, #2a1416 0%, var(--night) 60%) no-repeat fixed;
}

.both {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px var(--gutter) 24px;
}

.both-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.both-title {
  flex: 1;
}

.both-title h1 {
  font-size: clamp(1.25rem, 3vw, 1.7rem);
}

.both-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.device {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.device-label {
  margin: 0 0 8px 6px;
  font-size: 0.9rem;
}

.device-label span {
  color: var(--night-muted);
}

.device-screen {
  padding: 16px;
  border: 2px solid var(--night-line);
  border-radius: 28px;
  background: rgba(17, 19, 21, 0.85);
  overflow: auto;
}

.device-screen .route-map {
  max-height: 46vh;
}

.both-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--night-muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.both-link .icon {
  width: 30px;
  height: 30px;
  color: var(--vf-red);
}

.wave {
  flex: 1;
  max-width: 60px;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--night-muted) 0 6px, transparent 6px 12px);
}

@media (min-width: 900px) {
  .both-grid {
    grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr);
    align-items: stretch;
  }

  .device-screen {
    height: calc(100vh - 140px);
    min-height: 560px;
  }

  .both-link {
    flex-direction: column;
  }

  .wave {
    flex: none;
    width: 2px;
    height: 60px;
    background: repeating-linear-gradient(180deg, var(--night-muted) 0 6px, transparent 6px 12px);
  }
}
