/*
 * MindArc reference-informed vertical slice
 *
 * Built after the Puzzmo / Brilliant / Neal.fun / NYT Games / Lumosity teardown.
 * Scope: Today -> Daily Circuit -> gameplay -> stage transition -> result.
 * Presentation only. No gameplay, scoring, persistence, auth, billing or API changes.
 */

:root {
  --ref-ink: #f4f5ed;
  --ref-muted: #9ca8a4;
  --ref-faint: #6f7b77;
  --ref-rule: #30393a;
  --ref-rule-soft: rgba(255,255,255,.06);
  --ref-accent: #c7f76b;
  --ref-paper: #101418;
}

/* --- Shell: quieter chrome, content gets the visual weight ---------------- */

.site-header {
  height: 82px;
  border-bottom-color: rgba(255,255,255,.07);
}

.wordmark {
  font-size: 1.55rem;
}

.top-nav {
  gap: 1px;
}

.top-nav a {
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 8px;
  color: #95a19d;
}

.top-nav a:hover {
  background: rgba(255,255,255,.035);
}

.top-nav a[aria-current="page"] {
  background: transparent;
  color: var(--ref-ink);
  box-shadow: inset 0 -2px 0 var(--ref-accent);
}

.header-actions .account-header,
.header-actions .sound-toggle {
  background: transparent;
  border-color: transparent;
}

/* --- Today: editorial page, not dashboard hero ---------------------------- */

body[data-view="home"] main {
  width: min(1220px, calc(100% - 56px));
}

.home-heading {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: end;
  gap: 24px;
  padding: 34px 0 18px;
}

.home-heading h1 {
  margin-top: 5px;
  font-size: clamp(2.15rem,4.2vw,3.5rem);
  line-height: 1;
  letter-spacing: -.065em;
}

.home-heading .eyebrow {
  color: #77847f;
}

.habit-pill {
  margin-bottom: 3px;
  border: 0;
  background: transparent;
  padding: 7px 0;
  color: #89958f;
}

.habit-pill .habit-spark {
  color: var(--ref-accent);
}

.habit-pill strong {
  color: #dce1da;
}

.today-layout {
  display: block;
}

.daily-panel {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(260px,300px);
  border: 0;
  border-top: 1px solid var(--ref-rule);
  border-bottom: 1px solid var(--ref-rule);
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.daily-main {
  min-height: 470px;
  padding: 54px 72px 48px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.daily-topline {
  width: 100%;
  margin-bottom: 28px;
}

.daily-topline .eyebrow {
  color: var(--ref-accent);
}

.free-pill {
  border: 0;
  background: transparent;
  color: var(--ref-faint);
  padding-inline: 0;
}

.daily-main h2 {
  max-width: 10ch;
  margin: 0 0 18px;
  font-size: clamp(3.2rem,6vw,5.7rem);
  line-height: .92;
  letter-spacing: -.078em;
}

.daily-main h2 span {
  color: var(--ref-ink);
}

.daily-main > p {
  max-width: 48ch;
  margin-bottom: 28px;
  color: var(--ref-muted);
  font-size: 1rem;
  line-height: 1.68;
}

.daily-main .primary {
  min-width: 0;
  min-height: 50px;
  border-radius: 8px;
  padding: 14px 22px;
  box-shadow: none;
}

.daily-main .primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.daily-main > .quiet {
  margin-left: 12px;
}

.journey-footnote {
  margin-top: 14px;
  color: var(--ref-faint);
}

/* Puzzmo lesson: meta belongs in a rail, while the experience owns the page. */
.daily-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 35px 0 35px 30px;
  border: 0;
  border-left: 1px solid var(--ref-rule);
  background: transparent;
}

.daily-path {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
}

.daily-path .circuit-row {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  gap: 13px;
  min-height: 92px;
  align-items: start;
  padding: 0;
  border: 0;
  background: transparent;
}

.daily-path .circuit-row::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 35px;
  bottom: 0;
  width: 1px;
  height: auto;
  background: #3b4740;
}

.daily-path .circuit-row:last-child::before {
  display: none;
}

.journey-node {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #536058;
  background: var(--ref-paper);
  color: #a7b2ab;
  box-shadow: 0 0 0 6px var(--ref-paper);
}

.daily-path .is-current .journey-node {
  background: var(--ref-accent);
  border-color: var(--ref-accent);
  color: #182012;
  box-shadow: 0 0 0 6px var(--ref-paper), 0 0 24px rgba(199,247,107,.09);
}

.daily-path .is-complete .journey-node {
  background: #26351f;
  border-color: #587242;
  color: var(--ref-accent);
}

.daily-path .circuit-symbol,
.daily-path .journey-end-symbol {
  display: none;
}

.journey-step-copy {
  gap: 2px;
  padding-top: 0;
}

.journey-state {
  color: var(--ref-faint);
  font-size: .67rem;
  letter-spacing: .12em;
}

.is-current .journey-state {
  color: var(--ref-accent);
}

.circuit-name {
  font-size: 1.02rem;
  line-height: 1.3;
}

.circuit-caption {
  font-size: .77rem;
  color: #75817c;
}

.journey-finish {
  margin: 8px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--ref-rule-soft);
}

.finish-mark {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  font-size: .95rem;
}

/* Long-term progression is supporting editorial content, not another card row. */
.today-companion {
  display: grid;
  grid-template-columns: minmax(0,1.4fr) minmax(250px,.6fr);
  gap: 0;
  margin-top: 26px;
  border-bottom: 1px solid var(--ref-rule);
}

.arc-card {
  display: grid;
  grid-template-columns: 220px minmax(0,1fr);
  grid-template-rows: auto auto auto auto;
  align-items: center;
  gap: 0 28px;
  padding: 8px 30px 30px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.arc-card > .eyebrow,
.arc-card h2,
.arc-card p,
.arc-card .text-link {
  grid-column: 2;
}

.arc-card .mindarc-object {
  grid-column: 1;
  grid-row: 1 / 5;
  max-width: 205px;
  margin: 0;
}

.arc-card h2 {
  margin: 7px 0 5px;
  font-size: 1.35rem;
}

.arc-card p {
  max-width: 48ch;
  color: var(--ref-muted);
}

.arc-card .text-link {
  width: fit-content;
  margin-top: 4px;
}

.browse-invitation {
  min-height: 190px;
  padding: 26px 0 30px 30px;
  border: 0;
  border-left: 1px solid var(--ref-rule);
  border-radius: 0;
  background: transparent;
  align-items: end;
}

.browse-invitation:hover {
  border-color: var(--ref-rule);
  background: rgba(255,255,255,.018);
}

.browse-mark {
  color: #93baff;
}

.account-note {
  margin: 18px 0 38px;
  color: #6d7974;
}

/* --- Active play: page-as-game, not game-inside-card ---------------------- */

body[data-view="play"] main {
  width: min(1180px, calc(100% - 56px));
}

.session-shell {
  max-width: none;
  margin: 0 auto;
  padding-top: 18px;
}

.session-top {
  display: grid;
  grid-template-columns: auto minmax(160px,1fr) auto;
  align-items: center;
  gap: 12px 22px;
}

.back-button {
  grid-column: 1;
  grid-row: 1;
}

.session-time {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.stage-track {
  grid-column: 2;
  grid-row: 1;
  width: min(420px,100%);
  margin: 0 auto;
}

.stage-track span {
  height: 3px;
  background: #2d3637;
}

.session-journey {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 0;
  list-style: none;
  width: min(620px,100%);
  margin: 4px auto 0;
  padding: 0;
}

.session-journey .circuit-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  position: relative;
  color: #7d8984;
}

.session-journey .circuit-row::after {
  content: "";
  position: absolute;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  top: 15px;
  height: 1px;
  background: #34413a;
  z-index: -1;
}

.session-journey .circuit-row:last-child::after {
  display: none;
}

.session-journey .journey-node {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  box-shadow: 0 0 0 5px var(--ref-paper);
}

.session-journey .circuit-symbol,
.session-journey .journey-state,
.session-journey .circuit-caption {
  display: none;
}

.session-journey .circuit-name {
  max-width: 10ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .73rem;
  color: #818d88;
}

.session-journey .is-current .circuit-name {
  color: #dfe5dd;
}

.game-panel {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 22px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.game-meta {
  width: min(760px,100%);
  margin: 0 auto;
  padding: 12px 0 4px;
  border: 0;
}

.game-meta .eyebrow {
  letter-spacing: .13em;
}

.round-count {
  color: #73807a;
}

.game-body {
  padding: 12px 0 22px;
  text-align: center;
}

.game-body h1 {
  margin-inline: auto;
  max-width: 20ch;
  font-size: clamp(2rem,4.2vw,3.5rem);
  line-height: 1;
  letter-spacing: -.065em;
}

.instruction {
  max-width: 55ch;
  margin: 12px auto 0;
  color: #909d97;
  line-height: 1.55;
}

.play-zone {
  min-height: min(480px,52vh);
  margin: 18px 0 10px;
}

/* Brilliant lesson: the object itself should carry the state change. */
.memory-grid {
  width: min(430px,86vw);
  gap: 10px;
}

.tile {
  border-radius: 8px;
  border-color: #3b4646;
  background: #222a2c;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.012);
  transition: transform .13s ease, background .13s ease, border-color .13s ease, box-shadow .13s ease;
}

.tile:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb,var(--game-color) 60%,#3b4646);
}

.tile.selected {
  transform: scale(.94);
  background: color-mix(in srgb,var(--game-color) 78%,#17201a);
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--game-color) 12%,transparent);
}

.tile.target {
  background: var(--game-color);
  box-shadow: 0 0 22px color-mix(in srgb,var(--game-color) 14%,transparent);
}

.tile.missed {
  background: transparent;
  border-style: dashed;
  box-shadow: inset 0 0 0 2px color-mix(in srgb,var(--game-color) 8%,transparent);
}

.tile.wrong {
  transform: translateY(1px);
}

.game-actions {
  min-height: 56px;
}

.game-actions .primary {
  border-radius: 8px;
  box-shadow: none;
}

.memory-count {
  color: #7e8a85;
}

.feedback {
  max-width: 520px;
  margin: 12px auto 18px;
  padding: 10px 0 10px 16px;
  border: 0;
  border-left: 2px solid var(--game-color);
  border-radius: 0;
  background: transparent;
  color: #a7b2ad;
}

.feedback.incorrect {
  border-color: #f1a098;
  background: transparent;
}

.session-bottom {
  grid-column: 1 / -1;
  grid-row: 4;
  width: min(760px,100%);
  margin: 8px auto 0;
  padding-top: 12px;
  border-top: 1px solid var(--ref-rule-soft);
  color: #707c77;
}

/* --- Between games: transformation is the reward ------------------------- */

.stage-celebration {
  min-height: 560px;
  display: grid;
  place-items: center;
}

.stage-celebration .transition-panel {
  max-width: 700px;
  padding: 54px 20px 44px;
}

.connection-seal {
  width: 72px;
  height: 72px;
  margin: 0 auto 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid #40503e;
  background: rgba(199,247,107,.04);
}

.connection-seal .arc-game-glyph {
  border: 0;
  background: transparent;
}

.stage-celebration .transition-panel h1 {
  font-size: clamp(2.8rem,6vw,5rem);
  line-height: .94;
  letter-spacing: -.075em;
}

.stage-celebration .transition-panel > p {
  color: #7c8983;
}

.curiosity-reveal {
  max-width: 560px;
  margin: 28px auto;
  padding: 22px 24px;
  border: 1px solid var(--ref-rule);
  border-radius: 14px;
  background: rgba(255,255,255,.018);
  text-align: center;
}

.next-name {
  margin: 26px auto 18px;
}

.next-name span {
  color: #737f79;
}

.stage-save-note {
  color: #69756f !important;
}

/* --- Results: interpret first, quantify second ---------------------------- */

body[data-view="play"] .transition-panel .result-title {
  max-width: 13ch;
  margin-inline: auto;
  font-size: clamp(2.7rem,5.2vw,4.6rem);
  line-height: .96;
}

.round-rewards {
  width: min(580px,100%);
  margin: 24px auto 10px;
}

.result-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  font-size: clamp(3rem,8vw,4.6rem);
  color: var(--ref-ink);
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}

.result-score strong { font: inherit; font-weight: 500; }
.result-score span { color: #75817c; font-size: .34em; letter-spacing: 0; }

.result-total {
  color: #75817c;
}

.result-stats {
  grid-template-columns: repeat(3,1fr);
  max-width: 620px;
  margin: 26px auto 22px;
  border-color: var(--ref-rule);
}

.result-stats strong {
  font-size: 1.35rem;
}

.result-breakdown {
  max-width: 540px;
}

.result-breakdown > div {
  padding: 7px 0;
  border-bottom: 1px solid var(--ref-rule-soft);
}

.result-breakdown strong {
  color: #d9e0d8;
}

.new-best {
  border: 0;
  background: rgba(199,247,107,.07);
}

/* --- Responsive recomposition, not simple shrinking ---------------------- */

@media (max-width: 900px) {
  body[data-view="home"] main,
  body[data-view="play"] main {
    width: calc(100% - 36px);
  }

  .daily-panel {
    grid-template-columns: minmax(0,1fr) 250px;
  }

  .daily-main {
    padding-right: 40px;
  }

  .today-companion {
    grid-template-columns: 1fr;
  }

  .browse-invitation {
    min-height: 120px;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--ref-rule);
  }
}

@media (max-width: 700px) {
  .site-header,
  .site-footer,
  main,
  body[data-view="home"] main,
  body[data-view="play"] main {
    width: calc(100% - 28px);
  }

  .home-heading {
    display: flex;
    align-items: flex-start;
    padding-top: 26px;
  }

  .habit-pill {
    padding-top: 0;
  }

  .habit-label {
    display: none;
  }

  .daily-panel {
    display: block;
  }

  .daily-main {
    min-height: 0;
    padding: 38px 0 42px;
  }

  .daily-main h2 {
    font-size: clamp(3rem,14vw,4.6rem);
  }

  .daily-main > p {
    max-width: 40ch;
  }

  .daily-side {
    padding: 30px 0 22px;
    border-left: 0;
    border-top: 1px solid var(--ref-rule);
  }

  .daily-path {
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 0;
  }

  .daily-path .circuit-row {
    display: flex;
    min-height: 110px;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
  }

  .daily-path .circuit-row::before {
    left: calc(50% + 18px);
    right: calc(-50% + 18px);
    top: 17px;
    bottom: auto;
    width: auto;
    height: 1px;
  }

  .daily-path .circuit-row:last-child::before {
    display: none;
  }

  .daily-path .journey-step-copy {
    align-items: center;
  }

  .daily-path .circuit-caption {
    display: none;
  }

  .journey-finish {
    margin-top: 6px;
  }

  .arc-card {
    grid-template-columns: 155px minmax(0,1fr);
    gap: 0 16px;
    padding-right: 0;
  }

  .arc-card .mindarc-object {
    max-width: 150px;
  }

  .browse-invitation {
    min-height: 105px;
  }

  .session-top {
    grid-template-columns: auto 1fr auto;
    gap: 9px 12px;
  }

  .session-time {
    font-size: .75rem;
  }

  .stage-track {
    width: 100%;
  }

  .session-journey {
    margin-top: 8px;
  }

  .session-journey .circuit-name {
    display: none;
  }

  .game-panel {
    margin-top: 14px;
  }

  .game-meta {
    padding-top: 9px;
  }

  .game-body {
    padding-top: 8px;
  }

  .game-body h1 {
    font-size: clamp(2rem,10vw,3.1rem);
  }

  .play-zone {
    min-height: 48vh;
    margin-top: 12px;
  }

  .memory-grid {
    width: min(390px,92vw);
    gap: 8px;
  }

  .result-stats {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}

@media (max-width: 430px) {
  .site-header,
  .site-footer,
  main,
  body[data-view="home"] main,
  body[data-view="play"] main {
    width: calc(100% - 24px);
  }

  .home-heading h1 {
    font-size: 2.45rem;
  }

  .daily-main h2 {
    font-size: clamp(2.9rem,15vw,4rem);
  }

  .daily-main .primary {
    width: 100%;
  }

  .daily-main > .quiet {
    width: 100%;
    margin: 8px 0 0;
  }

  .arc-card {
    display: block;
    text-align: center;
    padding: 12px 0 26px;
  }

  .arc-card .mindarc-object {
    margin: 0 auto -4px;
    max-width: 175px;
  }

  .arc-card .text-link {
    margin-inline: auto;
  }

  .browse-invitation {
    padding: 22px 0;
  }

  .session-shell {
    padding-top: 10px;
  }

  .back-button {
    max-width: 105px;
    overflow: hidden;
    white-space: nowrap;
  }

  .session-time {
    font-size: 0;
  }

  .session-time span {
    font-size: .75rem;
  }

  .session-journey .journey-node {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
  }

  .memory-grid {
    width: min(350px,92vw);
    gap: 7px;
  }

  .result-stats strong {
    font-size: 1.12rem;
  }

  .result-stats span {
    font-size: .7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile {
    transition: none !important;
  }
}

/* -------------------------------------------------------------------------
   DE-BOXING PASS: Today and Results keep the important interactions, while
   passive explanation/stat areas lose the decorative frames and rule stacks.
   ------------------------------------------------------------------------- */

.daily-panel {
  column-gap: clamp(34px, 5vw, 72px);
  border: 0;
}

.daily-side {
  padding-left: 0;
  border: 0;
}

.journey-finish,
.today-companion,
.browse-invitation,
.session-bottom {
  border: 0;
}

.today-companion {
  gap: clamp(28px, 5vw, 64px);
}

.browse-invitation {
  padding-left: 0;
}

.browse-invitation:hover {
  border-color: transparent;
  background: rgba(255,255,255,.012);
}

.curiosity-reveal {
  padding: 18px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.result-stats {
  gap: clamp(18px, 4vw, 48px);
  padding: 10px 0;
  border: 0 !important;
}

.result-stats > div + div {
  border: 0 !important;
}

.result-breakdown {
  gap: 4px;
}

.result-breakdown > div {
  border: 0;
}

.round-rewards {
  gap: 4px;
}

.round-rewards .reward-item:not(.milestone-award) {
  padding: 11px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

@media (max-width: 900px) {
  .browse-invitation {
    border: 0;
  }
}

@media (max-width: 700px) {
  .daily-panel {
    border: 0;
  }
  .daily-side {
    border: 0;
  }
}
