/* Critical Thinking for a Stoic Mind — cosmic gold style of the author site */
:root {
  --bg: #05070d; --ink: #f4efe2; --soft: #c9c2b0; --dim: #8d8778;
  --gold: #c9a227; --gold-2: #e7c46a; --teal: #5fb8a3; --teal-2: #8fe6d2;
  --red: #e0705f; --red-2: #ff9b8a; --card: rgba(12, 16, 28, 0.9); --line: rgba(201, 162, 39, 0.35);
  --you: #2f8f7c; --rival: #a8423a; --neutral: #3a3f52;
  --serif: "Cormorant Garamond", Georgia, serif; --body: "Literata", Georgia, serif; --mono: "Space Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body { font: 400 1.04rem/1.55 var(--body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; }
[hidden] { display: none !important; }

.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 78% 12%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 72%, #fff7 50%, transparent 51%), radial-gradient(1.5px 1.5px at 62% 44%, #ffe9b8aa 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 82%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 6% 90%, #fff6 50%, transparent 51%),
    radial-gradient(60vmax 40vmax at 15% 10%, rgba(80, 120, 220, 0.18), transparent 70%),
    radial-gradient(50vmax 40vmax at 90% 90%, rgba(180, 90, 220, 0.14), transparent 70%), var(--bg);
  background-size: 300px 300px, 260px 260px, 340px 340px, 420px 420px, 380px 380px, 290px 290px, auto, auto, auto;
}

.stage { max-width: 1240px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); min-height: 100vh; display: flex; }
.screen { width: 100%; align-self: center; animation: rise .5s ease both; }
.screen-game { align-self: flex-start; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.eyebrow { font: 700 .74rem/1.4 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--teal-2); margin: 0 0 .6rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.08; margin: 0 0 .8rem; }
h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); }
h1 span { color: var(--gold-2); font-style: italic; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: 1.55rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .7rem 1.3rem; border: 1px solid var(--gold); background: transparent; color: var(--ink);
  font: 700 .78rem/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background .2s, transform .15s, opacity .2s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); background: rgba(201, 162, 39, .12); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--teal-2); outline-offset: 3px; }
.btn-gold { background: linear-gradient(135deg, #b8901f, #e7c46a); color: #120d02; border-color: transparent; box-shadow: 0 10px 30px rgba(201, 162, 39, .22); }
.btn-gold:hover:not(:disabled) { background: linear-gradient(135deg, #c99d24, #f0d07a); }
.btn-teal { border-color: var(--teal); }
.btn-red { border-color: var(--red); }
.btn small { font-weight: 400; letter-spacing: .04em; opacity: .8; }

/* title */
.screen-title { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(24px, 5vw, 60px); align-items: center; }
.title-art img { border: 1px solid var(--line); box-shadow: 0 30px 70px rgba(0, 0, 0, .6), 0 0 60px rgba(95, 184, 163, .1); }
.lede { color: var(--soft); max-width: 36rem; }
.how { padding-left: 1.2rem; margin: 1rem 0 1.5rem; color: var(--soft); display: grid; gap: .45rem; }
.how b { color: var(--gold-2); font-weight: 500; }
.title-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.best { font: .8rem var(--mono); color: var(--teal-2); margin: 1rem 0 0; letter-spacing: .05em; }
.fine { font: .72rem var(--mono); color: var(--dim); margin: 1rem 0 0; }
.back { display: inline-block; margin-top: 1rem; font: .78rem var(--mono); color: var(--dim); }
.back:hover { color: var(--gold-2); }
.quote { margin: 1.2rem 0 0; padding-left: 1rem; border-left: 2px solid var(--gold); font: italic 500 1.2rem/1.4 var(--serif); color: var(--ink); }
.quote cite { display: block; margin-top: .35rem; font: 700 .66rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-style: normal; }

/* top bar */
.bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem 1.4rem; padding: .8rem 1rem; margin-bottom: 14px; background: var(--card); border: 1px solid var(--line); }
.bar-title { display: flex; flex-direction: column; }
.season { font: 600 1.45rem/1.1 var(--serif); }
.phase { font: 700 .7rem var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--teal-2); }
.bar-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.stat { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: .45rem; align-items: center; }
.stat .ic { grid-row: 1 / 3; width: 12px; height: 12px; border-radius: 50%; }
.stat b { font: 700 1.25rem/1 var(--mono); }
.stat small { font: .62rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.ic.cp { background: var(--gold-2); } .ic.mo { background: var(--teal-2); } .ic.al { background: #9fb4ff; } .ic.rg { background: var(--you); }
.stat.low b { color: var(--red-2); }
.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.25); } }

/* board */
.board { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 14px; align-items: start; }
.map-wrap { background: var(--card); border: 1px solid var(--line); padding: 10px; position: sticky; top: 12px; }
.map { width: 100%; height: auto; display: block; touch-action: manipulation; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: .5rem .3rem 0; font: .68rem var(--mono); color: var(--dim); }
.sw { display: inline-block; width: 10px; height: 10px; margin-right: .35rem; vertical-align: -1px; }
.sw.you { background: var(--you); } .sw.rival { background: var(--rival); } .sw.neutral { background: var(--neutral); }

.cell { cursor: pointer; outline: none; }
.cell rect.body { stroke: rgba(201, 162, 39, .35); stroke-width: 1.5; transition: fill .4s, stroke .2s; }
.cell.you rect.body { fill: url(#g-you); } .cell.rival rect.body { fill: url(#g-rival); } .cell.neutral rect.body { fill: url(#g-neutral); }
.cell:hover rect.body, .cell:focus-visible rect.body { stroke: var(--gold-2); stroke-width: 2.5; }
.cell.sel rect.body { stroke: var(--gold-2); stroke-width: 4; }
.cell.target rect.body { stroke: var(--teal-2); stroke-width: 3; stroke-dasharray: 8 5; }
.cell.flash rect.body { animation: flash 1.2s ease; }
@keyframes flash { 30% { stroke: #fff; stroke-width: 6; } }
.cell .name { font: 600 21px var(--serif); fill: var(--ink); }
.cell .tag { font: 700 11px var(--mono); letter-spacing: .12em; fill: rgba(244, 239, 226, .65); text-transform: uppercase; }
.cell .forces { font: 700 26px var(--mono); fill: var(--ink); }
.cell .star { font: 22px serif; fill: var(--gold-2); }
.cell .bonus { font: 700 13px var(--mono); fill: var(--teal-2); }
.link { stroke: rgba(201, 162, 39, .22); stroke-width: 2; }

/* panel */
.panel { background: var(--card); border: 1px solid var(--line); padding: 18px; min-height: 300px; }
.advisor { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.advisor img { width: 64px; height: 64px; flex: none; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.advisor p { margin: 0; font: italic 500 1.1rem/1.35 var(--serif); color: var(--soft); }
.panel h3 { margin-bottom: .4rem; }
.panel .sub { color: var(--soft); margin: 0 0 1rem; font-size: .96rem; }

.report { border: 1px solid rgba(201, 162, 39, .3); padding: 14px; margin-bottom: 12px; background: rgba(255, 255, 255, .025); }
.report-head { display: flex; justify-content: space-between; gap: .6rem; font: 700 .68rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-2); margin-bottom: .45rem; }
.report-head .stamp { color: var(--dim); }
.stamp.t { color: var(--teal-2); } .stamp.f { color: var(--red-2); }
.report p.claim { margin: 0 0 .8rem; font-size: 1rem; }
.report .acts { display: flex; flex-wrap: wrap; gap: .5rem; }
.report .acts .btn { flex: 1 1 auto; min-height: 44px; padding: .55rem .8rem; }
.result { margin: .7rem 0 0; padding: .6rem .7rem; font-size: .93rem; color: var(--soft); border-left: 3px solid var(--gold); background: rgba(201, 162, 39, .06); }
.result.good { border-color: var(--teal-2); } .result.bad { border-color: var(--red); }
.result b { color: var(--ink); font-weight: 500; }
.lesson { display: block; margin-top: .35rem; font: italic 500 1.02rem/1.35 var(--serif); color: var(--gold-2); }

.orders-sel { padding: 12px; border: 1px dashed rgba(201, 162, 39, .35); margin-bottom: 12px; }
.orders-sel h4 { margin: 0 0 .2rem; font: 600 1.3rem var(--serif); }
.orders-sel .meta { font: .74rem var(--mono); color: var(--dim); margin: 0 0 .7rem; }
.order-btns { display: grid; gap: .5rem; }
.order-btns .btn { justify-content: space-between; text-align: left; letter-spacing: .06em; }
.global-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .4rem 0 1rem; }
.log { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .45rem; font-size: .93rem; color: var(--soft); }
.log li { padding: .45rem .6rem; border-left: 3px solid var(--line); background: rgba(255, 255, 255, .02); }
.log li.good { border-color: var(--teal-2); } .log li.bad { border-color: var(--red); }
.log li b { color: var(--ink); font-weight: 500; }
.dice { font: 700 .74rem var(--mono); color: var(--dim); }

.dilemma-art { width: 100%; height: 150px; object-fit: cover; border: 1px solid var(--line); margin-bottom: 12px; }
.choices { display: grid; gap: .6rem; margin-top: .6rem; }
.choice { width: 100%; text-align: left; padding: .8rem 1rem; min-height: 56px; background: rgba(255, 255, 255, .03); color: var(--ink); border: 1px solid rgba(201, 162, 39, .32); cursor: pointer; font: 1rem/1.4 var(--body); }
.choice:hover { background: rgba(201, 162, 39, .1); border-color: var(--gold); }
.choice:focus-visible { outline: 2px solid var(--teal-2); outline-offset: 2px; }
.next-row { display: flex; justify-content: flex-end; margin-top: 1rem; }

/* final */
.final-card { max-width: 920px; margin: 0 auto; display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: center; background: var(--card); border: 1px solid var(--line); padding: clamp(22px, 4vw, 42px); }
.final-art { border: 1px solid var(--line); }
.final-line { color: var(--soft); }
.final-stats { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .35rem; font: .84rem var(--mono); color: var(--soft); }
.final-stats b { color: var(--ink); }
.final-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; }
  .map-wrap { position: static; }
}
@media (max-width: 820px) {
  .screen-title { grid-template-columns: 1fr; }
  .title-art { max-width: 280px; margin: 0 auto; }
  .final-card { grid-template-columns: 1fr; }
  .final-art { max-width: 200px; margin: 0 auto; }
}
@media (max-width: 520px) {
  .bar-stats { width: 100%; justify-content: space-between; gap: .4rem; }
  .stat small { font-size: .56rem; }
  .global-btns { grid-template-columns: 1fr; }
  .panel { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.cell.reach rect.body { stroke: rgba(143, 230, 210, .55); stroke-width: 2.5; stroke-dasharray: 4 6; }
@media (max-width: 600px) {
  .cell .name { font-size: 29px; }
  .cell .tag { font-size: 15px; }
  .cell .forces { font-size: 40px; }
  .cell .star { font-size: 30px; }
  .cell .bonus { font-size: 18px; }
  .map-wrap { padding: 6px; }
}

/* Return to the author page: a command-console key with targeting brackets and a radar sweep. It sits in the page flow, so it never covers text. */
.home-row { margin: 1.2rem 0 0; }
.home { position: relative; display: inline-flex; align-items: center; min-height: 48px; padding: .7rem 1.4rem; overflow: hidden; isolation: isolate; text-decoration: none;
  font: 700 .8rem/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--teal-2); background: rgba(10, 30, 32, .85);
  border: 1px solid rgba(95, 184, 163, .55); box-shadow: 0 0 0 1px #000, 0 0 18px rgba(95, 184, 163, .22); animation: home-pulse 2.8s ease-in-out infinite; transition: color .2s, background .2s; }
.home::before, .home::after { content: ""; position: absolute; width: 10px; height: 10px; border: 2px solid var(--gold-2); pointer-events: none; }
.home::before { top: 3px; left: 3px; border-right: 0; border-bottom: 0; }
.home::after { bottom: 3px; right: 3px; border-left: 0; border-top: 0; }
.home span::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, transparent, rgba(143, 230, 210, .28), transparent); width: 40%; animation: home-sweep 3.2s linear infinite; }
.home:hover, .home:focus-visible { color: #fff; background: rgba(20, 60, 58, .95); outline: none; box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--teal-2), 0 0 26px rgba(95, 184, 163, .45); }
@keyframes home-pulse { 0%, 100% { box-shadow: 0 0 0 1px #000, 0 0 12px rgba(95, 184, 163, .18); } 50% { box-shadow: 0 0 0 1px #000, 0 0 24px rgba(95, 184, 163, .4); } }
@keyframes home-sweep { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
@media (max-width: 520px) { .home { font-size: .72rem; padding: .7rem 1rem; letter-spacing: .08em; } }
