:root {
  --ink: #013f43;
  --ink-deep: #002f33;
  --aqua: #1cd4de;
  --aqua-pale: #d2f6f8;
  --aqua-soft: #a4eef2;
  --paper: #f5f5f5;
  --white: #ffffff;
  --grey: #4a5354;
  --grey-light: #dce4e4;
  --warning: #ffb547;
  --danger: #e85656;
  --shadow: 0 24px 70px rgba(0, 47, 51, .16);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

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

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--white);
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 72px);
  color: var(--white);
  background: var(--ink);
}

.brand {
  display: inline-flex;
}

.brand img {
  display: block;
  width: 177px;
  height: 32px;
}

.header-phone {
  text-align: right;
  text-decoration: none;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
}

.header-phone span {
  display: block;
  color: var(--aqua-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-games {
  color: var(--aqua-soft);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
}

.header-games:hover,
.header-games:focus-visible {
  color: var(--white);
  text-decoration: underline;
}

.game-wrap {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 5vw, 72px) clamp(14px, 3vw, 40px);
  background:
    radial-gradient(circle at 8% 20%, rgba(28, 212, 222, .17), transparent 28rem),
    radial-gradient(circle at 90% 80%, rgba(28, 212, 222, .1), transparent 24rem),
    var(--ink-deep);
}

.game-wrap::before,
.game-wrap::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(164, 238, 242, .15);
  border-radius: 50%;
}

.game-wrap::before {
  top: -140px;
  right: 7%;
}

.game-wrap::after {
  bottom: -180px;
  left: 3%;
  width: 360px;
  height: 360px;
}

.game-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  min-height: 620px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.screen {
  display: none;
  min-height: 620px;
}

.screen.is-active {
  display: flex;
  animation: screen-reveal .55s cubic-bezier(.2, .75, .25, 1) both;
}

@keyframes screen-reveal {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.intro-screen {
  align-items: stretch;
}

.intro-copy {
  flex: 1 1 58%;
  align-self: center;
  padding: clamp(34px, 6vw, 78px);
}

.intro-art {
  position: relative;
  display: grid;
  flex: 1 1 42%;
  place-items: center;
  min-height: 520px;
  overflow: hidden;
  padding: 42px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .5), transparent 45%),
    var(--aqua-pale);
  perspective: 900px;
}

.intro-art svg {
  position: relative;
  z-index: 2;
  width: min(100%, 470px);
  filter: drop-shadow(0 30px 26px rgba(1, 63, 67, .17));
  animation: house-float 4.8s ease-in-out infinite;
  transform-style: preserve-3d;
}

.intro-glow {
  position: absolute;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(255, 255, 255, .9), rgba(28, 212, 222, .08) 58%, transparent 70%);
  border-radius: 50%;
  animation: intro-glow 3s ease-in-out infinite alternate;
}

.intro-drop {
  position: absolute;
  z-index: 3;
  top: -36px;
  width: 18px;
  height: 25px;
  background: linear-gradient(145deg, #78eef3, #0bb9c4);
  border-radius: 70% 35% 65% 35%;
  opacity: 0;
  transform: rotate(45deg);
  animation: intro-rain 3.2s linear infinite;
}

.drop-one { left: 22%; animation-delay: .2s; }
.drop-two { left: 72%; width: 12px; height: 18px; animation-delay: 1.3s; }
.drop-three { left: 48%; width: 9px; height: 13px; animation-delay: 2.1s; }

@keyframes house-float {
  0%, 100% { transform: rotateX(1deg) rotateY(-2deg) translateY(0); }
  50% { transform: rotateX(-1deg) rotateY(2deg) translateY(-12px); }
}

@keyframes intro-glow {
  to { transform: scale(1.14); opacity: .65; }
}

@keyframes intro-rain {
  0% { opacity: 0; transform: translateY(-20px) rotate(45deg) scale(.7); }
  18% { opacity: .75; }
  82% { opacity: .75; }
  100% { opacity: 0; transform: translateY(560px) rotate(45deg) scale(1.1); }
}

.art-house {
  fill: var(--white);
}

.art-roof {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 22;
}

.art-window {
  fill: var(--aqua-soft);
  stroke: var(--ink);
  stroke-width: 8;
}

.art-door {
  fill: var(--ink);
}

.art-water {
  fill: var(--aqua);
  opacity: .78;
  animation: water-bob 2.3s ease-in-out infinite alternate;
}

.art-valve {
  fill: var(--aqua);
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-width: 8;
  transform-box: fill-box;
  transform-origin: center;
  animation: valve-turn 4s cubic-bezier(.55, .1, .2, 1) infinite;
}

@keyframes water-bob {
  to { transform: translateY(-9px); }
}

@keyframes valve-turn {
  0%, 55%, 100% { transform: rotate(0deg); }
  70%, 85% { transform: rotate(90deg); }
}

.eyebrow {
  margin: 0 0 10px;
  color: #067982;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 740px;
  margin-bottom: 20px;
  font-size: clamp(38px, 5vw, 68px);
  letter-spacing: -.045em;
  line-height: .99;
}

h2 {
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -.035em;
  line-height: 1.05;
}

.screen h1[tabindex="-1"]:focus,
.screen h2[tabindex="-1"]:focus {
  outline: none;
}

.lead {
  max-width: 640px;
  color: var(--grey);
  font-size: clamp(18px, 2vw, 22px);
}

.intro-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0;
}

.intro-meta span {
  padding: 9px 14px;
  color: var(--ink);
  background: var(--aqua-pale);
  border-radius: 999px;
  font-size: 14px;
}

.intro-meta strong {
  font-size: 18px;
}

.button {
  min-height: 48px;
  padding: 12px 22px;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

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

.button:focus-visible,
.room-tab:focus-visible,
.tap-target:focus-visible {
  outline: 4px solid var(--warning);
  outline-offset: 3px;
}

.button-primary {
  position: relative;
  overflow: hidden;
  background: var(--aqua);
  border-color: var(--aqua);
}

.button-primary::after {
  content: "";
  position: absolute;
  top: -70%;
  left: -45%;
  width: 35%;
  height: 240%;
  background: rgba(255, 255, 255, .48);
  transform: rotate(22deg);
  transition: left .55s ease;
}

.button-primary:hover::after {
  left: 125%;
}

.button-primary:hover {
  box-shadow: 0 10px 22px rgba(28, 212, 222, .28);
}

.button-secondary {
  background: var(--white);
}

.button-text {
  border-color: transparent;
  text-decoration: underline;
}

.button-large {
  min-height: 58px;
  padding-inline: 30px;
  font-size: 18px;
}

.sound-note {
  margin: 18px 0 0;
  color: var(--grey);
  font-size: 13px;
}

.game-screen {
  flex-direction: column;
  padding: clamp(18px, 3vw, 34px);
  background:
    radial-gradient(circle at 70% 10%, rgba(28, 212, 222, .16), transparent 34%),
    #eaf1f1;
}

.game-status {
  display: grid;
  grid-template-columns: auto minmax(170px, 380px);
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 16px;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 22px;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 12px;
  color: var(--ink);
  background: var(--white);
  border: 2px solid #c3d0d1;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.sound-toggle:hover {
  border-color: var(--aqua);
}

.sound-toggle:focus-visible {
  outline: 4px solid var(--warning);
  outline-offset: 3px;
}

.sound-toggle[aria-pressed="true"] .sound-icon {
  animation: music-pulse .7s ease-in-out infinite alternate;
}

.sound-toggle[aria-pressed="false"] {
  color: var(--grey);
  background: transparent;
}

@keyframes music-pulse {
  to { transform: scale(1.25) rotate(-8deg); }
}

.status-label {
  margin: 0;
  color: var(--grey);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.timer {
  margin: -4px 0 0;
  font-size: 33px;
  font-weight: 900;
  line-height: 1;
}

.timer.is-urgent {
  color: var(--danger);
  animation: timer-pulse .7s ease infinite alternate;
}

@keyframes timer-pulse {
  to { transform: scale(1.08); }
}

.flood-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--grey);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.flood-track {
  height: 13px;
  overflow: hidden;
  background: var(--grey-light);
  border-radius: 999px;
}

.flood-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--aqua), #078997);
  border-radius: inherit;
  transition: width .25s linear;
}

.search-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 14px;
}

.search-header h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
}

.search-header > p {
  max-width: 430px;
  margin: 0;
  color: var(--grey);
  font-size: 14px;
  text-align: right;
}

.room-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.room-tab {
  position: relative;
  min-height: 43px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--white);
  border: 2px solid transparent;
  border-radius: 12px 12px 4px 4px;
  cursor: pointer;
  font-weight: 800;
  transition: color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.room-tab:hover {
  transform: translateY(-2px);
}

.room-tab.is-active {
  color: var(--white);
  background: var(--ink);
  box-shadow: 0 8px 18px rgba(1, 63, 67, .18);
}

.room-stage {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --light-x: 50%;
  --light-y: 25%;
  position: relative;
  isolation: isolate;
  flex: 1;
  min-height: 360px;
  overflow: hidden;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 8px 8px 18px 18px;
  cursor: crosshair;
  perspective: 1100px;
  transform-style: preserve-3d;
  box-shadow:
    inset 0 0 65px rgba(1, 63, 67, .13),
    0 18px 38px rgba(1, 63, 67, .12);
}

.room-stage::after {
  content: "";
  position: absolute;
  z-index: 7;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, .16), transparent 28%),
    radial-gradient(circle at center, transparent 50%, rgba(0, 47, 51, .16) 115%);
}

.stage-light {
  position: absolute;
  z-index: 3;
  inset: -10%;
  pointer-events: none;
  background: radial-gradient(circle at var(--light-x) var(--light-y), rgba(255, 255, 255, .42), transparent 28%);
  mix-blend-mode: soft-light;
  transition: background-position .15s linear;
}

.fx-canvas {
  position: absolute;
  z-index: 6;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.burst-pipe {
  position: absolute;
  z-index: 8;
  top: -2px;
  right: 8%;
  width: 84px;
  height: 96px;
  pointer-events: none;
  filter: drop-shadow(0 5px 5px rgba(1, 63, 67, .25));
}

.burst-pipe-body {
  position: absolute;
  top: 0;
  right: 22px;
  width: 26px;
  height: 60px;
  background: linear-gradient(90deg, #65787a, #c7d5d6 45%, #5a6c6e);
  border: 4px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 5px 5px;
}

.burst-pipe-end {
  position: absolute;
  top: 51px;
  right: 14px;
  width: 42px;
  height: 18px;
  background: #899a9c;
  border: 4px solid var(--ink);
  border-radius: 5px;
}

.burst-pipe i {
  position: absolute;
  top: 66px;
  right: 30px;
  width: 10px;
  height: 15px;
  background: var(--aqua);
  border-radius: 70% 35% 65% 35%;
  opacity: 0;
  transform: rotate(45deg);
}

.game-screen.is-live .burst-pipe i {
  animation: pipe-drip 1.2s ease-in infinite;
}

.game-screen.is-live .burst-pipe i:nth-child(3) { animation-delay: .25s; transform: translateX(-20px) rotate(45deg); }
.game-screen.is-live .burst-pipe i:nth-child(4) { animation-delay: .68s; transform: translateX(18px) rotate(45deg); }
.game-screen.is-live .burst-pipe i:nth-child(5) { animation-delay: .92s; }

@keyframes pipe-drip {
  0% { opacity: 0; translate: 0 0; scale: .6; }
  12% { opacity: .9; }
  100% { opacity: 0; translate: 0 55px; scale: 1.15; }
}

.room-name {
  position: absolute;
  z-index: 5;
  top: 13px;
  left: 13px;
  margin: 0;
  padding: 7px 12px;
  color: var(--white);
  background: var(--ink);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.room-scene {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 360px;
  filter: saturate(1.08) drop-shadow(0 14px 18px rgba(1, 63, 67, .1));
  transform-origin: center 58%;
  transform-style: preserve-3d;
}

.room-scene.is-active {
  display: block;
  animation: room-arrive .48s cubic-bezier(.2, .82, .2, 1) both;
  transform: rotateX(var(--tilt-y)) rotateY(var(--tilt-x)) scale(1.025);
  transition: transform .14s ease-out;
}

@keyframes room-arrive {
  from {
    opacity: .2;
    filter: blur(8px) saturate(.8);
    translate: 22px 0;
  }
  to {
    opacity: 1;
    filter: blur(0) saturate(1.08) drop-shadow(0 14px 18px rgba(1, 63, 67, .1));
    translate: 0 0;
  }
}

.wall { fill: #d9eeee; }
.wall-alt { fill: #e7e2d8; }
.floor { fill: #d4b27a; }
.floor-wood { fill: #c7955f; }
.tile-line,
.window-line,
.garage-lines { fill: none; stroke: rgba(1, 63, 67, .12); stroke-width: 4; }
.window-frame { fill: #c9f5f8; stroke: var(--ink); stroke-width: 10; }
.sun { fill: var(--warning); }
.counter { fill: #738486; }
.cabinet { fill: #f5c45a; stroke: var(--ink); stroke-width: 5; }
.cabinet-line { fill: none; stroke: var(--ink); stroke-width: 4; }
.handle,
.button-dot,
.door-handle { fill: var(--ink); }
.sink { fill: #c7d4d5; stroke: var(--ink); stroke-width: 5; }
.metal { fill: none; stroke: #64777a; stroke-linecap: round; stroke-width: 11; }
.appliance { fill: #404f50; stroke: var(--ink); stroke-width: 5; }
.appliance.large { fill: #eaf0f0; }
.appliance-dark { fill: var(--ink); }
.glass { fill: #8bdde3; opacity: .7; }
.plant-pot { fill: #d27b4e; }
.plant { fill: #3f9b72; }
.rug { fill: #ee8063; }
.open-door { fill: #e5ac3c; stroke: var(--ink); stroke-width: 5; }
.shelf { fill: #8a6d57; }
.bottle { fill: #ee8063; stroke: var(--ink); stroke-width: 3; }
.basket { fill: #f5c45a; stroke: var(--ink); stroke-width: 4; }
.towel { fill: #a4eef2; stroke: var(--ink); stroke-width: 4; }
.boiler { fill: #f8fbfb; stroke: var(--ink); stroke-width: 6; }
.boiler-screen { fill: var(--ink); }
.mop { fill: none; stroke: #7c614a; stroke-width: 10; }
.door { fill: #f2f0e9; stroke: var(--ink); stroke-width: 8; }
.toilet { fill: var(--white); stroke: var(--ink); stroke-width: 6; }
.stairs { fill: #be8d5d; stroke: var(--ink); stroke-linejoin: round; stroke-width: 7; }
.banister { fill: none; stroke: var(--ink); stroke-width: 8; }
.under-stairs { fill: #8a6d57; opacity: .45; }
.under-stairs-door { fill: #96714e; stroke: var(--ink); stroke-width: 5; }
.cellar-hatch { fill: #5e4432; stroke: var(--ink); stroke-width: 5; }
.cellar-line { fill: none; stroke: #a98461; stroke-width: 5; }
.picture { fill: var(--white); stroke: var(--ink); stroke-width: 6; }
.picture-art { fill: #77cdd3; }
.garage-wall { fill: #bcc7c7; }
.garage-floor { fill: #727c7d; }
.shelf-dark { fill: #39494a; }
.box { fill: #ba8b54; stroke: var(--ink); stroke-width: 5; }
.box-line { fill: none; stroke: #8f663d; stroke-width: 4; }
.bike-wheel { fill: none; stroke: var(--ink); stroke-width: 9; }
.bike { fill: none; stroke: #e85656; stroke-linecap: round; stroke-linejoin: round; stroke-width: 9; }
.toolboard { fill: #9b6b45; stroke: var(--ink); stroke-width: 6; }
.tools { fill: none; stroke: #dce4e4; stroke-linecap: round; stroke-width: 10; }
.meter { fill: #eef4f4; stroke: var(--ink); stroke-width: 6; }
.meter-face { fill: var(--aqua); stroke: var(--ink); stroke-width: 4; }
.oil-stain { fill: #3e4b4c; opacity: .55; }

.pipe {
  fill: none;
  stroke: #697c7e;
  stroke-linecap: round;
  stroke-width: 14;
}

.tap-target {
  display: none;
  cursor: pointer;
}

.tap-target.is-target {
  display: block;
  transform-box: fill-box;
  transform-origin: center;
}

.tap-target:hover .hit-area,
.tap-target:focus-visible .hit-area {
  fill: rgba(28, 212, 222, .17);
  stroke: var(--aqua);
}

.tap-target .hit-area {
  fill: transparent;
  stroke: transparent;
  stroke-width: 4;
}

.tap-target.is-found {
  animation: stop-tap-found .8s cubic-bezier(.2, .82, .2, 1) both;
}

.tap-target.is-found .valve,
.tap-target.is-found .valve-centre {
  transform-box: fill-box;
  transform-origin: center;
  animation: valve-success .75s cubic-bezier(.2, .75, .25, 1) both;
}

@keyframes stop-tap-found {
  35% { transform: scale(1.35); filter: drop-shadow(0 0 12px var(--aqua)); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 24px var(--aqua)); }
}

@keyframes valve-success {
  to { transform: rotate(180deg); }
}

.valve {
  fill: none;
  stroke: #e85656;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 9;
}

.valve-centre {
  fill: #dce4e4;
  stroke: #e85656;
  stroke-width: 7;
}

.water-overlay {
  position: absolute;
  z-index: 5;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
  pointer-events: none;
  overflow: visible;
  background: linear-gradient(180deg, rgba(28, 212, 222, .52), rgba(8, 145, 159, .48));
  border-top: 2px solid rgba(255, 255, 255, .7);
  box-shadow: inset 0 12px 25px rgba(255, 255, 255, .16);
  opacity: 0;
  transition: height .3s linear;
}

.water-overlay.has-water {
  opacity: 1;
}

.water-overlay::before,
.water-overlay::after {
  content: "";
  position: absolute;
  top: -18px;
  left: -10%;
  width: 120%;
  height: 28px;
  background: radial-gradient(ellipse at 22px 20px, rgba(28, 212, 222, .78) 0 20px, transparent 21px) 0 0 / 64px 28px repeat-x;
  animation: wave-slide 2.6s linear infinite;
}

.water-overlay::after {
  top: -11px;
  opacity: .45;
  animation-direction: reverse;
  animation-duration: 3.8s;
  translate: 22px 0;
}

@keyframes wave-slide {
  to { transform: translateX(64px); }
}

.cinematic-countdown {
  position: absolute;
  z-index: 12;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--white);
  background: rgba(0, 47, 51, .68);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.cinematic-countdown.is-visible {
  opacity: 1;
}

.cinematic-countdown span {
  display: grid;
  place-items: center;
  width: 136px;
  height: 136px;
  background: rgba(28, 212, 222, .16);
  border: 4px solid var(--aqua);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(28, 212, 222, .08), 0 0 55px rgba(28, 212, 222, .55);
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
}

.cinematic-countdown.is-beating span {
  animation: countdown-beat .58s cubic-bezier(.15, .8, .2, 1) both;
}

@keyframes countdown-beat {
  from { opacity: 0; transform: scale(1.65); }
  to { opacity: 1; transform: scale(1); }
}

.screen-flash {
  position: absolute;
  z-index: 11;
  inset: 0;
  background: rgba(210, 246, 248, .88);
  opacity: 0;
  pointer-events: none;
}

.screen-flash.is-active {
  animation: screen-flash .6s ease-out;
}

@keyframes screen-flash {
  0% { opacity: 0; }
  18% { opacity: 1; }
  100% { opacity: 0; }
}

.miss-message {
  position: absolute;
  z-index: 8;
  bottom: 18px;
  left: 50%;
  min-width: 180px;
  padding: 10px 16px;
  color: var(--white);
  background: var(--ink);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 12px);
  transition: opacity .18s ease, transform .18s ease;
}

.miss-message.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.result-screen,
.card-screen {
  position: relative;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 6vw, 76px);
}

.celebration {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.celebration i {
  position: absolute;
  top: -12%;
  left: var(--x);
  width: var(--size);
  height: calc(var(--size) * 1.7);
  background: var(--colour);
  border-radius: 3px;
  animation: confetti-fall var(--duration) cubic-bezier(.2, .7, .2, 1) var(--delay) both;
}

@keyframes confetti-fall {
  to {
    translate: var(--drift) 760px;
    rotate: var(--spin);
    opacity: .15;
  }
}

.dave-card {
  display: grid;
  grid-template-columns: minmax(130px, 200px) 1fr;
  align-items: center;
  gap: clamp(24px, 5vw, 58px);
}

.dave-avatar {
  width: min(100%, 200px);
}

.dave-avatar svg {
  display: block;
}

.dave-bg { fill: var(--aqua-pale); }
.dave-shirt { fill: var(--ink); }
.dave-neck,
.dave-face,
.dave-ear { fill: #e7ad83; }
.dave-hair { fill: #644937; }
.dave-eye { fill: var(--ink); }
.dave-smile { fill: none; stroke: #644937; stroke-linecap: round; stroke-width: 5; }
.dave-logo-mark { fill: var(--aqua); }

.result-screen h2 {
  margin-bottom: 12px;
  font-size: clamp(38px, 5vw, 62px);
}

.result-message {
  margin-bottom: 16px;
  color: var(--grey);
  font-size: 19px;
}

.dave-question {
  margin: 0;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.2;
}

.result-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.leaderboard-form {
  display: grid;
  gap: 10px;
  width: min(100%, 420px);
  margin: 24px 0 0;
  padding: 16px;
  border: 1px solid rgba(1, 63, 67, .12);
  border-radius: 16px;
  background: rgba(28, 212, 222, .12);
  text-align: left;
}

.leaderboard-form[hidden] {
  display: none;
}

.leaderboard-kicker {
  margin: 0;
  color: var(--ink);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.leaderboard-score {
  margin: 0;
  color: var(--ink-soft);
  font-size: .9rem;
  font-weight: 700;
}

.leaderboard-form label {
  display: grid;
  gap: 4px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink);
}

.leaderboard-form input[type="text"],
.leaderboard-form input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(1, 63, 67, .16);
  border-radius: 10px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}

.leaderboard-check {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600 !important;
}

.leaderboard-check input {
  margin-top: 3px;
  accent-color: var(--aqua);
}

.leaderboard-form .hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

.leaderboard-status {
  min-height: 1.2em;
  margin: 0;
  color: var(--ink-soft);
  font-size: .85rem;
  font-weight: 700;
}

.safety-tip {
  margin: 28px 0 0;
  padding: 18px 20px;
  background: var(--aqua-pale);
  border-left: 5px solid var(--aqua);
  border-radius: 4px 12px 12px 4px;
}

.card-screen {
  justify-content: flex-start;
}

.card-intro {
  max-width: 780px;
}

.card-intro h2 {
  margin-bottom: 12px;
}

.card-privacy-note {
  margin: 0;
  padding: 14px 16px;
  color: var(--ink);
  background: var(--aqua-pale);
  border-left: 4px solid var(--aqua);
  border-radius: 4px 10px 10px 4px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.card-intro > p:last-child:not(.card-privacy-note) {
  color: var(--grey);
}

.card-builder {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(320px, 1.1fr);
  align-items: start;
  gap: clamp(24px, 4vw, 48px);
  margin-top: 24px;
}

.emergency-form {
  display: grid;
  gap: 14px;
}

.emergency-form label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.emergency-form input {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--white);
  border: 2px solid #bfcaca;
  border-radius: 8px;
  outline: none;
}

.emergency-form input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--aqua-soft);
}

.emergency-form input[readonly] {
  background: #edf2f2;
}

.emergency-card {
  overflow: hidden;
  color: var(--ink);
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 10px 10px 0 var(--aqua-soft);
}

.emergency-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  color: var(--white);
  background: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .07em;
  text-align: right;
  text-transform: uppercase;
}

.emergency-card-head img {
  width: 155px;
  height: auto;
}

.card-instruction {
  margin: 0;
  padding: 15px 20px;
  background: var(--aqua-pale);
  font-size: 13px;
  font-weight: 700;
}

.emergency-card dl {
  margin: 0;
  padding: 10px 20px;
}

.emergency-card dl div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--grey-light);
}

.emergency-card dl div:last-child {
  border-bottom: 0;
}

.emergency-card dt {
  color: var(--grey);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.emergency-card dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.emergency-card dd.is-empty {
  color: #718081;
  font-weight: 500;
}

.card-phone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  color: var(--ink);
  background: var(--aqua);
  font-size: 21px;
  font-weight: 900;
  text-decoration: none;
}

.card-phone span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.save-status {
  min-height: 24px;
  margin: 12px 0 0;
  color: #067982;
  font-weight: 700;
}

.print-hint {
  max-width: 42rem;
  margin: 14px 0 0;
  color: var(--grey);
  font-size: 13px;
  line-height: 1.5;
}

.learn-section {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: clamp(34px, 7vw, 90px);
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(58px, 9vw, 112px) 0;
}

.learn-section h2 {
  max-width: 700px;
  margin-bottom: 18px;
}

.learn-section > div:first-child > p:last-child {
  max-width: 700px;
  color: var(--grey);
  font-size: 19px;
}

.learn-tip {
  align-self: center;
  padding: clamp(24px, 4vw, 38px);
  background: var(--aqua-pale);
  border-radius: 18px;
}

.learn-tip strong {
  display: block;
  margin-bottom: 8px;
  font-size: 24px;
}

.learn-tip a {
  color: var(--ink);
  font-weight: 800;
}

.games-room-back {
  display: flex;
  justify-content: center;
  margin: 28px 0 0;
}

.games-room-back-footer {
  margin: 0;
  padding: 28px clamp(20px, 5vw, 72px) 8px;
  background: var(--paper, #f6f1e8);
}

.site-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 34px clamp(20px, 5vw, 72px);
  color: var(--white);
  background: var(--ink);
}

.site-footer p {
  margin: 0;
}

.site-footer > a {
  color: var(--aqua);
  font-weight: 800;
}

.site-footer .copyright {
  grid-column: 1 / -1;
  padding-top: 18px;
  color: var(--aqua-soft);
  border-top: 1px solid rgba(255, 255, 255, .17);
  font-size: 12px;
}

@media (max-width: 800px) {
  .game-shell,
  .screen {
    min-height: 560px;
  }

  .intro-screen {
    flex-direction: column;
  }

  .intro-art {
    order: -1;
    min-height: 260px;
    padding: 20px 38px;
  }

  .intro-art svg {
    max-height: 240px;
  }

  .intro-copy {
    padding: 34px 28px 42px;
  }

  .game-screen {
    padding: 15px;
  }

  .game-status {
    grid-template-columns: minmax(190px, auto) 1fr;
  }

  .search-header {
    align-items: start;
  }

  .search-header > p {
    max-width: 300px;
  }

  .room-stage,
  .room-scene {
    min-height: 330px;
  }

  .card-builder {
    grid-template-columns: 1fr;
  }

  .learn-section {
    grid-template-columns: 1fr;
  }

  .site-footer {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 540px) {
  .site-header {
    min-height: 68px;
    padding: 14px 16px;
  }

  .brand img {
    width: 138px;
    height: auto;
  }

  .header-phone {
    font-size: 15px;
  }

  .header-phone span {
    font-size: 9px;
  }

  .game-wrap {
    padding: 14px 8px 24px;
  }

  .game-shell {
    border-radius: 17px;
  }

  h1 {
    font-size: 40px;
  }

  .intro-meta {
    gap: 6px;
    margin: 23px 0;
  }

  .intro-meta span {
    padding: 7px 10px;
    font-size: 12px;
  }

  .game-status {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .status-left {
    justify-content: space-between;
  }

  .flood-status {
    width: 100%;
  }

  .search-header {
    display: block;
  }

  .search-header > p {
    display: none;
  }

  .room-tabs {
    gap: 4px;
  }

  .room-tab {
    min-height: 40px;
    padding-inline: 5px;
    font-size: 12px;
  }

  .room-stage,
  .room-scene {
    min-height: 280px;
  }

  .burst-pipe {
    right: 3%;
    scale: .8;
    transform-origin: top right;
  }

  .cinematic-countdown span {
    width: 104px;
    height: 104px;
    font-size: 54px;
  }

  .room-scene {
    object-fit: cover;
  }

  .dave-card {
    grid-template-columns: 95px 1fr;
    align-items: start;
  }

  .result-screen,
  .card-screen {
    padding: 28px 20px;
  }

  .result-actions .button,
  .card-actions .button {
    width: 100%;
  }

  .card-builder {
    grid-template-columns: minmax(0, 1fr);
  }

  .emergency-card-head {
    align-items: start;
    flex-direction: column;
    text-align: left;
  }

  .emergency-card dl div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .card-phone {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }
}

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

  .room-scene.is-active {
    transform: none !important;
  }

  .fx-canvas {
    display: none;
  }
}

@media print {
  @page {
    size: A5 portrait;
    margin: 10mm;
  }

  html,
  body {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  body.is-printing-card > :not(#print-root) {
    display: none !important;
  }

  body.is-printing-card #print-root {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.is-printing-card #print-root .emergency-card {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  body.is-printing-card #print-root .card-phone {
    color: var(--ink) !important;
    text-decoration: none !important;
  }
}
