/* Firewall Breach — same Matrix shell language as Glitch Snake. */

.fb-shell {
  position: relative;
  background: #050805;
  border: 1px solid rgba(57, 255, 20, 0.35);
  border-radius: 12px;
  box-shadow: 0 0 24px rgba(57, 255, 20, 0.12);
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.fb-shell canvas {
  display: block;
  width: 100%;
  height: 148px;
}

.fb-shell .game-hud {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem 0.2rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: #7cff6b;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.45);
}

.fb-shell .game-hud strong {
  color: #39ff14;
  font-weight: 700;
}

/* Trace bar: 20261008fb thicker + brighter neon (was 6px flat #39ff14). */
.fb-timer {
  height: 12px;
  margin: 0.5rem 0.85rem 0.3rem;
  border-radius: 999px;
  background: rgba(57, 255, 20, 0.16);
  border: 1px solid rgba(57, 255, 20, 0.6);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.35), inset 0 0 6px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.fb-timer__fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #39ff14 0%, #7cff6b 70%, #d4ffc4 100%);
  box-shadow: 0 0 10px #39ff14, inset 0 0 3px rgba(232, 255, 228, 0.9);
  transform-origin: left center;
  transform: scaleX(1);
}

.fb-ports {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  padding: 0.7rem 0.75rem 0.85rem;
}

.fb-port {
  min-height: 56px;
  padding: 0.4rem 0.2rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #39ff14;
  background: rgba(13, 31, 14, 0.95);
  border: 1px solid rgba(57, 255, 20, 0.45);
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
}

.fb-port:disabled {
  cursor: default;
  opacity: 0.72;
}

.fb-port.is-open {
  color: #041204;
  background: #39ff14;
  border-color: #7cff6b;
  box-shadow: 0 0 16px rgba(57, 255, 20, 0.45);
}

.fb-port:not(:disabled):active {
  background: rgba(57, 255, 20, 0.22);
}

.fb-pause-row {
  display: flex;
  justify-content: center;
  padding: 0 0.75rem 0.85rem;
}

.fb-pause-row .btn {
  min-width: 7rem;
  min-height: 44px;
}

.fb-shell .game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 1.25rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.82);
  z-index: 3;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.fb-shell .game-overlay {
  overflow-y: auto;
}

.fb-shell .game-overlay[hidden] {
  display: none !important;
}

.fb-shell .game-overlay h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  color: #39ff14;
  letter-spacing: 0.04em;
}

.fb-shell .game-overlay p {
  margin: 0;
  max-width: 26rem;
  color: #a8e6a8;
  font-size: 0.88rem;
  line-height: 1.45;
}

.fb-shell .game-overlay .score-line {
  color: #7cff6b;
}

/* Easy / Hard mode toggle (20261008fc). Start + game-over screens only. */
.fb-mode {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(57, 255, 20, 0.55);
  border-radius: 999px;
  background: rgba(13, 31, 14, 0.92);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.22);
}

.fb-mode__btn {
  min-width: 5.5rem;
  min-height: 40px;
  padding: 0.35rem 1rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7cff6b;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
}

.fb-mode__btn:hover {
  color: #c8ffbd;
  background: rgba(57, 255, 20, 0.12);
}

.fb-mode__btn[aria-pressed="true"] {
  color: #041204;
  background: #39ff14;
  box-shadow: 0 0 14px rgba(57, 255, 20, 0.6);
}

.fb-mode__btn:focus-visible {
  outline: 2px solid #e8ffe4;
  outline-offset: 2px;
}

.fb-shell[data-fb-mode-current="hard"] .fb-hud-mode strong {
  color: #ff5f8f;
  text-shadow: 0 0 8px rgba(255, 59, 141, 0.55);
}

.fb-shell .game-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.4rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0a0a0a;
  background: #39ff14;
  border: 2px solid #39ff14;
  border-radius: 999px;
  cursor: pointer;
}

.fb-shell .fb-share-btn[hidden] {
  display: none !important;
}

.fb-pause-tip {
  margin: 0.55rem 0 0;
  text-align: center;
  font-size: 0.82rem;
}

[data-games-page="firewall-breach"] .game-howto {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

[data-games-page="firewall-breach"] .game-howto li {
  margin: 0.4rem 0;
  padding-left: 1.1rem;
  position: relative;
}

[data-games-page="firewall-breach"] .game-howto li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #39ff14;
}

/* Easy / Hard leaderboard tabs (20261008fe). */
.fb-board-tabs {
  margin: 0 0 0.6rem;
}

.fb-board-tabs .games-tab {
  min-width: 4.5rem;
  min-height: 34px;
}

.fb-board-tabs [data-fb-board="hard"].is-active {
  background: #ff5f8f;
  color: #0a0a0a;
}

@media (max-width: 520px) {
  .fb-shell .game-hud {
    font-size: 0.72rem;
  }
  .fb-port {
    font-size: 0.92rem;
    min-height: 52px;
  }
  .fb-timer {
    height: 11px;
    margin: 0.45rem 0.7rem 0.25rem;
  }
  .fb-shell .game-hud {
    gap: 0.5rem;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
  .fb-shell .game-overlay {
    gap: 0.55rem;
    padding: 0.9rem 1rem;
  }
  .fb-mode__btn {
    min-width: 5rem;
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fb-shell {
    box-shadow: none;
  }
  .fb-timer {
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.65);
  }
  .fb-timer__fill {
    transition: none;
  }
}
