/* ----- Members Games (20260928a): hub, Signal Catcher leaderboard, Daily Decode ----- */

.games-main {
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.games-crumb {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
}

.games-hero {
  margin: 0 0 1.25rem;
}

.games-hero h1 {
  margin: 0.15rem 0 0.35rem;
}

.games-hero .lede {
  margin: 0;
}

.games-hero--compact {
  margin-bottom: 0.9rem;
}

.games-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--lime);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Hub grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.9rem;
}

.game-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-height: 12rem;
  padding: 1.1rem 1.1rem 1.15rem;
  overflow: hidden;
  border: 1px solid rgba(57, 255, 20, 0.35);
  border-radius: var(--radius);
  background:
    linear-gradient(105deg, rgba(57, 255, 20, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(13, 28, 14, 0.96), rgba(8, 12, 8, 0.98));
  box-shadow: inset 0 0 24px rgba(57, 255, 20, 0.05);
}

.game-card::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 5px, rgba(57, 255, 20, 0.03) 6px, transparent 7px);
}

.game-card--live:hover,
.game-card--live:focus-within {
  border-color: rgba(57, 255, 20, 0.7);
  box-shadow: inset 0 0 24px rgba(57, 255, 20, 0.07), 0 0 18px rgba(57, 255, 20, 0.12);
}

.game-card--soon {
  border-style: dashed;
  border-color: rgba(57, 255, 20, 0.2);
  opacity: 0.72;
}

.game-card__glyph {
  position: absolute;
  top: 0.55rem;
  right: 0.75rem;
  z-index: -1;
  color: rgba(57, 255, 20, 0.16);
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.12em;
  line-height: 1;
  user-select: none;
}

.game-card__glyph span {
  color: rgba(255, 255, 255, 0.18);
  font-size: 0.42em;
  letter-spacing: 0;
  vertical-align: top;
}

.game-card__tag {
  margin: 0;
  color: #66bb6a;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-card__title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--headings);
}

.game-card__desc {
  margin: 0;
  flex: 1;
  color: #b8c6b8;
  font-size: 0.86rem;
  line-height: 1.45;
}

.game-card__meta {
  margin: 0.2rem 0 0.35rem;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.game-card__soon {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid rgba(57, 255, 20, 0.3);
  border-radius: 999px;
  color: #7a9a7a;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-card__admin-preview {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.12rem 0.45rem;
  border: 1px solid rgba(57, 255, 20, 0.55);
  border-radius: 999px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.game-card__admin-preview[hidden],
.game-card__soon[hidden],
.game-card__meta[hidden],
[data-hub-gs-play][hidden],
[data-hub-fb-play][hidden],
[data-hub-cc-play][hidden],
[data-hub-sd-play][hidden],
[data-hub-cx-play][hidden],
[data-hub-bd-play][hidden],
[data-hub-pr-play][hidden] {
  display: none !important;
}

/* Signal Catcher in the app */
[data-games-page="signal-catcher"] .game-shell {
  max-width: 480px;
}

[data-games-page="glitch-snake"] .game-shell,
[data-games-page="firewall-breach"] .game-shell,
[data-games-page="signal-duel"] .game-shell {
  max-width: 480px;
}

.games-save-status {
  min-height: 1.4em;
  margin: 0.55rem 0 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.leaderboard-panel {
  margin-top: 1rem;
}

.leaderboard-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.6rem;
}

.leaderboard-head .panel-title {
  margin: 0;
}

.games-tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.18rem;
  border: 1px solid rgba(57, 255, 20, 0.3);
  border-radius: 999px;
}

.games-tab {
  padding: 0.3rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #b8c6b8;
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.games-tab:hover,
.games-tab:focus-visible {
  color: var(--lime);
  outline: none;
}

.games-tab.is-active {
  background: var(--lime);
  color: #0a0a0a;
}

.leaderboard-pb {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
}

.leaderboard-pb strong {
  color: var(--lime);
  font-family: var(--mono);
}

.leaderboard-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.86rem;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.4rem;
  border-bottom: 1px solid rgba(57, 255, 20, 0.1);
}

.leaderboard-row:nth-child(-n + 3) .leaderboard-rank {
  color: var(--lime);
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
}

.leaderboard-row.is-me {
  background: rgba(57, 255, 20, 0.07);
  border-radius: 6px;
}

.leaderboard-rank {
  color: #7a9a7a;
  font-weight: 700;
}

.leaderboard-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score {
  color: var(--headings);
  font-weight: 700;
}

.leaderboard-empty,
.leaderboard-note {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
}

/* Daily Decode */
.dd-number {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 0.7em;
}

.dd-sub {
  margin: 0;
  font-size: 0.82rem;
}

.dd-legend {
  display: inline;
}

.dd-chip {
  display: inline-block;
  padding: 0 0.3rem;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #0a0a0a;
}

.dd-chip--correct { background: #39ff14; }
.dd-chip--present { background: #e8d33f; }
.dd-chip--absent { background: #3a3f3a; color: #cfd8cf; }

.dd-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}


/* Daily Decode — multi-puzzle progress strip */
.dd-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: min(100%, 300px);
}
.dd-progress-label {
  margin: 0;
  color: var(--lime, #39ff14);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-align: center;
}
.dd-slots {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
}
.dd-slot-dot {
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(57, 255, 20, 0.35);
  background: #0a100a;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.dd-slot-dot:disabled {
  cursor: default;
  opacity: 0.45;
}
.dd-slot-dot.is-pending {
  background: #0a100a;
  border-color: rgba(57, 255, 20, 0.25);
}
.dd-slot-dot.is-unlocked {
  border-color: rgba(57, 255, 20, 0.55);
  box-shadow: 0 0 6px rgba(57, 255, 20, 0.2);
}
.dd-slot-dot.is-playing {
  background: rgba(57, 255, 20, 0.2);
  border-color: #39ff14;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.45);
  animation: dd-slot-pulse 1.4s ease-in-out infinite;
}
.dd-slot-dot.is-won {
  background: #39ff14;
  border-color: #39ff14;
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
}
.dd-slot-dot.is-lost {
  background: #3a3f3a;
  border-color: #5a605a;
}
.dd-slot-dot.is-active {
  transform: scale(1.2);
}
.dd-slot-dot:not(:disabled):hover,
.dd-slot-dot:not(:disabled):focus-visible {
  outline: none;
  transform: scale(1.25);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.55);
}
@keyframes dd-slot-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(57, 255, 20, 0.35); }
  50% { box-shadow: 0 0 14px rgba(57, 255, 20, 0.7); }
}
.dd-next-puzzle {
  margin-top: 0.35rem;
}
.dd-stats-note {
  margin: 0.4rem 0 0.6rem;
  font-size: 0.72rem;
}

.dd-message {
  min-height: 1.5em;
  margin: 0;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 0.85rem;
  text-align: center;
}

.dd-board {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 0.35rem;
  width: min(100%, 300px);
}

.dd-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
}

.dd-row.is-shake {
  animation: dd-shake 0.35s ease;
}

.dd-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border: 2px solid #203a20;
  border-radius: 6px;
  background: #070b07;
  color: var(--headings);
  font-family: var(--mono);
  font-size: clamp(1.25rem, 6vw, 1.7rem);
  font-weight: 700;
  text-transform: uppercase;
  user-select: none;
}

.dd-tile.is-filled {
  border-color: rgba(57, 255, 20, 0.55);
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.15);
}

.dd-tile.is-correct {
  border-color: #39ff14;
  background: #39ff14;
  color: #031003;
  box-shadow: 0 0 14px rgba(57, 255, 20, 0.55);
}

.dd-tile.is-present {
  border-color: #e8d33f;
  background: #e8d33f;
  color: #141100;
  box-shadow: 0 0 10px rgba(232, 211, 63, 0.35);
}

.dd-tile.is-absent {
  border-color: #2c322c;
  background: #2c322c;
  color: #9aa59a;
}

.dd-tile.is-reveal {
  animation: dd-flip 0.45s ease both;
}

@keyframes dd-flip {
  0% { transform: rotateX(90deg); filter: brightness(1.8); }
  100% { transform: rotateX(0); filter: none; }
}

@keyframes dd-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.dd-kb {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: min(100%, 500px);
  margin-top: 0.25rem;
}

.dd-kb[hidden] {
  display: none;
}

.dd-kb-row {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
}

.dd-key {
  flex: 1 1 0;
  min-width: 0;
  max-width: 2.6rem;
  height: 3rem;
  padding: 0;
  border: 1px solid rgba(57, 255, 20, 0.28);
  border-radius: 6px;
  background: #0d160d;
  color: #d8f5d8;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dd-key--wide {
  flex: 1.6 1 0;
  max-width: 4.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.dd-key:hover,
.dd-key:focus-visible {
  border-color: var(--lime);
  outline: none;
}

.dd-key:active {
  transform: scale(0.96);
}

.dd-key.is-correct { background: #39ff14; border-color: #39ff14; color: #031003; }
.dd-key.is-present { background: #e8d33f; border-color: #e8d33f; color: #141100; }
.dd-key.is-absent { background: #1a1d1a; border-color: #1a1d1a; color: #5f6a5f; }

.dd-result {
  width: 100%;
  text-align: center;
}

.dd-result-line {
  margin: 0 0 0.6rem;
  color: #d8f5d8;
}

.dd-answer {
  color: var(--lime);
  font-family: var(--mono);
  letter-spacing: 0.12em;
}

.dd-share-preview {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(57, 255, 20, 0.2);
  border-radius: 8px;
  background: #070b07;
  color: #cfe8cf;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.35;
  text-align: left;
  white-space: pre-wrap;
}

.dd-share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.dd-share-status {
  min-height: 1.2em;
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
}

.dd-next {
  margin: 0.35rem 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.dd-stats {
  margin-top: 1.25rem;
}

.dd-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 0 0 1rem;
  text-align: center;
}

.dd-stat-grid dd {
  order: -1;
  margin: 0;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.dd-stat-grid > div {
  display: flex;
  flex-direction: column;
}

.dd-stat-grid dt {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dd-dist {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.dd-dist-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.dd-dist-label {
  width: 0.9rem;
  color: #b8c6b8;
}

.dd-dist-bar {
  min-width: 1.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  background: #2c322c;
  color: #e0e0e0;
  text-align: right;
}

.dd-dist-bar.is-today {
  background: #39ff14;
  color: #031003;
}

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

  .game-card {
    min-height: 0;
  }

  .dd-key {
    height: 2.9rem;
    font-size: 0.85rem;
  }

  .dd-kb-row {
    gap: 0.22rem;
  }

  .dd-stat-grid dd {
    font-size: 1.25rem;
  }
}


/* Daily Decode hints (Admin Preview / Live Updates) */
.dd-hints {
  width: min(100%, 340px);
  margin: 0.35rem 0 0.15rem;
  border: 1px solid rgba(57, 255, 20, 0.28);
  border-radius: 10px;
  background: rgba(8, 14, 8, 0.65);
  color: #cfd8cf;
}
.dd-hints[hidden] {
  display: none !important;
}
.dd-hints__summary {
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lime);
  user-select: none;
}
.dd-hints__summary::-webkit-details-marker { display: none; }
.dd-hints__summary::after {
  content: "▾";
  float: right;
  opacity: 0.7;
}
.dd-hints[open] .dd-hints__summary::after { content: "▴"; }
.dd-hints__body {
  padding: 0 0.85rem 0.75rem;
  border-top: 1px solid rgba(57, 255, 20, 0.15);
}
.dd-hints__row {
  margin: 0.55rem 0 0;
  font-size: 0.92rem;
  line-height: 1.35;
}
.dd-hints__label {
  display: inline-block;
  min-width: 4.6rem;
  margin-right: 0.35rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a988a;
}
.dd-hints__reveal {
  margin-top: 0.75rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(57, 255, 20, 0.18);
}
.dd-hints__letter-msg {
  margin: 0.45rem 0 0;
  min-height: 1.2em;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--lime);
}
.dd-hints__letter-note {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
}
.dd-hints [data-dd-hint-letter]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .dd-tile.is-reveal,
  .dd-row.is-shake,
  .dd-slot-dot.is-playing {
    animation: none;
  }
}
