@font-face {
  font-family: "Pixelify Sans";
  src: url('./assets/fonts/pixelify-sans.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme:light;
  --ink:#291736;
  --lavender:#c6ace8;
  --yellow:#ffe452;
  --green:#233e26;
  font-family:"Pixelify Sans", sans-serif;
  color:var(--ink);
  background:#faf5e9;
  font-synthesis:none;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
  padding:max(12px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));
  background:radial-gradient(ellipse at 50% 10%,#e8dcf5,transparent 70%);
}
button,a,input {
  -webkit-tap-highlight-color:transparent;
}
button {
  font:inherit;
  color:inherit;
  cursor:pointer;
  min-height:44px;
  border:1px solid #8970ab;
  border-radius:16px;
  background:#dac8f1;
  font-weight:700;
}
button:focus-visible,a:focus-visible,input:focus-visible {
  outline:3px solid #532c80;
  outline-offset:3px;
}
button:active {
  transform:translateY(2px);
}
button:disabled {
  cursor:default;
  opacity:.55;
}
button:disabled:active {
  transform:none;
}
.game {
  max-width:460px;
  margin:auto;
  padding:14px 12px 12px;
  background:linear-gradient(130deg,#d8c7ee,#bfa0df 60%,#d5bfec);
  border:2px solid #e9ddf5;
  border-radius:32px;
  box-shadow:0 15px 40px #4b2a5f22,inset 0 2px 3px #fff9;
}
.panel {
  background:linear-gradient(145deg,#ddcdf1,#c3a7e4);
  border:1px solid #ab8dc9;
  box-shadow:inset 0 2px 3px #f7edff99,0 3px 4px #63427829;
  border-radius:20px;
}
.top {
  display:grid;
  grid-template-columns:auto 1fr 44px;
  gap:10px;
  align-items:center;
  padding:13px 11px;
}
.brand {
  font-family:Impact,"Arial Black",sans-serif;
  font-weight:1000;
  letter-spacing:-1.4px;
  line-height:.83;
  font-size:27px;
  text-decoration:none;
  color:var(--ink);
  transform:rotate(-5deg);
  display:block;
}
.brand>span {
  display:block;
}
.brand i {
  font-size:20px;
  font-style:normal;
}
.trademark {
  font:8px sans-serif;
  letter-spacing:0;
}
.identity {
  display:flex;
  flex-direction:column;
  gap:6px;
  padding-left:10px;
  border-left:1px solid #9b79bf;
  font-size:12px;
  line-height:1.2;
}
.identity strong {
  font-size:13px;
}
.day {
  border:1px solid #9f7fc1;
  border-radius:20px;
  text-align:center;
  padding:4px;
  font-weight:700;
  box-shadow:inset 0 1px 3px #6f488b33;
}
.gear {
  width:44px;
  font-size:27px;
  border-radius:50%;
  background:#bea0de;
}
.gauges {
  display:grid;
  grid-template-columns:1fr 1fr;
  margin:12px 0;
  padding:5px 0;
}
.gauge {
  padding:9px 10px;
  min-width:0;
  display:grid;
  grid-template-columns:24px 1fr;
  column-gap:7px;
  align-items:center;
}
.gauge:nth-child(odd) {
  border-right:1px solid #a78abd;
}
.gauge:nth-child(-n+2) {
  border-bottom:1px solid #a78abd;
}
.gauge-icon {
  grid-row:1/3;
  font-size:26px;
  color:var(--green);
}
.gauge-label {
  display:flex;
  justify-content:space-between;
  gap:3px;
  font-weight:bold;
  font-size:12px;
  text-transform:uppercase;
}
.gauge-value {
  font-size:11px;
  font-weight:400;
}
.meter {
  height:17px;
  border:2px solid var(--green);
  padding:2px;
  border-radius:7px;
  background:#d0c4de;
  margin-top:5px;
}
.meter-fill {
  display:block;
  height:100%;
  background:repeating-linear-gradient(to right,#2d482b 0,#2d482b 9px,transparent 9px,transparent 11px);
  transition:width .3s;
}
.scene-shell {
  position:relative;
  padding:7px;
  background:#9879b5;
  border-radius:25px;
  box-shadow:inset 0 3px 7px #3e2b4c88,0 2px 2px #fff9;
  overflow:hidden;
}
canvas {
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:4/3;
  image-rendering:pixelated;
  border-radius:18px;
  background:#a6b970;
}
.speech {
  position:absolute;
  top:9%;
  right:8%;
  max-width:64%;
  padding:6px 8px;
  background:#d1dd99;
  color:#233e26;
  border:2px solid #233e26;
  border-radius:7px;
  font-size:12px;
  font-weight:700;
  box-shadow:2px 2px #233e26;
}
.speech:after {
  content:"";
  position:absolute;
  bottom:-7px;
  left:14px;
  width:9px;
  height:9px;
  background:#d1dd99;
  border-bottom:2px solid #233e26;
  border-right:2px solid #233e26;
  transform:skewY(-35deg);
}
#loading {
  position:absolute;
  inset:15px;
  background:#bbcd83;
  display:grid;
  place-content:center;
  text-align:center;
  color:#233e26;
  padding:20px;
}
#loading[hidden] {
  display:none;
}
.controls {
  margin-top:12px;
  min-height:255px;
}
.notice {
  padding:13px 15px;
  margin:0 0 12px;
  font-size:14px;
  line-height:1.45;
}
.care-actions {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  padding:0 4px;
}
.care {
  background:transparent;
  border:0;
  display:flex;
  align-items:center;
  flex-direction:column;
  gap:8px;
  font-size:13px;
  text-transform:uppercase;
  padding:0;
  min-width:0;
}
.care-disc {
  display:grid;
  place-items:center;
  width:100%;
  aspect-ratio:1;
  max-width:104px;
  border-radius:50%;
  background:radial-gradient(circle at 35% 25%,#fff58d,#ffe153 60%,#edbe2d);
  border:2px solid #775321;
  box-shadow:inset 0 3px 3px #fff9,0 4px 0 #745283,0 5px 8px #5c367444;
  font-size:40px;
  color:#233e26;
}
.progression {
  margin-top:14px;
  padding:12px;
  display:flex;
  align-items:center;
  gap:12px;
  font-size:12px;
}
.progression .track {
  flex:1;
  height:14px;
  border:1px solid #9270ae;
  border-radius:5px;
  background:#c4acd9;
  overflow:hidden;
}
.progression .track span {
  display:block;
  width:14%;
  height:100%;
  background:#6b497f;
}
.progression small {
  display:block;
  font-size:10px;
  margin-top:3px;
}
.sheet {
  padding:16px 14px;
}
.sheet h1 {
  font-size:15px;
  text-align:center;
  margin:0 0 12px;
  text-transform:uppercase;
}
.situation-text {
  font-size:16px;
  line-height:1.5;
  margin:14px 0 16px;
  font-weight:700;
  overflow-wrap:anywhere;
}
.countdown {
  display:flex;
  gap:10px;
  align-items:center;
  font-size:13px;
}

.choice,.wide {
  display:block;
  width:100%;
  padding:14px 12px;
  margin-top:10px;
  line-height:1.4;
  border:2px solid #99762c;
  background:linear-gradient(#fff280,#ffdc43);
  box-shadow:inset 0 2px #fff9,0 3px 0 #8b69a3;
  border-radius:13px;
  font-size:15px;
}
.changes {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:12px;
}
.change {
  padding:7px 9px;
  border-radius:9px;
  background:#ded0ef;
  font-size:12px;
  border:1px solid #b79acf;
}
.change b {
  display:inline-block;
  padding:2px 4px;
  border-radius:4px;
  background:#d4eea1;
  color:#233e26;
}
.change b.negative {
  background:#ffe46c;
}
.care-changes {
  margin:12px 4px;
}
.no-change {
  font-size:12px;
}
footer {
  font-size:10px;
  margin:15px 4px 0;
  line-height:1.6;
  display:flex;
  justify-content:space-between;
  gap:8px;
}
footer a {
  color:inherit;
  min-height:44px;
  display:inline-flex;
  align-items:center;
  margin-top:-13px;
}
.save-status {
  font-size:12px;
  line-height:1.5;
}
dialog {
  width:calc(100% - 28px);
  max-width:420px;
  max-height:85dvh;
  overflow:auto;
  background:#d6c2ed;
  color:var(--ink);
  border:2px solid #a381c3;
  border-radius:22px;
  padding:20px;
  box-shadow:0 20px 60px #29173655;
}
dialog::backdrop {
  background:#29173688;
}
.dialog-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.dialog-head h1 {
  font-size:22px;
  margin:0;
}
.dialog-head button {
  width:44px;
}
.setting {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:58px;
  font-size:15px;
  border-bottom:1px solid #b395d0;
}
.setting input {
  width:24px;
  height:24px;
  accent-color:#5a3379;
}
dialog p {
  font-size:13px;
  line-height:1.6;
}
.secondary {
  background:#e5d7f3;
  border-color:#a381c3;
}
.small {
  font-size:12px!important;
}
[hidden] {
  display:none!important;
}
@media(max-width:350px) {
  .game {
    padding:10px 8px;
  }
  .top {
    gap:6px;
    padding:12px 8px;
  }
  .brand {
    font-size:23px;
  }
  .identity {
    font-size:11px;
    padding-left:7px;
  }
  .identity strong {
    font-size:11px;
  }
  .gauge {
    padding:9px 7px;
    grid-template-columns:19px 1fr;
    gap:4px;
  }
  .gauge-icon {
    font-size:23px;
  }
  .gauge-label {
    font-size:11px;
  }
  .gauge-value {
    font-size:10px;
  }
  .care-actions {
    gap:10px;
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    transition:none!important;
    scroll-behavior:auto!important;
  }
}
.cat-mark {
  width:22px;
  height:22px;
  vertical-align:middle;
  transform:rotate(5deg);
}

/* Artwork reconstructed from the approved mockup, not font glyphs. */
.brand {
  width: 112px;
  transform: none;
  line-height: 1;
}
.brand img {
  display: block;
  width: 100%;
  height: auto;
}
.ui-asset {
  display: inline-block;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  background-image: url('./assets/icons.png');
  background-repeat: no-repeat;
  background-size: 300% 300%;
  image-rendering: pixelated;
  vertical-align: middle;
}
.asset-bulb { background-position: 0% 0%; }
.asset-moon { background-position: 50% 0%; }
.asset-star { background-position: 100% 0%; }
.asset-friends { background-position: 0% 50%; }
.asset-book { background-position: 50% 50%; }
.asset-gear { background-position: 100% 50%; }
.asset-school { background-position: 0% 100%; }
.asset-stage { background-position: 50% 100%; }
.asset-arrow { background-position: 100% 100%; }
.gear {
  display: grid;
  place-items: center;
}
.gear .ui-asset { width: 36px; height: 36px; }
.gauge-icon { width: 44px; height: 44px; margin-left: -11px; }
.care-icon { width: 85%; height: 85%; }
.notice { display: flex; align-items: center; gap: 9px; padding: 10px; }
.notice-avatar { width: 46px; height: 46px; }
.progress-person { display: flex; align-items: center; flex-direction: column; font-weight: bold; }
.progress-person .ui-asset { width: 48px; height: 48px; }
.progress-person small { font-weight: normal; }
.progress-arrow { width: 22px; height: 22px; }
@media (max-width: 350px) {
  .brand { width: 86px; }
  .gauge-icon { width: 40px; height: 40px; }
  .notice { gap: 6px; }
  .notice-avatar { width: 36px; height: 36px; }
  .progression { gap: 7px; padding: 9px; }
  .progress-person .ui-asset { width: 42px; height: 42px; }
}
/* The two-head silhouette is wider than the single gauge symbols. */
.gauge-icon.asset-friends { width: 28px; height: 28px; margin-left: -4px; }

/* Match the pixel UI in the approved mockup, including the foreground timer. */
:root { font-size: 18px; }
.identity { font-size: 14px; }
.identity strong { font-size: 14px; }
.day { font-size: 15px; }
.gauge-label { font-size: 14px; font-weight: 600; }
.gauge-value { font-size: 13px; }
.speech { font-size: 16px; font-weight: 500; }
.notice { font-size: 17px; line-height: 1.3; }
.care { font-size: 17px; }
.progression { font-size: 14px; }
.progression small { font-size: 12px; }
.sheet { padding: 14px 12px; }
.sheet h1 { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.situation-text { font-size: 19px; font-weight: 500; line-height: 1.25; text-align: center; margin: 12px 0; }
.choice { font-size: 19px; font-weight: 600; line-height: 1.2; padding: 13px 10px; }
.countdown { gap: 8px; font-size: 17px; }
#countdown-time { white-space: nowrap; min-width: 34px; }
.segmented-timer {
  display: flex;
  align-items: stretch;
  flex: 1;
  gap: 3px;
  min-width: 0;
  height: 20px;
  padding: 3px;
  border: 2px solid #44523e;
  border-radius: 7px;
  background: #bba6d6;
  box-shadow: inset 0 1px 2px #79579377, 0 1px 0 #eee4f9;
}
.timer-segment { flex: 1; min-width: 0; background: #2d482b; border-radius: 1px; }
.timer-segment.empty { background: #cdb8e2; }
.change { font-size: 14px; }
footer { font-size: 12px; }
@media (max-width: 350px) {
  .identity, .identity strong { font-size: 12px; }
  .gauge-label { font-size: 12px; }
  .gauge-value { font-size: 11px; }
  .notice { font-size: 16px; }
}

/* Chapter actions wrap without compressing touch targets. */
.care-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.care { min-width: 0; overflow-wrap: anywhere; }
.setting select { min-height: 44px; font: inherit; max-width: 50%; }
.gauge-label { overflow-wrap: anywhere; }

.reserves { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; font-size: 14px; }
.reserves div { min-width: 0; }
.reserves strong, .reserves small { display: block; }
.reserves small { margin-top: 4px; line-height: 1.3; }
.critical-warning { padding: 12px; border: 3px solid #6b2545; color: #4d1735; line-height: 1.4; }
.meter.critical { outline: 2px solid #6b2545; outline-offset: 2px; }
.death-help { font-size: 15px; line-height: 1.4; }
[hidden] { display: none !important; }

.ui-asset.career-icon { display: inline-flex; align-items: center; justify-content: center; background-image: none; }
.career-icon::before { content: ''; display: block; width: var(--icon-width); height: var(--icon-height);
  background-image: url('./assets/career-icons.png'); background-repeat: no-repeat;
  background-size: var(--atlas-size); background-position: var(--atlas-position); image-rendering: pixelated; }
/* Supplementary sprites use tight bounds; unlike the older atlas they do not
   need a large frame to compensate for transparent cell padding. */
.gauge-icon.career-icon { width: 24px; height: 28px; margin-left: 0; }
.care-icon.career-icon { width: 70%; height: 70%; }

.care-help { margin-top: 14px; padding: 0 12px 10px; font-size: 15px; }
.care-help summary { min-height: 44px; padding: 12px 0; cursor: pointer; }
.care-help p { line-height: 1.4; }
.care-effect-row { padding: 10px 0; border-top: 1px solid #a78abd; }
.care-effect-row strong { display: block; margin-bottom: 6px; }
.care-effect-row .changes { justify-content: flex-start; }

.progression { flex-wrap: wrap; }
.trial-targets { flex-basis: 100%; line-height: 1.4; }

.install-panel { margin-top: 16px; padding: 12px; }
.install-panel p { font-size: 15px; line-height: 1.45; margin: 8px 0; }
.install-panel button { width: 100%; }

.onboarding { padding: 16px; border: 2px solid #8a61ad; }
.onboarding h2 { margin: 4px 0 10px; font-size: 24px; line-height: 1.15; }
.onboarding p, .onboarding li { font-size: 16px; line-height: 1.4; }
.onboarding-progress { margin: 0; font-size: 13px !important; text-transform: uppercase; }
.onboarding-gauges { padding-left: 20px; margin: 12px 0; }
.onboarding-gauges li + li { margin-top: 6px; }
.onboarding .changes { margin: 12px 0; }
.onboarding .wide { margin-top: 10px; }
.onboarding-highlight { outline: 2px solid #ffe452; outline-offset: 2px; }
.sheet > .onboarding { margin-bottom: 18px; }
