:root {
  --ink: #333b31;
  --green: #436b50;
  --leaf: #dce9cf;
  --muted: #697168;
  --edge: #d8d9c9;
  --paper: #f9f7ef;
  --white: #fffef8;
  --shadow: 0 3px 0 #dbd9c9;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(#dddcca 0.7px, transparent 0.7px);
  background-size: 7px 7px;
  color: var(--ink);
  font:
    16px/1.55 "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
}
button,
a,
input,
select,
textarea {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  color: inherit;
}
a {
  color: var(--green);
}
button {
  border: 0;
  background: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #a97633;
  outline-offset: 3px;
}
button:disabled {
  cursor: default;
}
#shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
}
aside {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: #f2f1e5;
  border-right: 1px solid #cbceba;
  display: flex;
  flex-direction: column;
  padding: 35px 18px 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  padding: 0 2px 36px;
}
.brand-icon {
  width: 42px;
  height: 42px;
  background: var(--green);
  border: 2px solid #394f38;
  border-radius: 11px;
  display: grid;
  place-items: center;
}
.brand-icon img {
  width: 34px;
}
.brand b {
  display: block;
  font-size: 21px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.mono,
.brand small,
.english,
.pill,
.page-no {
  font-family: "Courier New", monospace;
}
.brand small {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #6d7666;
  font-weight: bold;
}
.nav {
  display: grid;
  gap: 8px;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  color: #626b5d;
}
.nav .active {
  color: #344f3a;
  background: #dce7d1;
  border-color: #c7d3b9;
}
.ico {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  display: inline-block;
  flex: none;
}
.sidefoot {
  margin-top: auto;
  border-top: 1px dashed #c2c8b7;
  padding: 17px 8px 0;
  color: #71796b;
  font-size: 13px;
}
.sidefoot span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #80a46d;
  border-radius: 50%;
  margin-right: 7px;
}
main {
  width: 100%;
  max-width: 1550px;
  margin: auto;
  padding: 32px clamp(22px, 3.3vw, 64px) 40px;
  align-self: start;
}
.top,
.row,
.head,
.money,
.kicker,
.modalhead,
.chips {
  display: flex;
  align-items: center;
}
.top,
.head,
.modalhead {
  justify-content: space-between;
}
.top {
  margin-bottom: 17px;
}
.kicker {
  gap: 8px;
  color: #667860;
  font:
    700 12px/1.2 "Courier New",
    monospace;
  letter-spacing: 2px;
}
.kicker i {
  display: block;
  width: 20px;
  border-top: 2px solid #92a877;
}
.money {
  background: #f9edcd;
  border: 1px solid #dabd85;
  border-radius: 99px;
  padding: 3px 13px 3px 7px;
  gap: 5px;
  font-size: 13px;
  font-weight: 650;
  color: #83612b;
}
.money img,
.fish {
  width: 30px;
  vertical-align: middle;
  image-rendering: pixelated;
}
.headline {
  font-size: clamp(29px, 3vw, 43px);
  font-weight: 800;
  margin: 0;
  letter-spacing: 1px;
  line-height: 1.23;
}
.lede {
  color: #6a7064;
  margin: 7px 0 21px;
  font-size: 15px;
}
.grid-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(245px, 1fr);
  gap: 18px;
}
.scene,
.friend,
.course,
.shelf,
.panel,
.catcard {
  border: 1.5px solid #b7bfaa;
  border-radius: 13px;
  box-shadow: var(--shadow);
  background: var(--white);
}
.scene {
  height: clamp(255px, 23vw, 355px);
  position: relative;
  overflow: hidden;
  border: 3px solid #586c51;
  box-shadow: 0 4px 0 #b6b99e;
  background: #b9d4a6 url(sunroom.jpg) center bottom / cover no-repeat;
}
.scene-top {
  position: absolute;
  top: 15px;
  left: 15px;
  background: #fff8df;
  border: 1.5px solid #5d674c;
  border-radius: 5px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 750;
  box-shadow: 2px 2px 0 #5f643958;
}
.scene-top .ico {
  width: 15px;
  height: 15px;
}
.scene > button {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: #fff8e8ed;
  border: 1px solid #7e8164;
  border-radius: 6px;
  font-size: 13px;
  padding: 6px 12px;
  font-weight: 650;
}
.friend {
  background: #edf2e3;
  display: flex;
  flex-direction: column;
  padding: 17px 20px 14px;
  min-width: 0;
}
.friend .head h2,
.shelf h2 {
  margin: 0;
  font-size: 18px;
}
.label {
  font:
    700 11px/1.3 "Courier New",
    monospace;
  color: #78856f;
  letter-spacing: 1.5px;
}
.petstage {
  flex: 1;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.petstage img {
  position: relative;
  width: 115px;
  filter: drop-shadow(0px 2px 0px #dce2cb);
  transition: transform 0.2s;
}
.petstage:hover img {
  transform: translateY(-3px);
}
.petstage::before {
  content: "";
  width: 80%;
  max-width: 190px;
  height: 14px;
  position: absolute;
  bottom: 17%;
  background: radial-gradient(ellipse, #d7dfbf 0%, transparent 68%);
}
.catname {
  text-align: center;
  font-size: 20px;
  font-weight: 750;
  line-height: 1.3;
}
.catmeta {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  margin: 2px 0 8px;
}
.feed {
  background: #476b4c;
  color: white;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 650;
  border: 1px solid #3a5941;
  box-shadow: 0 2px 0 #2f5036;
  cursor: pointer;
}
.feed:hover,
.primary:hover {
  background: #36583e;
}
.sectiontitle {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 28px 0 14px;
}
.sectiontitle h2 {
  font-size: 24px;
  letter-spacing: 1px;
  margin: 0;
}
.sectiontitle small {
  font:
    700 11px "Courier New",
    monospace;
  color: #89927d;
  letter-spacing: 1.3px;
}
.courses {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}
.course {
  position: relative;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  padding: 17px 17px 12px;
  background: var(--tint);
  border-color: var(--line);
  min-height: 151px;
  transition: transform 0.15s;
}
.course:hover,
.catcard:hover {
  transform: translateY(-2px);
}
.course img {
  width: 57px;
  height: 50px;
  object-fit: contain;
  image-rendering: pixelated;
  align-self: flex-start;
  margin-left: -4px;
  margin-bottom: 6px;
}
.course b {
  font-size: 19px;
}
.course .english {
  position: absolute;
  right: 12px;
  top: 15px;
  writing-mode: vertical-rl;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #62675c;
}
.course .foot {
  border-top: 1px dashed var(--line);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
  padding-top: 7px;
  font-size: 12px;
  color: #5f665c;
}
.course .foot .ico {
  width: 15px;
  height: 15px;
}
.shelf {
  margin-top: 23px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.shelf > div:first-child {
  flex-shrink: 0;
}
.shelf small,
.muted {
  color: var(--muted);
  font-size: 14px;
}
.minis {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex: 1;
  gap: 8px;
}
.minis button {
  padding: 0;
}
.minis img {
  width: 57px;
  vertical-align: middle;
}
.locked {
  filter: grayscale(1) brightness(0.58);
  opacity: 0.42;
}
.txtbtn {
  font-size: 14px;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.panel {
  padding: 22px;
  margin: 16px 0;
}
.chips {
  gap: 10px;
  flex-wrap: wrap;
}
.chip,
select,
.secondary {
  background: #f6f5eb;
  border: 1px solid #c4cbb8;
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 14px;
}
.primary {
  background: var(--green);
  color: #fff;
  padding: 9px 17px;
  border-radius: 7px;
  font-weight: 650;
}
.active-chip {
  background: #dce8cc;
}
.catgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.catcard {
  padding: 18px;
  text-align: center;
  transition: 0.15s;
}
.catcard img {
  width: 140px;
  max-width: 100%;
}
.catcard h3 {
  margin: 6px;
}
.paperrow {
  border-bottom: 1px dashed #d5d7c8;
  padding: 16px 0;
}
.paperrow:last-child {
  border: 0;
}
.paperrow h3 {
  font-size: 16px;
  margin: 0 0 8px;
}
.paperrow a,
.source-link {
  font-size: 14px;
  margin-right: 12px;
  overflow-wrap: anywhere;
}
.paperrow audio {
  width: min(370px, 100%);
  height: 33px;
  display: block;
  margin: 8px 0;
}
.errorrow {
  border-bottom: 1px dashed var(--edge);
  padding: 13px 0;
}
.errorrow p {
  margin: 5px 0;
}
.englishtext {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.65;
  color: #34453a;
}
.prompt {
  font-weight: 650;
}
.passage {
  padding: 14px 17px;
  background: #f2f4e9;
  border-left: 3px solid #91a982;
}
.options {
  display: grid;
  gap: 8px;
}
.option {
  text-align: left;
  border: 1px solid #c6cdbc;
  background: #fffdf6;
  padding: 10px 13px;
  border-radius: 6px;
}
.option b {
  margin-right: 10px;
  color: #68785d;
}
.option.good {
  background: #dfecd4;
  border-color: #7c9c69;
}
.option.bad {
  background: #f7e3d8;
  border-color: #c99c90;
}
.feedback {
  border-top: 1px dashed #adb99f;
  margin-top: 16px;
  padding-top: 14px;
}
.feedback p {
  margin: 8px 0;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 17px;
  align-items: center;
}
textarea {
  resize: vertical;
  width: 100%;
  min-height: 135px;
  padding: 12px;
  border: 1px solid #bdc6ad;
  border-radius: 8px;
  background: #fffcf4;
  color: var(--ink);
}
dialog {
  border: 1.5px solid #87977f;
  background: #fffdf5;
  border-radius: 15px;
  padding: 22px 26px;
  color: var(--ink);
  width: min(610px, 93vw);
  max-height: 90dvh;
  box-shadow: 0 9px 0 #394c362e;
}
dialog::backdrop {
  background: #27352970;
  backdrop-filter: blur(3px);
}
.modalhead h2 {
  font-size: 22px;
  margin: 0;
}
.close {
  font-size: 24px;
  line-height: 1.2;
  padding: 4px 9px;
}
.tag {
  font-size: 12px;
  display: inline-block;
  color: #5f714f;
  background: #edf1dd;
  border-radius: 4px;
  padding: 2px 7px;
}
.catportrait {
  display: block;
  width: 155px;
  margin: 15px auto;
}
.empty {
  text-align: center;
  padding: 25px;
}
.empty img {
  width: 105px;
}
.checks {
  display: flex;
  gap: 8px;
  align-items: start;
  margin: 15px 0;
}
.roomview {
  width: 100%;
  border-radius: 9px;
  margin-top: 12px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #334c38;
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
#toast.on {
  opacity: 1;
}
img {
  max-width: 100%;
}
.bigcount {
  font: 700 30px Georgia;
  color: #456a4c;
}
.stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.stats b {
  display: block;
}
.saved {
  font-size: 13px;
  color: #64755a;
}
.choice-list {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}
.choice-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  border: 1px solid #c8d0bf;
  background: #f6f6eb;
  padding: 11px 14px;
  border-radius: 8px;
}
.choice-list button small {
  color: var(--muted);
}
@media (min-width: 1450px) {
  #shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  aside {
    padding: 38px 25px;
  }
  .course {
    min-height: 172px;
    padding: 20px;
  }
  .course img {
    width: 65px;
    height: 60px;
  }
}
@media (max-width: 1050px) {
  #shell {
    grid-template-columns: 172px minmax(0, 1fr);
  }
  aside {
    padding: 25px 12px;
  }
  .brand {
    gap: 6px;
  }
  .brand b {
    font-size: 18px;
  }
  main {
    padding: 25px 20px;
  }
  .grid-hero {
    grid-template-columns: minmax(0, 1.55fr) minmax(210px, 1fr);
  }
  .course {
    padding: 13px 11px;
  }
  .shelf {
    gap: 9px;
  }
  .minis img {
    width: 43px;
  }
}
@media (max-width: 760px) {
  #shell {
    display: block;
  }
  aside {
    height: auto;
    position: static;
    display: block;
    border: 0;
    border-bottom: 1px solid var(--edge);
    padding: 12px 15px 8px;
  }
  .brand {
    padding: 0 0 9px;
  }
  .brand-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
  }
  .brand-icon img {
    width: 24px;
  }
  .brand > span:last-child {
    display: flex;
    align-items: baseline;
    gap: 9px;
  }
  .nav {
    display: flex;
    gap: 3px;
    overflow-x: auto;
  }
  .nav button {
    flex: 1;
    justify-content: center;
    white-space: nowrap;
    padding: 6px 4px;
    gap: 4px;
    font-size: 13px;
  }
  .nav .ico {
    width: 15px;
    height: 15px;
  }
  .sidefoot {
    display: none;
  }
  main {
    padding: 18px 15px 35px;
  }
  .top {
    margin-bottom: 10px;
  }
  .grid-hero {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.6fr);
    gap: 9px;
  }
  .scene {
    height: 215px;
  }
  .friend {
    padding: 10px;
  }
  .friend .label {
    display: none;
  }
  .friend .head h2 {
    font-size: 15px;
  }
  .petstage img {
    width: 83px;
  }
  .catname {
    font-size: 17px;
  }
  .catmeta {
    font-size: 12px;
  }
  .feed {
    font-size: 13px;
    padding: 6px;
  }
  .courses {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .course {
    min-height: 118px;
  }
  .course img {
    width: 43px;
    height: 38px;
  }
  .sectiontitle {
    margin: 22px 0 11px;
  }
  .sectiontitle h2 {
    font-size: 21px;
  }
  .shelf {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 13px;
  }
  .minis {
    grid-row: 2;
    grid-column: 1/-1;
  }
  .shelf > .txtbtn {
    grid-row: 1;
    grid-column: 2;
  }
  .catgrid {
    grid-template-columns: repeat(2, 1fr);
  }
  .panel {
    padding: 14px;
  }
  .headline {
    font-size: 32px;
  }
  .lede {
    font-size: 14px;
  }
  .scene-top {
    top: 8px;
    left: 8px;
    font-size: 11px;
  }
  .scene > button {
    bottom: 8px;
    right: 7px;
  }
  .modalhead h2 {
    font-size: 19px;
  }
  dialog {
    padding: 17px;
  }
  .label {
    font-size: 10px;
  }
}
@media (max-width: 420px) {
  .grid-hero {
    grid-template-columns: minmax(0, 1fr) 134px;
  }
  .nav .ico {
    display: none;
  }
  .sectiontitle small {
    font-size: 10px;
  }
  .catcard {
    padding: 11px;
  }
  .minis img {
    width: 38px;
  }
}
.playroom {
  position: relative;
  margin-top: 13px;
}
.playroom .roomview {
  display: block;
  margin: 0;
}
/* Walk cycles and rests share a clock so paws stop when the cat settles. */
.playroom { overflow: hidden; border-radius: 9px; }
.scene-top, .scene > button { z-index: 2; }
.scene > button { bottom: auto; top: 15px; }
.room-life { position: absolute; inset: 0; isolation: isolate; overflow: hidden; pointer-events: none; }
.wanderer { position: absolute; top: var(--floor); left: var(--start); transform: translate(-50%, -100%); padding: 0; width: clamp(42px, 14%, 94px); min-height: 36px; aspect-ratio: 44 / 34; border: 0; background: none; pointer-events: auto; cursor: pointer; animation: roam var(--duration) linear var(--offset) infinite; }
.wanderer:focus-visible { outline-offset: -3px; }
.facing, .walking-coat, .resting-coat { display: block; position: absolute; inset: 0; }
.facing { animation: turn-cat var(--duration) steps(1,end) var(--offset) infinite; }
.walking-coat, .resting-coat { background-image: var(--coat); background-size: 500% 100%; image-rendering: pixelated; }
.walking-coat { animation: footfalls .64s steps(4,end) infinite, walking-phase var(--duration) steps(1,end) var(--offset) infinite; }
.resting-coat { background-position: 100% 0; animation: resting-phase var(--duration) steps(1,end) var(--offset) infinite; }
@keyframes roam { 0%,100% {left:var(--start)} 36%,53% {left:var(--end)} 89% {left:var(--start)} }
@keyframes turn-cat { 0%,100% {transform:scaleX(var(--out))} 53% {transform:scaleX(var(--back))} }
@keyframes walking-phase { 0%,53%,100% {opacity:1} 36%,89% {opacity:0} }
@keyframes resting-phase { 0%,53%,100% {opacity:0} 36%,89% {opacity:1} }
@keyframes footfalls { from {background-position:0% 0} to {background-position:100% 0} }
.wanderer.petted, .wanderer:focus-visible, .wanderer.petted *, .wanderer:focus-visible *,
.resting .wanderer, .resting .wanderer *, .resting .sun-motes { animation-play-state: paused; }
.wanderer.petted .resting-coat { animation:none;opacity:1; }
.wanderer.petted .walking-coat { animation:none;opacity:0; }
.cat-heart { display:none;position:absolute;top:-10%;left:46%;color:#b9564c;font: bold 16px/1 system-ui;text-shadow:0 1px #fff5cf; }
.petted .cat-heart { display:block; }
.sun-motes { position:absolute;left:36%;top:26%;width:3px;height:3px;background:#fff0b6;box-shadow:23px 18px 0 #faf3c3aa,-12px 43px 0 #fff1ab,52px 28px 0 #fff7c8; animation: motes 7s ease-in-out infinite alternate; }
@keyframes motes { from {opacity:.15;transform:translate(0,0)} to {opacity:.85;transform:translate(13px,-15px)} }
.room-controls { display:flex;align-items:center;gap:10px;flex-wrap:wrap; }
.album-count { color:var(--green);font-size:14px;margin:0 0 15px; }
@media(max-width:760px){.scene > button {top:auto;bottom:5px;right:5px;font-size:11px;padding:2px 6px}.scene .wanderer {margin-top:-16px} }
@media (hover: hover) {
  .wanderer:hover, .wanderer:hover * { animation-play-state: paused; }
}
.cloud-tools {display:flex;gap:12px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
#sync-status {font-size:13px;color:#53664c}
.share-room {font-size:13px;white-space:nowrap}
.connect-panel {margin:10vh auto;max-width:480px;padding:32px;text-align:center;background:#fffdf4;border:1px solid #bfc7ae;border-radius:14px}
.connect-panel img {width:90px;image-rendering:pixelated}
body:has(.connect-panel) #sidebar {display:none}
body:has(.connect-panel) #shell {display:block}
@media(max-width:760px){.cloud-tools{gap:6px}.share-room{padding:4px 6px}.top{gap:6px;flex-wrap:wrap}}

dialog:not([open]) { display:none }
dialog.legacy-dialog[open] { display:block; position:fixed; z-index:1000; top:50%; left:50%; transform:translate(-50%,-50%); margin:0; max-height:90vh; overflow:auto; box-shadow:0 0 0 100vmax #27352970 }
