:root {
  --sphinx-ink: #231826;
  --sphinx-soft-ink: #5d5062;
  --sphinx-card: #ffffff;
  --sphinx-cloud: #f5fbff;
  --sphinx-mint: #9cf2d1;
  --sphinx-teal: #117a76;
  --sphinx-coral: #ff6f61;
  --sphinx-gold: #ffc83d;
  --sphinx-blue: #37c7ff;
  --sphinx-violet: #8b5cf6;
  --sphinx-rose: #ffd7dc;
  --sphinx-shadow: 0 18px 44px rgba(35, 24, 38, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.sphinx-game-page,
body.sphinx-game-embed {
  margin: 0;
  color: var(--sphinx-ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 200, 61, 0.66), transparent 24%),
    radial-gradient(circle at 88% 12%, rgba(55, 199, 255, 0.44), transparent 28%),
    radial-gradient(circle at 50% 95%, rgba(255, 111, 97, 0.28), transparent 32%),
    linear-gradient(140deg, rgba(156, 242, 209, 0.62), rgba(255, 215, 220, 0.46)),
    #f7fbff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body.sphinx-game-embed {
  background: transparent;
}

a {
  color: inherit;
}

.sphinx-page-main,
.sphinx-site-header,
.sphinx-site-footer {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.sphinx-site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0 10px;
  flex-wrap: wrap;
}

.sphinx-brand,
.sphinx-nav a,
.sphinx-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 900;
}

.sphinx-brand {
  padding: 10px 16px;
  color: #ffffff;
  background: var(--sphinx-ink);
  box-shadow: 0 4px 0 rgba(35, 24, 38, 0.24);
}

.sphinx-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.sphinx-nav a {
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(35, 24, 38, 0.1);
  font-size: 0.92rem;
}

.sphinx-page-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px 0 10px;
}

.sphinx-kicker {
  margin: 0 0 8px;
  color: var(--sphinx-teal);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sphinx-page-hero h1,
.sphinx-content-section h2 {
  margin: 0;
  line-height: 1.05;
}

.sphinx-page-hero h1 {
  max-width: 820px;
  font-size: clamp(2.1rem, 9vw, 4.2rem);
}

.sphinx-summary {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--sphinx-soft-ink);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.sphinx-game-shell {
  padding: 10px 0 18px;
}

.sphinx-game-embed .sphinx-game-shell {
  padding: 0;
}

.sphinx-game {
  width: min(100%, 1000px);
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  border: 4px solid rgba(35, 24, 38, 0.96);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 14px 0 rgba(35, 24, 38, 0.18), 0 26px 70px rgba(35, 24, 38, 0.22);
}

.game-topbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 200, 61, 0.36), transparent 28%),
    linear-gradient(120deg, #231826, #3a2450 56%, #117a76);
  border-bottom: 3px solid rgba(35, 24, 38, 0.9);
}

.game-stat {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.58);
  box-shadow: 0 5px 0 rgba(35, 24, 38, 0.16);
}

.game-stat:nth-child(1) {
  background: linear-gradient(145deg, #fff9c7, #ffc83d);
}

.game-stat:nth-child(2) {
  background: linear-gradient(145deg, #dff9ff, #37c7ff);
}

.game-stat:nth-child(3) {
  background: linear-gradient(145deg, #ffe1e5, #ff6f61);
}

.game-stat:nth-child(4) {
  background: linear-gradient(145deg, #d9fff2, #9cf2d1);
}

.game-stat span {
  display: block;
  color: rgba(35, 24, 38, 0.68);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.game-stat strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(1.05rem, 5vw, 1.55rem);
  line-height: 1;
  white-space: nowrap;
}

.game-stat strong span {
  display: inline;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.game-stage {
  position: relative;
  height: clamp(430px, 68svh, 640px);
  min-height: 430px;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 200, 61, 0.7), transparent 18%),
    radial-gradient(circle at 80% 18%, rgba(255, 111, 97, 0.42), transparent 20%),
    radial-gradient(circle at 50% 72%, rgba(156, 242, 209, 0.86), transparent 36%),
    linear-gradient(180deg, #fff4ff 0%, #e6fbff 48%, #fff1a8 100%);
  touch-action: manipulation;
}

.game-stage::before,
.game-stage::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  pointer-events: none;
  z-index: 0;
}

.game-stage::before {
  top: 8%;
  height: 58%;
  border-radius: 30px;
  background:
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 200, 61, 0.18) 0 9deg, transparent 9deg 18deg);
  opacity: 0.72;
  transform: rotate(-7deg);
}

.game-stage::after {
  bottom: -38px;
  height: 118px;
  border-radius: 50% 50% 0 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.72), transparent 42%),
    rgba(17, 122, 118, 0.18);
}

.sphinx-character {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 2;
  display: grid;
  justify-items: center;
  width: min(50vw, 235px);
  transform: translateX(-50%);
  pointer-events: none;
}

.sphinx-character img {
  width: clamp(128px, 36vw, 215px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 16px rgba(35, 24, 38, 0.2)) drop-shadow(0 0 20px rgba(255, 200, 61, 0.32));
}

.sphinx-bubble {
  max-width: 210px;
  margin: 0 0 -10px;
  padding: 9px 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--sphinx-ink), #5e2f75);
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 16px 16px 16px 4px;
  font-size: 0.86rem;
  font-weight: 850;
  text-align: center;
  box-shadow: 0 8px 0 rgba(35, 24, 38, 0.12);
}

.object-layer,
.feedback-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.wish-object {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  transition: transform 120ms ease, opacity 120ms ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.wish-object:focus-visible {
  outline: 4px solid #ffffff;
  outline-offset: 2px;
}

.wish-object.good .object-symbol {
  filter: drop-shadow(0 0 9px rgba(255, 199, 44, 0.9)) drop-shadow(0 4px 6px rgba(35, 24, 38, 0.3));
}

.wish-object.bad .object-symbol {
  filter: drop-shadow(0 0 9px rgba(107, 77, 145, 0.95)) drop-shadow(0 4px 6px rgba(18, 19, 26, 0.5));
}

.wish-object.is-hit {
  opacity: 0;
  transform: translate3d(var(--object-x, 0), var(--object-y, 0), 0) scale(1.24) rotate(8deg);
}

.object-symbol {
  display: block;
  font-size: 2.6rem;
  line-height: 1;
}

.feedback-pop {
  position: absolute;
  z-index: 6;
  min-width: 52px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--sphinx-teal);
  font-weight: 950;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: sphinxFeedback 760ms ease forwards;
  box-shadow: 0 8px 18px rgba(35, 24, 38, 0.18);
}

.feedback-pop.bad {
  background: var(--sphinx-coral);
}

.feedback-pop.bonus {
  color: var(--sphinx-ink);
  background: var(--sphinx-gold);
}

.game-screen {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 200, 61, 0.36), transparent 32%),
    rgba(245, 251, 255, 0.72);
  backdrop-filter: blur(5px);
}

.game-screen.is-visible {
  display: flex;
}

.screen-panel {
  width: min(100%, 560px);
  padding: clamp(18px, 5vw, 32px);
  border: 4px solid rgba(35, 24, 38, 0.96);
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.98), transparent 28%),
    radial-gradient(circle at 82% 0%, rgba(255, 200, 61, 0.58), transparent 26%),
    linear-gradient(150deg, #ffffff 0%, #fff3bd 47%, #d9fff2 100%);
  box-shadow: 0 14px 0 rgba(35, 24, 38, 0.18), 0 24px 52px rgba(35, 24, 38, 0.2);
  text-align: center;
}

.sphinx-game[dir="rtl"] .screen-panel,
.sphinx-game[dir="rtl"] .reward-panel {
  text-align: right;
}

.sphinx-game[dir="rtl"] .screen-actions {
  direction: rtl;
}

.screen-panel h1,
.screen-panel h2 {
  margin: 0;
  font-size: clamp(1.95rem, 8vw, 3.25rem);
  line-height: 1;
  text-wrap: balance;
}

.start-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(124px, 28vw, 176px);
  margin: -8px auto 8px;
}

.start-visual::before {
  content: "";
  position: absolute;
  width: min(54vw, 250px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 26%, rgba(255, 200, 61, 0.48) 27% 44%, rgba(55, 199, 255, 0.22) 45% 60%, transparent 61%);
  filter: blur(0.2px);
  animation: sphinxPrizeGlow 4s ease-in-out infinite;
}

.start-sphinx {
  position: relative;
  z-index: 2;
  width: clamp(126px, 32vw, 178px);
  height: auto;
  filter: drop-shadow(0 16px 12px rgba(35, 24, 38, 0.2)) drop-shadow(0 0 22px rgba(255, 200, 61, 0.46));
  animation: sphinxStartFloat 2.8s ease-in-out infinite;
}

.wish-preview {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.wish-preview span {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 46px;
  padding: 0 9px;
  border: 2px solid #ffffff;
  border-radius: 16px;
  color: var(--sphinx-ink);
  font-size: 0.76rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 7px 0 rgba(35, 24, 38, 0.16), 0 12px 22px rgba(35, 24, 38, 0.18);
  animation: wishPreviewPop 2.4s ease-in-out infinite;
}

.wish-preview .good {
  background: linear-gradient(145deg, #fff9c7, var(--sphinx-gold));
}

.wish-preview .bad {
  color: #ffffff;
  background: linear-gradient(145deg, #6b4d91, #171923);
}

.wish-preview span:nth-child(1) {
  left: 11%;
  top: 24%;
}

.wish-preview span:nth-child(2) {
  right: 15%;
  top: 14%;
  animation-delay: 180ms;
}

.wish-preview span:nth-child(3) {
  left: 21%;
  bottom: 12%;
  animation-delay: 320ms;
}

.wish-preview span:nth-child(4) {
  right: 8%;
  bottom: 23%;
  animation-delay: 460ms;
}

.wish-preview span:nth-child(5) {
  left: 7%;
  top: 4%;
  animation-delay: 620ms;
}

.start-subtitle {
  color: var(--sphinx-teal);
  font-size: 1.05rem;
  font-weight: 950;
  text-transform: uppercase;
}

.screen-panel p {
  margin: 12px auto 0;
  color: var(--sphinx-soft-ink);
  font-weight: 700;
}

.start-rules {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.start-rules li {
  padding: 10px 12px;
  border-radius: 14px;
  border: 2px solid rgba(35, 24, 38, 0.08);
  background: rgba(255, 255, 255, 0.74);
  font-weight: 850;
}

.start-rules li:nth-child(1) {
  background: #fff4a6;
}

.start-rules li:nth-child(2) {
  background: #d9fff2;
}

.start-rules li:nth-child(3) {
  color: #ffffff;
  background: #3a2450;
}

.start-rules li:nth-child(4) {
  background: #ffd7dc;
}

.screen-actions,
.hero-actions,
.sphinx-link-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.screen-actions {
  margin-top: 18px;
}

.sphinx-button {
  min-width: min(100%, 185px);
  border: 2px solid var(--sphinx-ink);
  padding: 12px 18px;
  color: var(--sphinx-ink);
  background: #ffffff;
  box-shadow: 0 5px 0 rgba(35, 24, 38, 0.2);
  cursor: pointer;
  font: inherit;
  line-height: 1.1;
  text-align: center;
}

.sphinx-button.primary {
  background: linear-gradient(145deg, #fff78e, var(--sphinx-gold) 54%, #ff9f1c);
}

.sphinx-button.secondary {
  background: linear-gradient(145deg, #e8fff7, var(--sphinx-mint));
}

.sphinx-button.dark {
  color: #ffffff;
  background: linear-gradient(145deg, #42304a, var(--sphinx-ink));
}

.sphinx-button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(35, 24, 38, 0.2);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.result-card {
  padding: 14px 12px;
  border-radius: 16px;
  background: var(--sphinx-cloud);
}

.result-card span {
  display: block;
  color: var(--sphinx-soft-ink);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-card strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.6rem, 9vw, 2.7rem);
  line-height: 1;
}

.sphinx-quote {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--sphinx-rose);
}

.reward-panel {
  display: none;
  margin-top: 14px;
  padding: 14px;
  border: 2px solid var(--sphinx-ink);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 200, 61, 0.62), transparent 26%),
    linear-gradient(135deg, #ffffff, rgba(156, 242, 209, 0.72));
  text-align: left;
}

.reward-panel.is-visible {
  display: block;
}

.reward-panel h3,
.reward-panel p {
  margin: 0;
}

.reward-panel h3 {
  font-size: 1.15rem;
  line-height: 1.15;
}

.reward-panel p + p,
.reward-panel h3 + p,
.reward-panel .screen-actions {
  margin-top: 10px;
}

.reward-status {
  min-height: 1.4em;
  color: var(--sphinx-soft-ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.reward-kicker {
  color: var(--sphinx-teal);
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.reward-locked {
  border-color: rgba(35, 24, 38, 0.22);
  background: var(--sphinx-cloud);
}

.sphinx-button.is-disabled,
.sphinx-button[aria-disabled="true"] {
  opacity: 0.58;
  cursor: wait;
}

.sphinx-content-section {
  margin: 18px 0;
  padding: clamp(18px, 5vw, 28px);
  border: 1px solid rgba(35, 24, 38, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.sphinx-content-section h2 {
  font-size: clamp(1.45rem, 5vw, 2.1rem);
}

.sphinx-content-section p {
  max-width: 850px;
  color: var(--sphinx-soft-ink);
}

.sphinx-steps,
.asset-list {
  padding-left: 1.2rem;
  color: var(--sphinx-soft-ink);
  font-weight: 700;
}

.asset-list li + li,
.sphinx-steps li + li {
  margin-top: 8px;
}

.faq-item {
  padding: 14px 0;
  border-top: 1px solid rgba(35, 24, 38, 0.12);
}

.faq-item h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.faq-item p {
  margin: 0;
}

.sphinx-site-footer {
  padding: 22px 0 30px;
  color: var(--sphinx-soft-ink);
  font-weight: 700;
}

@keyframes sphinxFeedback {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%) scale(0.7);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -120%) scale(0.92);
  }
}

@keyframes sphinxStartFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-7px) rotate(2deg);
  }
}

@keyframes sphinxPrizeGlow {
  0%,
  100% {
    opacity: 0.78;
    transform: scale(0.94) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.04) rotate(10deg);
  }
}

@keyframes wishPreviewPop {
  0%,
  100% {
    transform: translateY(0) rotate(-5deg) scale(1);
  }
  50% {
    transform: translateY(-5px) rotate(4deg) scale(1.04);
  }
}

@media (min-width: 680px) {
  .sphinx-page-hero {
    padding-top: 28px;
  }

  .game-topbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 12px;
  }

  .game-stat {
    padding: 10px 14px;
  }

  .start-rules {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .sphinx-site-header {
    align-items: stretch;
  }

  .sphinx-brand,
  .sphinx-nav,
  .sphinx-nav a,
  .sphinx-button {
    width: 100%;
  }

  .sphinx-nav {
    justify-content: stretch;
  }

  .game-stage {
    height: 72svh;
    min-height: 560px;
  }

  .game-screen {
    padding: 10px;
  }

  .screen-panel {
    max-height: calc(100% - 12px);
    overflow-y: auto;
    padding: 16px 14px;
  }

  .start-visual {
    min-height: 126px;
  }

  .start-sphinx {
    width: clamp(116px, 38vw, 146px);
  }

  .wish-preview span {
    min-width: 39px;
    height: 39px;
    border-radius: 14px;
    font-size: 0.68rem;
  }

  .screen-panel h1,
  .screen-panel h2 {
    font-size: clamp(1.6rem, 8vw, 2.1rem);
  }

  .screen-panel p {
    font-size: 0.93rem;
  }

  .start-rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 12px 0;
  }

  .start-rules li {
    padding: 8px 7px;
    font-size: 0.9rem;
  }

  .screen-actions {
    gap: 8px;
    margin-top: 12px;
  }

  .sphinx-button {
    min-height: 42px;
    padding: 10px 16px;
  }

  .wish-object {
    width: 60px;
    height: 60px;
    border-radius: 20px;
  }

  .sphinx-character img {
    width: clamp(118px, 42vw, 160px);
  }

  .sphinx-bubble {
    max-width: 170px;
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
