:root {
  --green: #075b56;
  --dark-green: #00413d;
  --teal: #5aaca4;
  --gold: #ffbf3f;
  --ink: #083e4b;
  --white: #fffef8;
  --muted: #568b87;
  --line: #e4efea;
  --shadow: 0 9px 24px #173d4210;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background: var(--white);
  color: var(--ink);
  overflow-x: clip;
  position: relative;
}

button,
a,
input {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 4px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .65;
}

[hidden] {
  display: none !important;
}

.container {
  width: calc(100% - 28px);
  max-width: 1000px;
  min-width: 0;
  margin-inline: auto;
}

/* هدر */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 900;
}

.brand svg {
  width: 45px;
  height: 45px;
  flex-shrink: 0;
}

.header-note {
  color: var(--muted);
  font-size: .88rem;
}

/* معرفی برنامه */

.hero {
  text-align: center;
  padding: 30px 0 10px;
}

.main-logo {
  width: clamp(160px, 30vw, 290px);
  max-width: 100%;
  margin: 0 auto 14px;
  filter: drop-shadow(0 12px 15px #073f4b15);
  animation: float 4s ease-in-out infinite;
}

.main-logo img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

h1 {
  color: var(--green);
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  font-weight: 900;
  line-height: 1.5;
  letter-spacing: -1.5px;
}

.spark {
  display: inline-block;
  color: var(--gold);
  font-size: .55em;
  vertical-align: middle;
  margin-inline: 12px;
}

.description {
  max-width: 660px;
  margin: 8px auto 0;
  font-size: clamp(.98rem, 2.4vw, 1.35rem);
  line-height: 2;
  font-weight: 500;
}

/* کارت‌های صفحه اصلی */

.cards {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 42px 0 40px;
}

.card {
  min-width: 0;
  max-width: 100%;
  min-height: 178px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  border: 0;
  border-radius: 28px;
  color: var(--ink);
  text-align: right;
  cursor: pointer;
  box-shadow: 0 9px 20px #173d4210;
  transition: transform .22s ease, box-shadow .22s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 28px #173d421c;
}

.card:active,
.option-card:active,
.game-card:active {
  transform: scale(.98);
}

.card h2 {
  min-width: 0;
  font-size: clamp(1.15rem, 2.7vw, 2rem);
  line-height: 1.6;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.illustration {
  width: clamp(75px, 12vw, 125px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ffffff60;
  display: grid;
  place-items: center;
}

.illustration svg {
  width: 86%;
  height: 86%;
}

.arrow {
  margin-inline-start: auto;
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  transition: transform .2s ease;
}

.card:hover .arrow {
  transform: translateX(-4px);
}

.seventh {
  background: linear-gradient(135deg, #c9efd8, #d7f1df);
}

.eighth {
  background: linear-gradient(135deg, #afe2ff, #c4edff);
}

.ninth {
  background: linear-gradient(135deg, #dcc7fa, #e8d8ff);
}

.about {
  background: linear-gradient(135deg, #ffdfa9, #ffe9c6);
}

/* صفحات داخلی */

.page,
.games-page,
.play-page {
  display: none;
  margin: 28px 0 35px;
  animation: appear .3s ease;
}

.page.active,
.games-page.active,
.play-page.active {
  display: block;
}

.page-heading {
  text-align: center;
  padding: 20px 0 25px;
}

.page-heading h2 {
  color: var(--green);
  font-size: clamp(1.7rem, 5vw, 2.7rem);
  font-weight: 900;
  line-height: 1.8;
}

.page-heading p {
  font-size: 1rem;
  line-height: 2;
  color: var(--muted);
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.option-card,
.game-card {
  width: 100%;
  min-width: 0;
  min-height: 145px;
  border: 0;
  border-radius: 24px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: right;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
}

.option-card:hover,
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 26px #173d4218;
}

.option-card h3,
.game-card h3 {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 900;
  line-height: 1.8;
}

.option-card p,
.game-card p {
  font-size: .88rem;
  line-height: 1.9;
  color: #42666b;
  margin-top: 3px;
}

.option-icon {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: #ffffffa6;
}

.option-icon svg {
  width: 38px;
  height: 38px;
  stroke: var(--green);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notes-card {
  background: linear-gradient(135deg, #c9efd8, #e5f6e9);
}

.video-card {
  background: linear-gradient(135deg, #afe2ff, #d8f2ff);
}

.practice-card {
  background: linear-gradient(135deg, #ffdfa9, #fff0d4);
}

.exam-card {
  background: linear-gradient(135deg, #dcc7fa, #eee5ff);
}

.games-card {
  background: linear-gradient(135deg, #bce9e1, #e0f7f1);
}

/* کارت بازی */

.game-card {
  background: white;
  border: 1px solid var(--line);
  min-height: 160px;
}

.game-number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #e6f5ee;
  color: var(--green);
  font-weight: 900;
  font-size: 1.35rem;
}

.game-card .arrow {
  color: var(--green);
}

.game-card-content {
  min-width: 0;
  flex: 1;
}

.game-best {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin-top: 8px;
  color: var(--green);
  font-size: .8rem;
  font-weight: 800;
}

.game-best svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.score-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.score-overview > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px;
  background: #eff8f3;
  border: 1px solid #d9eee2;
  border-radius: 18px;
}

.score-overview span {
  color: #527975;
  font-size: .85rem;
}

.score-overview strong {
  color: var(--green);
  font-size: 1.5rem;
  font-weight: 900;
}

/* بخش اطلاع‌رسانی */

.notice {
  display: none;
  padding: 22px;
  margin-top: 20px;
  background: #f0f8f4;
  border: 1px solid #d8eae1;
  border-radius: 18px;
  line-height: 2;
}

.notice.active {
  display: block;
  animation: appear .25s ease;
}

.notice h3 {
  color: var(--green);
  margin-bottom: 5px;
}

.notice p {
  color: #42666b;
}

.notice ul {
  padding-right: 22px;
}

.content-item {
  padding: 14px 0;
  border-bottom: 1px solid #d8eae1;
}

.content-item:last-child {
  border-bottom: 0;
}

.content-item h4 {
  color: var(--green);
  margin-bottom: 4px;
}

/* درباره من */

.about-text {
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: white;
  box-shadow: 0 10px 28px #123e4b12;
  line-height: 2.2;
  font-size: 1rem;
}

/* دکمه‌ها */

.back,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 20px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 800;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.back {
  margin-top: 24px;
  background: var(--green);
  color: white;
}

.back:hover,
.primary-button:hover {
  background: var(--dark-green);
  box-shadow: 0 8px 20px #075b5628;
}

.back:active,
.primary-button:active,
.secondary-button:active {
  transform: scale(.98);
}

.back svg,
.icon-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* صفحه بازی */

.play-page {
  max-width: 800px;
  margin-inline: auto;
}

.play-top {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 90px;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--green);
  cursor: pointer;
}

.play-heading {
  min-width: 0;
}

.play-heading > span {
  color: var(--muted);
  font-size: .8rem;
}

.play-heading h2 {
  color: var(--green);
  font-size: clamp(1.1rem, 3.5vw, 1.65rem);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.live-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9px;
  background: #fff0cf;
  border-radius: 15px;
}

.live-score span {
  color: #785c1e;
  font-size: .75rem;
}

.live-score strong {
  color: #61450b;
  font-size: 1.35rem;
  font-weight: 900;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  background: #e8f0ec;
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #5aaca4, #075b56);
  border-radius: inherit;
  transition: width .35s ease;
}

.play-status {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 18px;
  color: #64837e;
  font-size: .85rem;
}

.game-scene {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid #d9ebe3;
  border-radius: 28px;
  background:
    radial-gradient(circle at 10% 5%, #ffffffd9 0, transparent 26%),
    linear-gradient(145deg, #e7f7ef, #f8fbf5 50%, #e3f5f7);
  box-shadow: 0 15px 35px #073f4b0d;
}

.scene-decoration {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  opacity: .45;
}

.scene-decoration-one {
  width: 180px;
  height: 180px;
  background: #c9efd8;
  top: -110px;
  left: -45px;
}

.scene-decoration-two {
  width: 120px;
  height: 120px;
  background: #ffe4ad;
  bottom: -70px;
  right: -45px;
}

.question-panel,
.answer-area,
.feedback,
.game-actions {
  position: relative;
  z-index: 1;
}

.question-panel {
  text-align: center;
  padding: 10px 0 22px;
}

.question-label {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  color: var(--green);
  background: #ffffffc9;
  font-size: .82rem;
  font-weight: 800;
}

.question-panel h3 {
  margin-top: 15px;
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-weight: 900;
  line-height: 1.9;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.question-panel p {
  margin-top: 5px;
  color: #64837e;
  line-height: 2;
  font-size: .9rem;
}

.answer-area {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.answer-option {
  min-height: 65px;
  padding: 14px;
  border: 2px solid #dcece4;
  border-radius: 17px;
  background: #ffffffed;
  text-align: center;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
  overflow-wrap: anywhere;
}

.answer-option:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
}

.answer-option.selected {
  border-color: var(--green);
  background: #dff3e7;
  box-shadow: 0 0 0 3px #075b5610;
}

.answer-option.correct {
  border-color: #18845d;
  background: #d8f5e4;
  color: #0d6746;
}

.answer-option.incorrect {
  border-color: #c34b51;
  background: #ffebeb;
  color: #9b3037;
}

.answer-option:disabled {
  opacity: 1;
  cursor: default;
}

.answer-option .option-index {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-left: 7px;
  border-radius: 9px;
  background: #e9f4ee;
  color: var(--green);
  font-size: .78rem;
}

.answer-area.type-answer {
  grid-template-columns: minmax(0, 1fr);
}

.text-answer {
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  border: 2px solid #dcece4;
  border-radius: 16px;
  background: white;
  color: var(--ink);
  font-size: 1rem;
  outline: none;
}

.text-answer:focus {
  border-color: var(--green);
}

.feedback {
  min-height: 44px;
  margin-top: 12px;
  padding: 8px 12px;
  text-align: center;
  border-radius: 13px;
  line-height: 1.9;
  font-size: .9rem;
  font-weight: 800;
}

.feedback:empty {
  visibility: hidden;
}

.feedback.success {
  color: #126b48;
  background: #d9f5e5;
}

.feedback.error {
  color: #98373b;
  background: #ffebeb;
}

.game-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.primary-button {
  min-width: 155px;
  background: var(--green);
  color: white;
}

.secondary-button {
  margin-top: 10px;
  min-width: 155px;
  background: #e8f5ed;
  color: var(--green);
}

.secondary-button:hover {
  background: #d9eee3;
}

.next-button {
  background: #176f65;
}

/* بازی جورچین */

.scramble-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  min-height: 55px;
  margin-bottom: 14px;
  padding: 12px;
  border: 2px dashed #b8d8c8;
  border-radius: 16px;
  background: #ffffffaa;
}

.word-chip {
  padding: 10px 14px;
  border: 1px solid #bcd9ca;
  border-radius: 12px;
  background: white;
  color: var(--green);
  font-weight: 900;
  cursor: pointer;
}

.word-chip:disabled {
  opacity: .45;
}

.scramble-result {
  min-height: 56px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.scramble-result .word-chip {
  background: #dff3e7;
}

.clear-words {
  display: block;
  margin: 0 auto;
  border: 0;
  padding: 7px 12px;
  border-radius: 10px;
  background: #ffffff;
  color: var(--green);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 800;
}

/* صفحه نتیجه */

.result-panel {
  padding: clamp(20px, 5vw, 40px);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, #f0faf4, #fffef8);
  box-shadow: 0 15px 35px #073f4b0d;
  animation: appear .35s ease;
}

.result-medal svg {
  width: 90px;
  height: 90px;
}

.result-panel h2 {
  color: var(--green);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 900;
  margin: 10px 0;
}

.result-panel > p {
  color: #5c7e78;
  line-height: 2;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 25px 0;
}

.result-stats > div {
  padding: 16px 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 17px;
}

.result-stats span {
  display: block;
  color: #64837e;
  font-size: .78rem;
  line-height: 1.8;
}

.result-stats strong {
  display: block;
  margin-top: 5px;
  color: var(--green);
  font-size: 1.4rem;
  font-weight: 900;
}

/* پاورقی */

footer {
  text-align: center;
  padding: 12px 0 35px;
  color: #588581;
  font-size: .9rem;
  line-height: 2;
}

/* انیمیشن */

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-7px);
  }
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* تبلت */

@media (max-width: 760px) {
  .container {
    width: min(100% - 32px, 620px);
  }

  .hero {
    padding-top: 25px;
  }

  .cards {
    gap: 15px;
    margin-top: 30px;
  }

  .card {
    min-height: 155px;
    padding: 16px;
    gap: 12px;
    border-radius: 23px;
  }

  .illustration {
    width: 85px;
  }

  .card h2 {
    font-size: clamp(1.05rem, 3vw, 1.5rem);
  }

  .arrow {
    font-size: 1.6rem;
  }

  .page-grid {
    gap: 13px;
  }

  .option-card,
  .game-card {
    padding: 15px;
    gap: 11px;
  }

  .option-icon {
    width: 58px;
    height: 58px;
  }
}

/* موبایل */

@media (max-width: 480px) {
  .container {
    width: calc(100% - 28px);
  }

  header {
    padding-top: 17px;
  }

  .brand {
    font-size: 1.1rem;
    gap: 7px;
  }

  .brand svg {
    width: 38px;
    height: 38px;
  }

  .header-note {
    font-size: .72rem;
  }

  .hero {
    padding-top: 22px;
  }

  .main-logo {
    width: min(62%, 210px);
    margin-bottom: 10px;
  }

  h1 {
    font-size: clamp(2.2rem, 10vw, 3rem);
    letter-spacing: -.8px;
  }

  .spark {
    margin-inline: 5px;
  }

  .description {
    font-size: .98rem;
    line-height: 2;
    padding-inline: 4px;
    margin-top: 5px;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 26px 0 30px;
  }

  .card {
    min-height: 150px;
    padding: 14px 5px;
    gap: 5px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 20px;
  }

  .illustration {
    width: clamp(64px, 19vw, 82px);
  }

  .card h2 {
    font-size: clamp(.88rem, 4vw, 1.08rem);
    line-height: 1.8;
    overflow-wrap: anywhere;
  }

  .card .arrow {
    display: none;
  }

  .page,
  .games-page,
  .play-page {
    margin-top: 15px;
  }

  .page-heading {
    padding: 10px 0 20px;
  }

  .page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .option-card,
  .game-card {
    min-height: 145px;
    padding: 13px 9px;
    border-radius: 18px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 7px;
  }

  .option-icon {
    width: 58px;
    height: 58px;
    border-radius: 17px;
  }

  .option-icon svg {
    width: 32px;
    height: 32px;
  }

  .option-card h3,
  .game-card h3 {
    font-size: .94rem;
    line-height: 1.8;
  }

  .option-card p,
  .game-card p {
    font-size: .78rem;
    line-height: 1.8;
  }

  .game-number {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 1.15rem;
  }

  .game-card .arrow {
    display: none;
  }

  .game-card-content {
    width: 100%;
  }

  .game-best {
    justify-content: center;
    flex-wrap: wrap;
  }

  .score-overview > div {
    padding: 13px;
  }

  .score-overview span {
    font-size: .75rem;
  }

  .score-overview strong {
    font-size: 1.3rem;
  }

  .about-text {
    padding: 18px;
    border-radius: 19px;
  }

  .play-top {
    grid-template-columns: 40px minmax(0, 1fr) 68px;
    gap: 8px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .live-score {
    padding: 7px 4px;
  }

  .live-score strong {
    font-size: 1.15rem;
  }

  .play-status {
    font-size: .75rem;
  }

  .game-scene {
    padding: 15px 12px;
    border-radius: 21px;
  }

  .question-panel h3 {
    font-size: 1.25rem;
  }

  .answer-area {
    gap: 8px;
  }

  .answer-option {
    min-height: 60px;
    padding: 10px 7px;
    font-size: .88rem;
    border-radius: 13px;
  }

  .game-actions {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .result-stats {
    gap: 6px;
  }

  .result-stats > div {
    padding: 12px 4px;
  }

  .result-stats span {
    font-size: .68rem;
  }

  .result-stats strong {
    font-size: 1.1rem;
  }

  footer {
    font-size: .8rem;
    padding-bottom: 24px;
  }
}

/* گوشی‌های بسیار باریک */

@media (max-width: 340px) {
  .container {
    width: calc(100% - 20px);
  }

  .header-note {
    font-size: .65rem;
  }

  .card {
    min-height: 132px;
    padding: 10px 4px;
  }

  .illustration {
    width: 58px;
  }

  .card h2 {
    font-size: .82rem;
  }

  .description {
    font-size: .9rem;
  }

  .option-card,
  .game-card {
    padding: 9px 5px;
  }

  .option-card h3,
  .game-card h3 {
    font-size: .85rem;
  }

  .answer-option {
    font-size: .8rem;
  }
}


/* دسترس‌پذیری */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}