.gb-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  width: 4.5rem;
  height: 6.1rem;
  padding: 0.55rem 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  border: none;
  border-radius: 0.85rem 0.85rem 1.4rem 0.85rem;
  background: linear-gradient(155deg, #d6d3e0 0%, #b9b5c9 55%, #a8a3ba 100%);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.5) inset,
    0 -3px 6px rgb(0 0 0 / 0.18) inset,
    0 10px 22px -8px rgb(0 0 0 / 0.55);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.gb-fab:hover {
  transform: translateY(-3px) scale(1.04);
}

.gb-fab:active {
  transform: scale(0.96);
}

.gb-fab:focus-visible {
  outline: 2px solid #22e0a8;
  outline-offset: 3px;
}

.gb-fab__screen {
  width: 100%;
  height: 1.65rem;
  border-radius: 0.2rem;
  background: #0e1f16;
  border: 2px solid #6b6780;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gb-fab__screen span {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #22e0a8;
  animation: gbBlink 1.6s steps(1) infinite;
}

.gb-fab__controls {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.1rem;
}

.gb-fab__dpad {
  position: relative;
  width: 1.3rem;
  height: 1.3rem;
}

.gb-fab__dpad::before,
.gb-fab__dpad::after {
  content: "";
  position: absolute;
  background: #4a4658;
  border-radius: 1px;
}

.gb-fab__dpad::before {
  left: 35%;
  top: 0;
  width: 30%;
  height: 100%;
}

.gb-fab__dpad::after {
  top: 35%;
  left: 0;
  width: 100%;
  height: 30%;
}

.gb-fab__buttons {
  display: flex;
  gap: 0.28rem;
  transform: rotate(-18deg);
}

.gb-fab__buttons span {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #7c2740;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.15) inset, 0 1px 2px rgb(0 0 0 / 0.4);
}

@keyframes gbBlink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0.15; }
}

.pd-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgb(5 6 8 / 0.82);
  backdrop-filter: blur(6px);
}

.pd-modal.is-open {
  display: flex;
}

.pd-frame {
  position: relative;
  width: min(94vw, 38rem);
  border-radius: 1.4rem;
  padding: 0.9rem 0.9rem 1.1rem;
  background: linear-gradient(160deg, #d6d3e0, #a8a3ba);
  box-shadow: 0 30px 70px -20px rgb(0 0 0 / 0.6);
}

.pd-close {
  position: absolute;
  top: -0.6rem;
  right: -0.6rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: none;
  background: #16181a;
  color: #f4f5f3;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px -6px rgb(0 0 0 / 0.6);
}

.pd-close:hover {
  background: #22e0a8;
  color: #0a0b0d;
}

.pd-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.15rem 0.35rem 0.6rem;
  font-family: "Outfit", system-ui, sans-serif;
  color: #26241f;
}

.pd-hud__group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.pd-hud__lives {
  display: flex;
  gap: 0.2rem;
}

.pd-hud__lives img {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgb(0 0 0 / 0.3);
}

.pd-mute {
  border: none;
  background: rgb(0 0 0 / 0.12);
  color: #26241f;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-screen-wrap {
  position: relative;
  border-radius: 0.6rem;
  overflow: hidden;
  background: #0a0b0d;
  border: 3px solid #4a4658;
  box-shadow: inset 0 0 0 2px #0e0f11, inset 0 8px 24px rgb(0 0 0 / 0.6);
}

#pd-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: grab;
}

#pd-canvas:active {
  cursor: grabbing;
}

.pd-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  text-align: center;
  padding: 1.5rem;
  background: rgb(10 11 13 / 0.86);
  color: #f4f5f3;
  font-family: "Outfit", system-ui, sans-serif;
}

.pd-overlay.is-visible {
  display: flex;
}

.pd-overlay h2 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

.pd-overlay p {
  margin: 0;
  font-size: 0.85rem;
  color: #9a9ea3;
  max-width: 22rem;
}

.pd-overlay .pd-cast {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0.2rem 0;
}

.pd-cast__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.pd-cast__item img {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f4d78b;
}

.pd-cast__item--pig img {
  border-color: #7fd858;
  filter: saturate(0.75) hue-rotate(50deg);
}

.pd-cast__item span {
  font-size: 0.7rem;
  color: #9a9ea3;
}

.pd-btn {
  border: none;
  border-radius: 0.75rem;
  padding: 0.7rem 1.5rem;
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  background: #22e0a8;
  color: #06110d;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.pd-btn:hover {
  transform: translateY(-2px);
}

.pd-btn:active {
  transform: scale(0.97);
}

.pd-overlay.is-paused {
  background: rgb(10 11 13 / 0.6);
}

.pd-btn-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.pd-btn--ghost {
  background: rgb(255 255 255 / 0.14);
  color: #f4f5f3;
}

.pd-help {
  text-align: center;
  font-size: 0.7rem;
  color: #6b6780;
  margin-top: 0.6rem;
}
