:root {
  --bg-1: #fff8fc;
  --bg-2: #f6f4ff;
  --card-bg: rgba(255, 255, 255, 0.92);
  --text: #2f2440;
  --muted: #786d8a;
  --pink: #ff78b2;
  --pink-dark: #e05597;
  --purple: #9f7dff;
  --shadow: 0 18px 46px rgba(86, 53, 116, 0.14);
  --shadow-soft: 0 10px 24px rgba(86, 53, 116, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  direction: rtl;
}

body {
  font-family: Tahoma, Arial, sans-serif;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(255, 203, 227, 0.55), transparent 28%),
    radial-gradient(circle at bottom left, rgba(215, 223, 255, 0.72), transparent 34%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

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

button {
  font-family: inherit;
}

.game-page {
  min-height: 100vh;
  padding: 20px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.game-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.back-link,
.brand-badge {
  min-height: 44px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-soft);
  font-weight: 700;
}

.back-link {
  color: var(--muted);
}

.brand-badge {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
}

.game-card {
  background: var(--card-bg);
  border-radius: 32px;
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
}

.game-kicker {
  margin-bottom: 8px;
  color: var(--pink-dark);
  font-size: 14px;
  font-weight: 800;
}

h1 {
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.1;
  margin-bottom: 10px;
}

.game-desc {
  max-width: 680px;
  margin: 0 auto 20px;
  line-height: 1.9;
  color: var(--muted);
  font-size: 15px;
}

#game-container {
  width: min(100%, 420px);
  margin: 0 auto 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.color-btn {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.color-btn:active,
.color-btn.active {
  transform: scale(1.05);
  filter: brightness(1.18);
}

#green {
  background: linear-gradient(135deg, #43c46b, #23964a);
}

#red {
  background: linear-gradient(135deg, #ff6b81, #e0445b);
}

#yellow {
  background: linear-gradient(135deg, #ffd861, #f0bc20);
}

#blue {
  background: linear-gradient(135deg, #64b8ff, #327de6);
}

#game-status {
  margin-top: 10px;
}

.my-text {
  font-size: 1.05rem;
  margin-top: 12px;
  color: var(--text);
  background: linear-gradient(180deg, #eef3ff, #dde7ff);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
}

#sequence-display,
#click-count,
#status-text {
  font-weight: 700;
  color: var(--pink-dark);
}

.start-btn {
  margin-top: 20px;
  min-width: 180px;
  min-height: 48px;
  padding: 12px 20px;
  font-size: 18px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  font-weight: 700;
}

.start-btn:hover {
  opacity: 0.92;
}

#level-message {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-top: 18px;
  min-height: 34px;
  opacity: 0;
  transition: opacity 0.35s ease-in-out;
}

#level-message.show {
  opacity: 1;
}

#level-message.success {
  color: #1f9d55;
}

#level-message.fail {
  color: #d63031;
}

@media (max-width: 520px) {
  .game-page {
    padding: 14px 10px;
    align-items: flex-start;
  }

  .game-card {
    padding: 16px;
    border-radius: 24px;
  }

  #game-container {
    gap: 10px;
  }

  .my-text {
    font-size: 0.95rem;
  }

  .start-btn {
    width: 100%;
  }
}