:root {
  --indigo-950: #11183f;
  --indigo-900: #1c275f;
  --indigo-800: #26347d;
  --indigo-700: #3f52b2;
  --indigo-500: #5e72e4;
  --indigo-300: #aeb9ff;
  --mint-700: #128f57;
  --mint-600: #1fbf7c;
  --mint-500: #2dce89;
  --mint-200: #a5f3d0;
  --yellow-600: #e5a824;
  --yellow-500: #ffc84d;
  --yellow-200: #fff0b8;
  --coral-700: #a93642;
  --coral-500: #e86969;
  --sky-500: #388ec6;
  --violet-500: #8660cf;
  --surface: #f7f8ff;
  --white: #ffffff;
  --ink: #20243b;
  --muted: #626982;
  --safe-top: max(14px, env(safe-area-inset-top));
  --safe-bottom: max(14px, env(safe-area-inset-bottom));
  --safe-left: max(14px, env(safe-area-inset-left));
  --safe-right: max(14px, env(safe-area-inset-right));
  --z-scene: -3;
  --z-base: 1;
  --z-hud: 10;
  --z-header: 20;
  --z-dialog: 40;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  background: var(--indigo-950);
}

body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--indigo-950);
  color: var(--white);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  overscroll-behavior: none;
  touch-action: manipulation;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--yellow-500);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  align-content: center;
  justify-items: center;
  background: var(--indigo-900);
  transition:
    opacity 180ms ease-out,
    visibility 180ms ease-out;
}

.loading-screen img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
}

.loading-screen p {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8rem;
  font-weight: 750;
}

.loading-track {
  width: 148px;
  height: 5px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

.loading-track span {
  display: block;
  width: 48%;
  height: 100%;
  border-radius: inherit;
  background: var(--mint-500);
  animation: loading-slide 900ms ease-in-out infinite alternate;
}

.loading-screen.is-ready {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.game-shell {
  position: relative;
  isolation: isolate;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
  background: var(--indigo-800);
}

.office-world,
.scene-shade {
  position: absolute;
  inset: 0;
  z-index: var(--z-scene);
  overflow: hidden;
}

.office-panorama {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: max(100vw, calc(100dvh * 2.35715));
  min-width: 100vw;
  background-image: url("./assets/art/office-panorama-2k.webp");
  background-position: center;
  background-size: cover;
  animation: office-pan 28s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
  will-change: transform;
}

.office-parallax {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.office-parallax-back {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.24), transparent 22%),
    radial-gradient(circle at 78% 30%, rgba(45, 206, 137, 0.09), transparent 26%);
  animation: light-drift 16s ease-in-out infinite alternate;
}

.office-parallax-front {
  background: linear-gradient(
    90deg,
    rgba(28, 39, 95, 0.08),
    transparent 18%,
    transparent 82%,
    rgba(28, 39, 95, 0.08)
  );
}

.scene-shade {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(17, 24, 63, 0.83) 0%, rgba(17, 24, 63, 0.04) 27%),
    linear-gradient(0deg, rgba(12, 18, 48, 0.86) 0%, rgba(12, 18, 48, 0) 36%);
  pointer-events: none;
}

.brand-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--safe-top) var(--safe-right) 8px var(--safe-left);
}

.brand-link {
  display: inline-flex;
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: flex-end;
  color: var(--white);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 9px;
}

.brand-logo-surface {
  display: none;
}

.brand-logo {
  display: block;
  width: 176px;
  height: auto;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: rgba(17, 24, 63, 0.84);
  color: var(--white);
  cursor: pointer;
  place-items: center;
  transition:
    background 160ms ease-out,
    transform 160ms ease-out;
}

.icon-button:hover {
  background: var(--indigo-700);
}

.icon-button:active {
  transform: translateY(2px);
}

.icon-button svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sound-off {
  display: none;
}

.icon-button[aria-pressed="false"] .sound-on {
  display: none;
}

.icon-button[aria-pressed="false"] .sound-off {
  display: block;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.pause-button {
  display: none;
}

[data-screen="play"] .pause-button {
  display: grid;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out;
}

[data-screen="menu"] .screen-menu,
[data-screen="play"] .screen-play,
[data-screen="result"] .screen-result {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.screen-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding:
    calc(var(--safe-top) + 60px) max(20px, var(--safe-right))
    var(--safe-bottom) max(20px, var(--safe-left));
  text-align: center;
}

.screen-menu::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(17, 24, 63, 0.28),
    rgba(17, 24, 63, 0.5) 52%,
    rgba(12, 18, 48, 0.88)
  );
  content: "";
  pointer-events: none;
}

.screen-menu > * {
  position: relative;
  z-index: 1;
}

.menu-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.offered-by {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 0 rgba(17, 24, 63, 0.2);
  color: var(--indigo-900);
}

.offered-by span {
  max-width: 72px;
  font-size: 0.56rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: left;
}

.offered-by img {
  width: 132px;
  height: auto;
}

.game-edition {
  margin: 0 0 9px;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--yellow-500);
  color: var(--indigo-900);
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

h1 {
  margin: 0;
  font-family:
    "Arial Rounded MT Bold", ui-rounded, "Trebuchet MS", sans-serif;
  font-size: clamp(3.4rem, 16vw, 5.2rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.8;
  text-shadow: 0 5px 0 rgba(23, 31, 80, 0.3);
  text-wrap: balance;
  transform: rotate(-2deg);
}

h1 span,
h1 strong {
  display: block;
}

h1 strong {
  color: var(--yellow-500);
  font-style: normal;
}

.menu-copy {
  max-width: 28rem;
  margin: 20px 0 0;
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.4;
  text-shadow: 0 2px 7px rgba(12, 18, 48, 0.8);
  text-wrap: pretty;
}

.brand-claim {
  margin: 11px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.7rem;
  line-height: 1.38;
  text-shadow: 0 2px 6px rgba(12, 18, 48, 0.8);
}

.brand-claim strong {
  color: var(--mint-200);
}

.challenge-banner {
  display: flex;
  gap: 10px;
  align-items: center;
  width: min(100%, 390px);
  margin-top: 15px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(17, 24, 63, 0.92);
  box-shadow: 0 4px 0 rgba(8, 13, 38, 0.28);
  text-align: left;
}

.challenge-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--yellow-500);
  place-items: center;
}

.challenge-banner div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.challenge-banner div span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.66rem;
  font-weight: 750;
}

.challenge-banner strong {
  color: var(--white);
  font-size: 0.84rem;
}

.start-panel {
  width: min(100%, 430px);
  margin-top: auto;
}

.quick-rules {
  display: flex;
  justify-content: center;
  margin-bottom: 13px;
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 850;
  text-shadow: 0 2px 6px rgba(12, 18, 48, 0.8);
}

.quick-rules span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 0 10px;
}

.quick-rules span + span {
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.quick-rules b {
  display: grid;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--indigo-800);
  color: var(--mint-200);
  font-size: 0.64rem;
  place-items: center;
}

.menu-audio-prompt {
  display: flex;
  width: 100%;
  min-height: 48px;
  margin: 0 0 13px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: rgba(17, 24, 63, 0.9);
  box-shadow: 0 4px 0 rgba(8, 13, 38, 0.3);
  color: var(--white);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
  transition:
    background 160ms ease-out,
    box-shadow 120ms ease-out,
    transform 120ms ease-out;
}

.menu-audio-prompt:hover {
  background: var(--indigo-800);
}

.menu-audio-prompt:active {
  box-shadow: 0 2px 0 rgba(8, 13, 38, 0.3);
  transform: translateY(2px);
}

.menu-audio-prompt svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--yellow-500);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.menu-utility-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 13px;
}

.utility-button {
  display: inline-flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 12px;
  background: rgba(17, 24, 63, 0.84);
  color: var(--white);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  transition:
    background 160ms ease-out,
    border-color 160ms ease-out,
    transform 120ms ease-out;
}

.utility-button:hover {
  border-color: rgba(255, 255, 255, 0.72);
  background: var(--indigo-800);
}

.utility-button:active {
  transform: translateY(2px);
}

.utility-button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--yellow-500);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 48px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: var(--mint-500);
  box-shadow: 0 7px 0 var(--mint-700);
  color: #102d2a;
  font-size: 1rem;
  text-transform: uppercase;
  transition:
    background 160ms ease-out,
    box-shadow 120ms ease-out,
    transform 120ms ease-out;
}

.primary-button:hover {
  background: #47dda0;
}

.primary-button:active {
  box-shadow: 0 3px 0 var(--mint-700);
  transform: translateY(4px);
}

.primary-button svg {
  width: 23px;
  margin-left: 8px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.secondary-button {
  width: 100%;
  border: 2px solid #d8dcef;
  border-radius: 12px;
  background: transparent;
  color: var(--indigo-700);
}

.secondary-button:hover {
  background: #eceeff;
}

.text-button {
  border: 0;
  background: transparent;
  color: inherit;
}

.control-hint {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.66rem;
  font-weight: 700;
  text-shadow: 0 2px 5px rgba(12, 18, 48, 0.8);
}

[data-screen="play"] .scene-shade {
  background:
    linear-gradient(180deg, rgba(17, 24, 63, 0.78) 0%, rgba(17, 24, 63, 0) 21%),
    linear-gradient(0deg, rgba(12, 18, 48, 0.88) 0%, rgba(12, 18, 48, 0) 24%);
}

.hud {
  position: absolute;
  top: calc(var(--safe-top) + 59px);
  right: var(--safe-right);
  left: var(--safe-left);
  z-index: var(--z-hud);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border-radius: 13px;
  background: rgba(25, 34, 87, 0.95);
  box-shadow: 0 5px 0 rgba(12, 18, 48, 0.26);
}

.stat {
  position: relative;
  display: flex;
  min-height: 61px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat + .stat::before {
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.17);
  content: "";
}

.stat span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.53rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.stat strong {
  margin-top: 1px;
  font-size: 1.18rem;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.stat-combo strong {
  color: var(--yellow-500);
}

.stat-score strong {
  color: var(--mint-200);
}

.play-surface {
  position: absolute;
  top: calc(var(--safe-top) + 124px);
  right: env(safe-area-inset-right);
  bottom: calc(var(--safe-bottom) + 89px);
  left: env(safe-area-inset-left);
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.safe-zone-label {
  position: absolute;
  top: 10px;
  left: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(17, 24, 63, 0.7);
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}

.target-layer,
.effects-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.target-layer {
  z-index: 2;
}

.effects-layer {
  z-index: 6;
}

.game-target {
  --x: -180px;
  --y: -120px;
  --rotation: 0deg;
  --scale: 1;
  position: absolute;
  top: 0;
  left: 0;
  width: 142px;
  min-height: 90px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: crosshair;
  pointer-events: auto;
  transform: translate3d(var(--x), var(--y), 0) rotate(var(--rotation))
    scale(var(--scale));
  transform-origin: center;
  will-change: transform;
}

.target-paper {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 90px;
  gap: 9px;
  align-items: center;
  padding: 10px;
  overflow: hidden;
  border: 3px solid var(--indigo-800);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 6px 0 rgba(18, 25, 67, 0.3);
  text-align: left;
}

.target-paper::after {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 57px;
  height: 3px;
  border-radius: 3px;
  background: #d8dcef;
  box-shadow:
    0 -9px 0 #e3e5f3,
    0 -18px 0 #e3e5f3;
  content: "";
}

.target-symbol {
  position: relative;
  z-index: 1;
  display: grid;
  width: 40px;
  height: 51px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--indigo-700);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 950;
  place-items: center;
}

.game-target[data-tone="mint"] .target-symbol {
  background: var(--mint-600);
  color: var(--indigo-950);
}

.game-target[data-tone="yellow"] .target-symbol {
  background: var(--yellow-500);
  color: var(--ink);
}

.game-target[data-tone="violet"] .target-symbol {
  background: #6845b8;
}

.game-target[data-tone="coral"] .target-symbol {
  background: var(--coral-500);
  color: var(--indigo-950);
}

.game-target[data-tone="sky"] .target-symbol {
  background: var(--sky-500);
  color: var(--indigo-950);
}

.game-target[data-tone="orange"] .target-symbol {
  background: #e58a36;
  color: var(--indigo-950);
}

.target-copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-self: flex-start;
  flex-direction: column;
  padding-top: 5px;
}

.target-copy strong {
  color: var(--indigo-900);
  font-size: 0.66rem;
  font-weight: 950;
  line-height: 1.08;
}

.target-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 750;
  line-height: 1.1;
}

.target-stamp {
  position: absolute;
  z-index: 4;
  right: 8px;
  bottom: 8px;
  visibility: hidden;
  padding: 4px 5px 3px;
  border: 2px solid var(--indigo-700);
  border-radius: 4px;
  color: var(--indigo-700);
  font-size: 0.55rem;
  font-weight: 950;
  letter-spacing: 0.03em;
  opacity: 0;
  transform: scale(1.65) rotate(-8deg);
}

.game-target.is-hit {
  pointer-events: none;
}

.game-target.is-hit .target-stamp {
  visibility: visible;
  opacity: 1;
  transform: scale(1) rotate(-8deg);
  transition:
    opacity 70ms ease-out,
    transform 140ms cubic-bezier(0.16, 1, 0.3, 1);
}

.game-target.is-hit .target-paper {
  animation: target-hit 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.game-target.is-golden .target-paper {
  border-color: var(--yellow-600);
  background: #fff8dc;
  box-shadow: 0 6px 0 #c38b1b;
}

.golden-label {
  position: absolute;
  z-index: 3;
  top: -10px;
  left: 50%;
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--yellow-500);
  color: var(--indigo-900);
  font-size: 0.49rem;
  font-weight: 950;
  white-space: nowrap;
  transform: translateX(-50%);
}

.game-target.is-powerup {
  width: 132px;
  min-height: 105px;
}

.powerup-body {
  display: grid;
  min-height: 105px;
  align-content: center;
  justify-items: center;
  padding: 11px 9px;
  border: 3px solid var(--white);
  border-radius: 14px;
  background: var(--yellow-500);
  box-shadow: 0 6px 0 var(--yellow-600);
  color: var(--indigo-900);
  text-align: center;
}

.game-target[data-powerup="stapler"] .powerup-body {
  background: var(--indigo-700);
  box-shadow: 0 6px 0 var(--indigo-800);
  color: var(--white);
}

.game-target[data-powerup="eraser"] .powerup-body {
  background: #ef8181;
  box-shadow: 0 6px 0 #b34f55;
  color: var(--indigo-950);
}

.powerup-symbol {
  font-size: 2rem;
  font-weight: 950;
  line-height: 1;
}

.powerup-body strong {
  margin-top: 5px;
  font-size: 0.68rem;
  font-weight: 950;
}

.powerup-body small {
  margin-top: 1px;
  font-size: 0.55rem;
  font-weight: 800;
}

.powerup-pulse {
  position: absolute;
  inset: -8px;
  border: 3px solid var(--yellow-500);
  border-radius: 18px;
  animation: powerup-pulse 900ms ease-out infinite;
  pointer-events: none;
}

.aim-cursor {
  --aim-x: 50%;
  --aim-y: 50%;
  position: absolute;
  z-index: 8;
  top: 0;
  left: 0;
  display: none;
  width: 58px;
  height: 58px;
  pointer-events: none;
  transform: translate3d(var(--aim-x), var(--aim-y), 0) translate(-50%, -50%);
}

.aim-ring {
  position: absolute;
  inset: 5px;
  border: 3px solid var(--indigo-900);
  border-radius: 50%;
  box-shadow:
    0 0 0 2px var(--white),
    inset 0 0 0 2px var(--white);
}

.aim-ring::before,
.aim-ring::after {
  position: absolute;
  background: var(--indigo-900);
  content: "";
}

.aim-ring::before {
  top: 50%;
  right: -8px;
  left: -8px;
  height: 2px;
}

.aim-ring::after {
  top: -8px;
  bottom: -8px;
  left: 50%;
  width: 2px;
}

.aim-pen {
  position: absolute;
  right: -4px;
  bottom: -9px;
  display: grid;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--yellow-500);
  color: var(--indigo-900);
  font-size: 0.85rem;
  place-items: center;
}

@media (hover: hover) and (pointer: fine) {
  .play-surface,
  .game-target {
    cursor: none;
  }

  .aim-cursor {
    display: block;
  }
}

.ink-burst {
  --effect-x: 50%;
  --effect-y: 50%;
  position: absolute;
  top: var(--effect-y);
  left: var(--effect-x);
  width: 78px;
  height: 78px;
  border: 4px solid var(--indigo-500);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.35);
  animation: ink-burst 320ms ease-out forwards;
}

.ink-burst::before,
.ink-burst::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110px;
  height: 4px;
  border-radius: 4px;
  background: var(--yellow-500);
  content: "";
  transform: translate(-50%, -50%) rotate(25deg);
}

.ink-burst::after {
  transform: translate(-50%, -50%) rotate(-25deg);
}

.miss-mark {
  --effect-x: 50%;
  --effect-y: 50%;
  position: absolute;
  top: var(--effect-y);
  left: var(--effect-x);
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(17, 24, 63, 0.84);
  color: var(--white);
  font-size: 0.58rem;
  font-weight: 850;
  opacity: 0;
  animation: miss-float 600ms ease-out forwards;
  transform: translate(-50%, -50%);
}

.miss-mark.is-penalty {
  padding: 6px 9px;
  background: var(--coral-700);
  box-shadow: 0 3px 0 rgba(82, 18, 28, 0.34);
  font-size: 0.66rem;
}

.wave-banner {
  position: absolute;
  z-index: 7;
  top: 43%;
  left: 50%;
  visibility: hidden;
  padding: 12px 18px;
  border: 3px solid var(--white);
  border-radius: 10px;
  background: var(--yellow-500);
  box-shadow: 0 6px 0 var(--yellow-600);
  color: var(--indigo-900);
  font-family:
    "Arial Rounded MT Bold", ui-rounded, "Trebuchet MS", sans-serif;
  font-size: 1rem;
  font-weight: 950;
  opacity: 0;
  text-transform: uppercase;
  transform: translate(-50%, -30%) rotate(-2deg) scale(0.8);
  pointer-events: none;
}

.wave-banner.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, -50%) rotate(-2deg) scale(1);
  transition:
    opacity 110ms ease-out,
    transform 190ms cubic-bezier(0.16, 1, 0.3, 1);
}

.wave-banner.is-intro {
  background: var(--mint-500);
  box-shadow: 0 6px 0 var(--mint-700);
}

.central-feedback {
  position: absolute;
  z-index: 7;
  top: 18px;
  left: 50%;
  display: flex;
  visibility: hidden;
  gap: 7px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--indigo-900);
  box-shadow: 0 4px 0 rgba(12, 18, 48, 0.28);
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
}

.central-feedback strong {
  color: var(--white);
  font-size: 0.67rem;
  font-weight: 950;
}

.central-feedback span {
  color: var(--mint-200);
  font-size: 0.78rem;
  font-weight: 950;
}

.central-feedback.is-penalty {
  background: var(--coral-700);
}

.central-feedback.is-penalty span {
  color: var(--white);
}

.central-feedback.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
  transition:
    opacity 100ms ease-out,
    transform 170ms ease-out;
}

.first-play-tip {
  position: absolute;
  z-index: 9;
  right: var(--safe-right);
  bottom: calc(var(--safe-bottom) + 101px);
  left: var(--safe-left);
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(17, 24, 63, 0.94);
  box-shadow: 0 5px 0 rgba(8, 13, 38, 0.28);
  transition:
    opacity 180ms ease-out,
    transform 180ms ease-out;
  pointer-events: none;
}

.first-play-tip.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}

.tip-target {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 3px solid #6845b8;
  border-radius: 9px;
  background: var(--surface);
  color: #6845b8;
  font-size: 0.65rem;
  font-weight: 950;
  place-items: center;
  transform: rotate(-5deg);
}

.first-play-tip div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.first-play-tip strong {
  font-size: 0.73rem;
}

.first-play-tip div span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.6rem;
}

.tool-belt {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-hud);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  min-height: calc(76px + var(--safe-bottom));
  padding:
    8px max(13px, var(--safe-right)) var(--safe-bottom)
    max(13px, var(--safe-left));
  background: rgba(17, 24, 63, 0.96);
  box-shadow: 0 -4px 0 rgba(94, 114, 228, 0.3);
}

.current-tool {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tool-symbol {
  display: grid;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--yellow-500);
  color: var(--indigo-900);
  font-size: 1.35rem;
  font-weight: 950;
  place-items: center;
}

.tool-copy {
  display: flex;
  max-width: 103px;
  flex-direction: column;
}

.tool-copy span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.48rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tool-copy strong {
  overflow: hidden;
  font-size: 0.65rem;
  font-weight: 950;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tool-time {
  display: grid;
  min-width: 35px;
  height: 35px;
  border: 2px solid var(--mint-500);
  border-radius: 50%;
  color: var(--mint-200);
  font-size: 0.57rem;
  font-weight: 900;
  place-items: center;
}

.next-tool {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.next-tool > span {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.56rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-progress {
  height: 6px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.tool-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--mint-500);
  transition: width 140ms ease-out;
}

.tool-belt kbd {
  display: none;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom-width: 3px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.11);
  color: var(--white);
  font-family: inherit;
  font-size: 0.55rem;
  font-weight: 900;
  text-transform: uppercase;
}

.screen-reader-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  margin: -1px !important;
  white-space: nowrap !important;
}

.screen-result {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding:
    calc(var(--safe-top) + 68px) max(12px, var(--safe-right))
    var(--safe-bottom) max(12px, var(--safe-left));
  background: linear-gradient(180deg, rgba(12, 18, 48, 0.24), rgba(12, 18, 48, 0.76));
}

[data-screen="result"] .office-world {
  filter: saturate(0.72) brightness(0.72);
}

.result-sheet {
  position: relative;
  width: min(100%, 440px);
  padding: 24px 17px 12px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 0 rgba(12, 18, 48, 0.28);
  color: var(--ink);
  text-align: center;
}

.result-stamp {
  position: absolute;
  top: -18px;
  right: 16px;
  padding: 7px 9px 5px;
  border: 3px solid var(--indigo-700);
  border-radius: 5px;
  color: var(--indigo-700);
  font-family:
    "Arial Rounded MT Bold", ui-rounded, "Trebuchet MS", sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transform: rotate(6deg);
}

.result-kicker {
  margin: 0;
  color: var(--indigo-700);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-sheet h2 {
  margin: 0;
  color: var(--indigo-900);
  font-family:
    "Arial Rounded MT Bold", ui-rounded, "Trebuchet MS", sans-serif;
  font-size: clamp(3.55rem, 18vw, 5.1rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.result-label {
  margin: -2px 0 11px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.result-notices {
  display: grid;
  gap: 7px;
  justify-items: center;
}

.challenge-result {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin: -2px 0 9px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--yellow-200);
  color: var(--indigo-900);
  font-size: 0.7rem;
}

.challenge-result.is-lost {
  background: #e8eaff;
}

.result-leaderboard-note {
  width: 100%;
  margin: 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: #ffe2df;
  color: var(--coral-700);
  font-size: 0.65rem;
  font-weight: 850;
  line-height: 1.35;
}

.highscore-callout {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: var(--yellow-500);
  box-shadow: 0 4px 0 var(--yellow-600);
  color: var(--indigo-950);
  cursor: pointer;
  text-align: left;
}

.highscore-callout > span:first-child {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--indigo-900);
  color: var(--yellow-500);
  place-items: center;
}

.highscore-callout > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  font-size: 0.6rem;
  font-weight: 800;
}

.highscore-callout strong {
  font-size: 0.74rem;
  font-weight: 950;
}

.rank-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 3px 0 #e0e3f3;
  text-align: left;
}

.rank-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: #fff5d3;
  font-size: 1.28rem;
  place-items: center;
}

.rank-row div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.rank-row div span {
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rank-row strong {
  overflow: hidden;
  color: var(--indigo-800);
  font-size: 0.82rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 11px 0 12px;
}

.result-stats div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1px 4px;
}

.result-stats div + div {
  border-left: 1px solid #dfe2f1;
}

.result-stats span {
  color: var(--muted);
  font-size: 0.47rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.result-stats strong {
  overflow: hidden;
  color: var(--indigo-800);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  text-overflow: ellipsis;
}

.whatsapp-button {
  min-height: 53px;
  background: #2ed878;
  box-shadow: 0 6px 0 #17994c;
  font-size: 0.86rem;
}

.whatsapp-button svg {
  width: 22px;
  margin: 0 8px 0 0;
  stroke-width: 2;
}

.result-sheet .secondary-button {
  min-height: 48px;
  margin: 0;
  font-size: 0.8rem;
}

.result-actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.result-sheet .text-button {
  min-height: 44px;
  color: var(--muted);
  font-size: 0.7rem;
}

.result-footer {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.56rem;
}

.game-dialog {
  width: min(calc(100% - 24px), 760px);
  max-width: none;
  max-height: calc(100dvh - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
}

.game-dialog::backdrop {
  background: rgba(9, 14, 40, 0.86);
}

.game-dialog[open] {
  animation: dialog-enter 190ms cubic-bezier(0.16, 1, 0.3, 1);
}

.dialog-panel {
  display: flex;
  max-height: inherit;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 0 rgba(9, 14, 40, 0.38);
}

.dialog-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 17px 13px;
  border-bottom: 1px solid #dfe2f1;
  background: var(--surface);
}

.dialog-header > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.dialog-symbol {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--yellow-500);
  color: var(--indigo-950);
  font-size: 1.1rem;
  font-weight: 950;
  place-items: center;
}

.dialog-header h2 {
  margin: 0;
  color: var(--indigo-900);
  font-size: 1.35rem;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.dialog-close {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #e8eaff;
  color: var(--indigo-800);
  cursor: pointer;
  place-items: center;
}

.dialog-close:hover {
  background: #dce0fa;
}

.dialog-close svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.dialog-scroll {
  min-height: 0;
  padding: 16px 17px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog-intro {
  max-width: 68ch;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.5;
}

.instructions-layout {
  display: grid;
  gap: 19px;
}

.instructions-column {
  display: grid;
  align-content: start;
  gap: 19px;
}

.instruction-section h3 {
  margin: 0 0 9px;
  color: var(--indigo-800);
  font-size: 0.86rem;
  font-weight: 950;
}

.rule-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0 0 0 19px;
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.42;
}

.rule-list li::marker {
  color: var(--mint-700);
}

.command-list {
  display: grid;
  gap: 7px;
  margin: 0;
}

.command-list div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px;
  align-items: baseline;
  padding-bottom: 7px;
  border-bottom: 1px solid #e1e4f2;
  font-size: 0.72rem;
}

.command-list dt {
  color: var(--indigo-800);
  font-weight: 900;
}

.command-list dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 10px;
  background: var(--white);
  font-size: 0.72rem;
}

.score-table th,
.score-table td {
  padding: 7px 9px;
  border-bottom: 1px solid #e4e6f2;
  text-align: left;
}

.score-table thead th {
  background: var(--indigo-800);
  color: var(--white);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.score-table tbody th {
  color: var(--ink);
  font-weight: 750;
}

.score-table td,
.score-table thead th:last-child {
  width: 78px;
  color: var(--indigo-800);
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  text-align: right;
}

.score-table thead th:last-child {
  color: var(--white);
}

.score-table tbody tr:last-child th,
.score-table tbody tr:last-child td {
  border-bottom: 0;
}

.score-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.weapon-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.weapon-list li {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 48px;
  padding: 5px 8px;
  border-bottom: 1px solid #e1e4f2;
}

.weapon-list li > span {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--yellow-500);
  color: var(--indigo-900);
  font-size: 1rem;
  font-weight: 950;
  place-items: center;
}

.weapon-list li:nth-child(2) > span {
  background: var(--yellow-200);
}

.weapon-list li:nth-child(3) > span {
  background: #e8eaff;
}

.weapon-list li:nth-child(4) > span {
  background: #ffe2df;
}

.weapon-list li div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.weapon-list strong {
  color: var(--indigo-800);
  font-size: 0.72rem;
}

.weapon-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.3;
}

.dialog-footer {
  flex: 0 0 auto;
  padding: 12px 17px calc(13px + env(safe-area-inset-bottom));
  border-top: 1px solid #dfe2f1;
  background: var(--surface);
}

.dialog-footer .primary-button {
  min-height: 50px;
  font-size: 0.82rem;
}

.leaderboard-dialog {
  width: min(calc(100% - 24px), 520px);
}

.leaderboard-header p {
  margin: 0 0 1px;
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.trophy-symbol {
  background: var(--yellow-500);
}

.leaderboard-scroll {
  padding-top: 13px;
}

.leaderboard-entry-panel {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--yellow-200);
  color: var(--indigo-950);
}

.leaderboard-entry-panel > div:first-child {
  display: flex;
  flex-direction: column;
}

.leaderboard-entry-panel > div:first-child span {
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.leaderboard-entry-panel > div:first-child strong {
  margin-top: 2px;
  font-size: 0.8rem;
}

.nickname-form {
  margin-top: 10px;
}

.nickname-form label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.75rem;
  font-weight: 850;
}

.nickname-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(124px, auto);
  gap: 8px;
}

.nickname-form input {
  width: 100%;
  min-height: 50px;
  padding: 5px 12px;
  border: 2px solid var(--indigo-700);
  border-radius: 10px;
  background: var(--white);
  color: var(--indigo-900);
  font-size: 0.9rem;
  font-weight: 850;
  letter-spacing: 0;
  text-align: left;
}

.nickname-form input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.nickname-form input:focus-visible {
  outline: 3px solid var(--indigo-700);
  outline-offset: 2px;
}

.nickname-form input[aria-invalid="true"] {
  border-color: var(--coral-700);
}

.nickname-form .primary-button {
  min-height: 50px;
  box-shadow: 0 4px 0 var(--mint-700);
  font-size: 0.76rem;
}

.field-hint {
  margin: 6px 0 0;
  color: #4d536d;
  font-size: 0.68rem;
  line-height: 1.4;
}

.field-error {
  margin: 5px 0 0;
  color: var(--coral-700);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.4;
}

.field-error:empty {
  display: none;
}

.privacy-note {
  margin: 9px 0 0;
  color: #4d536d;
  font-size: 0.68rem;
  line-height: 1.4;
}

.leaderboard-message {
  margin: 18px 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.45;
  text-align: center;
}

.leaderboard-message.is-success {
  color: #0b7243;
}

.leaderboard-message.is-error {
  color: var(--coral-700);
}

.leaderboard-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: leaderboard-rank;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  padding: 5px 9px;
  border-radius: 9px;
  background: var(--white);
  color: var(--ink);
  counter-increment: leaderboard-rank;
}

.leaderboard-list li::before {
  color: var(--muted);
  content: counter(leaderboard-rank, decimal-leading-zero);
  font-size: 0.62rem;
  font-weight: 900;
}

.leaderboard-list li:nth-child(1) {
  background: var(--yellow-200);
}

.leaderboard-list li:nth-child(2) {
  background: #e8eaff;
}

.leaderboard-list li:nth-child(3) {
  background: #e2f8ee;
}

.leaderboard-list li.is-current {
  outline: 3px solid var(--mint-600);
  outline-offset: -3px;
}

.leaderboard-nickname {
  min-width: 0;
  color: var(--indigo-800);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.leaderboard-score {
  color: var(--indigo-900);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  white-space: nowrap;
}

.leaderboard-retry {
  width: 100%;
  margin-top: 10px;
  border-color: #c9cde2;
  background: var(--white);
  color: var(--indigo-800);
}

@media (max-width: 380px) {
  .nickname-form > div {
    grid-template-columns: 1fr;
  }

  .nickname-form .primary-button {
    width: 100%;
  }
}

.pause-layer {
  position: absolute;
  inset: 0;
  z-index: var(--z-dialog);
  display: grid;
  padding: 20px;
  background: rgba(9, 14, 40, 0.88);
  place-items: center;
}

.pause-panel {
  width: min(100%, 360px);
  padding: 27px 22px 18px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 7px 0 rgba(9, 14, 40, 0.35);
  color: var(--ink);
  text-align: center;
}

.pause-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 13px;
  border-radius: 50%;
  background: var(--indigo-500);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  place-items: center;
}

.pause-panel h2 {
  margin: 0;
  color: var(--indigo-900);
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.pause-panel p {
  margin: 7px 0 20px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.pause-panel .text-button {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.75rem;
}

.noscript-message {
  position: fixed;
  inset: 20px;
  z-index: 200;
  display: grid;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  text-align: center;
  place-items: center;
}

@keyframes office-pan {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(100vw - 100%));
  }
}

@keyframes light-drift {
  from {
    transform: translateX(-2%);
  }

  to {
    transform: translateX(2%);
  }
}

@keyframes loading-slide {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(210%);
  }
}

@keyframes target-hit {
  0% {
    filter: brightness(1);
    transform: scale(1);
  }

  44% {
    filter: brightness(1.3);
    transform: scale(0.91) rotate(2deg);
  }

  100% {
    filter: brightness(1);
    transform: scale(1.04);
  }
}

@keyframes powerup-pulse {
  0% {
    opacity: 0.8;
    transform: scale(0.92);
  }

  100% {
    opacity: 0;
    transform: scale(1.13);
  }
}

@keyframes ink-burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.3) rotate(0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.1) rotate(18deg);
  }
}

@keyframes miss-float {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%);
  }

  25% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -120%);
  }
}

@media (min-width: 760px) {
  .brand-bar {
    padding:
      var(--safe-top) max(30px, var(--safe-right)) 10px
      max(30px, var(--safe-left));
  }

  .brand-mark {
    display: none;
  }

  .brand-logo-surface {
    display: block;
    padding: 8px 12px 7px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 4px 0 rgba(12, 18, 48, 0.2);
  }

  .screen-menu {
    align-items: flex-start;
    justify-content: center;
    padding:
      94px max(7vw, var(--safe-right)) 56px
      max(7vw, var(--safe-left));
    text-align: left;
  }

  .screen-menu::before {
    background: linear-gradient(
      90deg,
      rgba(17, 24, 63, 0.74),
      rgba(17, 24, 63, 0.5) 38%,
      rgba(17, 24, 63, 0.05) 67%
    );
  }

  .menu-content {
    align-items: flex-start;
  }

  .offered-by {
    margin-bottom: 18px;
  }

  .offered-by img {
    width: 154px;
  }

  h1 {
    font-size: min(7vw, 6rem);
  }

  .menu-copy {
    font-size: 1.05rem;
  }

  .brand-claim {
    font-size: 0.76rem;
  }

  .challenge-banner {
    width: 360px;
  }

  .start-panel {
    width: 360px;
    margin-top: 34px;
  }

  .instructions-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 25px;
  }

  .quick-rules {
    justify-content: flex-start;
  }

  .hud {
    top: calc(var(--safe-top) + 61px);
    right: 50%;
    left: auto;
    width: min(600px, 46vw);
    transform: translateX(50%);
  }

  .play-surface {
    top: calc(var(--safe-top) + 128px);
    bottom: calc(var(--safe-bottom) + 82px);
  }

  .game-target {
    width: 158px;
  }

  .game-target.is-powerup {
    width: 142px;
  }

  .central-feedback {
    top: 13px;
  }

  .first-play-tip {
    right: auto;
    bottom: calc(var(--safe-bottom) + 96px);
    left: 30px;
    width: 355px;
  }

  .tool-belt {
    grid-template-columns: auto minmax(220px, 420px) auto;
    justify-content: center;
    gap: 22px;
    min-height: calc(72px + var(--safe-bottom));
    padding-right: max(30px, var(--safe-right));
    padding-left: max(30px, var(--safe-left));
  }

  .tool-copy {
    max-width: 150px;
  }

  .tool-belt kbd {
    display: block;
  }

  .screen-result {
    align-items: center;
    justify-content: flex-end;
    padding:
      84px max(6vw, var(--safe-right)) 25px
      max(6vw, var(--safe-left));
  }

  .result-sheet {
    width: min(440px, 40vw);
  }
}

@media (max-height: 700px) {
  .brand-bar {
    padding-top: max(9px, env(safe-area-inset-top));
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .icon-button {
    width: 48px;
    height: 48px;
  }

  .screen-menu {
    padding-top: calc(var(--safe-top) + 47px);
  }

  .offered-by {
    margin-bottom: 8px;
    padding: 6px 8px;
  }

  .offered-by img {
    width: 118px;
  }

  .game-edition {
    margin-bottom: 6px;
  }

  h1 {
    font-size: 3.35rem;
  }

  .menu-copy {
    margin-top: 13px;
    font-size: 0.83rem;
  }

  .brand-claim {
    margin-top: 7px;
    font-size: 0.63rem;
  }

  .challenge-banner {
    margin-top: 9px;
  }

  .quick-rules {
    margin-bottom: 9px;
  }

  .menu-audio-prompt {
    margin-bottom: 9px;
  }

  .menu-utility-actions {
    margin-top: 9px;
  }

  .primary-button {
    min-height: 52px;
  }

  .control-hint {
    margin-top: 11px;
  }

  .hud {
    top: calc(var(--safe-top) + 47px);
  }

  .stat {
    min-height: 56px;
  }

  .play-surface {
    top: calc(var(--safe-top) + 106px);
    bottom: calc(var(--safe-bottom) + 70px);
  }

  .first-play-tip {
    bottom: calc(var(--safe-bottom) + 93px);
  }

  .tool-belt {
    min-height: calc(70px + var(--safe-bottom));
  }

  .result-sheet {
    padding-top: 21px;
  }

  .result-sheet h2 {
    font-size: 3.5rem;
  }

  .result-label {
    margin-bottom: 8px;
  }

  .rank-row {
    padding: 7px 9px;
  }

  .rank-icon {
    width: 36px;
    height: 36px;
  }

  .result-stats {
    margin: 8px 0 9px;
  }

  .whatsapp-button {
    min-height: 48px;
  }

  .result-actions-row {
    margin-top: 8px;
  }
}

@media (max-height: 520px) and (min-width: 540px) {
  .screen-menu {
    display: grid;
    grid-template-areas:
      "main challenge"
      "main start";
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    grid-template-rows: auto auto;
    gap: 8px 18px;
    align-content: center;
    align-items: center;
    padding:
      56px max(24px, var(--safe-right)) 10px
      max(24px, var(--safe-left));
    text-align: left;
  }

  .screen-menu::before {
    background: linear-gradient(
      90deg,
      rgba(17, 24, 63, 0.78),
      rgba(17, 24, 63, 0.52) 58%,
      rgba(17, 24, 63, 0.25)
    );
  }

  .menu-content {
    grid-area: main;
    align-items: flex-start;
  }

  .offered-by {
    margin-bottom: 5px;
    padding: 5px 7px;
  }

  .offered-by span {
    max-width: 62px;
    font-size: 0.48rem;
  }

  .offered-by img {
    width: 105px;
  }

  .game-edition {
    margin-bottom: 4px;
    padding: 4px 7px;
    font-size: 0.54rem;
  }

  h1 {
    font-size: clamp(2.65rem, 8.4vw, 3.25rem);
  }

  .menu-copy {
    margin-top: 9px;
    font-size: 0.74rem;
    line-height: 1.25;
  }

  .brand-claim {
    margin-top: 5px;
    font-size: 0.55rem;
    line-height: 1.25;
  }

  .challenge-banner {
    grid-area: challenge;
    width: 100%;
    margin: 0;
    padding: 7px 9px;
  }

  .start-panel {
    grid-area: start;
    width: 100%;
    margin: 0;
  }

  .quick-rules {
    justify-content: flex-start;
    margin-bottom: 7px;
    font-size: 0.59rem;
  }

  .quick-rules span {
    padding: 0 5px;
  }

  .quick-rules b {
    width: 18px;
    height: 18px;
    font-size: 0.52rem;
  }

  .menu-audio-prompt {
    min-height: 48px;
    margin-bottom: 7px;
    font-size: 0.65rem;
  }

  .primary-button {
    min-height: 48px;
    font-size: 0.8rem;
  }

  .control-hint {
    display: none;
  }

  .menu-utility-actions {
    gap: 7px;
    margin-top: 7px;
  }

  .utility-button {
    font-size: 0.63rem;
  }

  .safe-zone-label,
  .first-play-tip {
    display: none;
  }

  .game-target {
    width: 136px;
  }

  .screen-result {
    display: block;
    padding:
      55px max(12px, var(--safe-right)) 8px
      max(12px, var(--safe-left));
  }

  .result-sheet {
    display: grid;
    width: min(100%, 760px);
    grid-template-areas:
      "kicker rank"
      "score rank"
      "label stats"
      "challenge share"
      "footer replay"
      "footer home";
    grid-template-columns: minmax(170px, 0.82fr) minmax(270px, 1.18fr);
    gap: 5px 14px;
    align-items: center;
    margin: 0 auto;
    padding: 15px 15px 10px;
  }

  .result-kicker {
    grid-area: kicker;
  }

  .result-sheet h2 {
    grid-area: score;
    font-size: 3.2rem;
  }

  .result-label {
    grid-area: label;
    margin: 0;
  }

  .result-notices {
    grid-area: challenge;
  }

  .result-notices .challenge-result {
    margin: 0;
  }

  .rank-row {
    grid-area: rank;
  }

  .result-stats {
    grid-area: stats;
    margin: 0;
  }

  .whatsapp-button {
    grid-area: share;
    min-height: 48px;
    font-size: 0.74rem;
  }

  .result-actions-row {
    grid-area: replay;
    margin: 0;
  }

  .result-sheet .text-button {
    grid-area: home;
    min-height: 48px;
  }

  .result-footer {
    grid-area: footer;
    margin: 0;
  }

  .result-stamp {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .office-panorama,
  .office-parallax-back {
    transform: none !important;
  }
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (forced-colors: active) {
  .game-target,
  .icon-button,
  .menu-audio-prompt,
  .utility-button,
  .dialog-close,
  .highscore-callout,
  .primary-button,
  .secondary-button {
    border: 2px solid ButtonText;
  }
}
