@import url("https://fonts.googleapis.com/css2?family=Jersey+15&display=swap");

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

body {
  margin: 0;
  font-family: "Jersey 15", system-ui, sans-serif;
  background-color: #222222;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #f5f5f5;
  cursor: url("../img/finger.svg") 12 12, url("../img/finger.svg") 12 12, pointer;
}

:root,
button,
a,
input,
textarea,
select,
canvas,
.page,
.arena,
.game-screen,
* {
  cursor: url("../img/finger.svg") 12 12, url("../img/finger.svg") 12 12, pointer !important;
}

.logo {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: 1.6rem;
}

.logo__kirchhoff {
  font-weight: 600;
}

.logo__divider {
  width: 3px;
  height: 36px;
  background: #ffffff;
  display: inline-block;
}

.logo__team {
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  line-height: 1.1;
}

:root {
  --game-control-height: 34px;
  --accent: #52fb7c;
}

.page {
  width: min(1280px, 100%);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hidden {
  display: none !important;
}

.audio-toggle {
  position: static;
  padding: 0;
  width: var(--game-control-height);
  height: var(--game-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-family: "Jersey 15", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1;
  border-radius: 999px;
  cursor: pointer;
  flex: 0 0 var(--game-control-height);
  transition: background 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
}

.audio-toggle:hover,
.audio-toggle:focus-visible {
  background: rgba(106, 228, 179, 0.25);
  border-color: var(--accent);
  outline: none;
}

.audio-toggle:active {
  transform: translateY(1px);
}

.audio-toggle.is-playing {
  background: rgba(106, 228, 179, 0.35);
  border-color: var(--accent);
}

.audio-toggle.is-locked,
.audio-toggle[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.7);
}

.game-frame__actions .audio-toggle.is-playing {
  border-color: var(--accent);
  background: rgba(106, 228, 179, 0.35);
}

.arena {
  display: flex;
  flex-direction: column;
  gap: 26px;
  background: #222222;
  border: 4px solid #ffffff;
  padding: 32px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.arena__header {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 1.4rem;
  text-align: center;
  color: #ffffff;
}

.arena__header h1 {
  margin: 18px 0 12px;
  font-size: 2.2rem;
  letter-spacing: 0.14em;
}

.arena__header p {
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.75);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.game-card {
  background: #222222;
  border: 3px solid #ffffff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: #f5f5f5;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.game-card__body h2 {
  margin: 0;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  border-bottom: 2px solid rgba(34, 34, 34, 0.2);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.game-card__body p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card__button {
  border: 2px solid #ffffff;
  background: transparent;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  padding: 12px 20px;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 12px;
  font-family: "Jersey 15", sans-serif;
}

.game-card__button:hover {
  transform: translateY(-3px);
}

.imprint {
  margin-top: 12px;
  padding: 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.imprint h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.game-screen {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 3px solid #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 1rem;
  background: #222222;
}

.game-actions {
  display: flex;
  gap: 10px;
}

.secondary-button,
.back-button {
  border: 2px solid rgb(255, 255, 255);
  background: transparent;
  color: rgb(255, 255, 255);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 10px 1px;
  cursor: pointer;
  font-size: 0.85rem;
  border-radius: 12px;
}

.page__content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.slope-wrapper {
  position: relative;
  background: #222222;
  padding: 12px;
  border: 3px solid rgba(255, 255, 255, 0.5);
}

canvas {
  border: 0;
  background: #222222;
  image-rendering: pixelated;
  box-shadow: none;
}

.pdf-screen {
  position: fixed;
  inset: 0;
  background-color: #222222;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px 12px;
  color: #f5f5f5;
  z-index: 40;
  gap: 8px;
}

.game-frame {
  width: min(1100px, calc(100vw - 72px));
  height: auto;
  max-height: calc(100vh - 48px);
  padding-bottom: 12px;
  display: flex;
  flex-direction: column;
  row-gap: 24px;
  border: 4px solid #ffffff;
  background: #222222;
  position: relative;
  overflow: hidden;
}

.game-frame__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 24px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.95rem;
  gap: 20px;
  flex: 0 0 auto;
}

.game-frame__top-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.game-frame__title {
  font-size: 1.3rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.game-frame__back {
  border: 0;
  background: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0.08em;
  font-family: "Jersey 15", sans-serif;
  font-size: 1.3rem;
}

.game-frame__close-icon {
  width: 30px;
  height: 30px;
  border: 2px solid currentColor;
  position: relative;
}

.game-frame__close-icon::before,
.game-frame__close-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  background: currentColor;
}

.game-frame__close-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.game-frame__close-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.game-frame__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}

.game-frame__actions .audio-toggle {
  flex: 0 0 var(--game-control-height);
}

.game-frame__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--game-control-height);
  height: var(--game-control-height);
  padding: 0 12px;
  border: 2px solid #ffffff;
  background: transparent;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: "Jersey 15", sans-serif;
}

.game-frame__button--start {
  background: transparent;
  color: #ffffff;
}

.game-frame__canvas {
  padding: 0 12px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

.game-frame__description {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 1.1rem;
  color: #ffffff;
  text-align: center;
}

.game-frame__arrow {
  color: #56fd8b;
}

.pdf-canvas-wrapper {
  width: 100%;
  height: clamp(380px, 55vh, 600px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 3px solid #ffffff;
  box-shadow: none;
  background: #222222;
  flex: 1;
  padding: 6px;
  box-sizing: border-box;
}

.pdf-canvas-wrapper canvas {
  display: block;
  height: 100%;
  width: 100%;
  border: 0;
  border-radius: 0;
  image-rendering: pixelated;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

#pdf-screen .pdf-canvas-wrapper canvas {
  image-rendering: auto;
}

.game-frame__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 11px 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.game-frame__stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.game-frame__stat {
  position: relative;
  border: 0;
  padding: 0;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: transparent;
}

.score-display {
  position: relative;
  width: clamp(200px, 32vw, 320px);
  min-width: 200px;
  aspect-ratio: 324 / 59;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.score-display__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 0;
  pointer-events: none;
}

.score-display__label,
.game-frame__stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  opacity: 0.82;
  z-index: 1;
  justify-self: start;
}

.score-display__value,
.game-frame__stat-value {
  font-size: 1.8rem;
  letter-spacing: 0.1em;
  z-index: 1;
  text-align: right;
  justify-self: end;
  line-height: 1;
}

.score-display__label,
.score-display__value {
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}

.game-frame__lives {
  display: flex;
  gap: 18px;
  align-items: center;
}

.pdf-heart {
  width: 48px;
  height: 48px;
  display: inline-block;
  background: url("../img/heart.svg") no-repeat center;
  background-size: contain;
  image-rendering: pixelated;
  opacity: 0.35;
  transition: opacity 0.2s ease-in-out;
}

.pdf-heart--full {
  opacity: 1;
}

.game-brand {
  margin-bottom: 12px;
  align-self: center;
  width: 100%;
  display: flex;
  justify-content: center;
}

.pdf-overlay {
  inset: 0;
  background: #222222;
  border: 0;
  color: #fff;
  border-radius: 0;
  font-size: 1.2rem;
}

.pdf-overlay .overlay__title {
  font-size: clamp(52px, 9vw, 80px);
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  letter-spacing: 0.18em;
  margin: 0;
}

.pdf-overlay .overlay__score {
  font-size: 1.6rem;
  letter-spacing: 0.3em;
}

.pdf-overlay .overlay__hint {
  color: #56fd8b;
  font-size: 40px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  margin: 0;
  text-transform: none;
}

.mobile-variant .overlay__hint,
.is-touch .overlay__hint {
  display: none;
}

@media (max-width: 900px) {
  .game-frame__top,
  .game-frame__bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .game-frame__stats {
    width: 100%;
    justify-content: flex-start;
    gap: 14px;
  }

  .game-frame__stat {
    flex: 1 1 200px;
    min-width: 0;
    align-items: center;
  }

  .score-display {
    width: 100%;
    max-width: 360px;
    min-width: 200px;
  }

  .game-frame__lives {
    justify-content: center;
  }
}

@media (max-width: 720px) {
  :root {
    --game-control-height: 30px;
  }

  .game-frame__actions {
    gap: 8px;
    flex-wrap: wrap;
  }

  .game-frame__button {
    min-width: 110px;
    padding: 8px 10px;
  }

}

@media (hover: none) and (pointer: coarse) {
  body {
    padding: 0 6px 6px;
  }

  .pdf-screen {
    padding: 6px 8px;
    height: 100dvh;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    gap: 14px;
  }

  .game-grid {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
    justify-content: center;
    justify-items: center;
  }

  .game-card {
    width: min(100%, 340px);
  }

  .game-frame {
    width: 100%;
    max-width: 100%;
    height: calc(100dvh - 8px);
    max-height: none;
    border-width: 0;
    flex: 1 1 auto;
    min-height: 0;
    transform: none;
    row-gap: 6px;
  }

  /* Grow only the play frame on touch without stretching game contents */
  .pdf-canvas-wrapper {
    width: min(100vw, calc((100dvh - 40px) * (1400 / 760)));
    max-width: 100%;
    height: min(calc(100dvh - 40px), calc(100vw * (760 / 1400)));
    max-height: calc(100dvh - 40px);
    aspect-ratio: 1400 / 760;
    border-width: 0;
    flex: 1 1 auto;
    justify-content: center;
    align-items: center;
  }

  .pdf-canvas-wrapper::before {
    content: none;
  }

  .pdf-canvas-wrapper canvas {
    width: 100%;
    max-width: 100%;
    height: 100%;
  }

  .game-frame__top {
    padding: 6px 8px;
  }

  .game-frame__bottom {
    padding: 6px 8px;
  }

  /* Specific touch padding for Slalom and Stock Shopper */
  #game-screen .game-frame__bottom,
  #market-screen .game-frame__bottom {
    padding: 6px 6px 14px;
  }

  .game-frame__canvas {
    padding: 0;
    gap: 6px;
    align-items: stretch;
  }

  #pdf-screen .game-frame__canvas {
    padding-top: 10px;
  }

#pdf-screen .pdf-canvas-wrapper {
  margin-top: 0;
}
.pdf-canvas-wrapper {
  background: #ffffff;
}

#pdf-start-overlay,
#slalom-start-overlay,
#market-start-overlay {
  outline: 3px solid #222222;
  outline-offset: -2px;
  box-sizing: border-box;
}

  #slope {
    background: #ffffff;
  }

  .game-frame__stats {
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap;
    width: 100%;
  }

  .score-display {
    width: 48%;
    min-width: 0;
    max-width: none;
    padding: 6px 8px;
    gap: 4px;
  }

  .score-display__value,
  .game-frame__stat-value {
    font-size: 1.3rem;
  }

  .score-display__label,
  .game-frame__stat-label {
    letter-spacing: 0.18em;
    font-size: 0.72rem;
  }

  .game-frame__lives {
    gap: 10px;
  }

  .pdf-heart {
    width: 36px;
    height: 36px;
  }

  /* PDF Juggler: shrink HUD so stats + hearts sit comfortably in frame */
  #pdf-screen .game-frame__bottom {
    row-gap: 10px;
  }

  #pdf-screen .game-frame__stats {
    gap: 10px;
  }

  #pdf-screen .score-display {
    min-width: 150px;
    max-width: 240px;
    padding: 5px 9px;
  }

  #pdf-screen .score-display__value,
  #pdf-screen .game-frame__stat-value {
    font-size: 1.15rem;
  }

  #pdf-screen .score-display__label,
  #pdf-screen .game-frame__stat-label {
    font-size: 0.68rem;
    letter-spacing: 0.16em;
  }

  #pdf-screen .game-frame__lives {
    gap: 8px;
  }

  #pdf-screen .pdf-heart {
    width: 30px;
    height: 30px;
  }

  .game-brand {
    display: none;
  }

  .page,
  .arena,
  .page__content,
  .game-screen,
  .game-frame,
  .game-frame__top,
  .game-frame__bottom,
  .game-frame__stats,
  .game-share,
  .hud,
  .game-card,
  .imprint,
  .page__footer {
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .game-frame__top {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
  }

  .game-frame__back {
    justify-content: center;
    margin-right: auto;
  }

  .game-frame__top-meta {
    flex-direction: row;
    margin-left: 0;
    margin-right: auto;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }

  .game-frame__actions {
    width: auto;
    justify-content: center;
    gap: 8px;
  }

  .game-frame__button {
    width: auto;
    min-width: 120px;
  }

  .game-frame__description,
  .game-frame__title,
  .logo {
    display: none;
  }

  .game-frame__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .game-frame__back span:not(.game-frame__close-icon) {
    display: none;
  }
}

/* Touch fallback when the browser misreports hover/pointer */
.is-touch body {
  padding: 0 6px 6px;
}

.is-touch .pdf-screen {
  padding: 6px 8px;
  height: 100dvh;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.is-touch .game-grid {
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
  justify-content: center;
  justify-items: center;
}

.is-touch .game-card {
  width: min(100%, 340px);
}

.is-touch .game-frame {
  width: 100%;
  max-width: 100%;
  height: calc(100dvh - 8px);
  max-height: none;
  border-width: 0;
  flex: 1 1 auto;
  min-height: 0;
  transform: none;
  row-gap: 6px;
}

/* Grow only the play frame on touch without stretching game contents */
.is-touch .pdf-canvas-wrapper {
  width: 100%;
  max-width: none;
  height: calc(100dvh - 40px);
  max-height: calc(100dvh - 40px);
  aspect-ratio: auto;
  border-width: 0;
  flex: 1 1 auto;
  justify-content: center;
  align-items: center;
}

.is-touch .pdf-canvas-wrapper::before {
  content: none;
}

.is-touch .pdf-canvas-wrapper canvas {
  width: auto;
  max-width: 100%;
  height: 100%;
}

.is-touch .game-frame__top {
  padding: 6px 8px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.is-touch .game-frame__bottom {
  padding: 6px 8px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Specific touch padding for Slalom and Stock Shopper */
.is-touch #game-screen .game-frame__bottom,
.is-touch #market-screen .game-frame__bottom {
  padding: 6px 6px 14px;
}

.is-touch .game-frame__canvas {
  padding: 0;
  gap: 6px;
  align-items: stretch;
}

.is-touch #pdf-screen .game-frame__canvas {
  padding-top: 10px;
}

.is-touch #pdf-screen .pdf-canvas-wrapper {
  margin-top: 0;
}
.is-touch .pdf-canvas-wrapper {
  background: #222222;
}

.is-touch #slope {
  background: #ffffff;
}

.is-touch .game-frame__stats {
  gap: 10px;
  justify-content: center;
  flex-wrap: nowrap;
  width: 100%;
  align-items: center;
}

.is-touch .score-display {
  width: 48%;
  min-width: 0;
  max-width: none;
  padding: 6px 8px;
  gap: 4px;
}

.is-touch .score-display__value,
.is-touch .game-frame__stat-value {
  font-size: 1.3rem;
}

.is-touch .score-display__label,
.is-touch .game-frame__stat-label {
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

.is-touch .game-frame__lives {
  gap: 10px;
  justify-content: center;
}

.is-touch .pdf-heart {
  width: 36px;
  height: 36px;
}

/* PDF Juggler: shrink HUD so stats + hearts sit comfortably in frame */
.is-touch #pdf-screen .game-frame__bottom {
  row-gap: 10px;
}

.is-touch #pdf-screen .game-frame__stats {
  gap: 10px;
  margin-top: 16px;
}

.is-touch #pdf-screen .score-display {
  min-width: 0;
  max-width: none;
  padding: 5px 8px;
}

.is-touch #pdf-screen .score-display__value,
.is-touch #pdf-screen .game-frame__stat-value {
  font-size: 1.15rem;
}

.is-touch #pdf-screen .score-display__label,
.is-touch #pdf-screen .game-frame__stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
}

.is-touch #pdf-screen .game-frame__lives {
  gap: 8px;
}

.is-touch #pdf-screen .pdf-heart {
  width: 30px;
  height: 30px;
}

.is-touch .game-brand {
  display: none;
}

.is-touch .page,
.is-touch .arena,
.is-touch .page__content,
.is-touch .game-screen,
.is-touch .game-frame,
.is-touch .game-frame__top,
.is-touch .game-frame__bottom,
.is-touch .game-frame__stats,
.is-touch .game-share,
.is-touch .hud,
.is-touch .game-card,
.is-touch .imprint,
.is-touch .page__footer {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.is-touch .game-frame__back {
  justify-content: center;
  margin-right: auto;
}

.is-touch .game-frame__top-meta {
  flex-direction: row;
  margin-left: 0;
  margin-right: auto;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.is-touch .game-frame__actions {
  width: auto;
  justify-content: center;
  gap: 8px;
}

.is-touch .game-frame__button {
  width: auto;
  min-width: 120px;
}

.is-touch .game-frame__description,
.is-touch .game-frame__title,
.is-touch .logo {
  display: none;
}

.is-touch .game-frame__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.is-touch .game-frame__back span:not(.game-frame__close-icon) {
  display: none;
}

.is-touch .game-frame__back {
  font-size: 1.1rem;
}

.overlay {
  position: absolute;
  inset: 0;
  background: #222222;
  border: 0;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  font-size: 0.95rem;
  border-radius: 0;
}

.pdf-canvas-wrapper .overlay,
.game-frame__canvas .overlay {
  inset: 6px;
}

.mobile-variant .pdf-canvas-wrapper .overlay,
.mobile-variant .game-frame__canvas .overlay {
  inset: 0;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay--image {
  background: transparent;
  padding: 0;
}

.overlay__image {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
}

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

.score-submit {
  width: min(380px, 90%);
  margin-top: 18px;
  padding: 16px 18px;
  background: rgba(24, 24, 24, 0.9);
  border: 2px solid #ffffff;
  box-shadow: 6px 6px 0 rgba(255, 255, 255, 0.9);
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.score-submit__label {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.95rem;
  margin: 0;
  color: #ffffff;
}

.score-submit__input {
  width: 100%;
  max-width: 240px;
  text-align: center;
  background: #111111;
  color: #ffffff;
  border: 2px solid #ffffff;
  padding: 10px 12px;
  font-family: "Jersey 15", system-ui, sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  outline: none;
}

.score-submit__input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.score-submit__button {
  background: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
  padding: 8px 18px;
  text-transform: lowercase;
  letter-spacing: 0.18em;
  font-family: "Jersey 15", system-ui, sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
}

.score-submit__button:hover,
.score-submit__button:focus-visible {
  background: rgba(106, 228, 179, 0.18);
  border-color: #52fb7c;
  outline: none;
}

.score-submit__button:active {
  transform: translateY(1px);
}

.score-submit__error {
  min-height: 18px;
  color: #52fb7c;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
}

.score-submit__actions {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.score-submit__actions[hidden] {
  display: none;
}

.score-submit__link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hud {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hud__row {
  background: #222222;
  border: 3px solid #ffffff;
  padding: 10px 14px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.9rem;
  border-radius: 16px;
}

.label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.value {
  font-size: 1.1rem;
}

.page__footer {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

/* Dedicated mobile variant */
.mobile-variant .pdf-screen {
  padding: 0;
  height: 100dvh;
  min-height: 100vh;
  align-items: center;
  justify-content: flex-start;
}

.mobile-variant .game-frame {
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  border-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  row-gap: 0;
}

.mobile-variant .game-frame__top {
  padding: 12px 12px 16px;
  justify-content: space-between;
  align-items: center;
}

.mobile-variant .game-frame__back {
  margin-right: 0;
}

.mobile-variant .game-frame__top-meta {
  margin-left: 0;
  margin-right: 0;
  gap: 8px;
}

.mobile-variant .game-frame__title,
.mobile-variant .game-frame__description,
.mobile-variant .game-brand,
.mobile-variant .logo {
  display: none;
}

.mobile-variant .game-frame__canvas {
  padding: 0 12px;
  gap: 24px;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(320px, 60vh, 900px);
  height: 100%;
  width: 100%;
}

.mobile-variant .pdf-canvas-wrapper {
  width: 100%;
  height: auto;
  max-width: 100vw;
  border-width: 0;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.mobile-variant .pdf-canvas-wrapper canvas {
  height: 100%;
  width: 100%;
  max-width: 100%;
}

.mobile-variant .game-frame__bottom {
  padding: 4px 6px 16px;
  justify-content: center;
  gap: 6px;
}

.mobile-variant .game-frame__stats {
  width: 100%;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.mobile-variant .score-display {
  width: 48%;
  min-width: 0;
  max-width: none;
  padding: 16px;
}

.mobile-variant .game-frame__actions {
  justify-content: center;
  gap: 8px;
}

@media (min-width: 720px) {
  .page__content {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 28px;
    align-self: center;
    width: fit-content;
    max-width: 100%;
  }

  .hud {
    width: auto;
    min-width: 190px;
  }
}
.pdf-canvas-wrapper::before {
  content: none;
}

.pdf-canvas-wrapper canvas {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  image-rendering: pixelated;
}

#pdf-screen .pdf-canvas-wrapper canvas {
  image-rendering: auto;
}
