:root {
  color-scheme: dark;
  --navy: #263746;
  --blue: #31475a;
  --yellow: #ffdb00;
  --game-scale: 1.4;
  font-family: Arial, sans-serif;
  color: #fff;
  background: var(--blue);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

button {
  font: inherit;
}

a {
  color: inherit;
}

button:focus-visible,a:focus-visible {
  outline: 3px solid white;
  outline-offset: 6px;
}

.site-header {
  height: 152px;
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

.header-inner {
  position: relative;
  max-width: 1228px;
  margin: auto;
  height: 100%;
  padding-top: 48px;
}

.brand {
  display: inline-flex;
  background: var(--navy);
  padding: 0 8px;
  position: relative;
  margin-left: -8px;
}

.brand img {
  display: block;
}

.brand-line {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 7px;
  left: 0;
  right: 0;
  top: 75px;
  height: 4px;
}

.line {
  height: 3px;
  background: var(--yellow);
  flex: 1;
}

.line-end {
  flex: none;
  display: block;
}

.operators {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 9px;
}

.operators img {
  display: block;
  object-fit: contain;
  width: auto;
  height: 16px;
  max-width: 94px;
}

.experience {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100svh - 152px);
}

.campaign {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 36px;
}

.campaign h1 {
  position: relative;
  margin: 0;
  width: min(100%,490px);
  font-size: 0;
}

.campaign h1 img {
  display: block;
  width: 100%;
  height: auto;
}

.logo-drawing {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  opacity: 0;
}

.game {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #788896;
  padding: 64px 32px;
}

.game-content {
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 44px;
}

.game h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  text-align: center;
}

.mobile-heading {
  display: none;
}

.stage {
  position: relative;
  overflow: hidden;
  width: min(100%,520px);
  height: calc(280px * var(--game-scale));
  isolation: isolate;
}

.target {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 236px;
  height: 236px;
  transform: translate(-50%,-50%) scale(var(--game-scale));
  z-index: 0;
}

.faces {
  position: absolute;
  inset: 0;
}

.face-entry-yellow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.face {
  --entry-scale: 1;
  --entry-rotation: 0deg;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200px;
  height: 200px;
  will-change: transform;
  transform: translate(-50%,-50%) scale(var(--game-scale));
  visibility: hidden;
  scale: var(--entry-scale);
  rotate: var(--entry-rotation);
}

.button {
  --button-scale: 1;
  --button-rotation: 0deg;
  --button-lift: 0px;
  --button-glow: 0;
  --shine-x: -150%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 18px;
  border: 1px solid var(--yellow);
  border-radius: 100px;
  color: var(--navy);
  background: var(--yellow);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  scale: var(--button-scale);
  rotate: var(--button-rotation);
  translate: 0 var(--button-lift);
  box-shadow: 0 calc(5px * var(--button-glow)) 0 var(--navy),
    0 0 0 calc(5px * var(--button-glow)) rgb(255 219 0 / .18),
    0 calc(10px * var(--button-glow)) calc(20px * var(--button-glow)) rgb(0 0 0 / .18);
}

.button::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  left: -45%;
  top: -50%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .65), transparent);
  transform: translateX(var(--shine-x)) skewX(-25deg);
}

.button::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 4px;
  border: 1px dashed rgb(38 55 70 / .4);
  border-radius: inherit;
  opacity: var(--button-glow);
}

.button:focus-visible {
  background: #ffe84d;
  border-color: #ffe84d;
}

@media (hover: hover) and (pointer: fine) {
  .button:hover:not(:disabled) {
    background: #ffe84d;
    border-color: #ffe84d;
  }
}

.button:disabled {
  cursor: default;
}

.capture {
  margin-top: -16px;
}

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

dialog {
  --backdrop-opacity: 1;
  border: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  color: white;
  width: min(440px,calc(100vw - 32px));
  max-height: calc(100svh - 32px);
}

dialog::backdrop {
  background: rgb(12 18 22 / calc(.7 * var(--backdrop-opacity)));
  backdrop-filter: blur(calc(5px * var(--backdrop-opacity)));
}

.result-card {
  --halo-scale: 1;
  --halo-opacity: 1;
  position: relative;
  isolation: isolate;
  background: #1f2e39;
  border-radius: 22px;
  padding: 56px 24px 24px;
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  overflow: auto;
  max-height: calc(100svh - 32px);
  box-shadow: 0 20px 90px #0005;
}

.result-card.is-animating {
  /* Scaling the halo and contents must not create temporary scrollbars. */
  overflow: hidden;
  overflow: clip;
}

.result-card:before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 5px dashed #a5aebc55;
  border-radius: 50%;
  filter: blur(7px);
  pointer-events: none;
  z-index: -1;
  transform: scale(var(--halo-scale));
  opacity: var(--halo-opacity);
}

.result-word {
  display: inline-block;
}

.result-brand {
  position: absolute;
  top: 22px;
  right: 24px;
  width: 64px;
  height: auto;
}

.result-card h2 {
  font-size: 42px;
  line-height: 1.12;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 2px;
  margin: 0 0 30px;
  outline: none;
}

.result-face {
  width: 280px;
  height: 280px;
  max-width: 90%;
  object-fit: contain;
  flex-shrink: 0;
}

.result-message {
  margin: 28px 0 22px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 1.5px;
  line-height: 1.35;
}

.result-message strong {
  display: block;
  color: var(--yellow);
  font-size: 25px;
  margin-bottom: 10px;
}

.result-message span {
  display: block;
  font-size: 17px;
}

.result-card:not(.is-miss) .result-message {
  max-width: 30ch;
  font-size: 20px;
  line-height: 1.4;
  text-wrap: balance;
}

.result-card:not(.is-miss) .result-message strong,
.result-card:not(.is-miss) .result-message span {
  display: inline;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  margin: 0;
}

.retry {
  font-size: 16px;
  min-height: 44px;
}

.result-card.is-miss .result-message strong {
  font-size: 22px;
}

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

@media(min-width:761px) {
  .game {
    overflow: hidden;
  }

  .stage,
  .faces {
    overflow: visible;
  }

  .header-inner {
    margin-left: 7.4%;
    margin-right: 7.4%;
  }

}

@media(min-width:761px) and (max-height:800px) {
  .game {
    --game-scale: 1.05;
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .game-content {
    gap: 28px;
  }

  .campaign {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .campaign h1 {
    max-width: min(490px,calc((100svh - 216px) * 1.127));
  }

}

@media(min-width:761px) and (max-width:1250px) {
  .header-inner {
    margin: 0 7.4%;
  }

  .game {
    padding: 48px 28px;
    --game-scale: 1.1;
  }

  .game-content {
    gap: 30px;
  }

  .campaign {
    padding: 48px 32px;
  }

  .game h2 {
    font-size: 14px;
  }

}

@media(max-width:1024px) {
  .result-message {
    margin: 24px 0;
  }
}

@media(max-width:760px) {
  :root {
    --game-scale: 1;
    --mobile-gap: clamp(8px, calc(8px + (100svh - 568px) * 0.08), 40px);
    /* Reserve space for the header, game, instructions and touch button. */
    --mobile-title-height: clamp(
      88px,
      calc(100svh - 80px - 248px - 52px - 48px - 5 * var(--mobile-gap)),
      291px
    );
  }

  .site-header {
    height: 80px;
  }

  .header-inner {
    padding-top: 18px;
    margin: 0 24px;
  }

  .brand {
    margin-left: -8px;
    padding: 0 8px;
  }

  .brand-line {
    top: 42px;
  }

  .line {
    height: 4px;
  }

  .operators {
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-start;
  }

  .operators img {
    height: 12px;
    max-width: none;
  }

  .operators img:nth-child(1) {
    width: 43px;
  }

  .operators img:nth-child(2) {
    width: 38px;
  }

  .operators img:nth-child(3) {
    width: 80px;
  }

  .operators img:nth-child(4) {
    width: 50px;
  }

  .operators img:nth-child(5) {
    width: 70px;
  }

  .experience {
    display: flex;
    flex-direction: column;
    min-height: calc(100svh - 80px);
    justify-content: space-evenly;
  }

  .campaign {
    padding: var(--mobile-gap) 16px 0;
    flex: 0 0 auto;
  }

  .campaign h1 {
    width: min(100%, 328px, calc(var(--mobile-title-height) * 328 / 291));
  }

  .game {
    padding: var(--mobile-gap) 0;
    background: var(--blue);
    flex: 0 0 auto;
    align-items: flex-start;
  }

  .game-content {
    gap: var(--mobile-gap);
  }

  .game h2 {
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 16px;
    font-weight: 700;
    letter-spacing: 1.3px;
    padding: 0 16px;
    width: 100%;
    max-width: 440px;
  }

  .desktop-heading {
    display: none;
  }

  .mobile-heading {
    display: block;
    line-height: 1.3;
  }

  .stage {
    width: 100%;
    height: 248px;
  }

  .capture {
    margin-top: 0;
  }

  .result-card {
    padding: 44px 16px 16px;
    border-radius: 18px;
  }

  .result-brand {
    top: 21px;
    right: 24px;
    width: 58px;
  }

  .result-card h2 {
    font-size: clamp(24px, 4svh, 32px);
    margin-bottom: var(--mobile-gap);
    letter-spacing: 2px;
  }

  .result-face {
    width: clamp(96px, calc(100svh - 420px), 200px);
    height: clamp(96px, calc(100svh - 420px), 200px);
  }

  .result-card:not(.is-miss) .result-message {
    font-size: 18px;
    letter-spacing: 1px;
  }

  .result-message strong {
    font-size: 20px;
    margin-bottom: 0px;
  }

  .result-message span {
    font-size: 14px;
    line-height: 1.4;
  }

  .result-card.is-miss h2 {
    font-size: clamp(24px, 4svh, 28px);
  }

  .result-card.is-miss .result-message strong {
    font-size: 18px;
  }

}

@media(max-width:359px) {
  .header-inner {
    margin-left: 16px;
    margin-right: 16px;
  }

  .operators {
    gap: 6px;
  }

  .operators img:nth-child(3) {
    width: 64px;
  }

  .operators img:nth-child(5) {
    width: 58px;
  }

  .game h2 {
    font-size: 14px;
  }

}

@media(prefers-reduced-motion:reduce) {
  .face {
    will-change: auto;
  }

  dialog::backdrop {
    backdrop-filter: none;
  }

}

@media(max-width:760px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 10;
  }

}
