@import url("https://fonts.googleapis.com/css2?family=Anton&family=Kanit:ital,wght@0,300;0,400;0,500;0,700;0,900;1,400&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap");

:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4fb;
  --primary: #005daa;
  --primary-dark: #003f7a;
  --accent: #00a3e0;
  --success: #11a36a;
  --warning: #f2a900;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e2ef;
  --shadow: 0 20px 45px rgba(25, 55, 90, 0.14);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --game-border-width: clamp(3px, 0.42vw, 4px);
  --landing-stroke: 2px solid rgba(255, 255, 255, 0.95);
  --font-title: "Anton", Impact, sans-serif;
  --font-text: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-text);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(0, 55, 92, 0.08), rgba(0, 55, 92, 0.18)),
    url("../assets/fondo.jpg") center / cover fixed no-repeat;
  color: var(--ink);
}

.game-one-page {
  --font-title: "Kanit", system-ui, sans-serif;
  --font-text: "Kanit", system-ui, sans-serif;
  font-family: var(--font-text);
}

.game-one-page .app-header {
  justify-content: center;
}

.game-one-page .app-header-logo {
  max-width: min(42vw, 180px);
}

button,
a {
  font: inherit;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 18px 28px;
}

.login-shell {
  width: 100%;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.screen {
  min-height: calc(100vh - 50px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.inner-screen {
  gap: 20px;
}

.login-screen {
  min-height: calc(100vh - 22px);
  gap: 0;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--primary), var(--accent));
  color: #fff;
  font-family: var(--font-title);
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 12px 24px rgba(0, 93, 170, 0.28);
}

.brand-text strong,
.eyebrow {
  display: block;
}

.brand-text strong {
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 55, 92, 0.26);
}

.brand-text span,
.eyebrow {
  color: #dff7fb;
  font-size: 13px;
}

.hero-card,
.panel,
.game-card,
.result-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.result-game-character {
  display: none;
}

.game-result-page {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(2, 15, 31, 0.46), rgba(2, 15, 31, 0.62)),
    url("../assets/cinta.jpg") center / cover fixed no-repeat;
}

.juego-2-result {
  background:
    linear-gradient(180deg, rgba(2, 15, 31, 0.56), rgba(2, 15, 31, 0.68)),
    url("../assets/juego-fondo-cajas.jpg") center / cover fixed no-repeat;
}

.juego-3-result {
  background:
    linear-gradient(180deg, rgba(2, 15, 31, 0.54), rgba(2, 15, 31, 0.64)),
    url("../assets/fondo-duenos-resultado.jpg") center / cover fixed no-repeat;
}

.final-result {
  background:
    linear-gradient(180deg, rgba(2, 15, 31, 0.5), rgba(2, 15, 31, 0.68)),
    url("../assets/fondo.jpg") center / cover fixed no-repeat;
}

.game-result-page .app-shell {
  width: 100%;
  max-width: none;
  padding: 0;
}

.game-result-page .inner-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.game-result-page .app-header {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 16px;
  right: 16px;
  justify-content: center;
}

.game-result-page .app-header-logo {
  width: 150px;
  max-width: 42vw;
}

.game-result-page .user-chip {
  display: none;
}

.game-result-page .result-card {
  position: relative;
  z-index: 3;
  isolation: isolate;
  width: min(calc(100% - 32px), 470px);
  height: min(715px, calc(100vh - 24px));
  min-height: 0;
  margin: 0;
  padding: 46px 34px 0;
  border: 1px solid rgba(157, 224, 246, 0.3);
  border-radius: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  background: linear-gradient(145deg, rgba(5, 22, 40, 0.9), rgba(8, 34, 56, 0.8));
  color: #ffffff;
  backdrop-filter: blur(20px) saturate(1.25);
  box-shadow: 0 0 28px rgba(0, 166, 220, 0.12), 0 24px 60px rgba(0, 0, 0, 0.42);
}

.game-result-page .result-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: calc(var(--game-border-width) * -1);
  padding: var(--game-border-width);
  border-radius: 34px;
  background: linear-gradient(120deg, rgba(255,255,255,.9), #62d6f2, #1789c8, rgba(255,255,255,.9));
  background-size: 300% 300%;
  filter: drop-shadow(0 0 6px rgba(131, 222, 255, 0.38));
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: conveyor-border-orbit 8s ease-in-out infinite;
}

.result-luggage-rain {
  position: fixed;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.result-raining-luggage {
  position: absolute;
  top: -90px;
  left: var(--rain-left);
  width: var(--rain-size);
  height: auto;
  opacity: 1;
  filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.32));
  animation: result-luggage-fall var(--rain-duration) linear var(--rain-delay) infinite;
}

@keyframes result-luggage-fall {
  0% { transform: translate3d(0, -12vh, 0) rotate(var(--rain-rotation)); }
  50% { transform: translate3d(var(--rain-drift), 52vh, 0) rotate(calc(var(--rain-rotation) + 170deg)); }
  100% { transform: translate3d(calc(var(--rain-drift) * -0.5), 116vh, 0) rotate(calc(var(--rain-rotation) + 360deg)); }
}

.result-box-flow {
  position: fixed;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.result-flowing-box {
  position: absolute;
  top: var(--box-top);
  left: calc(var(--box-size) * -1.4);
  width: var(--box-size);
  height: auto;
  opacity: .94;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .38)) drop-shadow(0 0 12px rgba(69, 217, 255, .28));
  animation: result-box-cross var(--box-duration) linear var(--box-delay) infinite;
}

@keyframes result-box-cross {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(calc(50vw + var(--box-size)), var(--box-bob), 0);
  }
  100% {
    transform: translate3d(calc(100vw + var(--box-size) * 2.8), 0, 0);
  }
}

.result-runway-lights {
  position: fixed;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.result-runway-light {
  position: absolute;
  top: 47%;
  left: 50%;
  width: var(--light-size);
  height: var(--light-size);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 5px #ffffff, 0 0 13px rgba(255,255,255,.9), 0 0 26px rgba(174,228,255,.7);
  opacity: 0;
  will-change: transform, opacity;
  animation: result-runway-light-flight var(--light-duration) cubic-bezier(.18,.52,.42,1) var(--light-delay) infinite;
}

@keyframes result-runway-light-flight {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(.12);
  }
  14% {
    opacity: .28;
  }
  68% {
    opacity: .96;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--light-x), var(--light-y), 0) scale(3.1);
  }
}

.game-result-page .celebration,
.game-result-page .eyebrow {
  display: none;
}

.game-result-page .result-card h1 {
  position: relative;
  z-index: 3;
  color: #ffffff;
  font-family: "Anton", Impact, sans-serif;
  font-size: 40px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-shadow: 0 0 18px rgba(64, 216, 255, 0.28);
}

.game-result-page .result-card .lead {
  position: relative;
  z-index: 3;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  font-weight: 300;
}

.game-result-page .result-card .result-value-message {
  max-width: 31ch;
  margin: 18px auto 0;
  color: rgba(255, 255, 255, 0.84);
  font: 400 16px/1.5 "Open Sans", system-ui, sans-serif;
  text-align: center;
}

.replay-score-link,
.result-ranking-link {
  display: none;
}

.game-result-page .replay-score-link,
.game-result-page .result-ranking-link {
  position: relative;
  z-index: 5;
  display: block;
  max-width: 31ch;
  min-height: 0;
  margin-top: 12px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font: 400 13px/1.4 "Open Sans", system-ui, sans-serif;
  text-align: center;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}

.game-result-page .replay-score-link:hover {
  color: #ffffff;
}

.game-result-page .result-ranking-link:hover {
  color: #ffffff;
}

.replay-score-help {
  display: none;
}

.game-result-page .replay-score-help {
  position: relative;
  z-index: 5;
  display: block;
  max-width: 34ch;
  margin: 7px auto 0;
  color: rgba(255, 255, 255, 0.58);
  font: 300 11px/1.35 "Open Sans", system-ui, sans-serif;
  text-align: center;
}

.game-result-page .score-big {
  position: relative;
  z-index: 4;
  margin-top: 10px;
  padding: 0;
  background: transparent;
  text-align: center;
}

.game-result-page .score-big span {
  display: block;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-result-page .score-big strong {
  color: #ffffff;
  font-family: "Anton", Impact, sans-serif;
  font-size: clamp(58px, 14vw, 78px);
  font-weight: 400;
  text-shadow: 0 0 20px rgba(89, 221, 255, 0.42);
}

@media (min-width: 700px) {
  .game-result-page .result-card {
    width: min(520px, calc(100% - 48px));
  }
}

.game-result-page .result-game-character {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 350px;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.32));
  pointer-events: none;
}

.juego-2-result .result-game-character {
  right: -10%;
  left: -10%;
  width: 120%;
  height: 440px;
  bottom: -70px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.36)) drop-shadow(0 0 24px rgba(69, 217, 255, 0.22));
}

.game-result-page .final-result-character {
  bottom: 82px;
  width: min(92%, 420px);
  height: 270px;
  margin: 0 auto;
}

.game-result-page .result-card .actions {
  position: absolute;
  z-index: 5;
  right: 34px;
  bottom: 28px;
  left: 34px;
  margin: 0;
  display: grid;
  gap: 8px;
}

.game-result-page .result-card .button.primary {
  font-family: "Open Sans", system-ui, sans-serif;
  box-shadow: 0 14px 34px rgba(0, 36, 78, 0.48);
}

.game-result-page .result-card .result-home-button {
  position: relative;
  isolation: isolate;
  border: 0;
  margin-top: 2px;
}

.game-result-page .result-card .result-home-button::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: calc(var(--game-border-width) * -1);
  padding: var(--game-border-width);
  border-radius: inherit;
  background: linear-gradient(120deg, #ffffff, #ffffff, #45d9ff, #006fd4, #ffffff, #72e7ff, #ffffff);
  background-size: 300% 300%;
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 16px rgba(32, 193, 255, 0.82));
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: conveyor-border-orbit 3.2s linear infinite;
}

.game-result-page .result-card .button.result-replay-button {
  min-height: 66px;
  margin-inline: -8px;
  padding: 9px 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  flex-direction: column;
  gap: 2px;
  background: rgba(2, 15, 31, 0.68);
  color: #ffffff;
  font-family: "Open Sans", system-ui, sans-serif;
  box-shadow: none;
}

.result-replay-title,
.result-replay-help {
  display: block;
  text-align: center;
}

.result-replay-title {
  font-weight: 750;
  line-height: 1.15;
}

.result-replay-help {
  color: rgba(255, 255, 255, .76);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.25;
}

.game-result-page .result-card .button.result-replay-button:hover {
  border-color: #ffffff;
  background: rgba(2, 15, 31, 0.88);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.result-best-score-help {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .game-result-page .result-card::before {
    animation: none;
  }

  .game-result-page .result-card .result-home-button::before {
    animation: none;
  }

  .result-luggage-rain {
    display: none;
  }

  .result-box-flow,
  .result-runway-lights {
    display: none;
  }

  .ranking-user-card::before {
    animation: none;
  }
}

.hero-card .eyebrow,
.panel .eyebrow,
.game-card .eyebrow,
.result-card .eyebrow {
  color: var(--muted);
}

.hero-card {
  margin-top: auto;
  padding: 26px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.hero-card.compact {
  margin-top: 0;
}

.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.landing-content {
  width: min(calc(100% - 36px), 480px);
  margin: 0 auto;
  display: grid;
  gap: 34px;
  padding-top: 22px;
  position: relative;
  z-index: 2;
}

.landing-hero .eyebrow,
.landing-hero .lead {
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 55, 92, 0.28);
}

.landing-hero h1 {
  max-width: 10ch;
  margin-top: 0;
  font-size: 52px;
  line-height: 0.95;
}

.landing-hero h2 {
  margin-top: 8px;
  font-size: 29px;
}

.landing-hero .lead {
  max-width: 32ch;
  margin-top: 20px;
}

.landing-hero .actions {
  margin-top: 30px;
}

.landing-bottom-image {
  width: 100vw;
  max-width: none;
  margin: auto 0 0;
  display: block;
  align-self: center;
  object-fit: contain;
  object-position: bottom center;
  transform: translateY(8px);
  filter: drop-shadow(0 -4px 24px rgba(0, 55, 92, 0.2));
}

.index-page {
  overflow: hidden;
}

.index-desktop-landing {
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(26px, var(--safe-top)) max(24px, var(--safe-right)) 0 max(24px, var(--safe-left));
  display: grid;
  grid-template-rows: auto 1fr;
  place-items: center;
  position: relative;
  isolation: isolate;
}

.index-desktop-landing .brand-logo-header {
  position: relative;
  z-index: 3;
}

.index-desktop-hero {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  align-self: start;
  margin-top: clamp(24px, 5vh, 48px);
}

.index-desktop-hero h1 {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-title);
  font-size: clamp(52px, 8vw, 92px);
  font-weight: 400;
  line-height: .94;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(16, 135, 188, .28), 0 5px 18px rgba(0, 55, 92, .28);
}

.index-qr-area {
  display: grid;
  margin: 0 0 2px;
}

.index-qr-area .desktop-qr-row {
  display: grid;
  grid-template-columns: auto minmax(160px, 230px);
  align-items: center;
  gap: clamp(14px, 1.8vw, 22px);
}

.index-qr-area .desktop-qr-placeholder {
  width: clamp(92px, 9vw, 120px);
  aspect-ratio: 1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .28);
}

.index-qr-area p {
  max-width: 24ch;
  margin: 0;
  color: rgba(255, 255, 255, .88);
  font-size: clamp(14px, 1vw, 16px);
  font-weight: 700;
  line-height: 1.34;
  text-align: left;
  text-shadow: 0 2px 12px rgba(0, 55, 92, .32);
}

.index-qr-area p span {
  display: block;
}

.index-desktop-character {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -1vh;
  width: min(82vw, 920px);
  max-width: none;
  max-height: min(50vh, 500px);
  object-fit: contain;
  object-position: bottom center;
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 -4px 26px rgba(0, 55, 92, .22));
}

.is-mobile-frame .index-desktop-landing {
  padding: max(22px, var(--safe-top)) max(16px, var(--safe-right)) 0 max(16px, var(--safe-left));
}

.is-mobile-frame .index-desktop-landing .brand-logo-header {
  display: none !important;
}

.is-mobile-frame .index-desktop-hero {
  margin-top: clamp(74px, 14vh, 132px);
}

.is-mobile-frame .index-desktop-hero h1 {
  font-size: clamp(46px, 15vw, 74px);
  max-width: 9ch;
}

.is-mobile-frame .index-desktop-character {
  width: min(142vw, 620px);
  max-height: min(56vh, 520px);
}

.intro-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 12px;
}

.intro-hero .eyebrow,
.intro-hero .lead {
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 55, 92, 0.28);
}

.intro-hero h1 {
  max-width: 10ch;
  margin-top: 10px;
  font-size: 46px;
  line-height: 0.95;
}

.intro-hero .lead {
  max-width: 31ch;
}

.intro-video-page {
  background: #071622;
  overflow: hidden;
}

.intro-video-background {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.intro-video-shell {
  position: relative;
  z-index: 1;
}

.intro-video-page .intro-hero {
  margin: 42px 0 auto;
}

.intro-video-page .intro-hero h1 {
  max-width: 12ch;
}

.intro-video-page .intro-hero .lead {
  margin-top: 18px;
}

.intro-character-image {
  width: min(116%, 520px);
  max-width: none;
  margin: auto -8% -22px;
  align-self: center;
  display: block;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 18px 24px rgba(0, 55, 92, 0.22));
}

.hero-visual {
  height: 188px;
  margin: -8px -8px 20px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(0, 63, 122, 0.1), rgba(255, 255, 255, 0.04)),
    var(--surface-soft);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.hero-visual img {
  height: 112%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 18px rgba(14, 42, 70, 0.2));
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  font-family: var(--font-title);
  font-weight: 400;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 3px 14px rgba(0, 55, 92, 0.28);
}

h1 {
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 25px;
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-card h1,
.hero-card h2,
.panel h1,
.panel h2,
.game-card h1,
.game-card h2,
.result-card h1,
.result-card h2 {
  color: var(--ink);
  text-shadow: none;
}

.lead {
  margin-top: 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.actions {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.button {
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  padding: 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 750;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:active {
  transform: scale(0.98);
}

.button.primary {
  background: linear-gradient(140deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 16px 28px rgba(0, 93, 170, 0.25);
}

.button.secondary {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.button.disabled,
.button:disabled {
  background: #e5eaf1;
  color: #98a2b3;
  cursor: not-allowed;
  box-shadow: none;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
}

.brand-logo-header {
  display: grid;
  justify-items: center;
}

.app-logo {
  width: min(74%, 250px);
  height: auto;
  justify-self: center;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(0, 55, 92, 0.22));
}

.app-header-logo {
  width: 132px;
  max-width: 40%;
  height: auto;
  display: block;
  filter: drop-shadow(0 5px 12px rgba(0, 55, 92, 0.18));
}

.user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.user-copy {
  min-width: 0;
  text-align: right;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 55, 92, 0.24);
}

.user-copy strong,
.user-copy span {
  display: block;
}

.user-copy strong {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.user-copy span {
  font-size: 11px;
  opacity: 0.86;
  white-space: nowrap;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-dark);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
  box-shadow: 0 8px 18px rgba(0, 55, 92, 0.18);
}

.panel {
  border-radius: var(--radius-lg);
  padding: 20px;
}

.progress-panel {
  padding: 4px 0 0;
}

.progress-panel .eyebrow {
  color: #ffffff;
  margin-bottom: 6px;
  font-weight: 600;
  line-height: 1.35;
  text-shadow: 0 2px 12px rgba(0, 55, 92, 0.28);
}

.progress-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.progress-header h1 {
  max-width: none;
  font-size: clamp(26px, 7vw, 32px);
  white-space: nowrap;
}

.home-rank-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 5px;
  color: #ffffff;
  text-align: right;
}

.home-rank-heading span {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-shadow: 0 2px 12px rgba(0, 55, 92, 0.28);
}

.home-rank-heading strong {
  min-width: 4.2ch;
  font-family: var(--font-title);
  color: #ffffff;
  font-size: clamp(26px, 7vw, 32px);
  font-weight: 400;
  line-height: 1;
  text-shadow: 0 3px 14px rgba(0, 55, 92, 0.28);
}

.progress-number {
  font-family: var(--font-title);
  min-width: 62px;
  min-height: 38px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(4, 35, 60, 0.34);
  font-size: 26px;
  font-weight: 400;
  color: #ffffff;
  line-height: 1;
  text-shadow: 0 3px 14px rgba(0, 55, 92, 0.28);
}

.progress-track {
  height: 18px;
  border: var(--landing-stroke);
  border-radius: 999px;
  background: rgba(0, 68, 96, 0.24);
  overflow: hidden;
  margin-top: 18px;
  box-shadow: inset 0 1px 4px rgba(0, 55, 92, 0.2), 0 2px 10px rgba(0, 55, 92, 0.18);
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width 500ms ease;
}

.boarding-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 0.72fr)) minmax(0, 1.55fr);
  gap: 8px;
  margin-top: 10px;
}

.boarding-step {
  min-height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #d9f4e8;
  color: var(--success);
  font-size: 17px;
  font-weight: 800;
  backdrop-filter: blur(8px);
  transition: background 220ms ease, color 220ms ease, transform 220ms ease;
}

.boarding-score {
  padding: 0 10px;
  color: #ffffff;
  font-size: 13px;
  white-space: nowrap;
  background: rgba(4, 35, 60, 0.46);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.boarding-score-divider {
  width: 1px;
  height: 16px;
  flex: 0 0 1px;
  background: rgba(255, 255, 255, 0.42);
}

.boarding-score:hover {
  background: rgba(4, 35, 60, 0.62);
}

.boarding-step.done {
  background: rgba(9, 130, 80, 0.9);
  color: #ffffff;
  transform: translateY(-2px);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title h2 {
  color: #ffffff;
  text-shadow: 0 3px 14px rgba(0, 55, 92, 0.28);
}

.game-list {
  height: min(68vh, 640px);
  min-height: 560px;
  position: relative;
  perspective: 1400px;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  overflow: hidden;
}

.games-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
}

.games-stage .game-list {
  width: 100%;
  margin-block: auto;
}

.game-card {
  width: min(90%, 380px);
  aspect-ratio: 53.98 / 85.6;
  height: auto;
  border-radius: 30px;
  padding: 22px 22px 20px;
  display: grid;
  grid-template-rows: auto minmax(185px, 1fr) auto auto;
  gap: 12px;
  position: absolute;
  top: 10px;
  left: 50%;
  cursor: grab;
  transform-origin: center center;
  transform-style: preserve-3d;
  transition:
    transform 560ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 560ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 560ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.game-card * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.game-card.has-long-art {
  grid-template-rows: minmax(340px, 1fr) auto auto;
  border: 0;
}

.game-card.has-long-art .game-card-header {
  position: absolute;
  z-index: 4;
  top: 24px;
  right: 24px;
  left: 24px;
}

.game-card.has-long-art .game-card-header h2 {
  max-width: 12ch;
  color: #ffffff;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.72);
}

.game-card.has-long-art .score-line {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.72);
}

@media (min-width: 768px) {
  .game-card.is-ownership-game.has-long-art .score-line {
    color: #ffffff;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 1), 0 0 10px rgba(0, 0, 0, 0.95);
  }
}

.game-card.has-long-art .game-card-art {
  grid-row: 1;
  min-height: 340px;
  margin: -22px -22px 0;
  border-radius: 30px 30px 24px 24px;
}

.game-card.has-placeholder-art .game-card-art {
  position: relative;
}

.game-card.has-placeholder-art .game-card-art::before,
.game-card.has-placeholder-art .game-card-art::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.game-card.has-placeholder-art .game-card-art::before {
  inset: 0;
  background:
    radial-gradient(circle at 78% 72%, rgba(255, 255, 255, 0.1), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 48%);
}

.game-card.has-placeholder-art .game-card-art::after {
  right: -15%;
  bottom: -16%;
  width: 70%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.game-card.placeholder-blue .game-card-art {
  background: linear-gradient(155deg, #0b4e80, #092943 72%);
}

.game-card.placeholder-slate .game-card-art {
  background: linear-gradient(155deg, #344657, #172331 72%);
}

.game-card.has-long-art .game-card-art-badges {
  top: auto;
  right: 18px;
  bottom: 18px;
  left: 18px;
}

.game-card.has-long-art .game-card-body {
  grid-row: 2;
}

.game-card.has-long-art > .button {
  grid-row: 3;
}

.game-card:active {
  cursor: grabbing;
}

.game-card[data-position="active"] {
  opacity: 1;
  z-index: 10;
  filter: none;
  transform:
    translateX(-50%)
    translateZ(0)
    rotateY(0deg)
    rotateZ(0deg)
    scale(1);
}

.game-card[data-position="left"] {
  opacity: 0.82;
  z-index: 3;
  filter: saturate(0.88) brightness(0.95);
  transform:
    translateX(-50%)
    translateX(-56px)
    translateZ(-80px)
    rotateY(0deg)
    rotateZ(0deg)
    scale(0.9);
}

.game-card[data-position="right"] {
  opacity: 0.82;
  z-index: 2;
  filter: saturate(0.88) brightness(0.95);
  transform:
    translateX(-50%)
    translateX(56px)
    translateZ(-80px)
    rotateY(0deg)
    rotateZ(0deg)
    scale(0.9);
}

.game-card.cursor-left {
  cursor: url("../assets/cursor-flecha-izquierda.svg") 28 28, w-resize;
}

.game-card.cursor-right {
  cursor: url("../assets/cursor-flecha-derecha.svg") 28 28, e-resize;
}

.game-card[data-position="left"] .button,
.game-card[data-position="right"] .button {
  opacity: 0;
}

.game-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.game-card h2 {
  font-size: 29px;
  line-height: 0.98;
}

.game-card-body {
  min-height: 0;
  overflow: visible;
}

.game-card-body .lead {
  display: block;
  margin-top: 0;
  max-width: 100%;
  overflow: visible;
  font-size: 13px;
  line-height: 1.34;
}

.game-card-art {
  min-height: 185px;
  border-radius: 24px;
  margin: 0 -4px;
  background:
    radial-gradient(circle at 50% 62%, rgba(255, 255, 255, 0.34), transparent 58%),
    linear-gradient(180deg, #ffb347 0%, #ff8a2a 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.game-card.is-done .game-card-header > .status {
  display: none;
}

.game-card-art-badges {
  position: absolute;
  z-index: 2;
  inset: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}

.game-card.is-completion-pending .game-card-art-badges {
  opacity: 0;
  transform: scale(0.72);
}

.game-card.is-completion-celebrating {
  z-index: 12;
  animation: home-completion-shake 1.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.game-card.is-completion-celebrating::after {
  content: "";
  position: absolute;
  z-index: 8;
  inset: 0;
  border: 3px solid rgba(116, 255, 198, 0.92);
  border-radius: inherit;
  box-shadow: inset 0 0 34px rgba(100, 255, 198, 0.8), inset 0 0 80px rgba(41, 206, 255, 0.42);
  pointer-events: none;
  animation: home-completion-glow 1.35s ease-out both;
}

.game-card.is-completion-pending.show-completion-badges .game-card-art-badges {
  animation: home-completion-badges 620ms cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}

@keyframes home-completion-shake {
  0%, 100% { translate: 0; rotate: 0deg; filter: brightness(1); }
  12% { translate: -8px 0; rotate: -0.8deg; filter: brightness(1.2); }
  24% { translate: 8px 0; rotate: 0.8deg; }
  36% { translate: -6px 0; rotate: -0.6deg; filter: brightness(1.42); }
  48% { translate: 6px 0; rotate: 0.6deg; }
  62% { translate: -3px 0; rotate: -0.3deg; }
  76% { translate: 3px 0; rotate: 0.3deg; filter: brightness(1.28); }
}

@keyframes home-completion-glow {
  0% { opacity: 0; }
  22%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes home-completion-badges {
  0% { opacity: 0; transform: translateY(8px) scale(0.72); }
  62% { opacity: 1; transform: translateY(-2px) scale(1.08); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.art-badge {
  min-height: 30px;
  padding: 0 12px;
  border: var(--landing-stroke);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(4, 22, 40, 0.78);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.art-badge.completed {
  color: #75f0c6;
}

.game-card.is-done .art-badge {
  min-height: 38px;
  padding: 0 15px;
  background: rgba(9, 130, 80, 0.9);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(2, 55, 34, 0.38), 0 0 18px rgba(70, 235, 164, 0.22);
}

.game-card-art img {
  height: 210px;
  max-width: 92%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 15px 14px rgba(14, 42, 70, 0.18));
}

.game-card-art.has-cover {
  align-items: stretch;
  background: #071a2a;
}

.game-card-art.has-cover img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center center;
  filter: none;
}

.game-hero-character {
  width: 100%;
  min-height: 132px;
  margin: 16px 0 0;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(238, 244, 251, 0.8)),
    var(--surface-soft);
  display: grid;
  grid-template-columns: 118px 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 0;
  overflow: hidden;
}

.game-hero-character img {
  width: 112px;
  height: 120px;
  object-fit: contain;
  object-position: bottom center;
  align-self: end;
  filter: drop-shadow(0 12px 10px rgba(14, 42, 70, 0.18));
}

.game-hero-character span {
  font-family: var(--font-title);
  font-size: 32px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.done {
  background: #d9f4e8;
  color: #087a4c;
}

.status.available {
  background: #dbeafe;
  color: var(--primary-dark);
}

.status.pending {
  background: #fff3d1;
  color: #986f00;
}

.status.locked {
  background: #e8edf4;
  color: #667085;
}

.score-line {
  color: var(--muted);
  font-size: 14px;
}

.ranking-page {
  background:
    linear-gradient(180deg, rgba(0, 55, 92, 0.08), rgba(0, 55, 92, 0.18)),
    url("../assets/fondo.jpg") center / cover fixed no-repeat;
  color: #ffffff;
}

.ranking-page .app-shell {
  width: min(100%, 480px);
}

.ranking-page .inner-screen {
  gap: 20px;
}

.ranking-page .app-header-logo {
  filter: none;
}

.ranking-page .user-copy strong {
  color: #ffffff;
}

.ranking-page .user-copy span {
  color: rgba(255, 255, 255, 0.72);
}

.ranking-board {
  color: #ffffff;
}

.ranking-hero {
  padding: 4px 0 0;
  color: #ffffff;
  text-align: center;
}

.ranking-hero .eyebrow {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.ranking-hero h1 {
  margin-top: 0;
  color: #ffffff;
  font-size: clamp(31px, 8vw, 42px);
  line-height: 1;
  text-shadow: none;
}

.ranking-user-card {
  position: relative;
  isolation: isolate;
  min-height: 112px;
  margin-top: 16px;
  border: 0;
  border-radius: 20px;
  padding: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  background: rgba(2, 21, 39, 0.56);
  box-shadow: 0 14px 30px rgba(0, 36, 69, 0.3), inset 0 1px rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
}

.ranking-user-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: calc(var(--game-border-width) * -1);
  padding: var(--game-border-width);
  border-radius: 24px;
  background: linear-gradient(120deg, #ffffff, #72e7ff, #1789c8, #ffffff, #45d9ff, #ffffff);
  background-size: 300% 300%;
  filter: drop-shadow(0 0 7px rgba(255,255,255,.72)) drop-shadow(0 0 15px rgba(32,193,255,.56));
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: conveyor-border-orbit 4.2s linear infinite;
}

.ranking-user-card > * {
  position: relative;
  z-index: 2;
}

.ranking-medal {
  width: auto;
  min-width: 104px;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: #ffffff;
  font-family: var(--font-title);
  font-size: clamp(40px, 10vw, 48px);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 0 18px rgba(69,217,255,.52), 0 4px 14px rgba(0,0,0,.34);
  box-shadow: none;
}

.ranking-user-copy {
  min-width: 0;
}

.ranking-user-copy strong {
  display: block;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.18;
}

.ranking-user-copy span,
.ranking-score span,
.ranking-board-header p,
.ranking-person span {
  color: rgba(255, 255, 255, 0.72);
}

.ranking-score {
  text-align: right;
}

.ranking-score strong {
  display: block;
  font-family: var(--font-title);
  font-size: 42px;
  font-weight: 400;
  line-height: 0.9;
  color: #ffffff;
}

.ranking-score span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ranking-board {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.ranking-board-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  text-align: center;
}

.ranking-board-header > div {
  width: 100%;
}

.ranking-board-header h2 {
  color: #ffffff;
  font-size: 25px;
  line-height: 1;
}

.ranking-board-header p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.35;
}

.ranking-tabs {
  margin: 0 0 16px;
  border: 0;
  border-radius: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: transparent;
}

.ranking-tab {
  min-height: 78px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.05;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.ranking-tab:hover {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.14);
}

.ranking-tab-icon {
  display: block;
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0, 20, 38, 0.22));
}

.ranking-tab.is-active {
  border-color: rgba(166, 230, 255, 0.9);
  background: linear-gradient(145deg, #1479bd, #07559b);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 48, 92, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
}

.ranking-columns {
  min-height: 34px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px 10px 0 0;
  padding: 0 10px;
  display: grid;
  align-items: center;
  gap: 10px;
  background: rgba(4, 35, 60, 0.18);
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ranking-columns.is-people {
  grid-template-columns: 32px minmax(0, 1fr) 58px;
}

.ranking-columns.is-workplaces {
  grid-template-columns: 32px minmax(0, 1fr) 72px;
}

.ranking-columns span:last-child {
  text-align: right;
}

.ranking-list {
  display: grid;
  gap: 0;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

.ranking-row {
  min-height: 64px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 9px;
  background: transparent;
}

.ranking-row:nth-child(even) {
  background: rgba(4, 35, 60, 0.07);
}

.ranking-row:last-child {
  border-bottom: 0;
}

.ranking-row.is-current-user {
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0;
  padding: 9px 10px;
  background: rgba(117, 240, 198, 0.18);
  box-shadow: inset 4px 0 0 #75f0c6;
}

.ranking-workplace-row {
  grid-template-columns: 32px minmax(0, 1fr) 72px;
}

.ranking-position {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 20px;
  line-height: 1;
}

.ranking-person {
  min-width: 0;
}

.ranking-person strong {
  display: block;
  overflow: hidden;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-person span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
}

.ranking-points {
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 27px;
  line-height: 1;
  text-align: right;
}

.ranking-participation,
.ranking-average {
  text-align: right;
}

.ranking-participation strong,
.ranking-average strong {
  display: block;
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.ranking-workplace-row .ranking-average strong {
  font-size: 32px;
  line-height: 1;
}

.ranking-participation span,
.ranking-average span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ranking-page > .app-shell .actions {
  margin-top: 0;
}

.ranking-page .button.secondary {
  border-color: rgba(255, 255, 255, 0.9);
  background: transparent;
  color: #ffffff;
}

@media (max-width: 520px) {
  .ranking-board {
    margin-right: 0;
    margin-left: 0;
    padding: 0;
  }

  .ranking-columns.is-workplaces,
  .ranking-workplace-row {
    grid-template-columns: 28px minmax(0, 1fr) 66px;
    gap: 7px;
  }

  .ranking-person strong {
    font-size: 13px;
  }

  .ranking-person span {
    font-size: 10px;
  }
}

.mock-zone {
  min-height: 360px;
  border: 2px dashed #b8c7dc;
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(0, 93, 170, 0.08), transparent),
    #f8fbff;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: var(--muted);
  overflow: hidden;
}

.mock-zone.has-background {
  min-height: 520px;
  border: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  align-items: stretch;
  color: #ffffff;
  position: relative;
  padding: 14px;
}

.mock-zone-copy {
  width: 100%;
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  backdrop-filter: blur(10px);
}

.mock-zone.has-background .mock-zone-copy {
  background: rgba(5, 15, 28, 0.54);
  color: rgba(255, 255, 255, 0.86);
}

.mock-zone strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 400;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.mock-zone.has-background strong {
  color: #ffffff;
}

.game-fullscreen-mode {
  overflow: hidden;
}

.game-one-page.game-fullscreen-mode,
.game-one-page.game-fullscreen-mode * {
  cursor: url("../assets/cursor-mano.svg") 32 20, grab;
}

.game-fullscreen-mode .app-shell {
  width: 100%;
  max-width: none;
  padding: 0;
}

.game-fullscreen-mode .inner-screen {
  min-height: 100vh;
  gap: 0;
}

.game-fullscreen-mode .app-header {
  position: fixed;
  top: 12px;
  left: 16px;
  right: 16px;
  z-index: 20;
}

.game-fullscreen-mode .app-header-logo {
  width: 122px;
}

.game-fullscreen-mode .user-chip {
  display: none;
}

.game-fullscreen-mode .hero-card,
.game-fullscreen-mode > .actions,
.game-fullscreen-mode .inner-screen > .actions {
  display: none;
}

.game-fullscreen-mode .mock-zone.has-background {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: block;
  min-height: 100vh;
  border-radius: 0;
  padding: 0;
  background-position: center;
  isolation: isolate;
}

.game-fullscreen-mode .mock-zone.has-background::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background:
    radial-gradient(circle at 50% 45%, rgba(24, 193, 255, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(0, 12, 28, 0.08), rgba(0, 12, 28, 0.3));
}

.game-fullscreen-mode .mock-zone.has-background::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  height: 235px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(3, 8, 17, 0.82), rgba(3, 8, 17, 0.42) 52%, transparent);
}

.conveyor-start {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: min(calc(100% - 32px), 470px);
  transform: translate(-50%, calc(-50% - 27px));
  border: 1px solid rgba(87, 220, 255, 0.52);
  border-radius: 32px;
  min-height: 715px;
  padding: 45px 24px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: linear-gradient(145deg, rgba(4, 19, 38, 0.9), rgba(8, 38, 64, 0.72));
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
  backdrop-filter: blur(20px) saturate(1.25);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 0 42px rgba(0, 186, 255, 0.22), 0 28px 70px rgba(0, 0, 0, 0.48);
  isolation: isolate;
}

.conveyor-start::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: calc(var(--game-border-width) * -1);
  border-radius: 36px;
  padding: var(--game-border-width);
  background: linear-gradient(120deg, #ffffff, #ffffff, #45d9ff, #006fd4, #ffffff, #72e7ff, #ffffff);
  background-size: 300% 300%;
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 16px rgba(32, 193, 255, 0.82));
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: conveyor-border-orbit 3.2s linear infinite;
}

.conveyor-start strong {
  color: #ffffff;
  font-family: "Anton", Impact, sans-serif;
  font-size: 38px;
  font-weight: 500;
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-shadow: 0 0 24px rgba(64, 216, 255, 0.5);
}

.conveyor-start p {
  margin: 0;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

.conveyor-start .conveyor-rule {
  min-height: 132px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
}

.conveyor-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.conveyor-rule + .conveyor-rule {
  border-left: 1px solid rgba(114, 231, 255, 0.42);
}

.conveyor-rule span {
  display: grid;
  place-items: center;
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
}

.conveyor-rule.positive span {
  color: #66f0c4;
  text-shadow: 0 0 20px rgba(24, 210, 157, 0.5);
}

.conveyor-rule.negative span {
  color: #ff8393;
  text-shadow: 0 0 20px rgba(255, 91, 111, 0.5);
}

.conveyor-start .button {
  width: 100%;
}

.conveyor-guide {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  object-fit: contain;
  object-position: bottom center;
  z-index: 2;
  transform: scale(1.34);
  transform-origin: center bottom;
  filter: drop-shadow(0 22px 26px rgba(0, 0, 0, 0.42));
}

.conveyor-start-visual {
  position: relative;
  z-index: 2;
  flex: 1 0 400px;
  min-height: 400px;
  margin: 12px -24px 0;
  overflow: visible;
}

.conveyor-start-button {
  position: absolute;
  z-index: 3;
  top: auto;
  bottom: calc(18px + 10%);
  left: 50%;
  width: min(82%, 330px) !important;
  font-family: "Open Sans", system-ui, sans-serif;
  background: linear-gradient(140deg, var(--primary), var(--primary-dark));
  transform: translateX(-50%);
  isolation: isolate;
}

.conveyor-start-button::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: calc(var(--game-border-width) * -1);
  padding: var(--game-border-width);
  border-radius: inherit;
  background: linear-gradient(120deg, #ffffff, #ffffff, #45d9ff, #006fd4, #ffffff, #72e7ff, #ffffff);
  background-size: 300% 300%;
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 16px rgba(32, 193, 255, 0.82));
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: conveyor-border-orbit 3.2s linear infinite;
}

.conveyor-start-button:active {
  transform: translateX(-50%) scale(0.98);
}

@keyframes conveyor-border-orbit {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .conveyor-start::before,
  .conveyor-start-button,
  .conveyor-start-button::after,
  .conveyor-stat::before {
    animation: none;
  }
}

.conveyor-hud {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 150px;
  pointer-events: none;
}

.conveyor-stat,
.conveyor-tip {
  border: 1px solid rgba(164, 229, 255, 0.3);
  border-radius: 18px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(3, 20, 39, 0.88), rgba(7, 52, 77, 0.7));
  color: #ffffff;
  font-weight: 800;
  backdrop-filter: blur(14px);
  box-shadow: 0 0 24px rgba(0, 191, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.conveyor-stat {
  width: min(30vw, 150px);
  min-width: 118px;
  min-height: 54px;
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  line-height: 1;
  text-align: left;
  font-family: "Anton", Impact, sans-serif;
  background: linear-gradient(135deg, rgba(3, 17, 33, 0.9), rgba(10, 48, 70, 0.7));
  box-shadow: 0 8px 24px rgba(0, 8, 20, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
}

.conveyor-stat::before {
  content: none;
}

.conveyor-stat small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  font-family: "Anton", Impact, sans-serif;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.conveyor-stat strong {
  color: #ffffff;
  font-family: "Anton", Impact, sans-serif;
  font-size: 30px;
  font-weight: 400;
  text-shadow: 0 0 16px rgba(71, 219, 255, 0.38);
}

.conveyor-stat em {
  font-family: "Anton", Impact, sans-serif;
  margin-left: -8px;
  font-size: 16px;
  font-style: normal;
}

.conveyor-lane {
  position: absolute;
  top: 0;
  right: 18%;
  bottom: 0;
  left: 18%;
  z-index: 1;
  overflow: hidden;
  clip-path: none;
}

.conveyor-exit {
  position: absolute;
  z-index: 1;
  right: 7%;
  bottom: 5.5%;
  left: 7%;
  height: 76px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(73, 221, 255, 0.72);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(5, 29, 49, 0.72), rgba(1, 10, 22, 0.92));
  box-shadow: 0 0 28px rgba(0, 202, 255, 0.3), inset 0 0 30px rgba(0, 156, 220, 0.18);
}

.conveyor-exit::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(89, 218, 255, 0.25);
  border-radius: 14px;
  background: linear-gradient(90deg, transparent, rgba(45, 202, 255, 0.12), transparent);
}

.conveyor-exit span {
  position: relative;
  z-index: 1;
  color: #72e7ff;
  font-family: var(--font-text);
  font-size: 18px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-shadow: 0 0 16px rgba(72, 219, 255, 0.8);
}

.conveyor-exit.receiving {
  animation: exit-receive 540ms ease both;
}

.conveyor-exit.missed-positive {
  border-color: rgba(255, 91, 111, 0.9);
  box-shadow: 0 0 30px rgba(255, 91, 111, 0.46), inset 0 0 24px rgba(255, 91, 111, 0.18);
}

.exit-puff {
  position: absolute;
  z-index: 3;
  right: 50%;
  bottom: 13%;
  color: #ffb347;
  font-family: var(--font-text);
  font-size: 42px;
  line-height: 1;
  font-weight: 800;
  text-shadow: 0 0 18px currentColor;
  pointer-events: none;
  animation: exit-puff 540ms ease-out both;
}

.exit-puff.penalty {
  color: #ff5b6f;
}

.exit-puff.clear {
  color: #d7ff55;
  font-size: 28px;
}

.conveyor-lane.positive-hit::after,
.conveyor-lane.negative-hit::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  animation: lane-flash 360ms ease-out both;
}

.positive-screen-flow {
  position: fixed;
  z-index: 2;
  inset: -18%;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 18%, rgba(67, 255, 178, 0.52) 42%, rgba(190, 255, 226, 0.32) 51%, transparent 72%),
    radial-gradient(circle at 50% 55%, rgba(24, 235, 148, 0.48), transparent 52%);
  mix-blend-mode: screen;
  filter: blur(3px);
  animation: positive-screen-flow 900ms cubic-bezier(0.2, 0.72, 0.25, 1) both;
}

.negative-screen-flow {
  position: fixed;
  z-index: 2;
  inset: -12%;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 12%, rgba(255, 45, 76, 0.54) 44%, rgba(255, 148, 160, 0.3) 52%, transparent 76%),
    radial-gradient(circle at 50% 55%, rgba(255, 35, 68, 0.46), transparent 54%);
  mix-blend-mode: screen;
  filter: blur(2px);
  animation: negative-screen-flow 760ms ease-out both;
}

@keyframes positive-screen-flow {
  0% {
    opacity: 0;
    transform: translate3d(-14%, 7%, 0) scale(0.94) skewX(-5deg);
  }
  24% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(16%, -7%, 0) scale(1.08) skewX(-5deg);
  }
}

@keyframes negative-screen-flow {
  0% { opacity: 0; transform: translateX(0); }
  16% { opacity: 1; transform: translateX(-9px); }
  32% { transform: translateX(9px); }
  48% { transform: translateX(-6px); }
  64% { transform: translateX(6px); }
  100% { opacity: 0; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .positive-screen-flow,
  .negative-screen-flow {
    animation-duration: 240ms;
    transform: none;
  }
}

/* Juego 3 — Ser dueños del resultado */
.game-three-page {
  overflow: hidden;
  background: #07182c;
}

.game-three-page .app-header {
  z-index: 40;
  justify-content: center;
}

.game-three-page .ownership-game {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  color: #fff;
  user-select: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.34) 0%, rgba(0, 0, 0, 0.16) 28%, rgba(0, 0, 0, 0) 50%),
    linear-gradient(180deg, rgba(2, 14, 31, 0.08), rgba(2, 12, 25, 0.28)),
    url("../assets/fondo-duenos-resultado.jpg") center / cover no-repeat;
}

.game-three-page .ownership-game::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, transparent 38%, rgba(1, 9, 20, 0.2) 100%);
}

.ownership-start {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: min(calc(100% - 32px), 470px);
  height: min(715px, calc(100vh - 24px));
  min-height: 0;
  padding: 45px 24px 0;
  border: max(1px, calc(var(--game-border-width) * .35)) solid rgba(87, 220, 255, .52);
  border-radius: 32px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: center;
  background: linear-gradient(145deg, rgba(4,19,38,.9), rgba(8,38,64,.72));
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 0 42px rgba(0,186,255,.22), 0 28px 70px rgba(0,0,0,.48);
  backdrop-filter: blur(20px) saturate(1.25);
  isolation: isolate;
}

.ownership-start::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: calc(var(--game-border-width) * -1);
  padding: var(--game-border-width);
  border-radius: 36px;
  background: linear-gradient(120deg, #fff, #fff, #45d9ff, #006fd4, #fff, #72e7ff, #fff);
  background-size: 300% 300%;
  filter: drop-shadow(0 0 7px rgba(255,255,255,.95)) drop-shadow(0 0 16px rgba(32,193,255,.82));
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: conveyor-border-orbit 3.2s linear infinite;
}

.ownership-start-title {
  position: relative;
  z-index: 2;
  color: #fff;
  font-family: "Anton", Impact, sans-serif;
  font-size: 38px;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-shadow: 0 0 24px rgba(64,216,255,.5);
}

.ownership-start-rules {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 10px 0 -10px;
}

.ownership-start-rule {
  min-height: 116px;
  margin: 0;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
}

.ownership-start-rule + .ownership-start-rule { border-left: 1px solid rgba(114,231,255,.42); }

.ownership-start-rule span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #66f0c4;
  border-radius: 50%;
  color: #66f0c4;
  font-family: "Anton", Impact, sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 0 20px rgba(24,210,157,.38);
}

.ownership-start-visual {
  position: relative;
  z-index: 2;
  flex: 1 1 400px;
  min-height: 0;
  margin: 0 -24px;
  overflow: visible;
}

.ownership-guide {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  transform: scale(1.02);
  transform-origin: center bottom;
  filter: drop-shadow(0 22px 26px rgba(0,0,0,.42));
}

.ownership-start-button {
  position: absolute;
  z-index: 3;
  bottom: calc(18px + 10%);
  left: 50%;
  width: min(82%, 330px) !important;
  transform: translateX(-50%);
  font-family: "Open Sans", system-ui, sans-serif;
  isolation: isolate;
}

.ownership-start-button::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: calc(var(--game-border-width) * -1);
  padding: var(--game-border-width);
  border-radius: inherit;
  background: linear-gradient(120deg, #fff, #fff, #45d9ff, #006fd4, #fff, #72e7ff, #fff);
  background-size: 300% 300%;
  filter: drop-shadow(0 0 7px rgba(255,255,255,.95)) drop-shadow(0 0 16px rgba(32,193,255,.82));
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: conveyor-border-orbit 3.2s linear infinite;
}

.ownership-start-button:active { transform: translateX(-50%) scale(.98); }

@media (max-width: 620px) {
  .ownership-start {
    height: min(715px, calc(100vh - 28px));
    padding-top: 34px;
  }
  .ownership-start-title { font-size: 34px; }
  .ownership-start-rule { min-height: 104px; padding-inline: 10px; font-size: 14px; }
  .ownership-start-visual { flex-basis: 360px; min-height: 360px; }
  .ownership-guide { transform: scale(1.275); }
}

.ownership-board {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 360px));
  grid-template-rows: 1fr 230px;
  align-content: stretch;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 24px 20px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.34) 0%, rgba(0, 0, 0, 0.16) 28%, rgba(0, 0, 0, 0) 50%),
    linear-gradient(180deg, rgba(2, 14, 31, 0.08), rgba(2, 12, 25, 0.28)),
    url("../assets/fondo-duenos-resultado.jpg") center / cover no-repeat;
}

.ownership-screen-flow {
  position: absolute;
  z-index: 1;
  inset: -16%;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: blur(2px);
}

.ownership-screen-flow.is-correct {
  background:
    linear-gradient(115deg, transparent 12%, rgba(64, 255, 183, .46) 42%, rgba(213, 255, 236, .24) 52%, transparent 74%),
    radial-gradient(circle at 50% 48%, rgba(44, 244, 159, .42), transparent 54%);
  animation: ownership-positive-flow 900ms cubic-bezier(.2, .72, .25, 1) both;
}

.ownership-screen-flow.is-wrong {
  background:
    linear-gradient(110deg, transparent 12%, rgba(255, 40, 75, .52) 44%, rgba(255, 145, 158, .26) 52%, transparent 76%),
    radial-gradient(circle at 50% 50%, rgba(255, 35, 68, .42), transparent 56%);
  animation: ownership-negative-flow 760ms ease-out both;
}

.ownership-progress {
  position: absolute;
  z-index: 10;
  top: 14px;
  right: 28px;
  left: 28px;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 150px;
  pointer-events: none;
}

.ownership-stat {
  width: min(30vw, 150px);
  min-width: 118px;
  min-height: 54px;
  padding: 8px 18px;
  border: 1px solid rgba(164, 229, 255, .3);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(3, 17, 33, .9), rgba(10, 48, 70, .72));
  color: #fff;
  line-height: 1;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 8, 20, .3), inset 0 1px 0 rgba(255, 255, 255, .14);
}

.ownership-stat small {
  color: rgba(255, 255, 255, .68);
  font-family: "Anton", Impact, sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ownership-stat strong {
  font-family: "Anton", Impact, sans-serif;
  font-size: 30px;
  font-weight: 400;
  white-space: nowrap;
  text-shadow: 0 0 16px rgba(71, 219, 255, .38);
}

.ownership-stat em {
  font-size: 1em;
  font-style: normal;
  letter-spacing: .01em;
}

.ownership-choice {
  position: relative;
  z-index: 2;
  width: min(100%, 360px);
  height: min(150px, calc((100vh - 260px) / 4));
  min-height: 0;
  border: var(--game-border-width) solid currentColor;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(80, 219, 255, .86);
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease, background 180ms ease;
  background: linear-gradient(155deg, rgba(255, 255, 255, .96), rgba(237, 246, 255, .94));
  backdrop-filter: blur(10px);
  box-shadow: 0 22px 48px rgba(0,0,0,.28), 0 0 24px rgba(63, 210, 255, .28);
  overflow: hidden;
  isolation: isolate;
}

.ownership-choice::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -80% -25%;
  opacity: .2;
  transform: translateX(-58%) rotate(18deg);
  background: linear-gradient(90deg, transparent 35%, rgba(255,255,255,.22) 50%, transparent 65%);
  animation: ownership-choice-sheen 4.8s ease-in-out infinite;
}

.ownership-choice::after {
  content: none;
}

.ownership-board[data-drag-direction="left"] .ownership-choice-left,
.ownership-board[data-drag-direction="right"] .ownership-choice-right {
  transform: scale(1.015);
  filter: saturate(1.08) brightness(1.06);
}

.ownership-choice:hover {
  filter: saturate(1.08) brightness(1.06);
}

.ownership-choice-left {
  grid-column: 1;
  grid-row: 2;
  justify-self: end;
}

.ownership-choice-right {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
}

.ownership-choice strong {
  max-width: calc(100% - 24px);
  color: #092b61;
  font-family: "Anton", Impact, sans-serif;
  font-size: clamp(40px, 3.8vw, 60px);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  overflow-wrap: normal;
  word-break: keep-all;
  text-shadow: 0 0 12px rgba(80, 219, 255, .28);
}

.ownership-choice.is-long strong {
  font-size: clamp(21px, 2.25vw, 32px);
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

@keyframes ownership-choice-sheen {
  0%, 58%, 100% { transform: translateX(-58%) rotate(18deg); opacity: 0; }
  68% { opacity: .48; }
  82% { transform: translateX(58%) rotate(18deg); opacity: 0; }
}

.ownership-deck {
  position: absolute;
  z-index: 5;
  top: calc(50% - 115px);
  left: 50%;
  width: min(423px, calc(100vw - 48px));
  height: min(575px, calc(100vh - 315px));
  transform: translate(-50%, -50%);
  touch-action: none;
}

.ownership-card {
  position: absolute;
  inset: 0;
  border: var(--game-border-width) solid rgba(80, 219, 255, .74);
  border-radius: 34px;
  background: linear-gradient(155deg, #fff 0%, #edf4ff 100%);
  box-shadow: 0 28px 70px rgba(0,0,0,.38), 0 0 28px rgba(63, 210, 255, .32);
}

.ownership-card-shadow {
  pointer-events: none;
}

.ownership-card-shadow.shadow-1 {
  transform: translate(13px, 11px) rotate(2.2deg) scale(.985);
  opacity: .64;
}

.ownership-card-shadow.shadow-2 {
  transform: translate(-12px, 20px) rotate(-2.6deg) scale(.97);
  opacity: .32;
}

.ownership-card-active {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 72px clamp(30px, 4vw, 54px) 112px;
  color: #071d3e;
  text-align: left;
  cursor: grab;
  transition: transform 280ms cubic-bezier(.2,.8,.2,1), opacity 280ms ease;
  will-change: transform;
  isolation: isolate;
}

.ownership-card-active::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: calc(var(--game-border-width) * -1);
  border-radius: 37px;
  padding: var(--game-border-width);
  background: linear-gradient(120deg, #ffffff, #5de1ff, #0077d9, #ffffff, #72e7ff);
  background-size: 300% 300%;
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, .88)) drop-shadow(0 0 16px rgba(32, 193, 255, .68));
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: conveyor-border-orbit 3.2s linear infinite;
}

.ownership-card-active.is-dragging {
  cursor: grabbing;
  transition: none;
}

.ownership-area {
  position: absolute;
  top: 18px;
  left: clamp(30px, 4vw, 54px);
  max-width: calc(100% - 60px);
  margin: 0;
  padding: 10px 18px;
  border: 1px solid rgba(80, 219, 255, .42);
  border-radius: 20px;
  background: rgba(231, 247, 255, .82);
  color: #0b3d73;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.ownership-card-copy {
  width: 100%;
  margin: auto 0;
}

.ownership-situation-label {
  position: absolute;
  top: 28px;
  right: clamp(30px, 4vw, 54px);
  margin: 0;
  padding: 0;
  background: transparent;
  color: #60708a;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.ownership-card-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}

.ownership-card-title {
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.1;
}

.ownership-card-active p {
  width: 100%;
  margin: 0;
  color: #09234c;
  font-size: clamp(27px, 2.35vw, 34px);
  line-height: 1.12;
  font-weight: 600;
  line-height: 1.18;
}

.ownership-card-footer {
  position: absolute;
  right: 28px;
  bottom: 24px;
  left: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 18px;
  border-top: 1px dashed #a48aff;
  color: #60708a;
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
}

.ownership-card-footer span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.ownership-card-footer b {
  color: #4ccfff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.ownership-card-footer time {
  color: #092b61;
  font-family: "Anton", Impact, sans-serif;
  font-size: 22px;
}

.ownership-card-active.exit-left {
  transform: translateX(-130vw) rotate(-24deg) !important;
  opacity: 0;
}

.ownership-card-active.exit-right {
  transform: translateX(130vw) rotate(24deg) !important;
  opacity: 0;
}

.ownership-feedback {
  position: absolute;
  z-index: 1;
  inset: 0;
  border: var(--game-border-width) solid currentColor;
  border-radius: 34px;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(.96);
  font-family: "Anton", Impact, sans-serif;
  font-size: clamp(150px, 18vw, 245px);
  font-weight: 400;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 28px 70px rgba(0,0,0,.38), 0 0 34px currentColor;
}

.ownership-feedback.is-visible {
  animation: ownership-feedback 820ms ease both;
}

.ownership-feedback.is-correct {
  color: #68f1cf;
  background: linear-gradient(155deg, rgba(10, 176, 123, .94), rgba(2, 75, 57, .96));
  text-shadow: 0 0 34px rgba(68,255,203,.9), 0 3px 14px rgba(0,0,0,.35);
}

.ownership-feedback.is-wrong {
  color: #ff6881;
  background: linear-gradient(155deg, rgba(214, 36, 62, .96), rgba(91, 7, 25, .98));
  text-shadow: 0 0 34px rgba(255,54,93,.92), 0 3px 14px rgba(0,0,0,.35);
}

@keyframes ownership-feedback {
  0% { opacity: 0; transform: scale(.96); }
  18%, 74% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.03); }
}

@keyframes ownership-positive-flow {
  0% { opacity: 0; transform: translate3d(-12%, 6%, 0) scale(.94) skewX(-5deg); }
  24% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(14%, -6%, 0) scale(1.08) skewX(-5deg); }
}

@keyframes ownership-negative-flow {
  0% { opacity: 0; transform: translateX(0); }
  16% { opacity: 1; transform: translateX(-9px); }
  32% { transform: translateX(9px); }
  48% { transform: translateX(-6px); }
  64% { transform: translateX(6px); }
  100% { opacity: 0; transform: translateX(0); }
}

@media (max-width: 760px) {
  .ownership-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 1fr 176px;
    align-content: stretch;
    gap: 12px;
    padding: 0 12px 24px;
  }
  .ownership-choice { width: 100%; height: min(88px, calc((100vh - 240px) / 4)); border-radius: 22px; }
  .ownership-choice strong { font-size: clamp(28px, 9vw, 40px); writing-mode: initial; }
  .ownership-choice.is-long strong { font-size: clamp(18px, 5vw, 23px); line-height: 1.05; }
  .ownership-deck { top: calc(50% - 102px); width: min(380px, calc(100vw - 28px)); height: min(62vh, 540px, calc(100vh - 330px)); }
  .ownership-card-active { padding: 72px 24px 106px; }
  .ownership-area { top: 18px; left: 24px; max-width: calc(100% - 48px); }
  .ownership-card-active p { font-size: clamp(25px, 6.6vw, 31px); }
  .ownership-progress { top: 14px; right: 16px; left: 16px; width: auto; max-width: 620px; gap: 0; }
  .ownership-stat { width: min(31vw, 150px); min-width: 124px; gap: 4px; padding-inline: 10px; }
  .ownership-stat:first-child { flex-direction: column; }
  .ownership-stat small { font-size: 10px; letter-spacing: .04em; }
  .ownership-stat strong { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .ownership-card-active,
  .ownership-feedback.is-visible,
  .ownership-screen-flow { animation-duration: 120ms; transition-duration: 120ms; }
  .ownership-choice::before { animation: none; }
}

/* Juego 2 — Coraje para innovar */
.game-two-page {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(3, 12, 24, .38) 0%, rgba(3, 12, 24, .12) 42%, rgba(3, 12, 24, 0) 72%),
    url("../assets/juego-fondo-cajas3.jpg") center / cover fixed no-repeat;
}

.game-two-page .app-header {
  z-index: 40;
  justify-content: center;
}

.connections-game {
  --connections-darkness: linear-gradient(180deg, rgba(16, 31, 43, .42) 0%, rgba(3, 12, 23, .24) 32%, rgba(3, 12, 23, .08) 52%, rgba(3, 12, 23, 0) 72%);
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: auto;
  color: #fff;
  user-select: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.04) 1px, transparent 1px),
    var(--connections-darkness),
    url("../assets/juego-fondo-cajas3.jpg") center / cover fixed no-repeat;
  background-size: 46px 46px, 46px 46px, auto, cover;
}

.connections-game.is-playing {
  --connections-darkness: linear-gradient(180deg, rgba(3, 12, 23, .68), rgba(3, 12, 23, .52));
}

.connections-game.is-playing::before {
  opacity: .25;
}

.connections-game.is-playing::after {
  opacity: .34;
}

.connections-game::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .42;
  background:
    linear-gradient(90deg, transparent 0 calc(50% - 2px), rgba(114,231,255,.22) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 2px)),
    repeating-linear-gradient(115deg, transparent 0 58px, rgba(255,255,255,.04) 59px 60px);
}

.connections-game::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 44%, rgba(64, 216, 255, .24), transparent 28%),
    linear-gradient(100deg, transparent 0 33%, rgba(82, 223, 255, .16) 44%, transparent 56% 100%);
  mix-blend-mode: screen;
  animation: connections-ambient-scan 7s ease-in-out infinite;
}

.connections-start {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: min(calc(100% - 32px), 470px);
  height: min(715px, calc(100vh - 24px));
  min-height: 0;
  padding: 45px 24px 0;
  border: max(1px, calc(var(--game-border-width) * .35)) solid rgba(87,220,255,.52);
  border-radius: 32px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: center;
  background: linear-gradient(145deg, rgba(4,19,38,.9), rgba(8,38,64,.72));
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 0 42px rgba(0,186,255,.22), 0 28px 70px rgba(0,0,0,.48);
  backdrop-filter: blur(20px) saturate(1.25);
  isolation: isolate;
}

.connections-start::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: calc(var(--game-border-width) * -1);
  padding: var(--game-border-width);
  border-radius: 36px;
  background: linear-gradient(120deg, #fff, #fff, #45d9ff, #006fd4, #fff, #72e7ff, #fff);
  background-size: 300% 300%;
  filter: drop-shadow(0 0 7px rgba(255,255,255,.95)) drop-shadow(0 0 16px rgba(32,193,255,.82));
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: conveyor-border-orbit 3.2s linear infinite;
}

.connections-heading h1 {
  font-family: "Anton", Impact, sans-serif;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.connections-start-title {
  position: relative;
  z-index: 2;
  color: #fff;
  font-family: "Anton", Impact, sans-serif;
  font-size: 38px;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-shadow: 0 0 24px rgba(64,216,255,.5);
}

.connections-start-rules {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  margin-top: 4px;
}

.connections-start-rule {
  min-height: 132px;
  margin: 0;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
}

.connections-start-rule + .connections-start-rule { border-left: 1px solid rgba(114,231,255,.42); }

.connections-start-rule span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #66f0c4;
  border-radius: 50%;
  color: #66f0c4;
  font-family: "Anton", Impact, sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 0 20px rgba(24,210,157,.38);
}

.connections-start-visual {
  position: relative;
  z-index: 2;
  flex: 1 1 400px;
  min-height: 0;
  margin: 8px -24px 0;
  overflow: visible;
}

.connections-guide {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  transform: scale(1.18);
  transform-origin: center bottom;
  filter: drop-shadow(0 22px 26px rgba(0,0,0,.42));
}

.game-two-page .connections-guide {
  height: 112%;
  object-position: center bottom;
  transform: translateY(8%) scale(1.28);
  filter: drop-shadow(0 22px 26px rgba(0,0,0,.48)) drop-shadow(0 0 24px rgba(69,217,255,.28));
}

.connections-start-button {
  position: absolute;
  z-index: 3;
  bottom: calc(18px + 10%);
  left: 50%;
  width: min(82%, 330px) !important;
  transform: translateX(-50%);
  font-family: "Open Sans", system-ui, sans-serif;
  isolation: isolate;
}

.connections-start-button::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: calc(var(--game-border-width) * -1);
  padding: var(--game-border-width);
  border-radius: inherit;
  background: linear-gradient(120deg, #fff, #fff, #45d9ff, #006fd4, #fff, #72e7ff, #fff);
  background-size: 300% 300%;
  filter: drop-shadow(0 0 7px rgba(255,255,255,.95)) drop-shadow(0 0 16px rgba(32,193,255,.82));
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: conveyor-border-orbit 3.2s linear infinite;
}

.connections-start-button:active { transform: translateX(-50%) scale(.98); }

.connections-kicker {
  display: inline-flex;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(102,240,196,.16);
  color: #78f5cf;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.connections-board {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 24px));
  height: 100%;
  min-height: 680px;
  margin: 0 auto;
  padding: 0 0 24px;
  display: flex;
  align-items: flex-start;
}

.connections-hud {
  position: absolute;
  z-index: 10;
  top: 14px;
  right: 28px;
  left: 28px;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 150px;
  pointer-events: none;
}

.connections-stat {
  width: min(30vw, 150px);
  min-width: 118px;
  min-height: 54px;
  padding: 8px 18px;
  border: 1px solid rgba(164, 229, 255, .3);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(3, 17, 33, .9), rgba(10, 48, 70, .72));
  color: #fff;
  line-height: 1;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 8, 20, .3), inset 0 1px 0 rgba(255, 255, 255, .14);
}

.connections-stat small {
  color: rgba(255, 255, 255, .68);
  font-family: "Anton", Impact, sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.connections-stat strong {
  color: #ffffff;
  font-family: "Anton", Impact, sans-serif;
  font-size: 30px;
  font-weight: 400;
  white-space: nowrap;
  text-shadow: 0 0 16px rgba(71, 219, 255, .38);
}

.connections-stat em {
  font-size: 1em;
  font-style: normal;
  letter-spacing: .01em;
}

.connections-panel {
  position: relative;
  width: 100%;
  padding: 163px clamp(20px, 3vw, 34px) clamp(20px, 3vw, 34px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.connections-board.is-complete .connections-panel {
  max-width: 680px;
  margin: auto;
}

.connections-board.is-complete .connections-heading {
  display: block;
  margin-bottom: 20px;
  text-align: center;
}

.connections-board.is-complete .connections-heading > p {
  max-width: none;
  margin: 10px 0 0;
}

.connections-board.is-complete .connections-solved {
  margin-bottom: 18px;
}

.connections-board.is-complete .connections-message {
  min-height: 0;
  padding-top: 0;
  font-size: 18px;
  text-shadow: 0 0 18px rgba(120, 245, 207, .46);
}

.connections-heading {
  position: absolute;
  top: 60px;
  right: clamp(20px, 3vw, 34px);
  left: clamp(20px, 3vw, 34px);
  display: flex;
  min-height: 82px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  text-align: center;
}

.connections-heading h1 {
  max-width: none;
  margin: 0;
  color: white;
  font-size: clamp(30px, 4vw, 42px);
}

.connections-heading > p {
  max-width: 430px;
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: 14px;
  line-height: 1.35;
}

.connections-solved {
  display: grid;
  gap: 8px;
  width: min(100%, 68vh, 620px);
  margin-right: auto;
  margin-left: auto;
  margin-bottom: 8px;
}

.connections-group {
  position: relative;
  isolation: isolate;
  min-height: 68px;
  padding: 16px 24px;
  border: 0;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-align: center;
  overflow: hidden;
  background:
    linear-gradient(100deg, transparent 0 28%, rgba(255,255,255,.42) 42%, transparent 58% 100%),
    radial-gradient(circle at 50% 120%, rgba(var(--group-glow-rgb), .74), transparent 68%),
    linear-gradient(135deg, rgba(var(--group-glow-rgb), .62), rgba(3, 20, 39, .88));
  background-size: 220% 100%, auto;
  box-shadow:
    0 0 28px rgba(var(--group-glow-rgb), .58),
    0 0 72px rgba(var(--group-glow-rgb), .28),
    inset 0 0 24px rgba(var(--group-glow-rgb), .22),
    inset 0 1px rgba(255,255,255,.38);
  text-shadow: 0 0 14px rgba(var(--group-glow-rgb), .72);
  animation:
    connection-group-in 640ms cubic-bezier(.2,.72,.25,1) both,
    connection-group-scan 2.6s ease-in-out infinite;
}

.connections-group::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  padding: var(--game-border-width);
  border-radius: inherit;
  background: linear-gradient(110deg, #ffffff, #72e7ff, var(--group-glow), #1789c8, #ffffff);
  background-size: 300% 300%;
  filter: drop-shadow(0 0 7px rgba(255,255,255,.72)) drop-shadow(0 0 15px rgba(var(--group-glow-rgb),.72));
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: conveyor-border-orbit 3.2s linear infinite;
}

.connections-group strong {
  position: relative;
  z-index: 3;
  color: #ffffff;
  font-family: "Anton", Impact, sans-serif;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 400;
  line-height: .98;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.connections-group span {
  position: relative;
  z-index: 3;
  margin-top: 8px;
  color: rgba(255,255,255,.94);
  font-size: clamp(12px, 2vw, 15px);
  font-weight: 700;
  letter-spacing: .025em;
}

.connections-group.is-yellow { --group-glow: #ffd166; --group-glow-rgb: 255, 209, 102; }
.connections-group.is-green { --group-glow: #66f0c4; --group-glow-rgb: 102, 240, 196; }
.connections-group.is-blue { --group-glow: #45d9ff; --group-glow-rgb: 69, 217, 255; }
.connections-group.is-purple { --group-glow: #bf9cff; --group-glow-rgb: 191, 156, 255; }

.connections-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  justify-items: stretch;
  gap: 14px;
  width: min(100%, 68vh, 620px);
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.connections-grid.rows-3 { grid-template-rows: repeat(3, minmax(0, 1fr)); aspect-ratio: 4 / 3; }
.connections-grid.rows-2 { grid-template-rows: repeat(2, minmax(0, 1fr)); aspect-ratio: 2 / 1; }
.connections-grid.rows-1 { grid-template-rows: minmax(0, 1fr); aspect-ratio: 4 / 1; }

.connection-tile {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 24px 8px 10px;
  border: 1px solid rgba(221, 244, 255, .72);
  border-radius: 10px;
  background:
    linear-gradient(120deg, transparent 0 35%, rgba(114,231,255,.88) 45%, rgba(255,255,255,1) 50%, rgba(114,231,255,.62) 55%, transparent 65%),
    radial-gradient(circle at 50% 105%, rgba(0, 224, 255, .36), transparent 48%),
    linear-gradient(90deg, rgba(255,255,255,.24), transparent 22% 78%, rgba(0,0,0,.18)),
    linear-gradient(145deg, rgba(244,250,253,.98) 0%, rgba(169,193,207,.95) 50%, rgba(76,98,112,.98) 100%);
  background-size: 250% 100%, auto, auto, auto;
  color: #0a2232;
  font-size: clamp(12px, 2vw, 17px);
  font-weight: 850;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  cursor: pointer;
  box-shadow:
    0 16px 26px rgba(0,0,0,.34),
    0 0 28px rgba(68, 214, 255, .24),
    0 0 0 1px rgba(68,214,255,.1),
    inset 0 1px rgba(255,255,255,.78),
    inset 0 -14px 22px rgba(0,0,0,.1);
  transform: translateY(0);
  animation:
    crate-light-sweep 3.6s ease-in-out infinite,
    crate-glow-pulse 4.8s ease-in-out infinite;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.connection-tile::before {
  content: attr(data-crate-code);
  position: absolute;
  top: 7px;
  left: 8px;
  right: 8px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(10,34,50,.18);
  border-radius: 3px;
  background: rgba(255,255,255,.36);
  color: rgba(10,34,50,.58);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.connection-tile::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 10px;
  left: 12px;
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(87, 224, 255, .96), rgba(255,255,255,.9), rgba(87, 224, 255, .96), transparent);
  pointer-events: none;
  box-shadow: 0 0 16px rgba(87, 224, 255, .92);
  animation: crate-edge-pulse 2.6s ease-in-out infinite;
}

.connection-tile span {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 7px 5px;
  border: 0;
  border-radius: 5px;
  background: rgba(246,250,252,.34);
  box-shadow: inset 0 1px rgba(255,255,255,.45);
}

.connection-tile.is-selected::before {
  content: attr(data-order);
  position: absolute;
  top: 5px;
  right: 5px;
  left: auto;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #78f5cf;
  color: #073b43;
  font-family: "Anton", Impact, sans-serif;
  font-size: 12px;
  box-shadow: 0 0 12px rgba(120,245,207,.72);
}

.connection-tile:hover {
  border-color: #dff8ff;
  box-shadow:
    0 20px 30px rgba(0,0,0,.34),
    0 0 42px rgba(90, 229, 255, .48),
    0 0 0 1px rgba(255,255,255,.34),
    inset 0 1px rgba(255,255,255,.78),
    inset 0 -14px 22px rgba(0,0,0,.1);
}

.connection-tile.is-selected {
  transform: translateY(2px) scale(.98);
  border-color: #78f5cf;
  background:
    linear-gradient(120deg, transparent 0 38%, rgba(120,245,207,.74) 46%, rgba(255,255,255,.92) 50%, rgba(120,245,207,.5) 54%, transparent 62%),
    linear-gradient(90deg, rgba(255,255,255,.12), transparent 20% 80%, rgba(0,0,0,.2)),
    linear-gradient(145deg, #087a83, #0b506b);
  color: white;
  background-size: 220% 100%, auto, auto;
  box-shadow:
    0 12px 24px rgba(0,0,0,.3),
    0 0 34px rgba(66,240,207,.62),
    0 0 0 2px rgba(120,245,207,.2),
    inset 0 1px rgba(255,255,255,.2);
}

.connection-tile.is-selected span {
  border-color: rgba(255,255,255,.34);
  background: rgba(3,35,44,.24);
}

.connection-tile.is-final-correct {
  border-color: #66f0c4;
  color: #ffffff;
  background:
    linear-gradient(120deg, transparent 0 35%, rgba(255,255,255,.82) 48%, transparent 62%),
    linear-gradient(145deg, #22c982, #08744f 72%);
  background-size: 240% 100%, auto;
  box-shadow: 0 0 24px rgba(102,240,196,.8), 0 0 54px rgba(102,240,196,.38), inset 0 1px rgba(255,255,255,.7);
  transform: translateY(-4px) scale(1.025);
}

.connection-tile:nth-child(3n + 1) { animation-delay: -.8s; }
.connection-tile:nth-child(3n + 2) { animation-delay: -1.8s; }
.connection-tile:nth-child(4n) { animation-delay: -2.6s; }

.connections-message {
  min-height: 32px;
  padding-top: 10px;
  opacity: 0;
  color: #78f5cf;
  font-weight: 600;
  text-align: center;
  transition: opacity 160ms ease;
}

.connections-message.is-visible { opacity: 1; }
.connections-message.is-error { color: #ff8da0; }

.connections-controls {
  display: flex;
  justify-content: center;
}

.connections-submit {
  width: min(100%, 420px);
  min-height: 54px;
  position: relative;
  isolation: isolate;
}
.connections-submit span { margin-left: 10px; opacity: .62; font-size: 13px; }

.connections-submit {
  box-shadow: 0 0 28px rgba(69, 217, 255, .28), 0 16px 28px rgba(0, 93, 170, 0.25);
}

.connections-submit::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: calc(var(--game-border-width) * -1);
  padding: var(--game-border-width);
  border-radius: inherit;
  background: linear-gradient(120deg, #fff, #fff, #45d9ff, #006fd4, #fff, #72e7ff, #fff);
  background-size: 300% 300%;
  filter: drop-shadow(0 0 7px rgba(255,255,255,.95)) drop-shadow(0 0 16px rgba(32,193,255,.82));
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: conveyor-border-orbit 3.2s linear infinite;
}

.connections-submit:disabled {
  border: 1px solid rgba(255, 255, 255, .62);
  background: rgba(4, 35, 60, .34);
  color: rgba(255, 255, 255, .9);
  opacity: 1;
  cursor: not-allowed;
  box-shadow: 0 0 18px rgba(69, 217, 255, .16), 0 12px 24px rgba(0, 38, 75, .2);
}

.connections-submit:disabled::after {
  opacity: .52;
  filter: drop-shadow(0 0 4px rgba(255,255,255,.62)) drop-shadow(0 0 10px rgba(32,193,255,.48));
  animation-duration: 5.4s;
}

.connections-submit.is-wrong,
.connections-submit.is-wrong:hover {
  border-color: #ff9aa9;
  background: linear-gradient(140deg, #e92f4d, #9f1230);
  color: #ffffff;
  box-shadow: 0 0 30px rgba(255, 62, 91, .66), 0 14px 28px rgba(95, 0, 20, .36);
  animation: connections-button-no 420ms ease-in-out 2;
}

.connections-submit.is-wrong::after {
  background: linear-gradient(120deg, #ffffff, #ff8ca0, #e92f4d, #ffffff);
  animation-duration: .7s;
}

.connections-grid.is-wrong { animation: connections-shake 360ms ease; }

@keyframes connections-button-no {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px) rotate(-1deg); }
  40% { transform: translateX(8px) rotate(1deg); }
  60% { transform: translateX(-6px) rotate(-.6deg); }
  80% { transform: translateX(5px) rotate(.6deg); }
}

@keyframes connections-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-5px); }
}

@keyframes connection-group-in {
  0% { opacity: 0; transform: translateY(10px) scale(.94); filter: brightness(1.8); }
  58% { opacity: 1; transform: translateY(-2px) scale(1.03); filter: brightness(1.45); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: brightness(1); }
}

@keyframes connection-group-scan {
  0%, 35% { background-position: 130% 0, 0 0; }
  70%, 100% { background-position: -90% 0, 0 0; }
}

@keyframes crate-light-sweep {
  0%, 44% { background-position: 155% 0, 0 0, 0 0, 0 0; }
  72%, 100% { background-position: -75% 0, 0 0, 0 0, 0 0; }
}

@keyframes crate-glow-pulse {
  0%, 100% {
    box-shadow:
      0 16px 26px rgba(0,0,0,.34),
      0 0 24px rgba(68, 214, 255, .2),
      0 0 0 1px rgba(68,214,255,.1),
      inset 0 1px rgba(255,255,255,.78),
      inset 0 -14px 22px rgba(0,0,0,.1);
  }
  50% {
    box-shadow:
      0 16px 26px rgba(0,0,0,.34),
      0 0 38px rgba(68, 214, 255, .34),
      0 0 0 1px rgba(68,214,255,.18),
      inset 0 1px rgba(255,255,255,.78),
      inset 0 -14px 22px rgba(0,0,0,.1);
  }
}

@keyframes crate-edge-pulse {
  0%, 100% { opacity: .56; transform: scaleX(.78); }
  50% { opacity: 1; transform: scaleX(1); }
}

@keyframes connections-ambient-scan {
  0%, 100% { opacity: .38; transform: translateX(-4%); }
  50% { opacity: .72; transform: translateX(4%); }
}

@media (min-width: 761px) and (max-height: 780px) {
  .ownership-start {
    top: calc(50% + 30px);
    height: calc(100vh - 72px);
    padding-top: 34px;
  }

  .ownership-start-rule { min-height: 102px; }
}

@media (max-width: 620px) {
  .connections-start {
    height: min(715px, calc(100vh - 28px));
    padding-top: 34px;
  }
  .connections-start-title { font-size: 34px; }
  .connections-start-rule { min-height: 114px; padding-inline: 10px; font-size: 14px; }
  .connections-start-visual { flex-basis: 360px; }
  .connections-board { width: calc(100% - 16px); min-height: 720px; padding: 0 0 20px; align-items: flex-start; }
  .connections-panel { padding: 190px 10px 16px; border-radius: 0; }
  .connections-heading { top: 72px; right: 10px; left: 10px; min-height: 102px; margin: 0; display: flex; text-align: center; }
  .connections-heading > p { max-width: none; margin-top: 8px; font-size: 12px; }
  .connections-heading h1 { font-size: 31px; }
  .connections-hud { top: 14px; right: 16px; left: 16px; width: auto; max-width: 620px; gap: 0; }
  .connections-stat { width: min(31vw, 150px); min-width: 124px; gap: 4px; padding-inline: 10px; }
  .connections-stat:first-child { flex-direction: column; }
  .connections-stat small { font-size: 10px; letter-spacing: .04em; }
  .connections-stat strong { font-size: 20px; }
  .connections-grid { width: min(100%, 58vh); gap: 8px; padding: 2px; }
  .connections-solved { width: min(100%, 58vh); }
  .connection-tile { min-height: 0; padding: 22px 4px 8px; border-radius: 8px; font-size: clamp(9px, 2.7vw, 12px); box-shadow: 0 12px 18px rgba(0,0,0,.3), 0 0 18px rgba(68, 214, 255, .16), inset 0 1px rgba(255,255,255,.78); }
  .connection-tile::before { top: 5px; left: 5px; right: 5px; height: 15px; font-size: 8px; }
  .connection-tile span { padding: 5px 3px; }
  .connections-group { min-height: 70px; padding: 12px 10px; }
  .connections-group strong { font-size: clamp(24px, 8vw, 34px); }
  .connections-group span { margin-top: 5px; font-size: 10px; }
  .connections-controls { display: flex; }
  .connections-submit { width: min(100%, 320px); }
}

@media (prefers-reduced-motion: reduce) {
  .connections-grid.is-wrong,
  .connections-group { animation-duration: 100ms; }
  .connections-group::before { animation: none; }
  .connection-tile { animation: none; }
  .connections-game::after,
  .connections-submit::after { animation: none; }
}

.conveyor-lane.positive-hit::after {
  background: radial-gradient(circle at 50% 55%, rgba(215, 255, 85, 0.46), transparent 28%);
}

.conveyor-lane.negative-hit::after {
  background: rgba(255, 80, 56, 0.13);
  animation-name: lane-shake;
}

.conveyor-tip {
  position: absolute;
  top: 92px;
  left: 16px;
  right: 16px;
  bottom: auto;
  z-index: 3;
  text-align: center;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.35;
}

.falling-item {
  position: absolute;
  z-index: 2;
  top: -96px;
  width: 150px;
  height: 86px;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: #07192b;
  font-weight: 600;
  background: transparent;
  box-shadow: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  animation-name: item-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.falling-item-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 10px 10px rgba(0, 8, 20, 0.34));
}

.falling-item-label {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.falling-item-label {
  top: 31%;
  right: 18%;
  bottom: 29%;
  left: 24%;
  display: grid;
  place-items: center;
  margin: 0;
  font-family: "Kanit", sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  color: #ffffff;
  white-space: nowrap;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 15, 34, 0.74), 0 0 7px rgba(0, 15, 34, 0.28);
}

.falling-item-label.is-long,
.falling-item-label.is-very-long {
  right: 16%;
  left: 22%;
  font-size: 12px;
  line-height: 0.95;
  white-space: normal;
  text-wrap: balance;
}

.falling-item-label.is-very-long {
  font-size: 10px;
  line-height: 0.9;
}

.falling-item.hit {
  pointer-events: none;
}

.falling-item.collected {
  animation: collect-item 360ms ease-out both;
}

.falling-item.rejected {
  animation: reject-item 360ms ease-out both;
}

.tap-feedback {
  position: absolute;
  z-index: 4;
  width: 160px;
  height: 160px;
  margin: -80px 0 0 -80px;
  display: grid;
  place-items: center;
  font-size: 136px;
  font-weight: 400;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 0 32px currentColor;
  animation: tap-pop 620ms ease-out both;
}

@media (min-width: 700px) {
  .conveyor-lane {
    right: 22%;
    left: 22%;
  }

  .conveyor-start {
    width: min(520px, calc(100% - 48px));
  }

  .conveyor-hud {
    top: 14px;
    left: 28px;
    right: 28px;
    max-width: 620px;
    margin: 0 auto;
  }

  .conveyor-tip {
    left: 50%;
    right: auto;
    width: max-content;
    max-width: calc(100% - 40px);
    transform: translateX(-50%);
  }
}

.tap-feedback.positive {
  color: #66f0c4;
  background: transparent;
}

.tap-feedback.negative {
  color: #ff667b;
  background: transparent;
}

@keyframes item-fall {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(92vh);
  }
}

@keyframes exit-receive {
  0% { filter: brightness(1); transform: translateY(0); }
  35% { filter: brightness(2.1); transform: translateY(5px); }
  100% { filter: brightness(1); transform: translateY(0); }
}

@keyframes exit-puff {
  0% { opacity: 0; transform: translateY(8px) scale(0.7); }
  35% { opacity: 1; transform: translateY(-10px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-26px) scale(1.35); }
}

@keyframes tap-pop {
  0% {
    opacity: 0;
    transform: scale(0.65);
  }
  20% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(0.96);
  }
}

@keyframes collect-item {
  to {
    opacity: 0;
    transform: scale(1.62) rotate(8deg);
    filter: brightness(1.6);
  }
}

@keyframes reject-item {
  20%,
  60% {
    transform: translateX(-10px) rotate(-4deg);
  }
  40%,
  80% {
    transform: translateX(10px) rotate(4deg);
  }
  to {
    opacity: 0;
    transform: scale(0.78);
  }
}

@keyframes lane-flash {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes lane-shake {
  20%,
  60% { transform: translateX(-7px); }
  40%,
  80% { transform: translateX(7px); }
  to { opacity: 0; }
}

.result-card {
  margin: auto 0;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
}

.celebration {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 16px;
}

.score-big {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: var(--surface-soft);
}

.score-big strong {
  display: block;
  color: var(--primary);
  font-family: var(--font-title);
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
}

.footer-note {
  margin-top: auto;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 720px) {
  .app-shell {
    padding-block: 34px;
  }

  .screen {
    min-height: calc(100vh - 68px);
  }
}
.home-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  line-height: 0;
  cursor: pointer;
}

.home-logo-link img {
  display: block;
}

.home-logo-link .app-header-logo {
  max-width: none;
}

/* Responsive architecture -------------------------------------------------
   Mobile remains the visual baseline. Wider compositions are introduced only
   when their content has room, and component-specific changes use containers. */

:root {
  --page-gutter: clamp(14px, 4.6vw, 32px);
  --page-gutter-wide: clamp(24px, 4vw, 64px);
  --content-narrow: 480px;
  --content-reading: 720px;
  --content-wide: 1200px;
  --section-gap: clamp(16px, 2.2vw, 28px);
  --grid-gap: clamp(14px, 2vw, 24px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

html {
  min-width: 320px;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

img,
video,
svg {
  max-width: 100%;
}

button,
a {
  min-width: 0;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(0, 93, 170, .72);
}

p,
h1,
h2,
.button {
  overflow-wrap: break-word;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding-left: max(18px, var(--safe-left));
  padding-right: max(18px, var(--safe-right));
  padding-bottom: max(28px, var(--safe-bottom));
}

.screen {
  min-height: calc(100vh - 50px);
  min-height: calc(100dvh - 50px);
}

.progress-panel,
.game-card,
.ranking-board,
.ranking-user-card,
.result-card,
.conveyor-start,
.connections-start,
.ownership-start {
  container-type: inline-size;
}

.game-fullscreen-mode .app-shell,
.game-fullscreen-mode .inner-screen,
.game-fullscreen-mode .mock-zone.has-background,
.game-three-page .ownership-game,
.connections-game,
.game-result-page .inner-screen {
  min-height: 100vh;
  min-height: 100dvh;
}

.game-fullscreen-mode .app-header,
.game-result-page .app-header {
  top: max(12px, var(--safe-top));
  left: max(16px, var(--safe-left));
  right: max(16px, var(--safe-right));
}

.game-result-page .app-header {
  top: max(18px, var(--safe-top));
}

.game-result-page .result-card {
  max-height: calc(100dvh - max(24px, var(--safe-top)) - max(12px, var(--safe-bottom)));
}

@container (max-width: 335px) {
  .progress-header {
    align-items: flex-start;
    gap: 8px;
  }

  .progress-header h1 {
    white-space: normal;
    text-wrap: balance;
  }

  .home-rank-heading {
    flex: 0 0 auto;
  }

  .boarding-row {
    grid-template-columns: repeat(3, minmax(32px, .65fr)) minmax(112px, 1.7fr);
    gap: 5px;
  }

  .boarding-score {
    padding-inline: 7px;
    gap: 5px;
    font-size: 11px;
  }
}

@container (min-width: 540px) {
  .ranking-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ranking-tab {
    min-height: 58px;
    flex-direction: row;
  }
}

@media (max-width: 359px) {
  .app-shell {
    padding-left: max(14px, var(--safe-left));
    padding-right: max(14px, var(--safe-right));
  }

  .app-header {
    gap: 8px;
  }

  .app-header-logo {
    width: 116px;
  }

  .user-copy span {
    display: none;
  }

  .avatar {
    width: 38px;
    height: 38px;
  }

  .progress-header h1,
  .home-rank-heading strong {
    font-size: 25px;
  }

  .games-stage .game-list {
    width: calc(100% + 28px);
    margin-left: -14px;
  }

  .game-card {
    width: min(88%, 286px);
    padding-inline: 18px;
  }

  .game-card.has-long-art .game-card-art {
    margin-left: -18px;
    margin-right: -18px;
  }

  .game-card[data-position="left"] {
    transform: translateX(-50%) translateX(-42px) translateZ(-80px) scale(.88);
  }

  .game-card[data-position="right"] {
    transform: translateX(-50%) translateX(42px) translateZ(-80px) scale(.88);
  }

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

  .ranking-score {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 6px;
  }

  .ranking-medal {
    min-width: 76px;
    font-size: 38px;
  }

  .ranking-tab {
    padding-inline: 6px;
    font-size: 13px;
  }

  .game-result-page .result-card {
    width: calc(100% - 20px);
    padding-left: 18px;
    padding-right: 18px;
  }

  .game-result-page .result-card .actions {
    left: 18px;
    right: 18px;
  }

  .connections-stat,
  .ownership-stat {
    min-width: 0;
    width: min(33vw, 132px);
  }

  .conveyor-guide,
  .connections-guide,
  .ownership-guide {
    max-width: none;
  }
}

@media (max-height: 700px) {
  .conveyor-start,
  .connections-start,
  .ownership-start {
    top: calc(50% + max(20px, var(--safe-top)));
    height: calc(100dvh - max(58px, var(--safe-top)) - max(10px, var(--safe-bottom)));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .conveyor-start-visual,
  .connections-start-visual,
  .ownership-start-visual {
    min-height: 250px;
  }

  .conveyor-guide,
  .connections-guide,
  .ownership-guide {
    transform-origin: bottom center;
  }

  .game-result-page .result-card {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 34px;
  }

  .game-result-page .result-card .actions {
    position: sticky;
    bottom: 0;
    width: 100%;
    margin-top: auto;
    padding-top: 10px;
    padding-bottom: max(10px, var(--safe-bottom));
    background: linear-gradient(180deg, transparent, rgba(5, 22, 40, .96) 22%);
  }
}

@media (min-width: 640px) {
  .app-shell {
    width: min(100%, var(--content-reading));
    padding-left: max(var(--page-gutter), var(--safe-left));
    padding-right: max(var(--page-gutter), var(--safe-right));
  }

  .login-shell,
  .intro-video-shell,
  .game-fullscreen-mode .app-shell,
  .game-result-page .app-shell {
    width: 100%;
  }

  .inner-screen {
    gap: var(--section-gap);
  }

  .landing-content {
    width: min(100%, 540px);
  }

  .landing-hero h1 {
    font-size: clamp(52px, 8vw, 68px);
  }

  .intro-hero h1 {
    font-size: clamp(46px, 7vw, 64px);
  }

  .game-result-page .result-card {
    width: min(calc(100% - 48px), 540px);
  }

  .game-result-page .app-header {
    left: max(24px, var(--safe-left));
    right: max(24px, var(--safe-right));
  }
}

@media (min-width: 768px) {
  .app-shell {
    width: min(100%, 920px);
    max-width: none;
  }

  .ranking-page .app-shell {
    width: min(100%, 920px);
  }

  .ranking-page .ranking-board {
    container-type: inline-size;
  }

  .ranking-columns,
  .ranking-row {
    grid-template-columns: 64px minmax(0, 1fr) 110px;
  }

  .ranking-row {
    min-height: 68px;
    padding-inline: 18px;
  }

  .ranking-tabs {
    max-width: 560px;
    margin-inline: auto;
  }

  .game-result-page .result-card {
    width: min(calc(100% - 64px), 620px);
    padding-inline: clamp(34px, 5vw, 54px);
  }

  .game-result-page .result-card .lead,
  .game-result-page .result-card .result-value-message {
    max-width: 38ch;
  }

  .connections-board,
  .ownership-board {
    container-type: size;
  }
}

/* Index desktop: identidad arriba y dos columnas centradas debajo. */
@media (min-width: 768px) {
  .index-desktop-landing {
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    column-gap: clamp(28px, 5vw, 72px);
    align-items: start;
  }

  .index-desktop-landing .brand-logo-header {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .index-desktop-hero {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 0;
    display: grid;
    justify-items: center;
    gap: clamp(12px, 2vh, 20px);
  }

  .index-desktop-columns {
    grid-column: 1 / -1;
    grid-row: 3;
    width: fit-content;
    max-width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    column-gap: 0;
    justify-self: center;
    align-self: stretch;
    --index-column-overlap: clamp(12px, 2.4vw, 32px);
  }

  .index-desktop-image-column {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    align-self: stretch;
    flex: 0 0 auto;
  }

  .index-desktop-image-column .index-desktop-character {
    position: relative;
    inset: auto;
    width: min(100%, 720px);
    height: calc(100% + 1px);
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
    object-position: right bottom;
    align-self: flex-end;
    display: block;
    margin-bottom: -1px;
    transform: translateX(var(--index-column-overlap));
  }

  .index-desktop-qr-column {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-left: 0;
    position: relative;
    z-index: 2;
    transform: translateX(calc(-1 * var(--index-column-overlap)));
    flex: 0 0 auto;
  }

  .index-desktop-qr-column .index-qr-area {
    margin: 0;
  }

  .index-desktop-qr-column .desktop-qr-row {
    grid-template-columns: minmax(0, 230px);
    grid-template-rows: auto auto;
    gap: clamp(12px, 1.6vw, 18px);
    justify-items: start;
    text-align: left;
  }
}

/* Juego 1: dar aire al contador para separar con claridad el valor de la unidad. */
.game-one-page .conveyor-stat {
  width: min(36vw, 160px);
  min-width: 132px;
  gap: 10px;
}

.game-one-page .conveyor-stat em {
  margin-left: -2px;
}

@media (max-height: 760px) {
  .is-desktop-mobile-frame .game-one-page .conveyor-stat {
    width: min(38vw, 132px);
    min-width: 128px;
    padding-inline: 10px;
    gap: 8px;
  }
}

/* Vista de escritorio: el simulador vertical gana un 20% de ancho. */
@media (min-width: 768px) {
  .desktop-mobile-frame {
    width: min(518px, calc((100dvh - 40px) * .576));
  }
}

/* Juego 2: las dieciséis cajas acompañan el ancho nuevo del simulador. */
@media (max-height: 760px) {
  .is-desktop-mobile-frame .game-two-page .connections-grid {
    width: min(100%, 50.4dvh, 672px);
  }
}

/* Juego 2: zonas consecutivas, sin capas superpuestas. */
.game-two-page .connections-board {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(12px, 2dvh, 18px);
}

.game-two-page .connections-panel {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: clamp(12px, 1.8dvh, 16px);
  padding: 0;
  overflow: hidden;
}

.game-two-page .connections-heading {
  grid-row: 1;
  align-self: center;
  margin: 0;
}

.game-two-page .connections-boxes {
  grid-row: 2;
  min-height: 0;
  align-self: center;
  justify-self: stretch;
}

.game-two-page .connections-actions-zone {
  grid-row: 4;
  align-self: end;
  min-height: 0;
}

@media (max-width: 767px) {
  .index-desktop-landing {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
  }

  .index-desktop-columns {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .index-desktop-qr-column { order: 1; }
  .index-desktop-image-column { order: 2; width: 100%; min-height: 0; }
  .index-desktop-image-column .index-desktop-character {
    position: relative;
    width: min(142vw, 620px);
    height: auto;
    max-height: none;
    object-fit: contain;
  }
}

@media (min-width: 1024px) {
  body:not(.game-fullscreen-mode):not(.game-result-page):not(.intro-video-page) .app-shell {
    width: min(100%, var(--content-wide));
    padding: max(24px, var(--safe-top)) max(var(--page-gutter-wide), var(--safe-right)) max(28px, var(--safe-bottom)) max(var(--page-gutter-wide), var(--safe-left));
  }

  body:not(.game-fullscreen-mode):not(.game-result-page):not(.intro-video-page) .screen {
    min-height: calc(100dvh - 52px);
  }

  /* Login becomes a balanced split composition instead of scaling with 100vw. */
  .login-shell {
    overflow: clip;
  }

  .login-screen {
    display: grid;
    grid-template-columns: minmax(390px, .9fr) minmax(440px, 1.1fr);
    align-items: center;
    gap: clamp(24px, 4vw, 72px);
    min-height: calc(100dvh - max(48px, var(--safe-top)) - max(32px, var(--safe-bottom)));
  }

  .landing-content {
    width: 100%;
    max-width: 560px;
    margin: 0;
    padding: 0;
    justify-self: end;
  }

  .landing-content .brand-logo-header {
    justify-items: start;
  }

  .landing-content .app-logo {
    width: min(62%, 250px);
    justify-self: start;
  }

  .landing-hero {
    align-items: flex-start;
    text-align: left;
  }

  .landing-hero h1,
  .landing-hero .lead {
    max-width: 12ch;
  }

  .landing-hero .lead {
    max-width: 38ch;
  }

  .landing-bottom-image {
    width: min(52vw, 720px);
    max-width: 100%;
    max-height: calc(100dvh - max(32px, var(--safe-top)) - max(20px, var(--safe-bottom)));
    margin: auto 0 0;
    align-self: end;
    justify-self: start;
    object-fit: contain;
    transform: none;
  }

  /* Intro uses a reading column anchored to the available widescreen crop. */
  .intro-video-shell {
    padding: max(32px, var(--safe-top)) max(var(--page-gutter-wide), var(--safe-right)) max(32px, var(--safe-bottom)) max(var(--page-gutter-wide), var(--safe-left));
  }

  .intro-video-shell .screen {
    width: min(100%, var(--content-wide));
    margin-inline: auto;
    min-height: calc(100dvh - 64px);
  }

  .intro-video-page .brand-logo-header {
    justify-items: start;
  }

  .intro-video-page .app-logo {
    width: min(22vw, 250px);
    justify-self: start;
  }

  .intro-video-page .intro-hero {
    width: min(48%, 560px);
    margin: auto 0;
    align-items: flex-start;
    text-align: left;
  }

  .intro-video-page .intro-hero h1 {
    max-width: 11ch;
  }

  .intro-video-page .intro-hero .lead {
    max-width: 38ch;
  }

  .intro-video-page .intro-video-background {
    object-position: 62% center;
  }

  /* Result layouts use a wider, calmer card but preserve the mobile hierarchy. */
  .game-result-page .result-card {
    width: min(calc(100% - 96px), 680px);
    height: min(700px, calc(100dvh - 40px));
  }
}

@media (min-width: 1280px) {
  .login-screen {
    grid-template-columns: minmax(430px, .92fr) minmax(520px, 1.08fr);
  }

  .ranking-page .inner-screen {
    grid-template-columns: 360px minmax(0, 1fr);
  }
}

@media (hover: hover) and (pointer: fine) {
  .button:hover:not(:disabled) {
    filter: brightness(1.04);
  }

  .game-card[data-position="active"]:hover {
    filter: brightness(1.025);
  }
}

@media (pointer: coarse) {
  .button,
  .ranking-tab,
  .connection-tile,
  .ownership-choice {
    min-block-size: 48px;
  }
}

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

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

/* Visual QA remediation — 2026-09-07. Container thresholds match home.js. */
@media (min-width: 640px) {
  .home-page .app-shell { width: min(100%, var(--content-wide)); }
}
.games-stage { container: games / inline-size; }
.ranking-page .app-shell { container: ranking / inline-size; }
@container games (min-width: 600px) {
  /* Home changes from a mobile carousel to a scannable three-card grid. */
  body:not(.ranking-page) > .app-shell .games-stage {
    align-items: stretch;
  }

  body:not(.ranking-page) > .app-shell .game-list {
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: var(--grid-gap);
    overflow: visible;
    perspective: none;
    touch-action: auto;
  }

  body:not(.ranking-page) > .app-shell .game-card {
    position: relative;
    inset: auto;
    width: 100%;
    height: clamp(390px, calc(100dvh - 320px), 520px);
    aspect-ratio: auto;
    transform: none !important;
    opacity: 1;
    filter: none;
    cursor: default;
  }

  body:not(.ranking-page) > .app-shell .game-card[data-position] .button {
    opacity: 1;
  }

  body:not(.ranking-page) > .app-shell .game-card.has-long-art {
    grid-template-rows: minmax(230px, 1fr) auto auto;
  }

  body:not(.ranking-page) > .app-shell .game-card.has-long-art .game-card-art {
    min-height: 230px;
  }

  body:not(.ranking-page) > .app-shell .game-card h2 {
    font-size: clamp(24px, 2vw, 30px);
  }


}
@container games (min-width: 948px) {
  body.home-page > .app-shell .game-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container games (min-width: 600px) and (max-width: 947px) {
  body.home-page > .app-shell .game-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: calc((100% - var(--grid-gap)) / 2);
    justify-self: center;
  }
}
@container ranking (min-width: 960px) {
  /* Ranking becomes summary + independently scrollable board. */
  .ranking-page .app-shell {
    width: min(100%, var(--content-wide));
  }

  .ranking-page .inner-screen {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-items: start;
    column-gap: clamp(28px, 4vw, 56px);
    row-gap: 20px;
    min-height: calc(100dvh - 52px);
  }

  .ranking-page .app-header {
    grid-column: 1 / -1;
  }

  .ranking-hero {
    grid-column: 1;
    text-align: left;
  }

  .ranking-hero h1 {
    font-size: clamp(38px, 4vw, 54px);
    text-wrap: balance;
  }

  .ranking-user-card {
    grid-template-columns: 1fr auto;
  }

  .ranking-medal {
    grid-column: 1 / -1;
    justify-items: start;
  }

  .ranking-board {
    grid-column: 2;
    grid-row: 2 / 4;
    width: 100%;
    max-height: calc(100dvh - 132px);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    border-radius: 20px;
    background: rgba(2, 21, 39, .3);
    backdrop-filter: blur(8px);
  }

  .ranking-tabs {
    position: sticky;
    z-index: 3;
    top: 0;
    max-width: none;
    margin: 0;
    padding: 12px;
    background: rgba(2, 21, 39, .92);
    backdrop-filter: blur(12px);
  }

  .ranking-columns {
    position: sticky;
    z-index: 2;
    top: 82px;
    padding-inline: 18px;
    background: rgba(2, 21, 39, .92);
  }

  .ranking-page > .app-shell .actions {
    grid-column: 1;
    margin-top: 0;
  }


  .ranking-page .inner-screen { grid-template-rows: auto auto 1fr; }
  .ranking-page > .app-shell .actions { align-self: start; }
}
.user-copy strong, .user-copy span { white-space: normal; overflow-wrap: anywhere; }
.avatar { flex-shrink: 0; }
@media (max-width: 359px) {
  .user-copy span { display: block; font-size: 10px; }
  .app-header { align-items: center; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .login-screen { gap: 20px; }
  .landing-content { gap: 24px; padding-top: 12px; }
  .landing-bottom-image { width: 100%; max-height: max(220px, calc(100dvh - 480px)); transform: none; }
}

/* Game previews share the result-screen composition rules. */
.conveyor-start,
.connections-start,
.ownership-start {
  --game-start-gap: 16px;
  top: calc(50% + 26px);
  height: min(715px, calc(100dvh - 88px));
  min-height: 0;
  padding: 0;
  transform: translate(-50%, -50%);
  overflow: visible;
}

.conveyor-start {
  --game-start-art-height: min(112cqw, 60%);
}

.connections-start {
  --game-start-art-height: min(100cqw, 52%);
}

.ownership-start {
  --game-start-art-height: min(84.35cqw, 52%);
}

.conveyor-start .game-start-copy,
.connections-start .game-start-copy,
.ownership-start .game-start-copy {
  position: absolute;
  z-index: 3;
  top: 20px;
  right: 24px;
  bottom: calc(var(--game-start-art-height) + var(--game-start-gap));
  left: 24px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

.connections-start-title span {
  display: block;
}

.conveyor-rules,
.connections-start-rules,
.ownership-start-rules {
  margin: clamp(14px, 2.5vh, 26px) 0 0;
}

.conveyor-start-visual,
.connections-start-visual,
.ownership-start-visual {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--game-start-art-height);
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 0 0 31px 31px;
}

.conveyor-guide,
.connections-guide,
.game-two-page .connections-guide,
.ownership-guide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center top;
  transform: none;
}

.conveyor-start-visual {
  overflow: visible;
}

.conveyor-guide {
  right: auto;
  left: -25%;
  width: 150%;
  height: auto;
  object-fit: contain;
  object-position: center bottom;
}

.conveyor-start-button,
.connections-start-button,
.ownership-start-button {
  bottom: 18px;
}

@media (max-width: 359px), (max-height: 650px) {
  .conveyor-start,
  .connections-start,
  .ownership-start {
    --game-start-gap: 12px;
    top: calc(50% + 26px);
    height: calc(100dvh - 88px);
    padding: 0;
    overflow: visible;
  }

  .conveyor-start {
    --game-start-art-height: min(96cqw, 60%);
  }

  .conveyor-start .game-start-copy,
  .connections-start .game-start-copy,
  .ownership-start .game-start-copy {
    top: 12px;
    right: 14px;
    left: 14px;
  }

  .conveyor-start strong,
  .connections-start-title,
  .ownership-start-title {
    font-size: 30px;
  }

  .conveyor-rules,
  .connections-start-rules,
  .ownership-start-rules {
    margin-top: 14px;
  }

  .conveyor-guide {
    left: -14.5%;
    width: 129%;
  }

  .conveyor-start .conveyor-rule,
  .connections-start-rule,
  .ownership-start-rule {
    min-height: 94px;
    padding: 8px;
    gap: 6px;
    font-size: 13px;
  }

  .conveyor-rule span,
  .connections-start-rule span,
  .ownership-start-rule span {
    font-size: 28px;
  }

  .connections-start-rule span,
  .ownership-start-rule span {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .conveyor-start-button,
  .connections-start-button,
  .ownership-start-button {
    bottom: 12px;
  }
}

@media (min-height: 850px) {
  .conveyor-rules,
  .connections-start-rules,
  .ownership-start-rules {
    margin-top: 28px;
  }
}
@media (min-width: 1024px) {
  .intro-video-page { overflow-y: auto; }
  .intro-video-page .intro-video-background {
    left: 48%; width: 52%; object-fit: contain; object-position: center;
  }
  .intro-video-page .intro-hero {
    width: 44%; padding: 24px; border-radius: 24px;
    background: rgba(7, 22, 34, .96);
  }
}
@media (min-width: 1536px) and (min-height: 900px) {
  /* Uniform bounded scale preserves artwork, labels and hit areas together. */
  .conveyor-start, .connections-start, .ownership-start,
  .game-result-page .result-card { scale: 1.15; }
  .game-fullscreen-mode .app-header-logo,
  .game-result-page .app-header-logo { width: 190px; }
}
@media (max-width: 359px) and (max-height: 650px) {
  .game-result-page .result-card { padding-top: 30px; padding-bottom: 14px; }
  .game-result-page .result-game-character {
    position: relative; inset: auto; width: 100%; height: 130px; min-height: 130px; margin: 10px auto;
  }
  .game-result-page .result-card .actions { position: relative; inset: auto; flex-shrink: 0; margin-top: 0; }
  .game-result-page .result-card > * { flex-shrink: 0; }
}
@media (min-width: 433px) {
  .conveyor-start, .connections-start, .ownership-start {
    overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain;
  }
}
.intro-video-page.media-unavailable .intro-video-background { display: none; }
.intro-video-page.media-unavailable {
  background: #071622 url('../assets/saludandobaja.png') right bottom / auto 65% no-repeat;
}
@media (min-width: 1024px) {
  .intro-video-shell { width: 100%; max-width: none; }
  .intro-video-page .intro-hero h1 { font-size: clamp(40px, 4vw, 60px); overflow-wrap: normal; max-width: 100%; }
}
@media (min-width: 640px) {
  body.home-page > .app-shell {
    padding-inline: max(clamp(24px, 4vw, 48px), var(--safe-left));
  }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .login-screen { min-height: calc(100dvh - 68px); }
}
@media (min-width: 1536px) and (min-height: 900px) {
  .conveyor-start, .connections-start, .ownership-start {
    scale: none; transform: translate(-50%, -50%) scale(1.15);
  }
}
@media (max-width: 359px) and (max-height: 650px) {
  .game-result-page .result-card {
    margin-top: 62px; height: calc(100dvh - 80px); max-height: calc(100dvh - 80px);
    padding-top: 20px; scrollbar-gutter: stable;
  }
}

.result-scroll-hint { display: none; }
@media (max-width: 359px) and (max-height: 650px) {
  .result-scroll-hint { display: block; position: relative; z-index: 5; font-size: 12px; margin: 0 0 10px; color: #fff; }
}

/* iOS: rapid taps are actions, not double-tap zoom. Keep pinch and scrolling.
   Zero specificity preserves explicit drag gestures (touch-action: none).
   Apply to descendants too, including independently scrollable panels. */
:where(html, body, body *) {
  touch-action: manipulation;
}

/* Results: keep the brand outside the panel and balance the summary above art. */
.game-result-page .inner-screen {
  grid-template-rows: auto minmax(0, 1fr);
  place-items: stretch center;
  gap: 12px;
  padding: max(18px, var(--safe-top)) 0 max(12px, var(--safe-bottom));
}

.game-result-page .app-header {
  position: relative;
  inset: auto;
  min-height: 34px;
  justify-content: center;
}

.game-result-page .result-card {
  --result-art-height: min(382px, calc(68vw + 82px));
  --result-block-gap: 16px;
  align-self: center;
  height: min(608px, calc(100dvh - 100px));
  max-height: 608px;
}

.game-result-page .result-summary {
  position: absolute;
  z-index: 4;
  top: 22px;
  right: 24px;
  bottom: calc(var(--result-art-height) + var(--result-block-gap));
  left: 24px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.game-result-page .result-summary > :first-child {
  margin-top: 0;
}

.game-result-page.final-result .result-summary {
  bottom: calc(var(--result-art-height) + var(--result-block-gap));
}

.game-result-page .result-game-character,
.game-result-page .final-result-character,
.game-result-page.juego-2-result .result-game-character {
  right: 0;
  bottom: 82px;
  left: 0;
  width: 100%;
  max-width: none;
  height: var(--result-art-height);
  margin: 0;
  object-fit: cover;
  object-position: center top;
}

/* Let the artwork rest on the panel floor, behind the action area. */
.game-result-page.final-result .final-result-character {
  bottom: 0;
  height: var(--result-art-height);
  object-fit: cover;
  object-position: center top;
}

.game-result-page.juego-1-result .result-game-character {
  bottom: 0;
  height: var(--result-art-height);
}

.game-result-page.juego-2-result .result-game-character,
.game-result-page.juego-3-result .result-game-character {
  bottom: 0;
  height: var(--result-art-height);
}

@media (max-width: 359px), (max-height: 650px) {
  .game-result-page .inner-screen {
    gap: 8px;
    padding-top: max(10px, var(--safe-top));
    padding-bottom: max(8px, var(--safe-bottom));
  }

  .game-result-page .app-header {
    min-height: 28px;
  }

  .game-result-page .app-header-logo {
    width: 140px;
  }

  .game-result-page .result-card {
    --result-art-height: min(250px, 72vw);
    --result-block-gap: 12px;
    width: min(calc(100% - 20px), 470px);
    height: min(608px, calc(100dvh - 64px));
    margin: 0;
    padding: 10px 18px 12px;
    overflow-y: auto;
  }

  .game-result-page .result-summary,
  .game-result-page.final-result .result-summary {
    position: absolute;
    top: 10px;
    right: 18px;
    bottom: calc(var(--result-art-height) + var(--result-block-gap));
    left: 18px;
    min-height: 0;
  }

  .game-result-page .result-card h1 {
    font-size: 36px;
  }

  .game-result-page .score-big strong {
    font-size: 58px;
  }

  .game-result-page .result-game-character,
  .game-result-page .final-result-character,
  .game-result-page.juego-2-result .result-game-character {
    position: relative;
    inset: auto;
    width: calc(100% + 36px);
    max-width: none;
    height: 118px;
    min-height: 118px;
    margin: 2px -18px 6px;
    object-fit: cover;
    object-position: center top;
  }

  .game-result-page.final-result .final-result-character,
  .game-result-page.juego-1-result .result-game-character,
  .game-result-page.juego-2-result .result-game-character,
  .game-result-page.juego-3-result .result-game-character {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--result-art-height);
    min-height: 0;
    margin: 0;
  }

  .game-result-page .result-card .actions {
    position: absolute;
    right: 18px;
    bottom: 12px;
    left: 18px;
    width: auto;
    margin: 0;
  }

  .game-result-page .result-scroll-hint {
    display: none;
  }
}

/* Stable logo sizes by role: they no longer scale with the viewport. */
.brand-logo-header .app-logo {
  width: 220px;
  max-width: none;
}

.app-header-logo {
  width: 132px;
  max-width: none;
}

.app-header .home-logo-link {
  flex: 0 0 auto;
}

.game-result-page .app-header-logo,
.game-fullscreen-mode .app-header-logo {
  width: 150px;
  max-width: none;
}

/* Introduction: logo, compact message and a protected character zone. */
@media (max-width: 1023px) {
  .intro-video-shell {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: max(16px, var(--safe-top)) 18px 0;
  }

  .intro-video-shell .inner-screen {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: 60px auto minmax(0, 1fr);
    gap: 0;
  }

  .intro-video-page .brand-logo-header {
    align-content: start;
  }

  .intro-video-page .intro-hero {
    width: 100%;
    max-width: 540px;
    margin: clamp(12px, 2.4vh, 24px) auto 0;
  }

  .intro-video-page .intro-hero h1 {
    max-width: 12ch;
    margin-top: 0;
    font-size: clamp(36px, 9.5vw, 50px);
    line-height: .94;
  }

  .intro-video-page .intro-hero .lead {
    max-width: 32ch;
    margin-top: clamp(12px, 1.8vh, 18px);
    font-size: clamp(15px, 2.3vw, 17px);
    line-height: 1.42;
  }

  .intro-video-page .intro-hero .actions {
    margin-top: clamp(16px, 2.2vh, 22px);
  }

  .intro-video-page .intro-hero .button {
    min-height: 50px;
    padding-block: 12px;
  }

  .intro-image-zone {
    min-height: 0;
    pointer-events: none;
  }
}

@media (max-width: 390px) {
  .intro-video-page .intro-hero h1 {
    font-size: 36px;
  }

  .intro-video-page .intro-hero .lead {
    font-size: 15px;
  }

  .intro-video-page .intro-hero .button {
    min-height: 48px;
    padding: 11px 28px;
  }
}

@media (max-width: 359px) and (max-height: 650px) {
  .intro-video-page .intro-video-background {
    height: 125vh;
    height: 125dvh;
    object-position: center top;
  }

  .intro-video-page .intro-hero {
    margin-top: 8px;
  }

  .intro-video-page .intro-hero h1 {
    font-size: 32px;
  }

  .intro-video-page .intro-hero .lead {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.35;
  }

  .intro-video-page .intro-hero .actions {
    margin-top: 12px;
  }

  .intro-video-page .intro-hero .button {
    min-height: 44px;
    padding-block: 9px;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .intro-video-page .intro-hero h1 {
    max-width: 14ch;
    font-size: 50px;
  }
}

/* Desktop keeps the complete post-home journey in a true mobile viewport. */
.desktop-experience-shell {
  display: none;
}

@media (min-width: 768px) {
  body.desktop-framed {
    min-width: 768px;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
  }

  body.desktop-framed > :not(.desktop-experience-shell) {
    display: none !important;
  }

  body.desktop-framed .desktop-experience-shell {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(300px, 520px) auto;
    align-items: center;
    justify-content: center;
    gap: clamp(48px, 7vw, 120px);
    padding: 20px clamp(36px, 6vw, 96px);
    overflow: hidden;
    background:
      linear-gradient(145deg, rgba(4, 42, 54, .10), rgba(5, 24, 38, .16)),
      url("../assets/fondo.jpg") center / cover no-repeat;
  }

  .desktop-experience-copy {
    max-width: 500px;
    color: #fff;
  }

  .desktop-home-logo-link {
  display: inline-flex;
  width: fit-content;
  line-height: 0;
}

.desktop-home-logo-link img {
  display: block;
}

.desktop-experience-copy img {
    width: 220px;
    height: auto;
    margin-bottom: clamp(34px, 5vh, 64px);
  }

  .desktop-experience-copy h1 {
    max-width: 11ch;
    margin: 0;
    color: #fff;
    font-family: "Anton", Impact, sans-serif;
    font-size: clamp(48px, 5vw, 78px);
    font-weight: 400;
    line-height: .98;
    text-transform: uppercase;
    text-wrap: balance;
    text-shadow: 0 0 28px rgba(64, 216, 255, .28);
  }

  .desktop-experience-copy p {
    max-width: 30ch;
    margin-top: 24px;
    color: rgba(255, 255, 255, .78);
    font-size: clamp(17px, 1.4vw, 21px);
    line-height: 1.45;
  }

  .desktop-qr-area {
    display: grid;
    gap: 10px;
    margin-top: clamp(24px, 3.4vh, 34px);
  }

  .desktop-qr-row {
    display: grid;
    grid-template-columns: auto minmax(170px, 1fr);
    align-items: center;
    gap: clamp(18px, 2vw, 28px);
  }

  .desktop-qr-row p {
    max-width: 22ch;
    margin: 0;
  }

  .desktop-qr-area strong {
    color: rgba(255, 255, 255, .72);
    font-size: clamp(11px, .85vw, 13px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .02em;
  }

  .desktop-qr-placeholder {
    width: clamp(132px, 17vh, 184px);
    aspect-ratio: 1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .28);
  }

  .desktop-mobile-frame {
    width: min(432px, calc((100dvh - 40px) * .48));
    height: min(960px, calc(100dvh - 40px));
    overflow: hidden;
    border: max(1px, calc(var(--game-border-width) * .35)) solid rgba(151, 229, 255, .5);
    border-radius: clamp(24px, 3vh, 36px);
    background: #071622;
    box-shadow:
      0 0 0 1px rgba(255,255,255,.08) inset,
      0 0 48px rgba(38, 199, 244, .2),
      0 32px 80px rgba(0, 0, 0, .5);
  }

  .desktop-mobile-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #071622;
  }
}

.is-desktop-mobile-frame .game-fullscreen-mode .app-header {
  top: max(10px, var(--safe-top));
  min-height: 36px;
  justify-content: center;
  pointer-events: none;
}

.is-desktop-mobile-frame .game-fullscreen-mode .app-header-logo {
  width: 132px;
}

.is-desktop-mobile-frame .conveyor-hud,
.is-desktop-mobile-frame .connections-hud,
.is-desktop-mobile-frame .ownership-progress {
  top: max(62px, calc(var(--safe-top) + 58px));
}

.is-desktop-mobile-frame .conveyor-tip {
  top: max(124px, calc(var(--safe-top) + 120px));
}

.is-desktop-mobile-frame .intro-video-page .app-logo {
  width: 166px;
  max-width: none;
}

.is-desktop-mobile-frame .intro-video-page .brand-logo-header {
  align-content: start;
  min-height: 44px;
}

.is-desktop-mobile-frame .intro-video-page .intro-video-background {
  display: none;
}

.is-desktop-mobile-frame .intro-video-page {
  background:
    linear-gradient(180deg, rgba(0, 146, 176, .08), rgba(10, 166, 151, .12)),
    url("../assets/fondo.jpg") center / cover no-repeat;
}

.is-desktop-mobile-frame .intro-video-page::after {
  content: "";
  position: fixed;
  z-index: 0;
  right: -30%;
  bottom: -1%;
  left: -30%;
  height: 58%;
  background: url("../assets/saludandobaja-desk.png") center bottom / contain no-repeat;
  pointer-events: none;
}

.is-desktop-mobile-frame .intro-video-page .intro-hero {
  margin-top: clamp(8px, 1.7vh, 16px);
}

.is-desktop-mobile-frame .intro-video-page .intro-hero h1 {
  font-size: clamp(32px, 8.2vw, 42px);
}

.is-desktop-mobile-frame .intro-video-page .intro-hero .lead {
  font-size: 15px;
  line-height: 1.36;
}

.is-desktop-mobile-frame .intro-video-page .intro-hero .actions {
  margin-top: 14px;
}

.is-desktop-mobile-frame .home-page .game-list {
  height: min(54vh, 470px);
  min-height: 390px;
  transform: translateY(10px);
}

.is-desktop-mobile-frame .home-page .game-card {
  width: min(80%, 330px);
  height: 390px;
  aspect-ratio: auto;
  grid-template-rows: 202px minmax(74px, auto) 52px;
  gap: 10px;
  padding: 20px 20px 18px;
}

.is-desktop-mobile-frame .home-page .game-card.has-long-art {
  grid-template-rows: 202px minmax(74px, auto) 52px;
}

.is-desktop-mobile-frame .home-page .game-card.has-long-art .game-card-art {
  min-height: 202px;
  height: 202px;
  max-height: 202px;
  margin: -20px -20px 0;
}

.is-desktop-mobile-frame .home-page .game-card-body {
  overflow: visible;
}

.is-desktop-mobile-frame .home-page .game-card-body .lead {
  font-size: 13px;
  line-height: 1.34;
  max-width: 100%;
}

.is-desktop-mobile-frame .home-page .game-card > .button {
  align-self: end;
  height: 52px;
  min-height: 52px;
  padding: 10px 20px;
}

.is-desktop-mobile-frame .home-page .game-card-art.has-cover img {
  object-fit: cover;
  object-position: center bottom;
}

.is-desktop-mobile-frame .conveyor-start {
  --game-start-art-height: min(82cqw, 44%);
}

.is-desktop-mobile-frame .connections-start,
.is-desktop-mobile-frame .ownership-start {
  --game-start-art-height: min(70cqw, 38%);
}

.is-desktop-mobile-frame .game-two-page .connections-start {
  --game-start-art-height: min(95cqw, 54%);
}

.is-desktop-mobile-frame .conveyor-guide,
.is-desktop-mobile-frame .connections-guide,
.is-desktop-mobile-frame .ownership-guide {
  object-position: center 58%;
}

/* Juego 3: el arte vertical necesita conservar el rostro de Mía dentro del recorte. */
.ownership-guide {
  object-position: center 58%;
}

.is-desktop-mobile-frame .game-two-page .connections-guide {
  inset: 0 auto auto 50%;
  width: 112%;
  height: auto;
  object-fit: contain;
  object-position: center top;
  transform: translateX(-50%);
}

@media (min-width: 768px) {
  body:not(.desktop-framed) .login-shell {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    overflow: hidden;
  }

  body:not(.desktop-framed) .login-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    place-items: center;
    gap: 0;
    padding: max(26px, var(--safe-top)) max(24px, var(--safe-right)) 0 max(24px, var(--safe-left));
    position: relative;
    isolation: isolate;
  }

  body:not(.desktop-framed) .landing-content {
    width: min(100%, 760px);
    max-width: none;
    margin: 0 auto;
    padding: 0;
    display: grid;
    justify-items: center;
    gap: clamp(18px, 3.2vh, 38px);
    align-self: start;
    position: relative;
    z-index: 3;
  }

  body:not(.desktop-framed) .landing-content .brand-logo-header {
    justify-items: center;
  }

  body:not(.desktop-framed) .landing-content .app-logo {
    width: 250px;
    justify-self: center;
  }

  body:not(.desktop-framed) .landing-hero {
    align-items: center;
    text-align: center;
  }

  body:not(.desktop-framed) .landing-hero h1 {
    max-width: 10ch;
    margin: 0;
    font-size: clamp(50px, 6.5vw, 82px);
  }

  body:not(.desktop-framed) .landing-hero .lead {
    max-width: 43ch;
    margin-top: 16px;
  }

  body:not(.desktop-framed) .landing-hero .actions {
    margin-top: 22px;
  }

  body:not(.desktop-framed) .landing-bottom-image {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: -22px;
    width: min(96vw, 1040px);
    max-width: none;
    max-height: min(52vh, 560px);
    margin: 0;
    object-fit: contain;
    object-position: bottom center;
    transform: translateX(-50%);
    pointer-events: none;
  }
}

.is-desktop-mobile-frame .game-fullscreen-mode .app-header .home-logo-link,
.is-desktop-mobile-frame .intro-video-page .brand-logo-header .home-logo-link,
.is-desktop-mobile-frame .game-result-page .app-header .home-logo-link {
  pointer-events: auto;
}

.index-home-logo-link {
  display: inline-flex;
  width: fit-content;
  line-height: 0;
}

.index-home-logo-link .app-logo {
  display: block;
}

/* Juego 3 activo: separar contadores, card y botones en la vista vertical. */
@media (max-width: 760px) {
  .ownership-board {
    grid-template-rows: minmax(0, 1fr) 150px;
    padding: 0 12px 20px;
  }

  .ownership-progress {
    top: max(64px, calc(var(--safe-top) + 58px));
    right: 16px;
    left: 16px;
  }

  .ownership-deck {
    top: calc(50% - 34px);
    width: min(370px, calc(100vw - 28px));
    height: min(455px, calc(100dvh - 390px));
    min-height: 330px;
  }

  .ownership-card-active {
    padding: 62px 24px 96px;
  }

  .ownership-card-active p {
    font-size: clamp(22px, 5.65vw, 28px);
    line-height: 1.16;
  }

  .ownership-situation-label {
    top: 18px;
    right: 24px;
    font-size: 11px;
  }

  .ownership-card-footer {
    right: 24px;
    bottom: 20px;
    left: 24px;
    gap: 5px;
    padding-top: 14px;
    font-size: 12px;
  }

  .ownership-choice {
    height: min(112px, calc((100dvh - 680px) / 2 + 94px));
  }
}

@media (max-width: 380px), (max-height: 760px) {
  .ownership-deck {
    top: calc(50% - 22px);
    height: min(400px, calc(100dvh - 350px));
    min-height: 300px;
  }

  .ownership-card-active {
    padding: 56px 20px 86px;
  }

  .ownership-area {
    top: 14px;
    left: 20px;
    max-width: calc(100% - 40px);
    padding: 8px 14px;
    font-size: 11px;
  }

  .ownership-situation-label {
    top: 14px;
    right: 20px;
  }

  .ownership-card-active p {
    font-size: clamp(20px, 5.35vw, 25px);
    line-height: 1.14;
  }

  .ownership-card-footer {
    right: 20px;
    bottom: 16px;
    left: 20px;
    padding-top: 12px;
  }

  .ownership-card-footer time {
    font-size: 20px;
  }

  .ownership-choice {
    height: 84px;
  }

  .ownership-choice.is-long strong {
    font-size: clamp(16px, 4.6vw, 20px);
  }
}

/* Apertura juego 3: PNG completo de Mía, con signos saliendo de la caja. */
.game-three-page .ownership-start-visual {
  overflow: visible;
}

.game-three-page .ownership-guide {
  inset: auto auto -3px 50%;
  width: 132%;
  height: auto;
  max-width: none;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
}

.is-desktop-mobile-frame .game-three-page .ownership-start {
  --game-start-art-height: min(82cqw, 43%);
}

.is-desktop-mobile-frame .game-three-page .ownership-start-visual {
  overflow: visible;
}

.is-desktop-mobile-frame .game-three-page .ownership-guide {
  inset: auto auto -3px 50%;
  width: 140%;
  height: auto;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
}

/* Aperturas de juegos: bloque compacto título + pasos + imagen, sin superposición. */
.is-desktop-mobile-frame .conveyor-start,
.is-desktop-mobile-frame .connections-start,
.is-desktop-mobile-frame .ownership-start {
  --game-start-gap: clamp(10px, 1.55vh, 15px);
}

.is-desktop-mobile-frame .conveyor-start .game-start-copy,
.is-desktop-mobile-frame .connections-start .game-start-copy,
.is-desktop-mobile-frame .ownership-start .game-start-copy {
  top: clamp(14px, 2vh, 20px);
  bottom: calc(var(--game-start-art-height) + var(--game-start-gap));
  justify-content: end;
  gap: 0;
}

.is-desktop-mobile-frame .conveyor-rules,
.is-desktop-mobile-frame .connections-start-rules,
.is-desktop-mobile-frame .ownership-start-rules {
  margin-top: clamp(8px, 1.35vh, 13px);
}

.is-desktop-mobile-frame .conveyor-start-visual,
.is-desktop-mobile-frame .connections-start-visual,
.is-desktop-mobile-frame .ownership-start-visual {
  top: auto;
  bottom: 0;
  height: var(--game-start-art-height);
}

.is-desktop-mobile-frame .conveyor-start-button,
.is-desktop-mobile-frame .connections-start-button,
.is-desktop-mobile-frame .ownership-start-button {
  bottom: 18px;
}

.is-desktop-mobile-frame .conveyor-start {
  --game-start-art-height: min(84cqw, 46%);
}

.is-desktop-mobile-frame .game-two-page .connections-start {
  --game-start-art-height: min(90cqw, 50%);
}

.is-desktop-mobile-frame .game-three-page .ownership-start {
  --game-start-art-height: min(82cqw, 43%);
}

.is-desktop-mobile-frame .game-three-page .ownership-guide {
  inset: auto auto 0 50%;
  width: auto;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
}

@media (max-height: 760px) {
  .is-desktop-mobile-frame .conveyor-start,
  .is-desktop-mobile-frame .connections-start,
  .is-desktop-mobile-frame .ownership-start {
    --game-start-gap: 8px;
  }

  .is-desktop-mobile-frame .conveyor-rules,
  .is-desktop-mobile-frame .connections-start-rules,
  .is-desktop-mobile-frame .ownership-start-rules {
    margin-top: 11px;
  }
}

/* Index desktop: la tercera fila absorbe la imagen completa sin ampliar la página. */
@media (min-width: 768px) {
  .index-desktop-landing {
    height: 100dvh;
    min-height: 0;
  }

  .index-desktop-character {
    width: min(92vw, 980px);
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
  }
}

/* Juego 1: override final para el formato de celular dentro de escritorio. */
@media (max-height: 760px) {
  .is-desktop-mobile-frame .game-one-page .conveyor-stat {
    width: min(38vw, 132px);
    min-width: 128px;
    padding-inline: 10px;
    gap: 8px;
  }

  .is-desktop-mobile-frame .game-one-page .conveyor-stat em {
    margin-left: -2px;
  }
}

/* Aperturas: el bloque título+pasos mide por contenido, sin área vacía superior. */
.is-desktop-mobile-frame .conveyor-start .game-start-copy,
.is-desktop-mobile-frame .connections-start .game-start-copy,
.is-desktop-mobile-frame .ownership-start .game-start-copy {
  bottom: auto;
  height: auto;
  max-height: calc(100% - var(--game-start-art-height) - var(--game-start-gap) - clamp(14px, 2vh, 20px));
  justify-content: start;
}

/* Solución de raíz: aperturas como grilla real, no capas absolutas independientes. */
.is-desktop-mobile-frame .conveyor-start,
.is-desktop-mobile-frame .connections-start,
.is-desktop-mobile-frame .ownership-start {
  --game-start-inner-x: 24px;
  --game-start-inner-top: clamp(24px, 3.6vh, 36px);
  --game-start-title-rule-gap: clamp(8px, 1.25vh, 12px);
  --game-start-copy-image-gap: clamp(8px, 1.25vh, 12px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  row-gap: var(--game-start-copy-image-gap);
  padding: var(--game-start-inner-top) 0 0;
  overflow: visible;
}

.is-desktop-mobile-frame .conveyor-start .game-start-copy,
.is-desktop-mobile-frame .connections-start .game-start-copy,
.is-desktop-mobile-frame .ownership-start .game-start-copy {
  position: relative;
  z-index: 3;
  inset: auto;
  height: auto;
  max-height: none;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: start;
  padding: 0 var(--game-start-inner-x);
}

.is-desktop-mobile-frame .conveyor-rules,
.is-desktop-mobile-frame .connections-start-rules,
.is-desktop-mobile-frame .ownership-start-rules {
  margin: var(--game-start-title-rule-gap) 0 0;
}

.is-desktop-mobile-frame .conveyor-start-visual,
.is-desktop-mobile-frame .connections-start-visual,
.is-desktop-mobile-frame .ownership-start-visual {
  position: relative;
  z-index: 2;
  inset: auto;
  align-self: end;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 0 0 31px 31px;
}

.is-desktop-mobile-frame .conveyor-start-visual {
  overflow: visible;
}

.is-desktop-mobile-frame .ownership-start-visual {
  overflow: visible;
}

.is-desktop-mobile-frame .conveyor-guide,
.is-desktop-mobile-frame .connections-guide,
.is-desktop-mobile-frame .ownership-guide {
  position: absolute;
  top: auto;
  right: auto;
  bottom: 0;
  left: 50%;
  width: auto;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
}

.is-desktop-mobile-frame .conveyor-guide {
  height: 112%;
}

.is-desktop-mobile-frame .game-two-page .connections-guide {
  height: 100%;
}

.is-desktop-mobile-frame .game-three-page .ownership-guide {
  height: 100%;
}

.is-desktop-mobile-frame .conveyor-start-button,
.is-desktop-mobile-frame .connections-start-button,
.is-desktop-mobile-frame .ownership-start-button {
  bottom: 18px;
}

@media (max-height: 760px) {
  .is-desktop-mobile-frame .conveyor-start,
  .is-desktop-mobile-frame .connections-start,
  .is-desktop-mobile-frame .ownership-start {
    --game-start-inner-top: 10px;
    --game-start-title-rule-gap: 7px;
    --game-start-copy-image-gap: 7px;
  }
}

/* Logo interno: centrado en el espacio entre el borde superior del celular y la caja del juego. */
.is-desktop-mobile-frame .game-fullscreen-mode .app-header {
  top: calc(((100dvh - min(715px, calc(100dvh - 88px))) / 4) + 13px - 18px);
  min-height: 36px;
  align-items: center;
  justify-content: center;
}

/* Juego 3 apertura: escala compacta solo cuando el navegador queda muy angosto. */
@media (max-width: 420px), (max-height: 760px) {
  .game-three-page.game-fullscreen-mode .app-header-logo {
    width: 118px;
  }

  .game-three-page .ownership-start {
    border-radius: 28px;
  }

  .game-three-page .ownership-start::before {
    border-radius: 32px;
  }

  .game-three-page .ownership-start-title {
    font-size: clamp(31px, 9vw, 36px);
    line-height: .98;
  }

  .game-three-page .ownership-start-rules {
    margin-top: 8px;
  }

  .game-three-page .ownership-start-rule {
    min-height: 92px;
    padding: 8px 10px;
    gap: 7px;
    font-size: 13px;
    line-height: 1.14;
  }

  .game-three-page .ownership-start-rule span {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .game-three-page .ownership-start-button {
    width: min(78%, 300px) !important;
    min-height: 52px;
    height: 52px;
    padding: 10px 18px;
    font-size: 15px;
    line-height: 1.05;
  }

  .is-desktop-mobile-frame .game-three-page .ownership-start {
    --game-start-inner-top: 10px;
    --game-start-title-rule-gap: 7px;
    --game-start-copy-image-gap: 7px;
  }
}

@media (max-width: 360px), (max-height: 680px) {
  .game-three-page.game-fullscreen-mode .app-header-logo {
    width: 108px;
  }

  .game-three-page .ownership-start-title {
    font-size: clamp(27px, 8.4vw, 32px);
  }

  .game-three-page .ownership-start-rule {
    min-height: 82px;
    font-size: 12px;
  }

  .game-three-page .ownership-start-button {
    min-height: 48px;
    height: 48px;
    font-size: 14px;
  }
}

/* Juego 3 apertura: responsive angosto real, sin solape entre pasos e imagen. */
@media (max-width: 760px) {
  .game-three-page .ownership-start {
    --ownership-compact-top: clamp(14px, 3.2vh, 24px);
    --ownership-compact-gap: clamp(8px, 1.6vh, 14px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    row-gap: var(--ownership-compact-gap);
    padding: var(--ownership-compact-top) 0 0;
  }

  .game-three-page .ownership-start .game-start-copy {
    position: relative;
    inset: auto;
    z-index: 3;
    height: auto;
    min-height: 0;
    padding: 0 22px;
  }

  .game-three-page .ownership-start-visual {
    position: relative;
    inset: auto;
    align-self: end;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    overflow: visible;
  }

  .game-three-page .ownership-guide {
    position: absolute;
    top: auto;
    right: auto;
    bottom: 0;
    left: 50%;
    width: auto;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center bottom;
    transform: translateX(-50%);
  }
}

/* Juego 1 y 2: misma lógica de apertura en responsive real. */
@media (max-width: 760px) {
  .game-one-page .conveyor-start,
  .game-two-page .connections-start {
    --game-mobile-start-top: clamp(14px, 3.2vh, 24px);
    --game-mobile-start-gap: clamp(8px, 1.6vh, 14px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    row-gap: var(--game-mobile-start-gap);
    padding: var(--game-mobile-start-top) 0 0;
    overflow: visible;
  }

  .game-one-page .conveyor-start .game-start-copy,
  .game-two-page .connections-start .game-start-copy {
    position: relative;
    inset: auto;
    z-index: 3;
    height: auto;
    min-height: 0;
    padding: 0 22px;
  }

  .game-one-page .conveyor-rules,
  .game-two-page .connections-start-rules {
    margin-top: clamp(8px, 1.35vh, 13px);
  }

  .game-one-page .conveyor-start-visual,
  .game-two-page .connections-start-visual {
    position: relative;
    inset: auto;
    align-self: end;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    overflow: visible;
  }

  .game-one-page .conveyor-guide,
  .game-two-page .connections-guide {
    position: absolute;
    top: auto;
    right: auto;
    bottom: 0;
    left: 50%;
    width: auto;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center bottom;
    transform: translateX(-50%);
  }

  .game-one-page .conveyor-guide {
    height: 112%;
  }
}

@media (max-width: 420px), (max-height: 760px) {
  .game-one-page.game-fullscreen-mode .app-header-logo,
  .game-two-page.game-fullscreen-mode .app-header-logo {
    width: 118px;
  }

  .game-one-page .conveyor-start strong,
  .game-two-page .connections-start-title {
    font-size: clamp(31px, 9vw, 36px);
    line-height: .98;
  }

  .game-one-page .conveyor-start .conveyor-rule,
  .game-two-page .connections-start-rule {
    min-height: 92px;
    padding: 8px 10px;
    gap: 7px;
    font-size: 13px;
    line-height: 1.14;
  }

  .game-one-page .conveyor-rule span,
  .game-two-page .connections-start-rule span {
    font-size: 18px;
  }

  .game-two-page .connections-start-rule span {
    width: 34px;
    height: 34px;
  }

  .game-one-page .conveyor-start-button,
  .game-two-page .connections-start-button {
    width: min(78%, 300px) !important;
    min-height: 52px;
    height: 52px;
    padding: 10px 18px;
    font-size: 15px;
    line-height: 1.05;
  }
}

@media (max-width: 360px), (max-height: 680px) {
  .game-one-page.game-fullscreen-mode .app-header-logo,
  .game-two-page.game-fullscreen-mode .app-header-logo {
    width: 108px;
  }

  .game-one-page .conveyor-start strong,
  .game-two-page .connections-start-title {
    font-size: clamp(27px, 8.4vw, 32px);
  }

  .game-one-page .conveyor-start .conveyor-rule,
  .game-two-page .connections-start-rule {
    min-height: 82px;
    font-size: 12px;
  }

  .game-one-page .conveyor-start-button,
  .game-two-page .connections-start-button {
    min-height: 48px;
    height: 48px;
    font-size: 14px;
  }
}

/* Index desktop: misma lógica vertical, imagen flexible apoyada abajo. */
@media (min-width: 768px) {
  .index-desktop-landing {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    align-items: start;
    justify-items: center;
    row-gap: clamp(12px, 2vh, 22px);
    padding: max(24px, var(--safe-top)) max(24px, var(--safe-right)) 0 max(24px, var(--safe-left));
    overflow: hidden;
  }

  .index-desktop-landing .brand-logo-header {
    position: relative;
    z-index: 4;
  }

  .index-desktop-hero {
    align-self: start;
    margin-top: 0;
    gap: clamp(10px, 1.7vh, 16px);
  }

  .index-desktop-hero h1 {
    font-size: clamp(48px, 7.4vw, 86px);
  }

  .index-desktop-character {
    position: relative;
    z-index: 2;
    left: auto;
    bottom: auto;
    align-self: end;
    width: min(92vw, 980px);
    height: 100%;
    max-height: none;
    object-fit: contain;
    object-position: bottom center;
    transform: none;
  }
}

@media (min-width: 768px) and (max-height: 760px) {
  .index-desktop-landing {
    row-gap: 8px;
    padding-top: max(16px, var(--safe-top));
  }

  .index-desktop-landing .app-logo {
    width: 180px;
  }

  .index-desktop-hero {
    gap: 8px;
  }

  .index-desktop-hero h1 {
    font-size: clamp(40px, 6.2vw, 68px);
  }

  .index-qr-area .desktop-qr-placeholder {
    width: clamp(76px, 8vw, 96px);
  }

  .index-qr-area p {
    font-size: 13px;
  }

  .index-desktop-hero .button {
    min-height: 48px;
    padding: 10px 22px;
  }
}


/* Index desktop: más aire entre logo, título, QR y botón; imagen sigue flexible. */
@media (min-width: 768px) {
  .index-desktop-landing {
    row-gap: clamp(18px, 3vh, 34px);
  }

  .index-desktop-hero {
    gap: clamp(18px, 2.7vh, 30px);
  }

  .index-qr-area {
    margin-top: clamp(2px, .6vh, 8px);
  }

  .index-desktop-hero .button {
    margin-top: clamp(2px, .7vh, 10px);
  }
}

@media (min-width: 768px) and (max-height: 760px) {
  .index-desktop-landing {
    row-gap: clamp(10px, 1.6vh, 16px);
  }

  .index-desktop-hero {
    gap: clamp(10px, 1.6vh, 16px);
  }
}

/* Juego 2 interno: pila real para evitar solapes entre HUD, título, cajas y botón. */
.game-two-page .connections-board {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(10px, 1.8vh, 16px);
  padding: max(72px, calc(var(--safe-top) + 68px)) clamp(12px, 3vw, 24px) max(18px, var(--safe-bottom));
}

.game-two-page .connections-hud {
  top: max(12px, var(--safe-top));
}

.game-two-page .connections-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: clamp(8px, 1.6vh, 14px);
  padding: 0;
}

.game-two-page .connections-heading {
  position: relative;
  inset: auto;
  min-height: 0;
  gap: clamp(5px, 1vh, 9px);
}

.game-two-page .connections-heading h1 {
  font-size: clamp(24px, 5.8vw, 38px);
  line-height: .98;
}

.game-two-page .connections-heading > p {
  font-size: clamp(12px, 2.7vw, 14px);
  line-height: 1.24;
}

.game-two-page .connections-solved {
  margin: 0 auto;
}

.game-two-page .connections-grid {
  align-self: center;
  width: min(100%, 58vh, 620px);
  max-height: 100%;
}

.game-two-page .connections-message {
  min-height: 22px;
  padding-top: 0;
}

.game-two-page .connections-controls {
  align-self: end;
}

@media (max-width: 760px), (max-height: 760px) {
  .game-two-page .connections-board {
    gap: 8px;
    padding: max(64px, calc(var(--safe-top) + 60px)) 12px max(14px, var(--safe-bottom));
  }

  .game-two-page .connections-hud {
    right: 16px;
    left: 16px;
    gap: 0;
  }

  .game-two-page .connections-stat {
    width: min(32vw, 128px);
    min-width: 0;
    min-height: 48px;
    padding: 7px 10px;
    gap: 6px;
  }

  .game-two-page .connections-stat small {
    font-size: 10px;
  }

  .game-two-page .connections-stat strong {
    font-size: 22px;
  }

  .game-two-page .connections-panel {
    gap: 8px;
  }

  .game-two-page .connections-heading h1 {
    font-size: clamp(22px, 6.2vw, 31px);
  }

  .game-two-page .connections-heading > p {
    font-size: 12px;
  }

  .game-two-page .connections-grid {
    gap: clamp(7px, 1.8vw, 10px);
    width: min(100%, 52vh, 560px);
  }

  .game-two-page .connection-tile {
    padding: 20px 6px 8px;
    font-size: clamp(10px, 2.85vw, 13px);
  }

  .game-two-page .connections-submit {
    min-height: 48px;
    font-size: 14px;
  }
}

/* Juego 2 interno: una sola columna real, del HUD al botón. */
.game-two-page .connections-board {
  box-sizing: border-box;
  height: 100dvh;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(10px, 1.5dvh, 16px);
  padding: max(68px, calc(var(--safe-top) + 64px)) clamp(12px, 3vw, 24px) max(14px, var(--safe-bottom));
  overflow: hidden;
}

.game-two-page .connections-hud {
  position: relative;
  inset: auto;
  width: min(100%, 620px);
  max-width: none;
  margin: 0 auto;
  flex: 0 0 auto;
}

.game-two-page .connections-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: clamp(8px, 1.25dvh, 13px);
  padding: 0;
  overflow: hidden;
}

.game-two-page .connections-heading {
  position: relative;
  inset: auto;
  min-height: 0;
  gap: clamp(5px, .8dvh, 9px);
}

.game-two-page .connections-heading > p {
  margin: 0;
}

.game-two-page .connections-boxes {
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1dvh, 10px);
  overflow: hidden;
}

.game-two-page .connections-solved {
  flex: 0 0 auto;
  width: min(100%, 620px);
  margin: 0 auto;
}

.game-two-page .connections-grid {
  flex: 0 1 auto;
  width: min(100%, 54dvh, 620px);
  max-height: 100%;
  margin: 0 auto;
}

.game-two-page .connections-message {
  min-height: 20px;
  padding: 0;
}

.game-two-page .connections-controls {
  align-self: auto;
  flex: 0 0 auto;
}

@media (max-width: 760px), (max-height: 760px) {
  .game-two-page .connections-board {
    gap: 7px;
    padding: max(62px, calc(var(--safe-top) + 58px)) 10px max(10px, var(--safe-bottom));
  }

  .game-two-page .connections-panel {
    gap: 6px;
  }

  .game-two-page .connections-heading {
    gap: 3px;
  }

  .game-two-page .connections-heading h1 {
    font-size: clamp(20px, 5.8vw, 28px);
  }

  .game-two-page .connections-heading > p {
    font-size: clamp(10px, 2.6vw, 12px);
    line-height: 1.2;
  }

  .game-two-page .connections-boxes {
    gap: 5px;
  }

  .game-two-page .connections-grid {
    width: min(100%, 48dvh, 560px);
    gap: clamp(5px, 1.5vw, 8px);
  }

  .game-two-page .connections-message {
    min-height: 16px;
    font-size: 11px;
  }

  .game-two-page .connections-submit {
    min-height: 44px;
  }
}

/* El aire vertical pertenece al título: queda centrado entre HUD y cajas. */
.game-two-page .connections-panel {
  grid-template-rows: minmax(min-content, 1fr) auto;
}

.game-two-page .connections-heading {
  align-self: stretch;
  justify-content: center;
}

.game-two-page .connections-heading > p span {
  display: block;
  white-space: nowrap;
}

.game-two-page .connections-playfield {
  flex: 0 0 auto;
  justify-content: flex-start;
  overflow: visible;
}

@media (max-width: 390px) {
  .game-two-page .connections-heading > p span {
    white-space: normal;
  }
}

.is-desktop-mobile-frame .game-two-page .connections-board {
  padding-top: max(104px, calc(var(--safe-top) + 100px));
}

/* Juego 2 interno: título y tablero con acciones como dos bloques consecutivos. */
.game-two-page .connections-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.game-two-page .connections-heading h1 {
  font-size: clamp(26px, 6.3vw, 40px);
}

.game-two-page .connections-heading > p {
  max-width: 510px;
  font-size: clamp(13px, 3vw, 16px);
  line-height: 1.28;
}

.game-two-page .connections-playfield {
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, 1.1dvh, 11px);
  overflow: hidden;
}

.game-two-page .connections-boxes {
  flex: 0 1 auto;
  justify-content: flex-start;
}

.game-two-page .connections-controls {
  width: 100%;
}

.game-two-page .connections-submit:disabled::after {
  opacity: .86;
  filter: drop-shadow(0 0 5px rgba(255,255,255,.78)) drop-shadow(0 0 13px rgba(32,193,255,.68));
}

@media (max-width: 760px), (max-height: 760px) {
  .game-two-page .connections-heading h1 {
    font-size: clamp(22px, 6.1vw, 30px);
  }

  .game-two-page .connections-heading > p {
    font-size: clamp(11px, 2.8vw, 13px);
  }

  .game-two-page .connections-playfield {
    gap: 6px;
  }
}

/* Centrado final del texto dentro del aire entre estadísticas y tablero. */
.game-two-page .connections-panel {
  grid-template-rows: minmax(min-content, 1fr) auto;
}

.game-two-page .connections-heading {
  align-self: stretch;
  justify-content: center;
}

.game-two-page .connections-heading > p span {
  display: block;
  white-space: nowrap;
}

.game-two-page .connections-playfield {
  flex: 0 0 auto;
  justify-content: flex-start;
  overflow: visible;
}

@media (max-width: 390px) {
  .game-two-page .connections-heading > p span {
    white-space: normal;
  }
}



/* Juego 2: cajas centradas en la pantalla y botón centrado en el hueco inferior. */
.game-two-page .connections-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0;
  padding: 0 clamp(10px, 3vw, 24px) max(10px, var(--safe-bottom));
  overflow: hidden;
  pointer-events: none;
}

.game-two-page .connections-heading {
  grid-row: 1;
  align-self: end;
  margin-bottom: clamp(12px, 2.4dvh, 24px);
  pointer-events: auto;
}

.game-two-page .connections-boxes {
  grid-row: 2;
  align-self: center;
  pointer-events: auto;
}

.game-two-page .connections-actions-zone {
  grid-row: 3;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 1dvh, 9px);
  pointer-events: auto;
}

.game-two-page .connections-message {
  flex: 0 0 auto;
}

.game-two-page .connections-controls {
  flex: 0 0 auto;
}

@media (max-height: 760px) {
  .game-two-page .connections-heading {
    margin-bottom: 8px;
  }

  .game-two-page .connections-actions-zone {
    justify-content: center;
    gap: 3px;
  }
}

/* Juego 2: los aciertos no crecen contra los bordes ni recortan su brillo. */
.game-two-page .connections-boxes {
  overflow: visible;
}

.game-two-page .connection-tile.is-final-correct {
  transform: translateY(-2px) scale(1);
}

@keyframes connection-group-in {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(.98);
    filter: brightness(1.8);
  }
  58% {
    opacity: 1;
    transform: translateY(-2px) scale(1);
    filter: brightness(1.45);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

/* Resultado: layout único y responsive por ancho real de card. */
html:has(body.game-result-page) {
  min-width: 0;
}

body.game-result-page {
  width: 100%;
  min-width: 0;
}

.game-result-page .app-shell {
  width: min(100%, 480px);
  max-width: none;
  padding: 0;
}

.game-result-page .inner-screen {
  --result-card-height: min(660px, calc(100dvh - 96px));
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
}

.game-result-page .app-header {
  position: absolute;
  z-index: 20;
  top: calc((100dvh - var(--result-card-height)) / 4);
  left: 0;
  right: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
}

.game-result-page .app-header-logo {
  width: clamp(118px, 34vw, 170px);
  max-width: calc(100% - 32px);
}

.game-result-page .result-card {
  --result-pad-x: clamp(16px, 5cqw, 34px);
  --result-pad-top: clamp(24px, 7cqw, 44px);
  --result-border-width: clamp(3px, 1.05cqw, 5px);
  --result-art-bleed: clamp(48px, 18cqw, 128px);
  --result-min-art: 150px;
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  display: grid;
  grid-template-rows: auto minmax(var(--result-min-art), 1fr);
  gap: clamp(6px, 2cqw, 12px);
  align-self: center;
  width: min(calc(100vw - 32px), 470px);
  height: var(--result-card-height);
  max-height: var(--result-card-height);
  min-width: 0;
  margin: 0 auto;
  padding: var(--result-pad-top) var(--result-pad-x) 0;
  border: 0;
  border-radius: clamp(26px, 7cqw, 34px);
  overflow: hidden;
  scrollbar-gutter: auto;
  scale: none;
  transform: none;
  transform-origin: center center;
}

.game-result-page .result-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: var(--result-border-width);
  border-radius: inherit;
  background: linear-gradient(120deg, #ffffff, #72e7ff, #1789c8, #ffffff, #45d9ff, #ffffff);
  background-size: 300% 300%;
  filter: drop-shadow(0 0 7px rgba(255,255,255,.68)) drop-shadow(0 0 14px rgba(32,193,255,.56));
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: conveyor-border-orbit 8s ease-in-out infinite;
}

.game-result-page .result-summary,
.game-result-page.final-result .result-summary {
  position: relative;
  z-index: 5;
  inset: auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  overflow: visible;
}

.game-result-page .result-summary > :first-child,
.game-result-page .result-summary h1,
.game-result-page .score-big,
.game-result-page .score-big strong,
.game-result-page .result-card .lead,
.game-result-page .result-card .result-value-message,
.game-result-page .result-ranking-link {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

.game-result-page .result-summary h1 {
  margin: 0;
  color: #ffffff;
  font-family: "Anton", Impact, sans-serif;
  font-size: clamp(28px, 10.2cqw, 58px);
  font-weight: 400;
  line-height: .96;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: 0 0 18px rgba(64, 216, 255, 0.28);
}

.game-result-page .score-big {
  margin-top: clamp(6px, 1.8cqw, 10px);
  padding: 0;
  background: transparent;
  text-align: center;
}

.game-result-page .score-big span {
  display: block;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.66);
  font-size: clamp(10px, 2.6cqw, 12px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-result-page .score-big strong {
  display: block;
  color: #ffffff;
  font-family: "Anton", Impact, sans-serif;
  font-size: clamp(44px, 15.6cqw, 98px);
  font-weight: 400;
  line-height: .94;
  white-space: nowrap;
  text-shadow: 0 0 20px rgba(89, 221, 255, 0.42);
}

.game-result-page .result-card .lead,
.game-result-page .result-card .result-value-message {
  max-width: min(31ch, 100%);
  margin: clamp(12px, 3.4cqw, 20px) auto 0;
  color: rgba(255, 255, 255, 0.84);
  font: 400 clamp(13px, 3.8cqw, 22px)/1.34 "Open Sans", system-ui, sans-serif;
  text-align: center;
}

.game-result-page .result-ranking-link {
  display: block;
  margin-top: clamp(8px, 2.6cqw, 14px);
  padding: 3px 0;
  color: rgba(255, 255, 255, 0.72);
  font: 400 clamp(13px, 3.2cqw, 18px)/1.25 "Open Sans", system-ui, sans-serif;
  text-align: center;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.game-result-page .result-game-character,
.game-result-page .final-result-character,
.game-result-page.juego-1-result .result-game-character,
.game-result-page.juego-2-result .result-game-character,
.game-result-page.juego-3-result .result-game-character,
.game-result-page.final-result .final-result-character {
  position: relative;
  z-index: 2;
  grid-row: 2;
  align-self: end;
  justify-self: center;
  inset: auto;
  display: block;
  width: auto;
  min-width: calc(100% + var(--result-art-bleed));
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0 calc(var(--result-art-bleed) / -2);
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
}

.game-result-page .result-card .actions {
  position: absolute;
  z-index: 6;
  right: var(--result-pad-x);
  bottom: clamp(14px, 4cqw, 30px);
  left: var(--result-pad-x);
  width: auto;
  min-width: 0;
  display: grid;
  gap: clamp(8px, 2.4cqw, 12px);
  margin: 0;
  padding: 0;
}

.game-result-page .result-card .button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.game-result-page .result-card .button.result-replay-button {
  min-height: clamp(54px, 14cqw, 78px);
  margin-inline: 0;
  padding: 8px clamp(12px, 4cqw, 24px);
}

.game-result-page .result-card .result-home-button {
  min-height: clamp(54px, 13.5cqw, 74px);
  padding: 8px clamp(12px, 4cqw, 24px);
  font-size: clamp(17px, 5.2cqw, 26px);
  line-height: 1.08;
}

.game-result-page .result-replay-title {
  display: block;
  max-width: 100%;
  font-size: clamp(17px, 5.2cqw, 26px);
  font-weight: 750;
  line-height: 1.08;
  text-align: center;
}

.game-result-page .result-replay-help {
  display: block;
  max-width: 100%;
  color: rgba(255, 255, 255, .76);
  font-size: clamp(11px, 3.2cqw, 14px);
  font-weight: 400;
  line-height: 1.18;
  text-align: center;
}

.game-result-page .result-card .result-home-button::before {
  inset: 0;
  padding: var(--result-border-width);
}

.game-result-page .result-scroll-hint {
  display: none;
}

@media (max-height: 700px) {
  .game-result-page .inner-screen {
    --result-card-height: min(620px, calc(100dvh - 72px));
  }
}

@media (max-width: 360px) {
  .game-result-page .result-card {
    width: min(calc(100vw - 18px), 470px);
  }
}

/* Resultado dentro del celular desktop: igual que aperturas, medir contra el iframe y no contra la página exterior. */
.is-desktop-mobile-frame .game-result-page .app-shell,
.is-desktop-mobile-frame .game-result-page .inner-screen {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.is-desktop-mobile-frame .game-result-page .inner-screen {
  --result-card-height: min(660px, calc(100dvh - 96px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}

.is-desktop-mobile-frame .game-result-page .result-card {
  --result-pad-x: clamp(16px, 5cqw, 24px);
  --result-pad-top: clamp(24px, 6cqw, 34px);
  --result-art-bleed: clamp(48px, 14cqw, 80px);
  width: min(calc(100% - 24px), 398px);
  height: var(--result-card-height);
  max-height: var(--result-card-height);
  margin: 0 auto;
  left: calc((100dvw - 100%) / 2);
  border-radius: clamp(26px, 7cqw, 32px);
}

.is-desktop-mobile-frame .game-result-page .app-header {
  top: calc((100dvh - var(--result-card-height)) / 4);
  left: 0;
  right: 0;
}

.is-desktop-mobile-frame .game-result-page .app-header-logo {
  width: clamp(112px, 32dvw, 152px);
}

.is-desktop-mobile-frame .game-result-page .result-summary h1 {
  font-size: clamp(28px, 8.4cqw, 40px);
}

.is-desktop-mobile-frame .game-result-page .score-big strong {
  font-size: clamp(48px, 13.2cqw, 66px);
}

.is-desktop-mobile-frame .game-result-page .result-card .lead,
.is-desktop-mobile-frame .game-result-page .result-card .result-value-message {
  max-width: 27ch;
  font-size: clamp(13px, 3.5cqw, 16px);
}

.is-desktop-mobile-frame .game-result-page .result-card .result-home-button,
.is-desktop-mobile-frame .game-result-page .result-replay-title {
  font-size: clamp(17px, 4.8cqw, 22px);
}

.is-desktop-mobile-frame .game-result-page .result-replay-help {
  font-size: clamp(11px, 3cqw, 13px);
}

.is-desktop-mobile-frame .game-result-page .result-card .actions {
  right: var(--result-pad-x);
  left: var(--result-pad-x);
}

@media (max-height: 760px) {
  .is-desktop-mobile-frame .game-result-page .inner-screen {
    --result-card-height: min(620px, calc(100dvh - 72px));
  }

  .is-desktop-mobile-frame .game-result-page .result-card {
    --result-pad-top: 22px;
  }
}

/* Resultados: dar más presencia y aire a la frase situada debajo del puntaje. */
.game-result-page .result-card .lead,
.game-result-page .result-card .result-value-message,
.is-desktop-mobile-frame .game-result-page .result-card .lead,
.is-desktop-mobile-frame .game-result-page .result-card .result-value-message {
  max-width: min(30ch, 100%);
  margin-top: clamp(24px, 6cqw, 34px);
  font-size: clamp(18px, 5.2cqw, 25px);
  line-height: 1.36;
}

/* QA desktop 1366x768: acomodar los juegos dentro del iframe de 347x726. */
@media (max-height: 760px) {
  .is-desktop-mobile-frame .game-one-page .conveyor-hud {
    right: 16px;
    left: 16px;
    gap: 0;
  }

  .is-desktop-mobile-frame .game-one-page .conveyor-stat {
    width: min(32vw, 112px);
    min-width: 108px;
    padding-inline: 9px;
    gap: 6px;
  }

  .is-desktop-mobile-frame .game-two-page .connections-grid {
    width: min(100%, 42dvh, 560px);
  }

  .is-desktop-mobile-frame .game-two-page .connections-board {
    padding-top: max(60px, calc(var(--safe-top) + 56px));
  }
}

/* Index desktop final: contener la imagen completa dentro del alto disponible. */
@media (min-width: 768px) {
  .index-desktop-landing {
    height: 100dvh;
    min-height: 0;
  }

  .index-desktop-character {
    width: min(92vw, 980px);
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
  }
}

/* Simulador desktop: ancho final común, 20% mayor que la medida original. */
@media (min-width: 768px) {
  .desktop-mobile-frame {
    width: min(518px, calc((100dvh - 40px) * .576));
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .index-desktop-columns {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
  }

  .index-desktop-image-column {
    width: 100%;
  }

  .index-desktop-image-column .index-desktop-character {
    width: 100%;
    transform: none;
  }

  .index-desktop-qr-column {
    transform: none;
  }

  body.desktop-framed .desktop-experience-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(20px, 3vw, 32px);
    padding-inline: clamp(16px, 3vw, 32px);
  }

  .desktop-experience-copy h1 {
    font-size: clamp(38px, 5vw, 52px);
  }

  .desktop-home-logo-link img {
    width: 180px;
    margin-bottom: clamp(18px, 3vh, 32px);
  }

  .desktop-qr-row {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
  }

  .desktop-qr-placeholder {
    width: 120px;
    margin-bottom: 0;
  }

  .desktop-mobile-frame {
    width: min(100%, calc((100dvh - 40px) * .576));
    height: auto;
    aspect-ratio: .576;
    max-height: calc(100dvh - 40px);
  }
}

/* Juego 2: estructura final de bloques consecutivos dentro del celular. */
.game-two-page .connections-board {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(12px, 2dvh, 18px);
}

.game-two-page .connections-panel {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(88px, 1fr) auto minmax(0, 1fr) auto;
  gap: clamp(12px, 1.8dvh, 16px);
  padding: 0;
  overflow: hidden;
}

.game-two-page .connections-title-zone {
  grid-row: 1;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-two-page .connections-title-zone .connections-heading {
  grid-row: auto;
  align-self: auto;
  width: 100%;
  margin: 0;
}

.game-two-page .connections-boxes {
  grid-row: 2;
  min-height: 0;
  align-self: center;
  justify-self: stretch;
}

.game-two-page .connections-actions-zone {
  grid-row: 4;
  align-self: end;
  min-height: 0;
}

@media (max-height: 760px) {
  .is-desktop-mobile-frame .game-two-page .connections-grid {
    width: min(100%, 50.4dvh, 672px);
  }
}

.game-two-page .connections-actions-zone {
  transform: translateY(-24px);
}

/* Juego 1: las cajas muestran solo el contenido; el número aparece al seleccionarlas. */
.game-two-page .connection-tile {
  padding-top: 8px;
}

.game-two-page .connection-tile::before {
  display: none;
}

.game-two-page .connection-tile.is-selected::before {
  display: grid;
}

.game-two-page .connection-tile.has-long-word {
  font-size: clamp(8px, 2.25vw, 10px);
}

.game-two-page .connection-tile span {
  overflow-wrap: normal;
  word-break: normal;
}

.game-two-page .connection-tile.is-single-word span {
  padding-right: 2px;
  padding-left: 2px;
  white-space: nowrap;
}

.game-two-page .connections-grid {
  flex: none;
  height: min(44dvh, 320px);
  aspect-ratio: auto;
}

.game-two-page .connections-grid.rows-3 { height: min(33dvh, 240px); }
.game-two-page .connections-grid.rows-2 { height: min(22dvh, 160px); }
.game-two-page .connections-grid.rows-1 { height: min(11dvh, 80px); }

.connections-submit.is-checking {
  animation: connections-button-check 380ms cubic-bezier(.2, .85, .3, 1);
  box-shadow: 0 0 34px rgba(112, 236, 255, .82), 0 16px 32px rgba(0, 114, 211, .42);
}

@keyframes connections-button-check {
  0% { transform: scale(1); filter: brightness(1); }
  45% { transform: scale(1.045); filter: brightness(1.45); }
  72% { transform: scale(.985); filter: brightness(1.12); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* Apertura de Coraje para innovar: Coco ocupa los dos laterales del marco. */
.is-desktop-mobile-frame .game-two-page .connections-start-visual {
  overflow: hidden;
}

.is-desktop-mobile-frame .game-two-page .connections-guide {
  top: 0;
  right: auto;
  bottom: auto;
  left: 50%;
  width: 112%;
  min-width: 112%;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center top;
  transform: translateX(-50%);
}

/* Controles propios de la integración PHP. */
.sso-debug {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}

.sso-debug h2 {
  margin-top: 0;
  font-size: 18px;
}

.sso-debug pre {
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.user-chip {
  position: relative;
}

.profile-trigger {
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.profile-trigger:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.audio-toggle {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  margin-left: auto;
  margin-right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(3, 48, 79, 0.72);
  color: #fff;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

.audio-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.profile-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  min-width: 154px;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0, 35, 64, .24);
}

.profile-menu[hidden] {
  display: none;
}

.profile-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.profile-menu a:hover,
.profile-menu a:focus-visible {
  background: #edf6fa;
}

@media (min-width: 1200px) and (min-height: 600px) and (max-height: 800px) {
  body.home-page > .app-shell {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  body.home-page > .app-shell .inner-screen {
    gap: 12px;
    min-height: calc(100dvh - 32px);
  }

  .home-page .progress-track {
    margin-top: 14px;
  }

  .home-page .boarding-row {
    margin-top: 8px;
  }

  body.home-page > .app-shell .game-card {
    height: clamp(340px, calc(100dvh - 290px), 460px);
    padding: 16px 18px;
    gap: 8px;
  }

  body.home-page > .app-shell .game-card.has-long-art {
    grid-template-rows: minmax(200px, 1fr) auto auto;
  }

  body.home-page > .app-shell .game-card.has-long-art .game-card-art {
    min-height: 200px;
    margin: -16px -18px 0;
  }

  body.home-page > .app-shell .game-card.has-long-art .game-card-header {
    top: 18px;
    right: 18px;
    left: 18px;
  }
}

.game-one-page.game-active .app-header-logo {
  width: clamp(88px, 31vw, 104px);
  max-width: none;
}

.game-one-page.game-active .conveyor-hud {
  top: max(14px, var(--safe-top));
  right: 12px;
  left: 12px;
  gap: 0;
}

.game-one-page.game-active .conveyor-stat {
  width: clamp(78px, 26vw, 98px);
  min-width: 0;
  min-height: 48px;
  padding: 6px 5px;
  gap: 3px;
}

.game-one-page.game-active .conveyor-stat small {
  font-size: 10px;
  letter-spacing: .03em;
}

.game-one-page.game-active .conveyor-stat strong {
  font-size: 25px;
}

.game-one-page.game-active .conveyor-stat em {
  margin-left: 0;
  font-size: 13px;
}

.game-one-page.game-active .conveyor-tip {
  top: max(78px, calc(var(--safe-top) + 70px));
  right: 16px;
  left: 16px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.game-three-page.game-active .ownership-choice {
  z-index: 6;
  pointer-events: auto;
}

.game-three-page.game-active .ownership-deck {
  pointer-events: none;
}

.game-three-page.game-active .ownership-card-active {
  pointer-events: auto;
}

/* Login: conservar proporciones y centrado en monitores grandes. */
@media (min-width: 1800px) and (min-height: 1000px) {
  .index-desktop-landing .brand-logo-header .app-logo {
    width: clamp(240px, 7vw, 340px);
  }

  .index-desktop-hero h1 {
    font-size: clamp(92px, 5vw, 138px);
  }

  .index-desktop-hero .button {
    min-height: clamp(58px, 3vw, 74px);
    padding: 14px clamp(30px, 2vw, 44px);
    font-size: clamp(16px, 1vw, 22px);
  }

  .index-desktop-image-column .index-desktop-character {
    width: min(48vw, 1440px);
    max-width: none;
  }

  .index-desktop-qr-column .desktop-qr-row {
    grid-template-columns: minmax(0, 320px);
  }

  .index-qr-area .desktop-qr-placeholder {
    width: clamp(120px, 4.2vw, 190px);
  }

  .index-qr-area p {
    font-size: clamp(16px, .6vw, 22px);
  }
}
