/* Scoped to .pom so the rest of sexspielzeug.net is untouched. */

.pom-page {
  display: flex;
  justify-content: center;
  padding: 16px 12px 48px;
  overflow-anchor: none;
}

.pom {
  --pom-bg: #140810;
  --pom-card: #2a1822;
  --pom-card-2: #351d29;
  --pom-text: #fdf6f8;
  --pom-muted: #d7b8c2;
  --pom-ok: #34d399;
  --pom-line: rgba(255, 255, 255, 0.12);
  --pom-radius: 22px;
  --pom-shadow: 0 18px 50px rgba(20, 6, 12, 0.35);
  --pom-neon: #ff4d8d;
  --pom-violet: #c084fc;
  --pom-orange: #fb923c;
  box-sizing: border-box;
  width: min(92vw, 600px);
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  color: var(--pom-text);
  background: radial-gradient(1200px 480px at 50% -10%, #4a2233 0%, var(--pom-bg) 55%);
  border: 1px solid var(--pom-line);
  border-radius: var(--pom-radius);
  box-shadow: var(--pom-shadow);
  padding: 28px 20px 32px;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
  overflow: hidden;
  overflow-anchor: none;
  scroll-margin-top: 16px;
}

.pom *,
.pom *::before,
.pom *::after {
  box-sizing: border-box;
}

/*
 * Bootstrap sets [hidden] { display: none } without !important.
 * Later display:flex on the same node would keep it on screen.
 * Higher-specificity [hidden] wins without using !important.
 */
.pom [hidden],
.pom-screen[hidden],
.pom-overlay[hidden],
.pom-copy-msg[hidden],
.pom-fallback-url[hidden],
.pom-best[hidden],
.pom-hud-combo[hidden] {
  display: none;
}

.pom-screen {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  width: 100%;
}

.pom-screen:not([hidden]) {
  display: flex;
}

.pom-screen-play:not([hidden]) {
  gap: 8px;
}

.pom.is-playing {
  padding: 14px 12px 16px;
}

.pom-emoji {
  font-size: 48px;
  line-height: 1;
  margin: 4px 0 0;
}

.pom-title {
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  font-weight: 800;
}

.pom-title-sm {
  font-size: clamp(1.25rem, 5vw, 1.7rem);
  text-transform: none;
  letter-spacing: 0;
}

.pom-lead,
.pom-sub,
.pom-meta,
.pom-disclaimer,
.pom-kicker,
.pom-score-line {
  margin: 0;
}

.pom-lead {
  font-size: 1.12rem;
  max-width: 22em;
}

.pom-sub,
.pom-disclaimer,
.pom-meta {
  color: var(--pom-muted);
  max-width: 24em;
}

.pom-disclaimer {
  font-size: 0.82rem;
}

.pom-meta {
  font-size: 0.88rem;
  margin-top: 2px;
}

.pom-controls {
  width: 100%;
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--pom-card);
  border: 1px solid var(--pom-line);
  color: var(--pom-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.pom-controls-kicker {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--pom-text);
}

.pom-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pom-muted);
  font-weight: 700;
}

.pom-best {
  width: 100%;
  margin: 6px 0;
  padding: 14px 12px;
  border-radius: 16px;
  background: var(--pom-card);
  border: 1px solid var(--pom-line);
}

.pom-best-score {
  margin: 4px 0 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.pom-start-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.pom-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--pom-text);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.pom-btn:focus-visible,
.pom-icon-btn:focus-visible,
.pom-dpad-btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.pom-btn:disabled {
  cursor: default;
  opacity: 0.45;
}

.pom-btn-primary {
  background: var(--pom-accent, var(--pom-neon));
  color: #fff;
}

.pom-btn-secondary {
  background: var(--pom-card-2);
  border-color: var(--pom-line);
}

.pom-btn-ghost {
  background: transparent;
  border-color: var(--pom-line);
}

.pom-hud {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "lives score actions"
    "level combo actions";
  align-items: center;
  gap: 2px 10px;
  width: 100%;
  font-weight: 750;
  font-size: 0.92rem;
  padding-bottom: 6px;
  min-height: 52px;
}

.pom-hud-lives { grid-area: lives; margin: 0; letter-spacing: 0.06em; }
.pom-hud-score { grid-area: score; margin: 0; text-align: center; }
.pom-hud-level { grid-area: level; margin: 0; color: var(--pom-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.pom-hud-combo {
  grid-area: combo;
  margin: 0;
  text-align: center;
  color: var(--pom-orange);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.pom-hud-actions {
  grid-area: actions;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.pom-icon-btn {
  appearance: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  border: 1px solid var(--pom-line);
  background: var(--pom-card);
  color: var(--pom-text);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  touch-action: manipulation;
}

.pom-stage {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pom-stage canvas {
  display: block;
  width: min(100%, 600px);
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: #0e070c;
  touch-action: none;
  user-select: none;
}

.pom-stage canvas:focus {
  outline: none;
}

.pom-stage canvas:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.pom-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 16px;
  background: rgba(10, 4, 8, 0.82);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 16px;
  text-align: center;
}

.pom-overlay:not([hidden]) {
  display: flex;
}

#pom-overlay-countdown:not([hidden]) {
  pointer-events: none;
}

.pom-overlay .pom-btn {
  max-width: 280px;
}

.pom-overlay-big {
  margin: 0;
  font-size: clamp(3rem, 16vw, 5.2rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 24px var(--pom-neon);
}

.pom-overlay-kicker {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--pom-violet);
}

.pom-overlay-sub {
  margin: 0;
  color: var(--pom-muted);
  max-width: 18em;
}

.pom-score-line {
  font-weight: 700;
}

.pom-copy-msg {
  margin: 0;
  color: var(--pom-ok);
  font-weight: 700;
}

.pom-fallback-url {
  margin: 0;
  color: var(--pom-muted);
  word-break: break-all;
  font-size: 0.88rem;
}

.pom-dpad {
  display: grid;
  grid-template-columns: 64px 64px 64px;
  grid-template-rows: 64px 64px;
  grid-template-areas:
    ". up ."
    "left down right";
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
  user-select: none;
  position: relative;
  z-index: 3;
  touch-action: none;
  cursor: pointer;
}

.pom-dpad-btn {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 64px;
  border-radius: 18px;
  border: 1px solid var(--pom-line);
  background: var(--pom-card-2);
  color: var(--pom-text);
  font-size: 1.35rem;
  font-weight: 800;
  pointer-events: none;
  touch-action: none;
}

.pom-dpad-btn[data-dir="up"] { grid-area: up; }
.pom-dpad-btn[data-dir="left"] { grid-area: left; }
.pom-dpad-btn[data-dir="down"] { grid-area: down; }
.pom-dpad-btn[data-dir="right"] { grid-area: right; }

.pom-dpad-btn.is-held {
  background: var(--pom-accent, var(--pom-neon));
  border-color: var(--pom-accent, var(--pom-neon));
}

.pom-noscript {
  text-align: center;
  padding: 16px;
}

@media (hover: hover) and (pointer: fine) {
  .pom-btn-primary:hover:not(:disabled) {
    filter: brightness(1.06);
  }

  .pom-btn-secondary:hover:not(:disabled),
  .pom-btn-ghost:hover:not(:disabled),
  .pom-icon-btn:hover,
  .pom-dpad-btn:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: var(--pom-card-2);
  }
}

@media (min-width: 768px) {
  .pom-page {
    padding: 32px 16px 64px;
  }

  .pom {
    padding: 36px 32px 40px;
  }

  .pom.is-playing {
    padding: 18px 20px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pom-btn,
  .pom-icon-btn,
  .pom-dpad-btn {
    transition: none;
  }
}
