@font-face {
  font-family: "YS Geo";
  src: url("fonts/YS Geo-Thin.ttf") format("truetype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "YS Geo";
  src: url("fonts/YS Geo-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "YS Geo";
  src: url("fonts/YS Geo-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "YS Geo";
  src: url("fonts/YS Geo-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "YS Geo";
  src: url("fonts/YS Geo-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "YS Geo";
  src: url("fonts/YS Geo-Heavy.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "YS Geo";
  src: url("fonts/YS Geo-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --blue-bg: #00adff;
  --blue-dark: #3557cc;
  --blue-card: #4cc5ff;
  --blue-chip: #4cc5ff;
  --blue-accent: #3d59c7;
  --white: #ffffff;
  --orange: #ff6d2f;
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  font-family: "YS Geo", "Manrope", "Segoe UI", sans-serif;
  background: var(--blue-bg);
  color: var(--white);
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

strong {
  font-weight: 700;
}

.app {
  height: 100vh;
  min-height: 100dvh;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  overflow: hidden;
  background: var(--blue-bg);
  --success-card: var(--blue-dark);
}

.app[data-success="orange"] {
  --success-card: var(--orange);
}

.app[data-screen="fail"] {
  background: var(--blue-dark);
}

.topbar {
  position: absolute;
  top: 70px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 1;
}

.logo__img {
  width: 144px;
  height: auto;
}

.app[data-screen="intro"] .topbar,
.app[data-screen="start"] .topbar,
.app[data-screen="game"] .topbar,
.app[data-screen="success"] .topbar,
.app[data-screen="fail"] .topbar {
  display: none;
}

.screens {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 2;
  height: 100%;
}

.screen {
  display: none;
  width: 100%;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

.screen--intro,
.screen--start,
.screen--game,
.screen--success,
.screen--fail {
  padding: 0;
}

.app[data-screen="intro"] .screen--intro,
.app[data-screen="start"] .screen--start,
.app[data-screen="game"] .screen--game,
.app[data-screen="success"] .screen--success,
.app[data-screen="fail"] .screen--fail {
  display: block;
}

.app[data-screen="intro"] .screen--intro,
.app[data-screen="start"] .screen--start {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.app[data-screen="game"] .screen--game {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.app[data-screen="success"] .screen--success,
.app[data-screen="fail"] .screen--fail {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.card,
.game,
.result {
  width: 100%;
  max-width: 334px;
  margin: 0 auto;
}

.card {
  border-radius: var(--radius);
  padding: 34px 22px 30px;
  display: grid;
  gap: 16px;
  box-shadow: var(--shadow);
  text-align: center;
  min-height: 529px;
}

.card--intro {
  background: var(--blue-card);
  gap: 20px;
}

.card--start {
  background: var(--blue-dark);
  gap: 16px;
}

.card__logo {
  width: 144px;
  margin: 0 auto;
}

.card h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}

.card__lead {
  font-size: 16px;
  line-height: 1;
  margin: 0;
  font-weight: 500;
}

.rules {
  display: grid;
  gap: 16px;
  text-align: left;
}

.rule {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 16px;
  line-height: 1;
  font-weight: 400;
}

.rule__badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}

.cta {
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  margin: 6px 0 0;
}

.btn {
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 21px;
  border-radius: 999px;
  padding: 0 24px;
  line-height: 0.9;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn--ghost {
  background: #ffffff;
  color: var(--blue-accent);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.18);
}

.card .btn {
  width: 302px;
  max-width: 100%;
  margin: 0 auto;
}

.btn--ghost:active {
  transform: scale(0.98);
}

/* Game screen rebuilt from scratch */
.frame--game {
  position: relative;
  height: 812px;
  overflow: hidden;
}

.game-timer {
  position: absolute;
  top: 142.72px;
  left: calc(50% - 46px);
  width: 92px;
  height: 92px;
}

.game-timer__svg {
  position: absolute;
  left: -7.5px;
  top: -7.5px;
  width: 107px;
  height: 107px;
  transform: rotate(90deg) scaleX(-1);
  z-index: 5;
}

.game-timer__ring {
  fill: none;
  stroke: var(--blue-dark);
  stroke-width: 14.25;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s ease;
}

.game-timer__value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #ffffff;
  border-radius: 46px;
  font-size: 39.63px;
  font-weight: 800;
  line-height: 1;
  color: var(--blue-dark);
  z-index: 2;
}

.frame--game .frame-logo {
  display: block;
  z-index: 6;
}

.game-form {
  position: absolute;
  top: 274.72px;
  left: 20px;
  width: 336px;
}

.game-form input {
  width: 100%;
  height: 40px;
  padding: 10px 20px;
  border-radius: 30px;
  border: none;
  font-size: 16px;
  font-weight: 500;
  line-height: 0.9;
  font-family: inherit;
  background: #ffffff;
  color: #3b3b3b;
}

.game-form input::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

.game-form input:focus {
  outline: none;
}

.game-form input.input--error {
  background: var(--orange);
  color: #ffffff;
}

.game-form input.input--error::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.game-note {
  position: absolute;
  top: 324.72px;
  left: 20px;
  width: 300px;
  height: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  color: #ffffff;
  z-index: 6;
}

.frame--game #feedback {
  position: absolute !important;
  top: 324.72px !important;
  left: 20px !important;
  display: block !important;
  width: 300px !important;
  height: 16px !important;
  visibility: visible !important;
  z-index: 6 !important;
}

.game-note--bad {
  color: #ffffff;
}


.game-words-header {
  position: absolute;
  top: 355.72px;
  left: 20px;
  width: 336px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 21px;
  font-weight: 700;
  line-height: 0.9;
  color: #ffffff;
  z-index: 5;
}

.game-words-header span:last-child {
  opacity: 0.7;
  text-align: right;
}

.game-chips {
  position: absolute;
  top: 389.72px;
  left: 20px;
  width: 336px;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.game-chips .chip,
.game-chips li {
  background: var(--blue-card);
  color: #ffffff;
  padding: 10px 15px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 18px;
  line-height: 0.9;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.result {
  display: grid;
  gap: 16px;
  text-align: center;
  align-content: start;
}

.result h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.05;
}

.result__text {
  margin: 0;
  font-size: 16px;
  line-height: 1.1;
}

.result-card {
  margin: 12px auto 0;
  padding: 18px 24px;
  border-radius: 20px;
  width: min(300px, 100%);
  display: grid;
  gap: 6px;
  box-shadow: var(--shadow);
}

.result-card__label {
  font-size: 18px;
  font-weight: 700;
}

.result-card__value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
}

.result-card--success {
  background: var(--success-card);
}

.result-card--fail {
  background: var(--blue-bg);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.decor__arc {
  position: absolute;
  width: 430px;
  height: auto;
  left: -280px;
  top: -12px;
}

.decor__puck {
  position: absolute;
  width: 260px;
  height: auto;
  right: -12px;
  bottom: 8px;
}

.app[data-screen="intro"] .decor,
.app[data-screen="start"] .decor {
  display: none;
}

.frame {
  position: relative;
  width: 100%;
  max-width: 375.65px;
  height: 812px;
  background: var(--blue-bg);
  border-radius: 18.15px;
  overflow: hidden;
  font-family: "YS Geo", "Manrope", "Segoe UI", sans-serif;
  --frame-scale: 1;
  --frame-translate-x: 0px;
  --frame-translate-y: -20px;
}

@media (max-width: 430px) {
  .frame {
    --frame-offset: calc((100vw - 375.65px) / 2);
    max-width: none;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .frame-content {
    width: 375.65px;
    left: 50%;
    right: auto;
    --frame-translate-x: -50%;
  }

  .final-art {
    left: calc(-1 * var(--frame-offset));
  }

  .final-shadow {
    left: calc(118px - var(--frame-offset));
  }
}

@media (max-height: 820px) {
  .frame {
    --frame-scale: 0.96;
  }
}

@media (max-height: 780px) {
  .frame {
    --frame-scale: 0.92;
  }
}

@media (max-height: 740px) {
  .frame {
    --frame-scale: 0.88;
  }
}

@media (max-height: 700px) {
  .frame {
    --frame-scale: 0.84;
  }
}

.frame-content {
  position: absolute;
  inset: 0;
  transform: translate(var(--frame-translate-x), var(--frame-translate-y)) scale(var(--frame-scale));
  transform-origin: top center;
}

.ring {
  position: absolute;
  border: 8px solid #ffffff;
  border-radius: 9999px;
  opacity: 1;
}

.ring--start-1 {
  width: 851.63px;
  height: 255px;
  left: 1012.13px;
  top: 850.77px;
  transform: rotate(-180deg);
  transform-origin: top left;
}

.frame-logo {
  position: absolute;
  width: 213px;
  height: auto;
  left: 81px;
  top: 72px;
  z-index: 6;
}

.frame--game .frame-logo {
  display: block;
  z-index: 7;
}

.intro-title {
  position: absolute;
  top: 147px;
  left: 0;
  width: 376px;
  margin: 0;
  text-align: center;
  color: #ffffff;
  font-size: 35px;
  font-weight: 700;
  line-height: 0.9;
  z-index: 2;
}

.intro-subtitle {
  position: absolute;
  top: 201px;
  left: 30px;
  width: 316px;
  margin: 0;
  text-align: center;
  color: #ffffff;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  z-index: 2;
}

.intro-art {
  position: absolute;
  height: 347px;
  width: auto;
  left: 86px;
  top: 264px;
  z-index: 1;
}

.intro-note {
  position: absolute;
  left: 25px;
  width: 316px;
  top: 609px;
  margin: 0;
  text-align: center;
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  z-index: 2;
}

.btn--intro {
  position: absolute;
  width: 316px;
  height: 50px;
  left: 25px;
  top: 654px;
  background: #ffffff;
  color: var(--blue-dark);
  border-radius: 30px;
  font-size: 21px;
  font-weight: 800;
  line-height: 18.9px;
  box-shadow: none;
}

.start-logo {
  position: absolute;
  width: 213px;
  height: auto;
  left: 81px;
  top: 72px;
  z-index: 2;
}

.start-title {
  position: absolute;
  left: 0;
  top: 147px;
  margin: 0;
  width: 376px;
  text-align: center;
  color: #ffffff;
  font-size: 35px;
  font-weight: 700;
  line-height: 0.9;
  z-index: 2;
}

.start-panel {
  position: absolute;
  width: 316px;
  height: 386px;
  left: 30px;
  top: 203px;
  background: #ffffff;
  border-radius: 26px;
  z-index: 2;
}

.rule-box {
  position: absolute;
  left: 8px;
  width: 300.57px;
  background: var(--blue-dark);
  border-radius: 20.13px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  box-sizing: border-box;
}

.rule-box--1 {
  top: 8px;
  height: 160.75px;
}

.rule-box--2 {
  top: 173.5px;
  height: 108.43px;
}

.rule-box--3 {
  top: 286.69px;
  height: 91.31px;
}

.rule-box__text {
  margin: 0;
  color: #ffffff;
  font-size: 16.17px;
  font-weight: 400;
  line-height: 1;
}

.rule-box__text strong {
  font-weight: 700;
}

.start-cta {
  position: absolute;
  width: 316px;
  left: 30px;
  top: 626px;
  text-align: center;
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  line-height: 0.9;
  z-index: 2;
}

.btn--start {
  position: absolute;
  width: 316px;
  height: 50px;
  left: 30px;
  top: 654px;
  background: #ffffff;
  color: var(--blue-dark);
  border-radius: 30px;
  font-size: 21px;
  font-weight: 800;
  line-height: 18.9px;
  box-shadow: none;
}

.frame--game .game {
  position: absolute;
  left: 0;
  top: 140px;
  width: 375.65px;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 2;
}

.frame--game .timer-circle {
  width: 92.88px;
  height: 92.88px;
  margin: 0;
}

.frame--game .timer-circle__track {
  display: none;
}

.frame--game .timer-circle__ring {
  stroke: var(--blue-dark);
  stroke-width: 10;
  stroke-linecap: round;
}

.frame--game .timer-circle__value {
  inset: 8.4px;
  margin: 0;
  border-radius: 43.23px;
  font-size: 39.63px;
  font-weight: 800;
  line-height: 1;
  color: var(--blue-dark);
}

.frame--game .game__form {
  width: 336px;
}

.frame--game .game__form input {
  width: 100%;
  height: 40px;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 500;
  line-height: 0.9;
  outline: none;
}

.frame--game .game__form input:focus {
  outline: none;
}

.frame--game .game__form input::placeholder {
  color: #bebebe;
}

.frame--game .game__form input.input--error {
  background: var(--orange);
  color: #ffffff;
}

.frame--game .game__form input.input--error::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.frame--game .feedback {
  width: 300px;
  align-self: flex-start;
  margin: -10px 0 0 20px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  min-height: 0;
  text-align: left;
}

.frame--game .feedback:empty {
  display: none;
  margin: 0;
}

.frame--game .words-header {
  width: 100%;
  padding: 0 20px;
  font-size: 21px;
  font-weight: 700;
  line-height: 0.9;
  margin-top: 10px;
}

.frame--game .feedback:not(:empty) + .words-header {
  margin-top: 0;
}

.frame--game .words-header span:last-child {
  opacity: 0.7;
  line-height: 0.9;
  text-align: right;
}

.frame--game .chips {
  width: 100%;
  padding: 0 20px;
  gap: 5px;
}

.frame--game .chip {
  padding: 10px 15px;
  border-radius: 30px;
  background: var(--blue-card);
  font-size: 18px;
  font-weight: 800;
  line-height: 0.9;
}

.game-bottom {
  position: absolute;
  left: 0;
  top: 480px;
  width: 375.65px;
  height: 332.51px;
  background: transparent;
  z-index: 1;
  pointer-events: none;
}

.app[data-screen="game"] .decor {
  display: none;
}

.app[data-screen="success"] .decor__arc,
.app[data-screen="fail"] .decor__arc {
  display: none;
}

.app[data-screen="success"] .decor,
.app[data-screen="fail"] .decor {
  display: none;
}

.frame--success {
  background: var(--blue-bg);
}

.frame--fail {
  background: var(--blue-dark);
}

.ring--success {
  width: 978.54px;
  height: 293px;
  left: 1145.38px;
  top: 734px;
  transform: rotate(-180deg);
  transform-origin: top left;
}

.ring--fail {
  width: 978.54px;
  height: 293px;
  left: 1145.38px;
  top: 764px;
  transform: rotate(-180deg);
  transform-origin: top left;
}

.success-content,
.fail-content {
  position: absolute;
  top: 190px;
  left: 0;
  width: 375.65px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 2;
}

.success-content {
  gap: 25px;
}

.fail-content {
  gap: 20px;
}

.success-content h2,
.fail-content h2 {
  margin: 0;
  color: #ffffff;
  font-size: 36px;
  font-weight: 700;
  line-height: 32.4px;
}

.success-content p,
.fail-content p {
  margin: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  line-height: 16px;
}

.result-card {
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-card__text {
  text-align: center;
}

.result-card__label {
  display: block;
  color: #ffffff;
  font-size: 21px;
  font-weight: 700;
  line-height: 25.2px;
}

.result-card__value {
  display: block;
  color: #ffffff;
  font-size: 40px;
  font-weight: 700;
  line-height: 48px;
}

.frame--success .result-card {
  width: 224px;
  height: 110px;
  padding: 15px;
  border-radius: 15px;
  background: var(--blue-dark);
  margin: 0;
  box-shadow: none;
}

.frame--fail .result-card {
  position: absolute;
  left: 76px;
  top: 331px;
  width: 224px;
  height: 110px;
  padding: 15px;
  border-radius: 15px;
  background: var(--blue-bg);
  margin: 0;
  box-shadow: none;
  z-index: 2;
}

.puck-shadow--success {
  width: 180.31px;
  height: 71.43px;
  left: 118px;
  top: 556.88px;
}

.puck-base--success {
  width: 141.98px;
  height: 98px;
  left: 118px;
  top: 525.52px;
}

.puck-sign--success {
  width: 128.92px;
  height: 54.01px;
  left: 125.1px;
  top: 528.18px;
}

.puck-shadow--fail {
  width: 180.31px;
  height: 71.43px;
  left: 118px;
  top: 586.88px;
}

.puck-base--fail {
  width: 141.98px;
  height: 98px;
  left: 118px;
  top: 555.52px;
}

.puck-sign--fail {
  width: 128.92px;
  height: 54.01px;
  left: 125.1px;
  top: 558.18px;
}

@media (min-width: 768px) {
  .app {
    padding: 0;
  }

  .topbar {
    top: 80px;
  }

  .logo__img {
    width: 170px;
  }

  .card,
  .game,
  .result {
    max-width: 420px;
  }

  .card h1,
  .result h2 {
    font-size: 40px;
  }

  .card__lead,
  .result__text {
    font-size: 18px;
  }

  .timer-circle {
    width: 130px;
    height: 130px;
  }

  .timer-circle__value {
    font-size: 36px;
  }

  .decor__puck {
    width: 320px;
    bottom: 20px;
  }
}

@media (min-width: 1024px) {
  .card,
  .game,
  .result {
    max-width: 520px;
  }
}

/* Game logo + timer stacking fixes */
.frame-logo {
  z-index: 10;
  opacity: 1;
  pointer-events: none;
}

.frame--game .frame-logo {
  display: block !important;
  z-index: 10;
}

.game-timer__svg {
  z-index: 4;
}

.game-timer__value {
  z-index: 2;
}

/* Final screens (success / fail) rebuilt */
.final-title {
  position: absolute;
  left: 0;
  top: 147px;
  width: 376px;
  margin: 0;
  text-align: center;
  color: #ffffff;
  font-size: 35px;
  font-weight: 700;
  line-height: 0.9;
}

.final-subtitle {
  position: absolute;
  left: 0;
  top: 198px;
  width: 376px;
  margin: 0;
  text-align: center;
  color: #ffffff;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.final-subtitle--fail {
  width: 284px;
  left: calc(50% - 142px + 0.18px);
  top: 229px;
}

.final-card {
  position: absolute;
  left: 30px;
  top: 329px;
  width: 316px;
  height: 182px;
  border-radius: 25px;
  color: #ffffff;
}

.final-card--success {
  background: #3557cc;
}

.final-card--fail {
  background: #00adff;
}

.final-card__label {
  position: absolute;
  top: 23px;
  left: 0;
  width: 316px;
  text-align: center;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
}

.final-card--success .final-card__label {
  opacity: 0.9;
}

.final-card__value {
  position: absolute;
  top: 55px;
  left: 0;
  width: 316px;
  height: 127px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 90px;
  font-weight: 800;
  line-height: 1.2;
}

.final-shadow {
  position: absolute;
  width: 180.31px;
  height: 70.94px;
  left: 118px;
  top: 620.09px;
  z-index: 1;
  pointer-events: none;
}

.final-shadow--fail {
  top: 620.08px;
}

.final-art {
  position: absolute;
  height: 291px;
  width: auto;
  left: 0;
  top: 505px;
  z-index: 2;
  pointer-events: none;
  display: block;
}
