:root {
  --bg: #f3efe7;
  --bg-soft: #fbf8f3;
  --surface: rgba(255, 252, 247, 0.84);
  --surface-strong: rgba(255, 252, 247, 0.96);
  --border: rgba(53, 77, 74, 0.12);
  --border-strong: rgba(53, 77, 74, 0.2);
  --text: #223233;
  --text-soft: #61706f;
  --text-faint: #86918e;
  --accent: #446b72;
  --accent-soft: #dce9e4;
  --cooperation: #4d8d7d;
  --caution: #c79a57;
  --risk: #c16c58;
  --future: #667d5e;
  --trust: #5b82b3;
  --family: #8b6d99;
  --shadow: 0 22px 50px rgba(61, 54, 44, 0.1);
  --shadow-soft: 0 14px 26px rgba(61, 54, 44, 0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --line: rgba(53, 77, 74, 0.08);
  --positive-bg: #edf7f1;
  --positive-text: #2f7753;
  --negative-bg: #faece7;
  --negative-text: #a35b44;
  --neutral-bg: #eef3f2;
  --neutral-text: #5e706f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 18rem;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Kufi Arabic", "Tajawal", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(91, 130, 179, 0.12), transparent 28%),
    radial-gradient(circle at 12% 18%, rgba(199, 154, 87, 0.11), transparent 23%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.page-glow {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.28;
  pointer-events: none;
}

.page-glow--one {
  top: -140px;
  left: -120px;
  background: rgba(91, 130, 179, 0.26);
}

.page-glow--two {
  bottom: -120px;
  right: -80px;
  background: rgba(77, 141, 125, 0.2);
}

.page-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.24) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 78%);
  opacity: 0.3;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 1rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.card,
.overlay-card {
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-kicker,
.section-kicker,
.brand-kicker {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.88rem;
}

.start-screen {
  min-height: calc(100vh - 3rem);
  display: grid;
  place-items: center;
}

.hero-card {
  width: min(760px, 100%);
  padding: 1.6rem;
  border-radius: var(--radius-xl);
}

.hero-card--minimal {
  display: grid;
  gap: 1.35rem;
  text-align: center;
}

.hero-tags,
.feedback-meta,
.overlay-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.hero-tags {
  justify-content: center;
}

.hero-tags span,
.feedback-chip,
.overlay-chip,
.summary-chip,
.stage-badge,
.situation-stage {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  padding: 0.46rem 0.78rem;
  border-radius: 999px;
  background: rgba(68, 107, 114, 0.1);
  border: 1px solid rgba(68, 107, 114, 0.12);
  color: var(--accent);
  font-size: 0.84rem;
}

.hero-copy--minimal {
  display: grid;
  gap: 0.55rem;
}

.hero-copy--minimal h1,
.brand-block h1,
.situation-title,
.summary-card h2,
.overlay-head h2 {
  margin: 0;
}

.hero-copy--minimal h1 {
  font-size: clamp(3.1rem, 11vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 700;
}

.hero-challenge {
  margin: 0.35rem 0 0;
  color: var(--text);
  font-size: clamp(1.05rem, 3.2vw, 1.32rem);
  font-weight: 700;
}

.hero-actions,
.save-actions,
.overlay-actions,
.summary-actions,
.feedback-actions,
.utility-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.hero-actions--centered {
  justify-content: center;
}

.save-notice {
  margin-top: 0.2rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.54);
  text-align: center;
}

.save-notice p,
.confirm-text,
.feedback-copy,
.feedback-subcopy,
.indicator-tooltip,
.situation-context,
.choice-hint,
.summary-copy,
.overlay-note,
.recent-note,
.stage-line,
.how-list li {
  margin: 0;
  line-height: 1.9;
  color: var(--text-soft);
}

.btn,
.icon-btn,
.utility-btn,
.choice-btn,
.indicator-card {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.btn:hover,
.icon-btn:hover,
.utility-btn:hover,
.choice-btn:hover,
.indicator-card:hover {
  transform: translateY(-1px);
}

.btn {
  min-height: 50px;
  padding: 0.88rem 1.24rem;
  border-radius: 999px;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(135deg, #496d73, #5b8f71);
  color: #f9fcfb;
  box-shadow: 0 16px 26px rgba(73, 109, 115, 0.18);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(68, 107, 114, 0.14);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
}

.btn-text {
  background: transparent;
  min-height: auto;
  padding-inline: 0.3rem;
  color: var(--accent);
}

.btn-danger {
  background: linear-gradient(135deg, #b36954, #c57a65);
  color: #fff;
}

.btn-compact {
  min-height: 42px;
  padding: 0.62rem 0.95rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--border);
  font-weight: 800;
  color: var(--accent);
}

.icon-btn--small {
  width: 36px;
  height: 36px;
  font-size: 1.25rem;
}

.game-shell {
  display: grid;
  gap: 0.72rem;
}

.status-shell {
  position: sticky;
  top: 0.55rem;
  z-index: 30;
  padding: 0.72rem 0.82rem 0.68rem;
  border-radius: var(--radius-xl);
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  grid-template-areas:
    "title feedback"
    "indicators indicators"
    "tooltip tooltip";
  gap: 0.55rem 1rem;
  align-items: center;
}

.status-top,
.overlay-head,
.summary-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.status-top {
  grid-area: title;
  justify-self: end;
  align-items: center;
  gap: 0.75rem;
}

.brand-block--compact {
  display: grid;
  gap: 0.12rem;
  text-align: right;
}

.brand-block--compact h1 {
  font-size: clamp(1.3rem, 3vw, 1.85rem);
}

.status-top .btn-compact {
  min-height: 38px;
  padding: 0.48rem 0.82rem;
}

.feedback-strip {
  grid-area: feedback;
  justify-self: start;
  align-self: stretch;
  width: min(360px, 100%);
  min-height: 0;
  padding: 0.58rem 0.72rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--border);
  display: grid;
  gap: 0.4rem;
  text-align: right;
}

.feedback-strip.is-idle {
  background: rgba(246, 241, 233, 0.72);
}

.feedback-top {
  display: grid;
  gap: 0.34rem;
  align-items: start;
}

.feedback-copy-block {
  display: grid;
  gap: 0.14rem;
}

.feedback-title {
  margin: 0;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.45;
}

.feedback-subcopy {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}

.feedback-actions {
  display: flex;
  justify-content: flex-start;
}

.feedback-actions .btn {
  min-height: 36px;
  padding: 0.44rem 0.82rem;
}

.feedback-chip {
  font-size: 0.74rem;
}

.feedback-chip--positive {
  background: var(--positive-bg);
  border-color: rgba(47, 119, 83, 0.12);
  color: var(--positive-text);
}

.feedback-chip--negative {
  background: var(--negative-bg);
  border-color: rgba(163, 91, 68, 0.12);
  color: var(--negative-text);
}

.feedback-chip--neutral {
  background: var(--neutral-bg);
  border-color: rgba(94, 112, 111, 0.12);
  color: var(--neutral-text);
}

.indicator-bar {
  grid-area: indicators;
  display: flex;
  gap: 0.42rem;
  align-items: stretch;
  overflow-x: auto;
  padding: 0.05rem 0 0.02rem;
  scrollbar-width: none;
}

.indicator-bar::-webkit-scrollbar {
  display: none;
}

.indicator-card {
  position: relative;
  flex: 1 0 0;
  min-width: 116px;
  padding: 0.42rem 0.52rem 0.46rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--border);
  text-align: right;
  display: grid;
  gap: 0.28rem;
  box-shadow: none;
}

.indicator-card.is-active {
  border-color: rgba(68, 107, 114, 0.24);
  box-shadow: inset 0 0 0 1px rgba(68, 107, 114, 0.08);
}

.indicator-card.is-pulse {
  animation: statPulse 900ms ease;
}

.indicator-name {
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
}

.indicator-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.34rem;
  align-items: center;
}

.indicator-value {
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
}

.indicator-track,
.final-bar,
.path-progress {
  height: 0.28rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(34, 50, 51, 0.08);
}

.indicator-fill,
.final-fill,
.path-progress span {
  display: block;
  height: 100%;
  width: 50%;
  border-radius: inherit;
}

[data-accent="cooperation"] .indicator-fill,
.stat-accent--cooperation .final-fill {
  background: linear-gradient(90deg, rgba(77, 141, 125, 0.32), var(--cooperation));
}

[data-accent="caution"] .indicator-fill,
.stat-accent--caution .final-fill {
  background: linear-gradient(90deg, rgba(199, 154, 87, 0.28), var(--caution));
}

[data-accent="risk"] .indicator-fill,
.stat-accent--risk .final-fill {
  background: linear-gradient(90deg, rgba(193, 108, 88, 0.26), var(--risk));
}

[data-accent="future"] .indicator-fill,
.stat-accent--future .final-fill {
  background: linear-gradient(90deg, rgba(102, 125, 94, 0.28), var(--future));
}

[data-accent="trust"] .indicator-fill,
.stat-accent--trust .final-fill {
  background: linear-gradient(90deg, rgba(91, 130, 179, 0.24), var(--trust));
}

[data-accent="family"] .indicator-fill,
.stat-accent--family .final-fill {
  background: linear-gradient(90deg, rgba(139, 109, 153, 0.28), var(--family));
}

.indicator-delta {
  position: absolute;
  top: -0.18rem;
  left: 0.28rem;
  min-width: 28px;
  padding: 0.06rem 0.24rem;
  border-radius: 999px;
  font-size: 0.56rem;
  font-weight: 700;
  text-align: center;
  background: var(--neutral-bg);
  color: var(--neutral-text);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.indicator-delta.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.indicator-delta.is-positive {
  background: var(--positive-bg);
  color: var(--positive-text);
}

.indicator-delta.is-negative {
  background: var(--negative-bg);
  color: var(--negative-text);
}

.indicator-tooltip {
  grid-area: tooltip;
  justify-self: start;
  max-width: 360px;
  padding: 0.46rem 0.7rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  font-size: 0.76rem;
  pointer-events: none;
}

.utility-row {
  justify-content: center;
}

.utility-row--floating {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  gap: 0.42rem;
}

.utility-btn {
  min-height: 34px;
  padding: 0.46rem 0.74rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
}

.utility-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.play-layout {
  display: grid;
  gap: 0.52rem;
}

.main-stage {
  width: min(780px, 100%);
  margin: 0 auto;
}

.situation-card,
.summary-card,
.summary-panel,
.overlay-panel,
.recent-card {
  background: linear-gradient(180deg, var(--surface-strong), rgba(255, 255, 255, 0.92));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.situation-card,
.summary-card {
  padding: 1.45rem;
  border-radius: var(--radius-xl);
  display: grid;
  gap: 1.05rem;
  animation: fadeInUp 240ms ease;
}

.situation-head {
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  text-align: center;
}

.situation-head > div {
  display: grid;
  gap: 0.34rem;
  justify-items: center;
}

.situation-title {
  font-size: clamp(2rem, 5.2vw, 3rem);
  line-height: 1.16;
  max-width: 12ch;
}

.situation-context {
  font-size: 0.98rem;
  text-align: center;
  max-width: 48ch;
  margin-inline: auto;
}

.choice-list {
  display: grid;
  gap: 0.72rem;
}

.choice-btn {
  width: 100%;
  padding: 1rem 1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(53, 77, 74, 0.12);
  text-align: right;
  display: grid;
  gap: 0.3rem;
  scroll-margin-top: 12rem;
}

.choice-btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.choice-btn.is-chosen {
  border-color: rgba(68, 107, 114, 0.24);
  background: rgba(220, 233, 228, 0.46);
}

.choice-label {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.choice-hint {
  font-size: 0.88rem;
}

.choice-locked-note {
  padding: 0.7rem 0.82rem;
  border-radius: 14px;
  background: rgba(246, 241, 233, 0.78);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  text-align: center;
}

.summary-layout {
  display: grid;
  gap: 1rem;
}

.summary-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-panel {
  padding: 1rem;
  border-radius: var(--radius-lg);
  display: grid;
  gap: 0.8rem;
}

.summary-stats {
  display: grid;
  gap: 0.75rem;
}

.final-stat {
  display: grid;
  gap: 0.42rem;
}

.final-stat__head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--text-soft);
}

.final-stat__head strong {
  color: var(--text);
}

.summary-copy strong {
  color: var(--text);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(34, 50, 51, 0.24);
  backdrop-filter: blur(8px);
}

.overlay-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.15rem;
  border-radius: var(--radius-xl);
}

.overlay-card--compact {
  width: min(560px, 100%);
}

.overlay-body {
  display: grid;
  gap: 0.9rem;
}

.overlay-note,
.recent-note {
  font-size: 0.92rem;
}

.how-list,
.overlay-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.how-list li,
.overlay-list li,
.path-item,
.recent-card {
  padding: 0.86rem 0.9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--border);
}

.path-item {
  display: grid;
  gap: 0.45rem;
}

.path-item.is-current {
  border-color: rgba(68, 107, 114, 0.22);
  background: rgba(220, 233, 228, 0.34);
}

.path-item.is-done {
  background: rgba(237, 247, 241, 0.68);
}

.path-item-top,
.recent-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.path-title,
.recent-title {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.path-state,
.recent-stage {
  color: var(--text-faint);
  font-size: 0.78rem;
}

.recent-card {
  display: grid;
  gap: 0.45rem;
}

.recent-choice {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes statPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(68, 107, 114, 0.22);
  }

  60% {
    box-shadow: 0 0 0 12px rgba(68, 107, 114, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(68, 107, 114, 0);
  }
}

@media (max-width: 960px) {
  .status-shell {
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 12rem;
  }

  .app-shell {
    width: min(100%, calc(100% - 0.8rem));
  }

  .overlay-head,
  .summary-head {
    flex-direction: column;
  }

  .status-shell {
    top: 0.35rem;
    padding: 0.62rem 0.68rem 0.6rem;
    border-radius: 22px;
    grid-template-columns: minmax(0, 160px) minmax(0, 1fr);
    gap: 0.42rem 0.72rem;
  }

  .status-top {
    gap: 0.55rem;
  }

  .brand-block--compact h1 {
    font-size: 1.16rem;
  }

  .brand-kicker {
    font-size: 0.74rem;
  }

  .status-top .btn-compact {
    min-height: 34px;
    padding: 0.38rem 0.66rem;
  }

  .feedback-strip {
    width: 100%;
    padding: 0.48rem 0.58rem;
    border-radius: 16px;
  }

  .feedback-title {
    font-size: 0.82rem;
  }

  .feedback-subcopy {
    font-size: 0.72rem;
  }

  .feedback-actions .btn {
    min-height: 32px;
    padding: 0.36rem 0.64rem;
    font-size: 0.76rem;
  }

  .indicator-bar {
    gap: 0.32rem;
  }

  .indicator-card {
    min-width: 98px;
    padding: 0.34rem 0.44rem 0.36rem;
    border-radius: 12px;
  }

  .indicator-name {
    font-size: 0.64rem;
  }

  .indicator-inline {
    gap: 0.28rem;
  }

  .indicator-value {
    font-size: 0.7rem;
  }

  .indicator-track {
    height: 0.22rem;
  }

  .indicator-delta {
    top: -0.12rem;
    left: 0.22rem;
    min-width: 24px;
    font-size: 0.5rem;
  }

  .indicator-tooltip {
    font-size: 0.72rem;
    padding: 0.4rem 0.56rem;
  }

  .hero-card,
  .situation-card,
  .summary-card,
  .overlay-card {
    border-radius: 22px;
  }

  .hero-card,
  .situation-card,
  .summary-card,
  .overlay-card {
    padding: 1rem;
  }

  .utility-row--floating {
    width: 100%;
    margin: 0 auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.35rem;
    padding-bottom: 0.04rem;
    scrollbar-width: none;
  }

  .utility-row--floating::-webkit-scrollbar {
    display: none;
  }

  .utility-row--floating .utility-btn {
    flex: 0 0 auto;
    min-height: 31px;
    padding: 0.34rem 0.58rem;
    font-size: 0.74rem;
  }

  .main-stage {
    width: 100%;
  }

  .situation-title {
    font-size: clamp(1.8rem, 8.8vw, 2.35rem);
  }

  .situation-context {
    font-size: 0.92rem;
  }

  .choice-btn {
    padding: 0.95rem;
    scroll-margin-top: 11.5rem;
  }

  .overlay {
    align-items: end;
  }

  .overlay-card--sheet {
    width: 100%;
    max-height: min(82vh, 640px);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
}

@media (max-width: 480px) {
  html {
    scroll-padding-top: 10.5rem;
  }

  .status-shell {
    grid-template-columns: minmax(0, 144px) minmax(0, 1fr);
  }

  .brand-block--compact h1 {
    display: none;
  }

  .indicator-card {
    min-width: 92px;
  }

  .choice-btn {
    scroll-margin-top: 10.25rem;
  }
}

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