@font-face {
  font-family: "Archivo Black";
  src: url("/wp-content/themes/czesc-gizycko/assets/fonts/archivo-black-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113;
}

@font-face {
  font-family: "Archivo Black";
  src: url("/wp-content/themes/czesc-gizycko/assets/fonts/archivo-black-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Montserrat";
  src: url("/wp-content/themes/czesc-gizycko/assets/fonts/montserrat-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113;
}

@font-face {
  font-family: "Montserrat";
  src: url("/wp-content/themes/czesc-gizycko/assets/fonts/montserrat-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --blue: #0849a2;
  --blue-dark: #062d63;
  --water: #66b9d9;
  --water-pale: #d7eef6;
  --ice: #f7fbff;
  --white: #fff;
  --ink: #101820;
  --muted: #536674;
  --line: rgba(8, 73, 162, 0.2);
  --pink: #efb2c4;
  --brick: #c66c52;
  --green: #61856a;
  --cream: #f3dfae;
  --display: "Archivo Black", "Arial Black", sans-serif;
  --body: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

button {
  touch-action: manipulation;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 500;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  color: var(--white);
  background: var(--blue);
  transform: translateY(-160%);
}

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

.landscape-gate {
  display: none;
}

.portal-header {
  border-bottom: 1px solid rgba(8, 73, 162, 0.12);
  background: var(--white);
}

.portal-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 2rem), 1360px);
  min-height: 92px;
  margin: 0 auto;
}

.portal-header__brand {
  display: inline-flex;
  align-items: center;
}

.portal-header__brand img {
  display: block;
  width: 92px;
  height: auto;
}

.portal-header__back {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 850;
  text-decoration: none;
  text-transform: uppercase;
}

.portal-header__back span {
  font-size: 1.15rem;
  transition: transform 140ms ease;
}

.portal-header__back:hover span,
.portal-header__back:focus-visible span {
  transform: translateX(-4px);
}

.game-page {
  width: min(calc(100% - 2rem), 1360px);
  margin: 0 auto;
  padding: clamp(2rem, 3.5vw, 3.25rem) 0 clamp(4rem, 7vw, 7rem);
}

.game-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.55fr);
  gap: clamp(2rem, 7vw, 7.5rem);
  align-items: end;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.game-intro__eyebrow,
.leaderboard__eyebrow,
.game-overlay__eyebrow {
  margin: 0 0 0.55rem;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.game-intro h1,
.game-overlay h2,
.game-notes h2,
.leaderboard h2 {
  margin: 0;
  color: var(--blue);
  font-family: var(--display);
  font-weight: 400;
}

.game-intro h1 {
  max-width: 850px;
  font-size: clamp(2.8rem, 5.4vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.game-intro__lead {
  max-width: 520px;
  margin: 0;
  color: rgba(16, 24, 32, 0.72);
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.66;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(540px, 730px) minmax(280px, 1fr);
  gap: clamp(1.75rem, 4vw, 5rem);
  align-items: start;
}

.game-shell {
  overflow: hidden;
  border-top: 3px solid var(--blue);
  background: var(--blue-dark);
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr)) 64px 64px;
  color: var(--white);
  background: var(--blue);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.hud-item {
  min-width: 0;
  min-height: 66px;
  padding: 0.62rem clamp(0.65rem, 1.4vw, 1.2rem);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.hud-item span {
  display: block;
  margin-bottom: 0.16rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.hud-item strong {
  display: block;
  overflow: hidden;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 400;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  min-width: 0;
  padding: 0;
  place-items: center;
  color: var(--white);
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--blue);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible,
.icon-button[aria-pressed="false"]:hover {
  color: var(--blue);
  background: var(--white);
  outline: none;
}

.icon-button[aria-pressed="false"] {
  color: rgba(255, 255, 255, 0.48);
}

.icon-button span {
  font-size: 1.2rem;
  font-weight: 900;
}

.wave-meter {
  position: relative;
  height: 26px;
  overflow: hidden;
  color: var(--white);
  background: #041f47;
}

.wave-meter > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: var(--water);
  transform-origin: left center;
  transition: transform 100ms linear;
}

.wave-meter b {
  position: relative;
  z-index: 1;
  display: block;
  padding: 0.33rem 0.8rem 0;
  font-size: 0.63rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  text-transform: uppercase;
}

.game-stage {
  position: relative;
  display: grid;
  min-height: 690px;
  place-items: center;
  overflow: hidden;
  background: var(--water-pale);
  isolation: isolate;
}

.lake-top {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 126px;
  overflow: hidden;
  background: #a9dceb;
  border-bottom: 5px solid var(--blue-dark);
}

.lake-top__sun {
  position: absolute;
  top: 18px;
  right: 10%;
  width: 42px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff2b7;
}

.lake-top__shore {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 29px;
  background: #365f50;
  clip-path: polygon(0 58%, 5% 32%, 11% 52%, 17% 15%, 23% 57%, 31% 25%, 39% 62%, 47% 21%, 56% 51%, 63% 18%, 71% 59%, 78% 28%, 85% 63%, 92% 22%, 100% 53%, 100% 100%, 0 100%);
}

.lake-top__reed {
  position: absolute;
  bottom: 16px;
  width: 44px;
  height: 70px;
  border-left: 4px solid #466f58;
  border-right: 3px solid #466f58;
  transform: skewX(-7deg);
}

.lake-top__reed::before,
.lake-top__reed::after {
  position: absolute;
  width: 7px;
  height: 22px;
  background: #7f6242;
  border-radius: 50% 50% 36% 36%;
  content: "";
}

.lake-top__reed::before {
  top: -5px;
  left: -6px;
}

.lake-top__reed::after {
  top: 7px;
  right: -5px;
}

.lake-top__reed--left {
  left: 4%;
}

.lake-top__reed--right {
  right: 3%;
  transform: scaleX(-1) skewX(-7deg);
}

.tile-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(10, 1fr);
  gap: 4px;
  width: min(calc(100% - 4rem), 490px);
  aspect-ratio: 7 / 10;
  padding: 5px;
  background: var(--blue-dark);
  box-shadow: 10px 12px 0 rgba(8, 73, 162, 0.17);
  touch-action: none;
}

.tile-board:focus {
  outline: none;
}

.tile-board:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 3px;
}

.game-stage.is-menu .tile-board,
.game-stage.is-over .tile-board {
  pointer-events: none;
  opacity: 0.48;
}

.game-stage.is-danger .tile-board {
  background: #8f342e;
}

.game-stage.is-danger .wave-meter {
  background: #8f342e;
}

.tile-slot {
  display: block;
  min-width: 0;
  min-height: 0;
}

.tile {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 5%;
  place-items: center;
  overflow: hidden;
  color: var(--blue-dark);
  border: 0;
  border-radius: 4px;
  background: var(--tile-color);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transform: rotate(var(--tilt, 0deg));
  transition: filter 100ms ease, transform 100ms ease;
}

.tile:hover,
.tile:focus-visible,
.tile.is-cursor {
  z-index: 2;
  filter: brightness(1.08);
  outline: 3px solid var(--white);
  outline-offset: -4px;
  transform: rotate(0deg) scale(1.045);
}

.tile.is-selected {
  z-index: 3;
  outline: 4px solid var(--white);
  outline-offset: -5px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12), 0 0 0 3px var(--blue);
  transform: rotate(0deg) scale(1.04);
}

.tile.is-hint {
  z-index: 2;
  animation: tile-hint 850ms ease-in-out infinite alternate;
}

.tile.is-hint::after {
  position: absolute;
  z-index: 3;
  top: 4px;
  right: 4px;
  display: grid;
  width: 21px;
  height: 21px;
  color: var(--blue);
  background: var(--white);
  box-shadow: 2px 2px 0 var(--blue);
  content: attr(data-hint);
  font-family: var(--display);
  font-size: 0.72rem;
  line-height: 1;
  place-items: center;
}

.tile.is-wave-drop {
  animation: tile-wave-drop 610ms cubic-bezier(0.16, 0.78, 0.22, 1) both;
  animation-delay: var(--drop-delay, 0ms);
}

.tile:active {
  transform: rotate(0deg) scale(0.94);
}

.tile img {
  display: block;
  width: 82%;
  height: 82%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 0 rgba(4, 31, 71, 0.17));
}

.tile--tower img {
  width: 54%;
  height: 88%;
}

.tile--mushroom img {
  width: 90%;
}

.tile--duck img {
  width: 88%;
}

.tile--blocker {
  color: var(--white);
  background: #3d6573;
  cursor: not-allowed;
}

.tile--blocker::before {
  position: absolute;
  right: 12%;
  bottom: 8%;
  left: 12%;
  height: 3px;
  background: rgba(255, 255, 255, 0.72);
  content: "";
}

.tile-blocker__mark {
  position: relative;
  display: block;
  width: 35%;
  height: 64%;
  border: 3px solid #fff7e7;
  border-radius: 48% 48% 30% 30%;
  background: #d75948;
  box-shadow: inset 0 -9px 0 #fff7e7;
}

.tile-blocker__mark::before {
  position: absolute;
  top: -9px;
  left: 50%;
  width: 3px;
  height: 10px;
  background: #fff7e7;
  content: "";
  transform: translateX(-50%);
}

.tile__name {
  position: absolute;
  right: 3px;
  bottom: 2px;
  left: 3px;
  overflow: hidden;
  color: rgba(6, 45, 99, 0.78);
  font-size: 0.42rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tile.is-invalid {
  animation: tile-no 240ms ease;
}

.tile.is-clearing {
  animation: tile-clear 280ms ease forwards;
}

.tile.is-new {
  animation: tile-new 380ms cubic-bezier(0.2, 0.85, 0.2, 1);
}

.swap-guide {
  position: absolute;
  z-index: 12;
  top: 13px;
  left: 50%;
  max-width: calc(100% - 2rem);
  padding: 0.45rem 0.65rem;
  color: var(--white);
  background: rgba(6, 45, 99, 0.9);
  font-size: 0.65rem;
  font-weight: 850;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%);
}

.swap-guide.is-hinting {
  color: var(--blue-dark);
  background: var(--cream);
  animation: hint-guide 900ms ease-in-out infinite alternate;
}

.effect-layer {
  position: absolute;
  z-index: 11;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.match-burst,
.match-confetti {
  position: absolute;
  pointer-events: none;
}

.match-burst {
  width: 20px;
  height: 20px;
  border: 4px solid var(--burst-color, var(--cream));
  border-radius: 50%;
  animation: match-burst 620ms ease-out both;
  transform: translate(-50%, -50%);
}

.match-burst.is-big {
  border-width: 6px;
  animation-duration: 780ms;
}

.match-confetti {
  width: 8px;
  height: 13px;
  background: var(--confetti-color, var(--cream));
  animation: match-confetti 760ms cubic-bezier(0.18, 0.72, 0.26, 1) both;
  animation-delay: var(--confetti-delay, 0ms);
}

.match-confetti--1 {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.match-confetti--2 {
  width: 13px;
  height: 5px;
}

.game-stage.is-menu .swap-guide,
.game-stage.is-over .swap-guide {
  display: none;
}

.game-overlay {
  position: absolute;
  z-index: 20;
  inset: 50% auto auto 50%;
  display: grid;
  grid-template-columns: 0.72fr 1.25fr;
  width: min(calc(100% - 2rem), 620px);
  min-height: 385px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--white);
  box-shadow: 12px 14px 0 rgba(6, 45, 99, 0.28);
  transform: translate(-50%, -50%);
}

.game-overlay[hidden] {
  display: none;
}

.game-overlay__stamp {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 1.25rem 0.9rem 0.65rem;
  overflow: hidden;
  color: var(--blue);
  background: var(--pink);
}

.game-overlay__stamp span {
  align-self: flex-start;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 0.9;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.game-overlay__stamp img {
  position: absolute;
  right: -8%;
  bottom: 7%;
  width: 118%;
  max-width: none;
  transform: rotate(-6deg);
}

.game-overlay__content {
  align-self: center;
  padding: clamp(1.35rem, 4vw, 2.8rem);
}

.game-overlay h2 {
  max-width: 420px;
  font-size: clamp(2rem, 4.2vw, 3.55rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.game-overlay__content > p:not(.game-overlay__eyebrow):not(.game-overlay__hint) {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.62;
}

.game-overlay__score {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1.1rem 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.game-overlay__score span {
  padding: 0.75rem 0.8rem;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-overlay__score span + span {
  border-left: 1px solid var(--line);
}

.game-overlay__score strong {
  display: block;
  margin-top: 0.18rem;
  color: var(--blue);
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 400;
}

.difficulty-picker {
  min-width: 0;
  margin: 1rem 0 0;
  padding: 0;
  border: 0;
}

.difficulty-picker legend {
  margin-bottom: 0.45rem;
  padding: 0;
  color: var(--blue-dark);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.difficulty-picker__options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 2px solid var(--blue);
}

.difficulty-picker button {
  min-width: 0;
  min-height: 54px;
  padding: 0.5rem 0.35rem;
  color: var(--blue);
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  cursor: pointer;
}

.difficulty-picker button:last-child {
  border-right: 0;
}

.difficulty-picker button strong,
.difficulty-picker button span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.difficulty-picker button strong {
  font-size: 0.61rem;
  font-weight: 900;
  text-transform: uppercase;
}

.difficulty-picker button span {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.49rem;
  font-weight: 650;
}

.difficulty-picker button:hover,
.difficulty-picker button:focus-visible,
.difficulty-picker button.is-active {
  color: var(--white);
  outline: none;
  background: var(--blue);
}

.difficulty-picker button:hover span,
.difficulty-picker button:focus-visible span,
.difficulty-picker button.is-active span {
  color: rgba(255, 255, 255, 0.76);
}

.primary-button,
.score-form button {
  min-height: 48px;
  padding: 0.8rem 1.15rem;
  color: var(--white);
  border: 0;
  border-radius: 0;
  background: var(--blue);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  cursor: pointer;
}

.primary-button {
  margin-top: 1.25rem;
}

.primary-button:hover,
.primary-button:focus-visible,
.score-form button:hover,
.score-form button:focus-visible {
  color: var(--blue);
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  background: var(--white);
}

.primary-button:disabled,
.score-form button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.game-overlay__hint {
  margin: 0.7rem 0 0;
  color: #6e8190;
  font-size: 0.68rem;
  font-weight: 650;
}

.score-form {
  margin-top: 1rem;
}

.score-form > label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--blue-dark);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.score-form__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.score-form input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 0.85rem;
  color: var(--ink);
  border: 2px solid var(--blue);
  border-radius: 0;
  outline: none;
  background: var(--white);
  font-weight: 700;
}

.score-form input:focus {
  box-shadow: inset 0 0 0 2px var(--water);
}

.score-form #scoreFormHint,
.score-form__status {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.42;
}

.score-form__status {
  min-height: 1.1rem;
  color: var(--blue);
  font-weight: 750;
}

.game-message {
  position: absolute;
  z-index: 14;
  top: 53px;
  left: 50%;
  max-width: calc(100% - 2rem);
  padding: 0.62rem 0.82rem;
  color: var(--white);
  background: var(--blue-dark);
  font-size: 0.72rem;
  font-weight: 900;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -8px);
}

.game-message.is-visible {
  animation: message-pop 1400ms ease both;
}

.game-message.is-special {
  color: var(--blue-dark);
  background: var(--cream);
}

.pause-curtain {
  position: absolute;
  z-index: 18;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  background: rgba(6, 45, 99, 0.91);
  cursor: pointer;
}

.pause-curtain strong {
  font-family: var(--display);
  font-size: 3rem;
  font-weight: 400;
}

.pause-curtain span {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.game-notes {
  padding-top: clamp(0.5rem, 2vw, 1.5rem);
}

.game-notes__section {
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  column-gap: 1.15rem;
  padding: 1.45rem 0;
  border-bottom: 1px solid var(--line);
}

.game-notes__section:first-child {
  border-top: 3px solid var(--blue);
}

.game-notes__number {
  grid-row: 1 / span 2;
  margin: 0;
  color: var(--pink);
  font-family: var(--display);
  font-size: 2.55rem;
  line-height: 0.9;
}

.game-notes__section--wave .game-notes__number {
  color: var(--water);
}

.game-notes__section--sail .game-notes__number {
  color: var(--brick);
}

.game-notes h2 {
  font-size: clamp(1.25rem, 2.1vw, 1.7rem);
  line-height: 1;
}

.game-notes__section > p:last-child {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.game-notes__keys {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.8;
}

kbd {
  display: inline-grid;
  min-width: 23px;
  min-height: 23px;
  margin-right: 3px;
  place-items: center;
  color: var(--blue);
  border: 1px solid rgba(8, 73, 162, 0.28);
  background: var(--ice);
  font: 800 0.65rem/1 var(--body);
}

.leaderboard {
  margin-top: clamp(4rem, 8vw, 7.5rem);
}

.leaderboard__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: end;
  margin-bottom: 1.35rem;
}

.leaderboard h2 {
  font-size: clamp(2.1rem, 4vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.leaderboard__header > div > p:last-child {
  max-width: 680px;
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.leaderboard__mark {
  color: var(--blue);
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 3.7rem);
  line-height: 0.9;
}

.leaderboard__table-wrap {
  overflow-x: auto;
  border-top: 3px solid var(--blue);
}

.leaderboard table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

.leaderboard th,
.leaderboard td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.leaderboard th {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.leaderboard td {
  font-size: 0.86rem;
  font-weight: 700;
}

.leaderboard td:first-child {
  width: 90px;
  color: var(--blue);
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 400;
}

.leaderboard tbody tr:nth-child(-n + 3) td {
  background: rgba(215, 238, 246, 0.5);
}

.leaderboard__empty,
.leaderboard__error {
  margin: 0;
  padding: 1.1rem 1rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}

.leaderboard__error {
  color: #9b342b;
}

.game-footer {
  padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
  color: rgba(255, 255, 255, 0.72);
  background: var(--blue-dark);
  font-size: 0.72rem;
  text-align: center;
}

.game-footer p {
  margin: 0;
}

.game-footer a {
  color: var(--white);
  font-weight: 850;
}

@keyframes tile-no {
  0%, 100% { transform: translateX(0) rotate(var(--tilt, 0deg)); }
  30% { transform: translateX(-5px) rotate(-2deg); }
  65% { transform: translateX(5px) rotate(2deg); }
}

@keyframes tile-clear {
  0% { opacity: 1; transform: rotate(var(--tilt, 0deg)) scale(1); }
  55% { opacity: 1; transform: rotate(-4deg) scale(1.12); }
  100% { opacity: 0; transform: rotate(5deg) scale(0.2); }
}

@keyframes tile-new {
  from { opacity: 0; transform: translateY(-120%) rotate(-5deg); }
  to { opacity: 1; transform: translateY(0) rotate(var(--tilt, 0deg)); }
}

@keyframes tile-wave-drop {
  from { opacity: 0; transform: translateY(var(--drop-distance, -224%)) rotate(-5deg); }
  72% { opacity: 1; transform: translateY(7%) rotate(1deg); }
  to { opacity: 1; transform: translateY(0) rotate(var(--tilt, 0deg)); }
}

@keyframes tile-hint {
  from { outline: 2px solid rgba(255, 255, 255, 0.35); outline-offset: -3px; transform: rotate(var(--tilt, 0deg)) scale(1); }
  to { outline: 5px solid var(--white); outline-offset: -6px; transform: rotate(0deg) scale(1.07); }
}

@keyframes hint-guide {
  from { transform: translateX(-50%) scale(1); }
  to { transform: translateX(-50%) scale(1.035); }
}

@keyframes match-burst {
  from { opacity: 1; transform: translate(-50%, -50%) scale(0.25); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(6.5); }
}

@keyframes match-confetti {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(0deg) scale(0.45); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--confetti-x)), calc(-50% + var(--confetti-y))) rotate(var(--confetti-turn)) scale(1); }
}

@keyframes message-pop {
  0% { opacity: 0; transform: translate(-50%, -8px); }
  12%, 78% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -5px); }
}

@media (max-width: 980px) {
  .game-intro {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .play-layout {
    grid-template-columns: 1fr;
  }

  .game-shell {
    width: min(100%, 720px);
    margin: 0 auto;
  }

  .game-notes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    width: min(100%, 920px);
    margin: 0 auto;
  }

  .game-notes__section,
  .game-notes__section:first-child {
    display: block;
    border-top: 3px solid var(--blue);
  }

  .game-notes__number {
    margin-bottom: 0.65rem;
  }

  .game-notes__keys {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .portal-header__inner {
    min-height: 68px;
  }

  .portal-header__brand img {
    width: 70px;
  }

  .portal-header__back {
    font-size: 0.65rem;
  }

  .game-page {
    width: 100%;
    padding-top: 0.9rem;
  }

  .game-intro {
    width: calc(100% - 1.25rem);
    margin: 0 auto 0.9rem;
  }

  .game-intro__eyebrow {
    margin-bottom: 0.4rem;
    font-size: 0.65rem;
  }

  .game-intro h1 {
    font-size: clamp(2.25rem, 12.5vw, 3.25rem);
  }

  .game-intro__lead {
    font-size: 0.86rem;
    line-height: 1.5;
  }

  .game-shell {
    width: 100%;
    margin: 0;
    scroll-margin-top: 0;
  }

  .game-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 50px 50px;
  }

  .hud-item--best {
    display: none;
  }

  .hud-item {
    min-height: 55px;
    padding: 0.52rem 0.42rem;
  }

  .hud-item span {
    font-size: 0.48rem;
  }

  .hud-item strong {
    font-size: 0.94rem;
  }

  .icon-button {
    min-height: 55px;
  }

  .wave-meter {
    height: 23px;
  }

  .wave-meter b {
    padding-top: 0.28rem;
    font-size: 0.56rem;
  }

  .game-stage {
    min-height: 0;
    padding: 32px 0 0;
  }

  .lake-top {
    height: 88px;
  }

  .lake-top__sun {
    top: 10px;
    width: 31px;
  }

  .lake-top__reed {
    height: 49px;
  }

  .tile-board {
    width: calc(100% - 2px);
    gap: 1px;
    padding: 1px;
    box-shadow: none;
  }

  .tile {
    border-radius: 3px;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  }

  .tile__name {
    display: none;
  }

  .tile img {
    width: 92%;
    height: 92%;
  }

  .tile--tower img {
    width: 66%;
    height: 94%;
  }

  .tile--mushroom img,
  .tile--duck img {
    width: 96%;
  }

  .game-overlay {
    grid-template-columns: 1fr;
    width: calc(100% - 1rem);
    min-height: 0;
    max-height: calc(100% - 1rem);
    box-shadow: 6px 8px 0 rgba(6, 45, 99, 0.28);
  }

  .game-overlay__stamp {
    display: none;
  }

  .game-overlay__content {
    padding: 1rem;
  }

  .difficulty-picker {
    margin-top: 0.7rem;
  }

  .difficulty-picker__options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .difficulty-picker button {
    display: block;
    min-height: 48px;
    padding: 0.45rem 0.25rem;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    text-align: center;
  }

  .difficulty-picker button:last-child {
    border-right: 0;
  }

  .difficulty-picker button span {
    display: none;
  }

  .difficulty-picker button strong {
    overflow: visible;
    font-size: 0.57rem;
    text-overflow: clip;
  }

  .game-overlay__eyebrow {
    font-size: 0.58rem;
  }

  .game-overlay h2 {
    font-size: clamp(1.6rem, 8vw, 2rem);
  }

  .game-overlay__content > p:not(.game-overlay__eyebrow):not(.game-overlay__hint) {
    margin-top: 0.7rem;
    font-size: 0.75rem;
    line-height: 1.45;
  }

  .game-overlay__score {
    margin-top: 0.75rem;
  }

  .game-overlay__score span {
    padding: 0.55rem 0.45rem;
    font-size: 0.52rem;
  }

  .game-overlay__score strong {
    font-size: 1rem;
  }

  .primary-button {
    width: 100%;
    min-height: 54px;
    margin-top: 0.75rem;
    font-size: 0.78rem;
  }

  .game-overlay__hint {
    display: none;
  }

  .score-form__row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .score-form button,
  .score-form input {
    min-height: 44px;
  }

  .game-message {
    top: 49px;
    font-size: 0.64rem;
  }

  .swap-guide {
    top: 9px;
    font-size: 0.58rem;
  }

  .game-notes {
    display: block;
  }

  .game-notes__section {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .game-notes__number {
    grid-row: 1 / span 2;
    font-size: 2rem;
  }

  .game-notes__keys {
    display: none;
  }

  .leaderboard {
    margin-top: 4rem;
  }

  .leaderboard__header {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .leaderboard__mark {
    font-size: 1.7rem;
  }

  .leaderboard table {
    min-width: 510px;
  }

  .leaderboard th,
  .leaderboard td {
    padding: 0.75rem 0.65rem;
  }
}

@media (max-width: 370px) {
  .game-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 46px 46px;
  }

  .game-stage {
    min-height: 0;
  }
}

@media (orientation: landscape) and (max-width: 950px) and (max-height: 520px) {
  body > *:not(.landscape-gate) {
    display: none !important;
  }

  .landscape-gate {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    color: var(--white);
    background: var(--blue);
    text-align: center;
  }

  .landscape-gate__phone {
    position: relative;
    width: 48px;
    height: 78px;
    margin-bottom: 1rem;
    border: 3px solid var(--white);
    transform: rotate(-8deg);
  }

  .landscape-gate__phone::after {
    position: absolute;
    right: 13px;
    bottom: 5px;
    left: 13px;
    height: 3px;
    background: var(--pink);
    content: "";
  }

  .landscape-gate strong {
    font-family: var(--display);
    font-size: clamp(1.5rem, 6vw, 2.6rem);
    font-weight: 400;
  }

  .landscape-gate small {
    margin-top: 0.45rem;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 650;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
