@layer app {
/* ============================================================
   Game bar (gbar) — opponent + stop pips + label
   ============================================================ */
.gbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--status-brd);
  background: var(--screen-bg);
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.gbar-opponent {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.gbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--cell-bg);
  border: 1px solid var(--cell-brd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--flap-dim);
  flex-shrink: 0;
  font-family: var(--font-flap);
}

.gbar-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gbar-pips {
  display: flex;
  gap: 5px;
  align-items: center;
}

.pip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-flap);
  border: 1.5px solid var(--stop-brd);
  background: var(--stop-bg);
  color: var(--page-sub);
}

.pip-won {
  background: var(--stop-won-bg);
  border-color: var(--stop-won-brd);
  color: var(--stop-won-text);
}

.pip-lost {
  background: var(--stop-lost-bg);
  border-color: var(--stop-lost-brd);
  color: var(--stop-lost-text);
}

.pip-tied {
  background: var(--stop-tied-bg);
  border-color: var(--stop-tied-brd);
  color: var(--stop-tied-text);
}

.pip-current {
  background: var(--stop-cur-bg);
  border-color: var(--orange);
  color: var(--orange);
  position: relative;
}

.pip-current::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--orange-glow);
  animation: pip-pulse 1.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pip-pulse {
  0%, 100% { transform: scale(0.7); opacity: 0; }
  50%      { transform: scale(1);   opacity: 1; }
}

.gbar-label {
  display: none;
}

.gbar-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--label-col);
  white-space: nowrap;
}

.gbar-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.gbar-info-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cell-bg);
  border: 1px solid var(--cell-brd);
  color: var(--label-col);
  cursor: pointer;
  transition: background 0.15s ease;
}

.gbar-info-btn:active {
  background: var(--cell-empty-bg);
}

.gbar-manual-btn {
  flex-shrink: 0;
  width: auto;
  padding: 0 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.gbar-bag-btn {
  width: auto;
  padding: 0 10px;
  gap: 6px;
  border-radius: 16px;
}

.gbar-btn-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Legacy state-bar compat */
.game-state-bar {
  padding: 0;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  flex-shrink: 0;
}

.state-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 10px 14px;
}

.state-cell {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--stop-bg);
  border: 1.5px solid var(--stop-brd);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-flap);
  color: var(--page-sub);
}

.state-upcoming { color: var(--page-sub); }
.state-active { color: var(--orange); border-color: var(--orange); position: relative; }
.state-active::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--orange-glow); animation: pip-pulse 1.4s ease-in-out infinite; pointer-events: none; }
.state-won { background: var(--stop-won-bg); border-color: var(--stop-won-brd); color: var(--stop-won-text); }
.state-lost { background: var(--stop-lost-bg); border-color: var(--stop-lost-brd); color: var(--stop-lost-text); }
.state-tie { background: var(--stop-tied-bg); border-color: var(--stop-tied-brd); color: var(--stop-tied-text); }

}
