/* Local, dependency-free learning routes; all colors follow the shared theme. */
.games-invitation {
  display: flex;
  align-items: center;
  gap: 16px;
  border-block: 1px solid var(--line);
  padding: 16px 0;
  margin-bottom: 24px;
}
.games-invitation > span {
  color: var(--accent);
  font-size: 2rem;
}
.games-invitation p {
  flex: 1;
}
.games-invitation a {
  color: var(--accent);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.games-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.heat-game {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  background: var(--surface);
  min-width: 0;
  scroll-margin-top: 104px;
  overflow-wrap: anywhere;
}
.heat-game h3 {
  font-size: var(--type-h3);
  line-height: 1.25;
  margin: 8px 0 12px;
}
.game-intro {
  font-size: var(--type-small);
}
.game-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 12px;
  color: var(--muted);
  font-size: var(--type-small);
}
.game-progress span {
  flex: 1;
}
.game-progress progress {
  width: 84px;
  height: 6px;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--raised);
  accent-color: var(--accent);
}
.game-progress progress::-webkit-progress-bar {
  background: var(--raised);
}
.game-progress progress::-webkit-progress-value {
  background: var(--accent);
}
.game-progress progress::-moz-progress-bar {
  background: var(--accent);
}
.game-stage-title {
  font-size: 1.125rem;
  line-height: 1.35;
  margin: 0 0 12px;
}
.game-story {
  font-size: var(--type-body);
  line-height: 1.45;
}
.game-scene {
  width: 100%;
  height: auto;
  max-height: 184px;
  margin: 12px 0;
  background: var(--bg);
  border-radius: 12px;
}
.game-ground {
  stroke: var(--line);
  stroke-width: 2;
}
.game-vessel {
  fill: var(--raised);
  stroke: var(--muted);
  stroke-width: 2;
}
.game-insulation {
  fill: var(--raised);
  stroke: var(--green);
  stroke-width: 3;
  stroke-dasharray: 4 4;
}
.game-liquid {
  fill: var(--cool);
  opacity: 0.65;
  transition: fill 0.4s ease;
}
.game-scene.is-solved .game-liquid {
  fill: var(--accent);
}
.game-flow {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 9 5;
}
.game-label {
  fill: var(--muted);
  font:
    11px Manrope,
    sans-serif;
}
.game-energy,
.game-sun {
  fill: var(--accent);
}
.game-ice {
  fill: var(--cool);
  fill-opacity: 0.3;
  stroke: var(--cool);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center bottom;
}
.game-ice-line {
  fill: none;
  stroke: var(--cool);
  stroke-width: 1;
}
.game-puddle {
  fill: var(--cool);
  opacity: 0.55;
  transform-origin: center;
}
.game-bubble {
  fill: none;
  stroke: var(--bg);
  stroke-width: 2;
  animation: game-bubble-rise 2.4s ease-in infinite;
}
.game-heater {
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
}
.game-travel {
  animation: game-energy-flow 2s linear infinite;
}
.game-particle {
  animation: game-particle-vibrate 3.2s ease-in-out infinite;
}
.game-delay-0 {
  animation-delay: -0.4s;
}
.game-delay-1 {
  animation-delay: -1.2s;
}
.game-delay-2 {
  animation-delay: -2s;
}
.game-scene-ice.is-solved .game-ice {
  animation: game-ice-melt 7s ease-in-out infinite;
}
.game-scene-ice.is-solved .game-ice-line {
  opacity: 0.25;
}
.game-scene:hover .game-travel,
.heat-game:focus-within .game-travel {
  animation-duration: 1.4s;
}
.game-choices {
  display: grid;
  gap: 8px;
  margin: 16px 0 8px;
  min-width: 0;
}
.game-choices legend {
  font-size: var(--type-body);
  line-height: 1.45;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 12px;
  padding: 0;
  width: 100%;
}
.game-choice {
  text-align: left;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-size: var(--type-small);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.game-choice[aria-pressed="true"] {
  border-color: var(--accent);
}
.game-choice:disabled {
  opacity: 0.8;
}
.game-feedback {
  padding: 12px;
  border-left: 2px solid var(--accent);
  background: var(--bg);
  border-radius: 0 8px 8px 0;
  margin: 12px 0;
  color: var(--text);
  font-size: var(--type-small);
  line-height: 1.5;
}
.game-feedback.is-correct {
  border-color: var(--green);
}
.game-next {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-size: var(--type-small);
  min-height: 44px;
  margin: 4px 0 8px;
  max-width: 100%;
  white-space: normal;
}
.game-model-note {
  font-size: var(--type-small);
  line-height: 1.45;
  margin-top: 8px;
}
.game-evidence {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.game-evidence-label {
  grid-column: 1 / -1;
  font-size: var(--type-small);
}
.game-evidence button {
  min-height: 44px;
  font-size: var(--type-small);
  padding: 8px 12px;
}
.game-evidence-text {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: var(--type-small);
  color: var(--text);
}
.game-evidence button:nth-of-type(2) {
  grid-column: 2;
  grid-row: 2;
}
.game-takeaways {
  margin: 12px 0;
  padding-left: 20px;
  color: var(--text);
  font-size: var(--type-small);
  line-height: 1.5;
}
.game-takeaways li + li {
  margin-top: 8px;
}
.games-footnote {
  margin-top: 16px;
  font-size: var(--type-small);
  max-width: 80ch;
}
.games-bot-notice {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  font-size: var(--type-small);
}
.telegram-miniapp .games-bot-notice {
  display: none;
}
@keyframes game-energy-flow {
  to {
    stroke-dashoffset: -28;
  }
}
@keyframes game-particle-vibrate {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}
@keyframes game-bubble-rise {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-35px);
    opacity: 0;
  }
}
@keyframes game-ice-melt {
  0%,
  100% {
    transform: scale(1);
  }
  70% {
    transform: scale(0.8, 0.65);
  }
}
@media (max-width: 899px) {
  .games-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 479px) {
  .heat-game {
    padding: 16px;
  }
  .games-invitation {
    align-items: start;
    flex-wrap: wrap;
    gap: 8px 12px;
  }
  .games-invitation p {
    flex-basis: calc(100% - 40px);
  }
  .games-invitation a {
    margin-left: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) .game-scene * {
    animation: none !important;
    transition: none !important;
  }
}
.game-cloth {
  fill: var(--cool);
  fill-opacity: 0.4;
  stroke: var(--cool);
  stroke-width: 2;
}
.game-air {
  fill: none;
  stroke: var(--cool);
  stroke-width: 2;
  stroke-dasharray: 9 5;
}
.game-evaporating {
  fill: var(--cool);
  animation: game-bubble-rise 3.6s ease-in infinite;
}
.game-droplet {
  fill: var(--cool);
  animation: game-drop-form 4s ease-in-out infinite;
}
.game-reconsider .game-scene {
  outline: 1px dashed var(--accent);
  outline-offset: -1px;
}
@keyframes game-drop-form {
  0%,
  100% {
    opacity: 0.3;
  }
  60% {
    opacity: 1;
  }
}
