.ux-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ux-toolbar .toolbar-link,
.guide-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #ffd166;
  background: rgba(255,255,255,.06);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.ux-toolbar .toolbar-link:hover,
.guide-button:hover {
  border-color: rgba(255,209,102,.55);
  background: rgba(255,209,102,.12);
}

.ux-toolbar .toolbar-link {
  color: #fffaf0;
}

.guide-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(5,8,14,.72);
  backdrop-filter: blur(8px);
}

.guide-modal.open {
  display: grid;
}

.guide-panel {
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 22px;
  color: #fffaf0;
  background: #17152b;
  box-shadow: 0 30px 100px rgba(0,0,0,.34);
}

.guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.guide-kicker {
  margin: 0 0 8px;
  color: #ffd166;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.guide-title {
  margin: 0;
  font-size: clamp(26px, 6vw, 38px);
  line-height: 1.08;
  letter-spacing: -.04em;
}

.guide-close {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  color: white;
  background: transparent;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.guide-body {
  padding: 20px 22px 24px;
}

.guide-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.guide-list li {
  padding: 14px 15px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 15px;
  background: rgba(255,255,255,.045);
  color: rgba(255,255,255,.82);
  font-size: 15px;
  line-height: 1.65;
}

.guide-list strong {
  display: block;
  margin-bottom: 4px;
  color: white;
  font-size: 16px;
}

.guide-tip {
  margin: 16px 0 0;
  padding: 14px 15px;
  border-radius: 15px;
  color: #17152b;
  background: #ffd166;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.shared-action-button,
.game-ux-summary .toolbar-link,
.game-ux-summary .shared-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #fffaf0;
  background: rgba(255,255,255,.08);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.shared-action-button:hover,
.game-ux-summary .toolbar-link:hover,
.game-ux-summary .shared-action-button:hover {
  border-color: rgba(255,209,102,.45);
  background: rgba(255,209,102,.18);
}

/* Keep each game's main call-to-action visually consistent. */
.primary-button.shared-action-button {
  border-color: #ffd166;
  color: #24162f;
  background: #ffd166;
  box-shadow: 0 14px 36px rgba(255,209,102,.2);
}

.primary-button.shared-action-button:hover {
  border-color: #ffdc85;
  background: #ffdc85;
}

.game-welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(7,8,15,.8);
  backdrop-filter: blur(10px);
}

.game-welcome-modal.open {
  display: grid;
}

.game-welcome-panel,
.game-ux-summary-card {
  width: min(560px, 100%);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 24px;
  padding: 24px;
  color: #fffaf0;
  background: linear-gradient(135deg, rgba(23,21,43,.98), rgba(51,38,94,.96));
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
}

.game-welcome-panel h2,
.game-ux-summary-card h3 {
  margin: 0 0 8px;
  font-size: clamp(24px, 5vw, 32px);
}

.game-welcome-panel p,
.game-ux-summary-card p {
  margin: 0;
  color: rgba(255,250,240,.8);
  line-height: 1.6;
}

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.game-ux-summary {
  margin: 20px 0 0;
}

.summary-head {
  margin-bottom: 12px;
}

.summary-kicker {
  margin: 0 0 6px;
  color: #ffd166;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.metric {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  background: rgba(255,255,255,.05);
}

.metric span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255,250,240,.68);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.metric strong {
  font-size: 16px;
}

@media (max-width: 560px) {
  .summary-metrics {
    grid-template-columns: 1fr;
  }
  .guide-button {
    min-width: 38px;
    padding: 0 10px;
    font-size: 12px;
  }

  .guide-head,
  .guide-body {
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* Compact summary toggle + modal for small screens */
.game-ux-summary { display: none; }

/* Top compact summary bar */
.game-ux-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(23,21,43,0.98), rgba(34,30,60,0.96));
  color: #fffaf0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.game-ux-summary-bar .bar-metrics {
  display: flex;
  gap: 10px;
  align-items: center;
}
.bar-metric { display:flex; flex-direction:column; align-items:flex-start; }
.bar-label { font-size:11px; color:rgba(255,250,240,.68); font-weight:700; }
.bar-value { font-size:15px; margin-top:2px; }
.bar-actions { margin-left:12px; }

@media (max-width: 640px) {
  .game-ux-summary-bar { padding: 8px 10px; }
  .bar-metrics { gap: 8px; }
  .bar-label { font-size:10px; }
  .bar-value { font-size:14px; }
}
