.game-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.game-overlay[hidden] {
  display: none;
}

.game-card {
  width: 280px;
  border-radius: 16px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.game-header {
  position: relative;
  width: 280px;
  height: 98px;
  padding: 6px 16px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--blue);
}

/* Title sits in its own row above the score/meter row now — the app's
   mobile version stacks them (score literally on top of the title text)
   but that reads as illegible clutter at this size on the web, so here
   they're just two separate rows instead. */
.game-title-bg {
  display: flex;
  align-items: center;
  pointer-events: none;
}

.game-title-bg span {
  flex: 1;
  text-align: center;
  font-family: 'KCTallboyInked', serif;
  font-size: 26px;
  color: var(--lime);
}

.game-close {
  position: absolute;
  top: 4px;
  right: 8px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--red);
  cursor: pointer;
  padding: 4px;
  z-index: 1;
}

.game-score-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-score {
  flex: 1;
  text-align: center;
  font-family: 'KCTallboyInked', serif;
  font-size: 30px;
  color: var(--red);
}

.game-meter-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-meter-label {
  font-family: 'KCFunkWagon', sans-serif;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--red);
  margin-bottom: 2px;
}

.game-meter-track {
  position: relative;
  width: 90px;
  height: 10px;
  border-radius: 5px;
  border: 1.5px solid var(--red);
  overflow: hidden;
  display: flex;
}

.game-meter-zone {
  flex: 1;
  opacity: 0.55;
}
.game-meter-zone:nth-child(1),
.game-meter-zone:nth-child(5) { background: var(--red); }
.game-meter-zone:nth-child(2),
.game-meter-zone:nth-child(4) { background: #F8C756; }
.game-meter-zone:nth-child(3) { background: var(--lime); }

.game-meter-marker {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 100%;
  border-radius: 3px;
  background: #fff;
  border: 1px solid var(--red);
}

.game-pitch {
  position: relative;
  width: 280px;
  height: 380px;
  background: var(--lime);
  overflow: hidden;
  touch-action: none;
}

.goal-frame {
  position: absolute;
  top: 10px;
  left: 30px;
  width: 220px;
  height: 100px;
}

.goal-net {
  position: absolute;
  inset: 4px 0 0 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.35) 0, rgba(255,255,255,0.35) 1px, transparent 1px, transparent 20px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.35) 0, rgba(255,255,255,0.35) 1px, transparent 1px, transparent 11px);
}

.goal-crossbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: #fff;
}

.goal-post {
  position: absolute;
  top: 0;
  bottom: -10px;
  width: 5px;
  background: #fff;
}
.goal-post-left { left: 0; }
.goal-post-right { right: 0; }

.keeper {
  position: absolute;
  top: 4px;
  left: 50px;
  width: 120px;
  height: 143px;
  object-fit: contain;
  transition: left 0.35s ease-out;
}

.game-hint {
  position: absolute;
  bottom: 56px;
  left: 20px;
  right: 20px;
  text-align: center;
  pointer-events: none;
}

.hint-line {
  font-family: 'KCTallboyInked', serif;
  font-size: 26px;
  color: var(--red);
  line-height: 1.1;
  margin: 0;
}

.hint-line-small {
  font-family: 'KCTallboyInked', serif;
  font-size: 15px;
  color: var(--red);
  margin: 4px 0 0;
}

.result-banner {
  position: absolute;
  top: 150px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'KCTallboyInked', serif;
  font-size: 36px;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.result-banner.show {
  opacity: 1;
  transform: scale(1);
}

.result-banner.goal { color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.6); }
.result-banner.saved { color: var(--red); text-shadow: 0 1px 3px rgba(255,255,255,0.6); }

.ball {
  position: absolute;
  width: 24px;
  height: 24px;
  cursor: grab;
  touch-action: none;
  -webkit-user-drag: none;
  user-drag: none;
}
