body.boot-pending #app,
body.boot-pending #browser-gate,
body.boot-pending .skip-link {
  visibility: hidden;
}

body.browser-gate-active {
  min-height: 100vh;
  overflow: auto;
  overscroll-behavior: auto;
  background: #F7F3EA;
  color: #172033;
}

body.browser-gate-active #app,
body.browser-gate-active .skip-link,
body.browser-gate-active .onboarding-shell,
body.browser-gate-active .app-tour {
  display: none !important;
}

.browser-gate {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 56px);
  background:
    linear-gradient(90deg, rgba(23,32,51,.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23,32,51,.06) 1px, transparent 1px),
    #F7F3EA;
  background-size: 44px 44px;
}

.browser-game-shell {
  width: min(100%, 430px);
  padding: 18px;
  border: 2px solid #172033;
  border-radius: 8px;
  background: #FFFDF8;
  box-shadow: 8px 8px 0 #172033;
}

.browser-game-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.browser-game-header span {
  color: #B42318;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.browser-game-header h1 {
  color: #172033;
  font-size: clamp(26px, 8vw, 42px);
  font-weight: 800;
  line-height: .95;
  text-align: right;
}

.browser-game-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.browser-game-stats div {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid #172033;
  border-radius: 8px;
  background: #E8F5E9;
}

.browser-game-stats div:nth-child(2) {
  background: #FFF1C2;
}

.browser-game-stats span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.browser-game-stats strong {
  min-width: 38px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  text-align: right;
}

.browser-game-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 2px solid #172033;
  border-radius: 8px;
  background: #172033;
}

.signal-pad {
  position: relative;
  aspect-ratio: 1;
  border: 2px solid #172033;
  border-radius: 8px;
  background: #F7F3EA;
  cursor: pointer;
  transition: transform .12s var(--ease), background .12s var(--ease), box-shadow .12s var(--ease);
}

.signal-pad::before,
.signal-pad::after {
  content: "";
  position: absolute;
  inset: 28%;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: rgba(23,32,51,.26);
}

.signal-pad::after {
  inset: 42%;
  background: currentColor;
}

.signal-pad:active {
  transform: translateY(2px);
}

.signal-pad.is-active {
  transform: translateY(-2px);
  box-shadow: 0 0 0 4px rgba(255,255,255,.9);
}

.signal-pad.tone-red { background: #F04438; }
.signal-pad.tone-green { background: #22C55E; }
.signal-pad.tone-amber { background: #F59E0B; }
.signal-pad.tone-blue { background: #38BDF8; }
.signal-pad.is-active::before,
.signal-pad.is-active::after { color: #FFFFFF; }
.signal-pad.is-hit { background: #D1FAE5; }
.signal-pad.is-miss { background: #FEE2E2; }

.browser-game-footer {
  display: grid;
  grid-template-columns: minmax(120px, .8fr) 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.browser-game-start {
  min-height: 48px;
  border: 2px solid #172033;
  border-radius: 8px;
  background: #B42318;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 4px 4px 0 #172033;
}

.browser-game-start:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #172033;
}

.browser-game-footer p {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 2px solid #172033;
  border-radius: 8px;
  background: #FFFFFF;
  color: #172033;
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 360px) {
  .browser-game-shell { padding: 14px; box-shadow: 5px 5px 0 #172033; }
  .browser-game-footer { grid-template-columns: 1fr; }
}