/* Classic Pac-Man for the XP desktop. Scoped to .pc-app. */

.pc-app {
  --pc-menu-h: 26px;
  --pc-hud-h: 30px;
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #c0c0c0;
  color: #000;
  font: 12px/1.2 Tahoma, "MS Sans Serif", Verdana, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  outline: none;
}
.pc-app:focus-visible { outline: 2px solid #316ac5; outline-offset: -2px; }
.pc-app button { font: inherit; }

/* Menubar ------------------------------------------------------------- */

.pc-menubar {
  position: relative;
  z-index: 20;
  flex: none;
  display: flex;
  align-items: center;
  gap: 1px;
  height: var(--pc-menu-h);
  padding: 0 4px;
  border-bottom: 1px solid #aca899;
  background: #ece9d8;
}

.pc-menu { position: relative; }

.pc-menu-button {
  padding: 2px 7px;
  border: 0;
  background: transparent;
  color: #000;
  cursor: default;
}
.pc-menu-button:hover,
.pc-menu.open > .pc-menu-button { background: #316ac5; color: #fff; }

.pc-menu-list {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  display: none;
  min-width: 168px;
  padding: 2px;
  border: 1px solid #aca899;
  background: #fff;
  box-shadow: 2px 2px 3px rgba(0, 0, 0, .25);
}
.pc-menu.open > .pc-menu-list { display: block; }

.pc-menu-item {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 23px;
  padding: 3px 20px 3px 14px;
  border: 0;
  background: transparent;
  color: #000;
  text-align: left;
  white-space: nowrap;
  cursor: default;
}
.pc-menu-item:hover,
.pc-menu-item:focus-visible { background: #316ac5; color: #fff; outline: none; }
.pc-shortcut { margin-left: auto; padding-left: 22px; color: #696969; }
.pc-menu-item:hover .pc-shortcut,
.pc-menu-item:focus-visible .pc-shortcut { color: #fff; }
.pc-sep { height: 0; margin: 3px 4px; border-top: 1px solid #aca899; }

.pc-pause-button {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid #b7c9da;
  border-radius: 3px;
  background: linear-gradient(#fff, #dceaf6);
  color: #163c69;
  font-size: 11px;
  cursor: pointer;
}
.pc-pause-button:hover { border-color: #4788cd; background: #eef7ff; }
.pc-pause-button:active { background: #d5e6f5; }

/* HUD ----------------------------------------------------------------- */

.pc-hud {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--pc-hud-h);
  padding: 0 10px;
  overflow: hidden;
  border-bottom: 1px solid #191936;
  background: #000;
  color: #ffe600;
  font-family: "Courier New", Courier, monospace;
}

.pc-hud-block { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.pc-hud-label {
  color: #7c7cb0;
  font-family: Tahoma, Verdana, sans-serif;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.pc-hud b { font-size: 15px; font-weight: bold; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.pc-hud-right { margin-left: auto; align-items: center; }

.pc-lives { display: inline-flex; align-items: center; gap: 6px; height: 14px; }
.pc-life {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: conic-gradient(from 35deg, #ffe600 0 300deg, transparent 300deg 360deg);
}

/* Maze ---------------------------------------------------------------- */

.pc-playfield {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

.pc-canvas {
  display: block;
  background: #000;
  touch-action: none;
  cursor: default;
}

.pc-hint {
  display: none;
  margin: 0;
  padding: 6px 8px;
  background: #000;
  color: #7c7cb0;
  font-size: 10px;
  text-align: center;
}

/* Overlay ------------------------------------------------------------- */

.pc-overlay {
  position: absolute;
  z-index: 25;
  top: calc(var(--pc-menu-h) + var(--pc-hud-h));
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, .72);
}
.pc-overlay[hidden] { display: none; }

.pc-overlay-panel {
  width: min(330px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 14px 16px 16px;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  background: #ece9d8;
  color: #17283a;
  text-align: center;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, .45);
}

.pc-overlay-title {
  margin: 0 0 6px;
  color: #173c63;
  font-size: 21px;
  letter-spacing: .14em;
}
.pc-overlay[data-kind="over"] .pc-overlay-title { color: #9b1c14; }

.pc-copy { margin: 8px 0 0; color: #3c4c5c; font-size: 12px; }
.pc-final { margin: 10px 0 0; color: #173c63; font-size: 20px; font-weight: bold; letter-spacing: .06em; }

.pc-keys {
  display: grid;
  gap: 4px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: #4a5c70;
  font-size: 11px;
  text-align: left;
}
.pc-keys kbd,
.pc-copy kbd {
  display: inline-block;
  min-width: 16px;
  padding: 1px 4px;
  border: 1px solid #a9bccd;
  border-radius: 2px;
  background: #fff;
  color: #1b3a57;
  font: inherit;
  text-align: center;
}

.pc-primary {
  margin-top: 14px;
  min-width: 104px;
  padding: 5px 16px;
  border: 1px solid #4b91d3;
  border-radius: 3px;
  background: linear-gradient(#fff, #c5ddf3);
  color: #163c69;
  font-weight: bold;
  cursor: pointer;
}
.pc-primary:hover { border-color: #1c5e9b; background: linear-gradient(#fff, #d9ecfb); }
.pc-primary:focus-visible { outline: 2px solid #316ac5; outline-offset: 2px; }

/* Dialogs ------------------------------------------------------------- */

.pc-modal {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, .25);
}
.pc-modal[hidden] { display: none; }

.pc-dialog {
  display: flex;
  flex-direction: column;
  width: min(350px, 100%);
  max-height: 100%;
  overflow: hidden;
  border: 1px solid #0a3c9a;
  border-radius: 4px;
  background: #ece9d8;
  box-shadow: 2px 4px 12px rgba(0, 0, 0, .35);
}

.pc-dialog-head {
  display: flex;
  align-items: center;
  padding: 4px 6px 4px 9px;
  background: linear-gradient(180deg, #3a91ed 0%, #176ed3 35%, #0960c7 72%, #287cdf 100%);
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px 2px #123c83;
}
.pc-dialog-title { flex: 1; }
.pc-dialog-x {
  width: 22px;
  height: 20px;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 3px;
  background: linear-gradient(#f49a80, #dc351e 55%, #ad180b);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}

.pc-dialog-body { padding: 12px; overflow: auto; color: #172b3e; }
.pc-dialog-body p { margin: 0 0 8px; }
.pc-dialog-body p:last-child { margin-bottom: 0; }
.pc-help { margin: 0 0 8px; padding-left: 18px; }
.pc-help li { margin: 3px 0; }
.pc-help kbd {
  display: inline-block;
  min-width: 16px;
  padding: 1px 4px;
  border: 1px solid #a9bccd;
  border-radius: 2px;
  background: #fff;
  font: 11px/1.2 Tahoma, Verdana, sans-serif;
}
.pc-hint-text { color: #53677b; font-size: 11px; }

.pc-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid #c1d4e8;
  background: linear-gradient(#eaf3fb, #cbddef);
}
.pc-dialog-actions button {
  min-width: 72px;
  padding: 4px 12px;
  border: 1px solid #abc0d6;
  border-radius: 3px;
  background: linear-gradient(#fff, #d9e5f0);
  color: #213e59;
  cursor: pointer;
}
.pc-dialog-actions button:hover { border-color: #4b91d3; }
.pc-dialog-actions button.primary {
  border-color: #4b91d3;
  background: linear-gradient(#fff, #c5ddf3);
  font-weight: bold;
}

/* Screen-reader only -------------------------------------------------- */

.pc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Loading and error states -------------------------------------------- */

.pc-loading,
.pc-error {
  margin: 0;
  padding: 24px 12px;
  color: #ffe600;
  background: #000;
  text-align: center;
}
.pacman-body > .pc-loading,
.pacman-body > .pc-error { margin: auto; }
.pc-error { color: #ff8acb; max-width: 460px; }

/* Small screens ------------------------------------------------------- */

@media (max-width: 650px) {
  .pc-app { --pc-menu-h: 30px; --pc-hud-h: 28px; font-size: 13px; }
  .pc-menubar { padding: 0 3px; }
  .pc-menu-button { padding: 5px 9px; }
  .pc-pause-button { padding: 4px 8px; font-size: 10px; }
  .pc-hud { gap: 10px; padding: 0 8px; }
  .pc-hud b { font-size: 13px; }
  .pc-hud-label { font-size: 8px; }
  .pc-life { width: 11px; height: 11px; }
  .pc-hint { display: block; }
  .pc-overlay-panel { padding: 12px; }
  .pc-overlay-title { font-size: 18px; }
  .pc-keys { font-size: 10px; }
}
