/* ==== Games home ==== */
.game-card { text-align: center; padding: 1.75rem 1rem; }
.game-card .icon-wrap { font-size: 2.5rem; margin: 0 auto .75rem; background: none; }

/* ==== Shared HUD ==== */
.game-hud {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: .5rem; margin-bottom: 1rem; font-weight: 700;
}
.game-hud .game-lives { font-size: 1.1rem; }
.game-input {
  width: 100%; max-width: 420px; margin: 1rem auto 0; display: block; text-align: center;
  font-size: 1.3rem; padding: .6rem 1rem; border-radius: 14px; border: 2px solid var(--border-color);
  background: var(--bg-surface); color: var(--text-primary);
}
.game-input:focus { outline: none; border-color: var(--accent); }
.game-input.game-input-error { border-color: #dc2626; color: #dc2626; }
.game-word-display { font-size: 2.5rem; font-weight: 800; text-align: center; margin-bottom: .5rem; color: var(--accent); }
.game-word-hidden { color: var(--text-muted); }
.game-controls-row { margin-top: 1rem; display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.game-control-btn { color: var(--accent); border-color: var(--accent); background-color: transparent; }
.game-control-btn:hover, .game-control-btn:focus { color: #fff; background-color: var(--accent); border-color: var(--accent); }

/* ==== Object engine field ==== */
.game-field {
  position: relative; height: 420px; background: linear-gradient(180deg, rgba(var(--accent-rgb), .06), transparent);
  border: 1px solid var(--border-color); border-radius: 20px; overflow: hidden;
}
.game-object { position: absolute; text-align: center; width: 90px; transition: none; }
.game-object-emoji { font-size: 2.5rem; line-height: 1; }
.game-object-word {
  background: var(--bg-surface); border-radius: 8px; padding: .15rem .3rem; font-weight: 700;
  font-size: .85rem; margin-top: .2rem; display: inline-block;
}
.game-object-word .go-typed { color: var(--accent); }
.game-object-popped { animation: goPop .25s ease forwards; }
@keyframes goPop { to { transform: scale(1.6); opacity: 0; } }

/* ==== Race engine ==== */
.race-track { position: relative; height: 70px; background: var(--bg-surface-alt); border-radius: 12px; margin-bottom: .75rem; }
.race-track::after { content: '🏁'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; }
.race-car { position: absolute; top: 50%; transform: translateY(-50%); font-size: 2rem; transition: left .3s ease; left: 0; }
.race-status { text-align: center; font-weight: 700; margin-top: 1rem; min-height: 1.5rem; }

/* ==== Results overlay (shared) ==== */
.game-results-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 1080; padding: 1rem;
}
.game-results-card { position: relative; background: var(--bg-surface); border-radius: 20px; max-width: 420px; width: 100%; padding: 2rem; text-align: center; box-shadow: var(--shadow-lg); }
.game-res-score { font-size: 2.5rem; font-weight: 800; color: var(--accent); }
.game-res-coins { font-weight: 700; }
.game-res-stars { font-size: 1.5rem; }

/* Overlay close button — same look as typing.css's .overlay-close-btn */
.overlay-close-btn {
  position: absolute; top: .9rem; right: .9rem; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border-color); background: var(--bg-surface-alt); color: var(--text-primary);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.overlay-close-btn:hover { background: var(--border-color); }
#gamePlayWrap:fullscreen,
#gamePlayWrap.fs-fallback { background: var(--bg-body); padding: 2rem; overflow-y: auto; }
#gamePlayWrap.fs-fallback { position: fixed; inset: 0; z-index: 1090; }

@media (max-width: 575.98px) {
  .game-field { height: 320px; }
  .game-word-display { font-size: 1.8rem; }
}
