#online-counter {
  right: 96px;
  max-width: calc(100vw - 126px);
}

body[data-gameplay-guide-open="true"] #online-counter {
  display: none;
}

#landing-secondary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: min(360px, 100%);
}

#landing-options,
#landing-gameplay-guide {
  min-height: 40px;
  cursor: pointer;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd96bfa, #f3a72efa);
  box-shadow: 0 0 0 2px var(--ui-navy), inset 0 -3px #3b260524;
  padding: 7px 16px;
  color: #3b2605;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
}

#landing-gameplay-guide {
  background: linear-gradient(180deg, #7ed6ff, #2f98f4);
  color: #ffffff;
  text-shadow: 0 1px 0 #07112673;
}

#landing-options:hover,
#landing-options:focus-visible,
#landing-gameplay-guide:hover,
#landing-gameplay-guide:focus-visible {
  outline: 4px solid var(--ui-gold);
  outline-offset: 4px;
}

.gameplay-guide-modal[hidden] {
  display: none;
}

.gameplay-guide-modal {
  position: fixed;
  inset: 0;
  z-index: 72;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #ffffff;
}

.gameplay-guide-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 18%, #2f98f452, transparent 34%),
    linear-gradient(180deg, #06152bcf, #020817e8);
  backdrop-filter: blur(4px);
}

.gameplay-guide-card {
  position: relative;
  width: min(1040px, calc(100vw - 32px));
  max-height: min(calc(100vh - 36px), 820px);
  overflow: auto;
  border: 4px solid #ffffff;
  border-radius: 20px;
  background: linear-gradient(180deg, #12386f, #071b42);
  box-shadow: 0 22px 0 #03102a, 0 32px 72px #00000078;
  padding: 18px;
}

.gameplay-guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.gameplay-guide-chip {
  display: inline-flex;
  align-items: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd96b, #f3a72e);
  box-shadow: 0 0 0 2px var(--ui-navy);
  padding: 4px 12px;
  color: #3b2605;
  font-size: 13px;
  font-weight: 900;
}

#gameplay-guide-title {
  margin: 12px 0 0;
  color: #ffffff;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
  text-shadow: 0 4px 0 #071126;
}

#gameplay-guide-close {
  flex: 0 0 auto;
  min-width: 72px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: linear-gradient(180deg, #f8fbff, #dce9ff);
  box-shadow: 0 0 0 2px var(--ui-navy), inset 0 -3px #07112624;
  padding: 8px 14px;
  color: #071126;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.gameplay-guide-intro {
  margin: 0 0 12px;
  color: #dce9ff;
  font-size: 15px;
  line-height: 1.55;
}

.gameplay-guide-economy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.92fr);
  gap: 12px;
  margin-bottom: 12px;
}

.gameplay-guide-token-card,
.gameplay-guide-split-card {
  border: 3px solid #ffffff;
  border-radius: 16px;
  background: radial-gradient(circle at 0 0, #ffd96b2e, transparent 36%),
    linear-gradient(180deg, #ffffff1f, #ffffff0a);
  box-shadow: inset 0 0 0 2px #07112669;
  padding: 12px;
}

.gameplay-guide-card-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #07112685;
  padding: 4px 10px;
  color: #bfe8ff;
  font-size: 12px;
  font-weight: 900;
}

.gameplay-guide-token-card strong {
  display: block;
  margin: 8px 0 6px;
  color: #ffd96b;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1;
  text-shadow: 0 4px 0 #071126;
}

.gameplay-guide-token-card p {
  margin: 0;
  color: #edf5ff;
  font-size: 14px;
  line-height: 1.55;
}

.gameplay-guide-split-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
}

.gameplay-guide-split-card .gameplay-guide-card-label {
  grid-column: 1 / -1;
}

.gameplay-guide-split-row {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: center;
  gap: 4px;
  border: 2px solid #ffffffc9;
  border-radius: 12px;
  background: linear-gradient(180deg, #7ed6ff2e, #2f98f42e);
  padding: 7px 8px;
  text-align: center;
}

.gameplay-guide-split-row strong {
  color: #ffd96b;
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 2px 0 #071126;
}

.gameplay-guide-split-row span {
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}

.gameplay-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gameplay-guide-step {
  border: 3px solid #ffffff;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff18, #ffffff0a);
  box-shadow: inset 0 0 0 2px #07112669;
  padding: 12px;
}

.gameplay-guide-step h3 {
  margin: 0 0 8px;
  color: #ffd96b;
  font-size: 16px;
  line-height: 1.25;
  text-shadow: 0 2px 0 #071126;
}

.gameplay-guide-step p {
  margin: 0;
  color: #edf5ff;
  font-size: 14px;
  line-height: 1.55;
}

.gameplay-guide-loop {
  margin: 14px 0 0;
  border: 3px solid #ffffff;
  border-radius: 14px;
  background: linear-gradient(180deg, #7ed6ff2e, #2f98f42e);
  box-shadow: inset 0 0 0 2px #07112669;
  padding: 10px 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.gameplay-guide-guardrail {
  margin: 10px 0 0;
  border: 3px solid #ffffff;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffd96b26, #f3a72e18);
  box-shadow: inset 0 0 0 2px #07112669;
  padding: 10px 12px;
  color: #ffe8a8;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.5;
}

@media (max-width: 620px) {
  #online-counter {
    right: 80px;
    max-width: calc(100vw - 108px);
    padding: 6px 10px;
    font-size: 12px;
  }

  #landing-secondary-actions {
    gap: 8px;
  }

  #landing-options,
  #landing-gameplay-guide {
    flex: 1 1 0;
    padding: 7px 10px;
    font-size: 13px;
  }

  .gameplay-guide-modal {
    align-items: end;
    padding: 14px;
  }

  .gameplay-guide-card {
    width: 100%;
    max-height: 86vh;
    border-radius: 18px;
    padding: 14px;
  }

  .gameplay-guide-header {
    gap: 10px;
  }

  #gameplay-guide-title {
    font-size: 28px;
  }

  #gameplay-guide-close {
    min-width: 64px;
    padding: 7px 12px;
  }

  .gameplay-guide-economy-grid,
  .gameplay-guide-grid {
    grid-template-columns: 1fr;
  }

  .gameplay-guide-split-row {
    grid-template-columns: 64px minmax(0, 1fr);
    justify-items: stretch;
    text-align: left;
  }

  .gameplay-guide-token-card strong {
    font-size: 32px;
  }
}
