/* Pac-Man game-specific styles. */

.pacman-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

.pac-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
}

.pac-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--fg);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
}

.pac-scores {
  margin-left: auto;
  display: flex;
  gap: 1rem;
}

.pac-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
}

.pac-score__label {
  font-size: 0.7rem;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pac-score__value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}

.pac-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem 1rem;
}

.pac-stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game {
  width: 100%;
  height: auto;
  background: var(--bg);
  border-radius: 18px;
  touch-action: none;
  display: block;
}

/* Win overlay */
.pac-win {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 16, 38, 0.6);
  backdrop-filter: blur(2px);
  border-radius: 18px;
}

.pac-win[hidden] {
  display: none;
}

.pac-win__card {
  background: var(--bg-2);
  padding: 1.5rem 2rem;
  border-radius: 1rem;
  text-align: center;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.25);
}

.pac-win__title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--accent);
}

.pac-win__btn {
  font: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #222;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}

.pac-win__btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

/* D-pad */
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  grid-template-rows: repeat(3, 72px);
  gap: 6px;
  touch-action: none;
}

.dpad__btn {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 14px;
  background: var(--bg-2);
  color: var(--fg);
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.dpad__btn:active,
.dpad__btn[data-active="true"] {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  background: #1d2755;
}

.dpad__btn--up {
  grid-column: 2;
  grid-row: 1;
}
.dpad__btn--left {
  grid-column: 1;
  grid-row: 2;
}
.dpad__btn--right {
  grid-column: 3;
  grid-row: 2;
}
.dpad__btn--down {
  grid-column: 2;
  grid-row: 3;
}

@media (min-width: 640px) {
  .dpad {
    grid-template-columns: repeat(3, 84px);
    grid-template-rows: repeat(3, 84px);
  }
}
