/* ── Two permanent floating buttons ─────────────────── */
.gw-float-btn {
  position: fixed;
  right: 24px;
  z-index: 9999;
  background: #1a1a1a;
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  box-shadow: 2px 4px 18px rgba(0, 0, 0, 0.5);
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
}
.gw-float-btn:hover {
  background: #242424;
  border-color: rgba(255, 215, 0, 0.6);
  transform: scale(1.08);
}

#gw-btn-stars { bottom: 108px; }
#gw-btn-math  { bottom: 158px; }

.gw-float-icon {
  font-size: 18px;
  color: #ffd700;
  line-height: 1;
}

/* ── Shared overlay ─────────────────────────────────── */
.gw-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 18, 0.97);
  z-index: 10002;
  overflow: hidden;
}
.gw-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 1;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 6px;
  color: #777;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  padding: 5px 11px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
}
.gw-close:hover { color: #ffd700; border-color: rgba(255, 215, 0, 0.45); }

.gw-hud {
  position: absolute;
  top: 16px;
  left: 20px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #ffd700;
  letter-spacing: 0.06em;
  pointer-events: none;
}

/* ── Star game ──────────────────────────────────────── */
#sg-canvas { display: block; cursor: crosshair; }

.sg-msg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 215, 0, 0.9);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  white-space: nowrap;
}

/* ── Math game ──────────────────────────────────────── */
.gw-math .math-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(540px, 90vw);
  text-align: center;
}

.math-q {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(16px, 3vw, 22px);
  font-weight: 700;
  color: #eaeaea;
  line-height: 1.5;
  margin-bottom: 6px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* KaTeX overrides for dark theme */
.math-q .katex         { color: #eaeaea; font-size: 1.5em; }
.math-q .katex-display { margin: 0; color: #eaeaea; }

.math-hint {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: rgba(255, 215, 0, 0.4);
  letter-spacing: 0.07em;
  margin-bottom: 26px;
}

.math-input {
  width: 100%;
  background: #222;
  border: 1px solid #333;
  border-radius: 10px;
  color: #eaeaea;
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 600;
  padding: 14px 20px;
  text-align: center;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.math-input:focus { border-color: rgba(255, 215, 0, 0.5); }

.math-fb {
  margin-top: 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  min-height: 20px;
  letter-spacing: 0.04em;
}
.math-fb.correct { color: #4caf50; }
.math-fb.wrong   { color: #ef5350; }

/* ── Farah reaction character ───────────────────────── */
.gw-farah {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 90px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.gw-farah.show {
  opacity: 1;
  transform: translateY(0);
}
.gw-farah img {
  width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}
