:root {
  --orange: #ff7a00;
  --orange-dark: #e35f00;
  --orange-soft: #fff1e4;
  --graphite: #171717;
  --graphite-soft: #2c2c2f;
  --muted: #767676;
  --line: #ececec;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  align-items: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 122, 0, 0.18), transparent 34%),
    linear-gradient(160deg, #0f0f10 0%, #242426 48%, #080808 100%);
  color: var(--graphite);
  display: flex;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  justify-content: center;
  min-height: 100vh;
  padding: 14px;
}

button,
input {
  font: inherit;
}

.app-shell {
  aspect-ratio: 9 / 16;
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 28px);
  max-width: min(100%, 430px);
  min-height: 640px;
  overflow: hidden;
  position: relative;
  width: min(100%, 430px);
}

.screen {
  background: var(--white);
  display: none;
  height: 100%;
  inset: 0;
  overflow-y: auto;
  padding: 26px;
  position: absolute;
  width: 100%;
}

.screen--active {
  display: flex;
  flex-direction: column;
}

.start-screen {
  justify-content: space-between;
}

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

.brand-mark {
  align-items: center;
  background: var(--graphite);
  border-radius: 18px;
  color: var(--orange);
  display: flex;
  font-size: 30px;
  font-weight: 900;
  height: 62px;
  justify-content: center;
  width: 62px;
}

.eyebrow {
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1,
h2 {
  color: var(--graphite);
  letter-spacing: 0;
  line-height: 1.02;
  margin: 0;
}

h1 {
  font-size: clamp(38px, 12vw, 50px);
}

h2 {
  font-size: 38px;
}

.brand-subtitle {
  color: var(--orange-dark);
  font-size: 14px;
  font-weight: 900;
  margin: 8px 0 0;
}

.hero-orbit {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 122, 0, 0.16), transparent),
    #f7f7f7;
  border: 1px solid var(--line);
  border-radius: 28px;
  display: flex;
  height: 280px;
  justify-content: center;
  margin: 20px 0;
  overflow: hidden;
  position: relative;
}

.hero-lion {
  align-items: center;
  background: var(--orange);
  border: 8px solid var(--graphite);
  border-radius: 999px;
  color: var(--graphite);
  display: flex;
  font-size: 66px;
  font-weight: 1000;
  height: 126px;
  justify-content: center;
  position: relative;
  width: 126px;
  z-index: 2;
}

.box-stack {
  background:
    linear-gradient(var(--graphite), var(--graphite)) center 28px / 52px 5px no-repeat,
    repeating-linear-gradient(to bottom, var(--white) 0 34px, var(--orange) 34px 40px, var(--graphite) 40px 44px);
  border: 4px solid var(--graphite);
  border-radius: 8px;
  height: 210px;
  position: absolute;
  top: 34px;
  width: 74px;
}

.box-stack--left {
  left: 24px;
}

.box-stack--right {
  right: 24px;
}

.intro,
.screen-copy,
.status-note {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
  margin: 0;
}

.intro-control {
  color: var(--graphite-soft);
  font-weight: 850;
}

.tutorial-copy {
  background: #f7f7f7;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.tutorial-copy p {
  color: var(--graphite-soft);
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
}

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

.button {
  align-items: center;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 54px;
  padding: 0 18px;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
  width: 100%;
}

.button:active {
  transform: translateY(1px) scale(0.99);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button--primary {
  background: var(--orange);
  box-shadow: 0 14px 28px rgba(255, 122, 0, 0.24);
  color: #111111;
}

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

.button--ghost {
  background: var(--orange-soft);
  color: var(--graphite);
}

.button--dev {
  background: #f3f3f3;
  border: 1px dashed #b9b9b9;
  color: var(--graphite-soft);
  min-height: 46px;
}

.button--small {
  min-height: 42px;
  width: auto;
}

.button--glass {
  background: rgba(17, 17, 17, 0.78);
  color: var(--white);
}

.game-screen {
  background: #f7f7f7;
  overflow: hidden;
  padding: 0;
}

.game-topbar {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, 1fr);
  left: 10px;
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 3;
}

.game-topbar div {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(23, 23, 23, 0.08);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(23, 23, 23, 0.08);
  padding: 8px 6px;
  text-align: center;
}

.game-topbar strong {
  color: var(--graphite);
  display: block;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

#gameCanvas {
  display: block;
  height: 100%;
  touch-action: none;
  width: 100%;
}

.tap-hint {
  background: rgba(23, 23, 23, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
  color: var(--white);
  font-size: 14px;
  font-weight: 850;
  left: 50%;
  max-width: calc(100% - 44px);
  opacity: 1;
  padding: 12px 16px;
  pointer-events: none;
  position: absolute;
  text-align: center;
  top: 96px;
  transform: translateX(-50%);
  transition: opacity 180ms ease, transform 180ms ease;
  width: max-content;
  z-index: 4;
}

.tap-hint strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
}

.tap-hint small {
  color: rgba(255, 255, 255, 0.82);
  display: block;
  font-size: 12px;
  line-height: 1.25;
  margin-top: 6px;
}

.tap-hint--start {
  border-radius: 18px;
  max-width: calc(100% - 58px);
  top: 42%;
  width: 290px;
}

.tap-hint--assist {
  animation: hintPulse 1100ms ease-in-out infinite;
  top: 96px;
}

.tap-hint--hidden {
  opacity: 0;
  transform: translate(-50%, -8px);
}

@keyframes hintPulse {
  0%, 100% {
    transform: translateX(-50%);
  }

  50% {
    transform: translate(-50%, -5px);
  }
}

#pauseBackButton {
  bottom: 18px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  z-index: 3;
}

.result-screen,
.tutorial-screen,
.free-fail-screen,
.warning-screen,
.form-screen,
.certificate-screen,
.rules-screen {
  gap: 18px;
  justify-content: center;
}

.result-notice {
  background: var(--orange-soft);
  border: 1px solid rgba(255, 122, 0, 0.22);
  border-radius: 14px;
  color: var(--graphite);
  display: none;
  font-weight: 850;
  padding: 13px 14px;
  text-align: center;
}

.result-finished-notice {
  background: #f7f7f7;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--graphite-soft);
  display: none;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  padding: 14px;
}

.result-finished-notice strong {
  color: var(--graphite);
  font-weight: 850;
}

.result-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin: 8px 0 4px;
}

.result-grid div {
  background: #f7f7f7;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.result-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.result-grid strong {
  color: var(--graphite);
  font-size: 24px;
}

.certificate-form {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.certificate-form label {
  display: grid;
  gap: 8px;
}

.certificate-form label span {
  color: var(--graphite-soft);
  font-size: 14px;
  font-weight: 850;
}

.certificate-form input[type="text"],
.certificate-form input[type="tel"] {
  background: #f8f8f8;
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 52px;
  outline: 0;
  padding: 0 14px;
}

.certificate-form input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.12);
}

.checkbox-row {
  align-items: center;
  display: flex !important;
  gap: 10px !important;
}

.checkbox-row input {
  accent-color: var(--orange);
  height: 20px;
  width: 20px;
}

.form-error {
  color: #b42318;
  font-size: 13px;
  font-weight: 800;
  margin: 0;
  min-height: 18px;
}

.not-found-state {
  background: #f7f7f7;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--graphite-soft);
  display: none;
  line-height: 1.4;
  margin-top: 14px;
  padding: 14px;
}

.not-found-state p {
  margin: 0 0 12px;
}

.empty-state {
  display: none;
}

.empty-state .button {
  margin-top: 12px;
}

.certificate-card {
  background:
    linear-gradient(135deg, rgba(255, 122, 0, 0.12), transparent 36%),
    var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
  display: none;
  padding: 18px;
}

.certificate-head {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.certificate-head h2 {
  color: var(--graphite);
  font-size: 46px;
}

.certificate-head h3 {
  color: var(--graphite);
  font-size: 15px;
  font-weight: 1000;
  letter-spacing: 0;
  margin: 0 0 8px;
}

.cert-badge {
  background: var(--graphite);
  border-radius: 999px;
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
  padding: 7px 11px;
}

.promo-code {
  background: var(--graphite);
  border-radius: 18px;
  color: var(--orange);
  font-size: 26px;
  font-weight: 1000;
  letter-spacing: 1px;
  margin: 12px 0;
  padding: 13px;
  text-align: center;
}

.cert-details {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.cert-details div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
}

.cert-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.cert-details dd {
  color: var(--graphite);
  font-size: 15px;
  font-weight: 850;
  margin: 0;
}

.cert-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.34;
  margin: 0 0 8px;
}

.manager-link {
  margin: 8px 0 8px;
  min-height: 48px;
  text-decoration: none;
}

.certificate-card .button {
  min-height: 48px;
}

.rules-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 19px;
}

.rules-list li {
  color: var(--graphite-soft);
  line-height: 1.38;
}

@media (max-height: 700px) {
  .app-shell {
    border-radius: 0;
    max-height: none;
    min-height: 100vh;
    width: min(100%, 390px);
  }

  .screen {
    padding: 20px;
  }

  .hero-orbit {
    height: 220px;
  }

  .hero-lion {
    height: 104px;
    width: 104px;
  }
}

@media (min-width: 680px) {
  body {
    padding: 24px;
  }
}
