/* ============================================================
   iyoahsOS — applications
   now · books · music · blog · profile · settings · trophy
   terminal · room · readme
   ============================================================ */

/* ---------------- shared app bits ---------------- */
.loading {
  display: grid;
  place-items: center;
  gap: 12px;
  height: 100%;
  min-height: 180px;
  font-family: var(--font-en);
  font-size: 9px;
  color: var(--ink-soft);
  text-align: center;
}

.loading__bar {
  width: 160px;
  height: 12px;
  border: 2px solid var(--line);
  padding: 2px;
}

.loading__bar i {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--accent);
  animation: loading-slide 1s steps(5) infinite;
}

@keyframes loading-slide {
  0% { transform: translateX(0); }
  50% { transform: translateX(130%); }
  100% { transform: translateX(0); }
}

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
}

.meter {
  height: 10px;
  border: 2px solid var(--line);
  background: var(--paper-2);
  padding: 1px;
}

.meter i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width .3s var(--ease);
}

.stat-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--font-zh);
  font-size: 12px;
  color: var(--ink-soft);
}

.stat-row b {
  font-family: var(--font-en);
  font-size: 13px;
  color: var(--ink);
  margin-right: 4px;
}

.dot-list li {
  display: flex;
  gap: 9px;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.7;
  border-bottom: 1px dashed color-mix(in srgb, var(--line) 30%, transparent);
}

.dot-list li:last-child {
  border-bottom: 0;
}

.dot-list li::before {
  content: "▸";
  color: var(--accent);
  font-family: var(--font-en);
  font-size: 9px;
  line-height: 2.2;
  flex: none;
}

.dot-list li span {
  min-width: 0;
}

.sample-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  background: var(--sun);
  color: var(--note-ink);
  border: 1px solid #6b5410;
  font-family: var(--font-en);
  font-size: 6px;
  letter-spacing: .04em;
}

.sample-badge::before {
  content: "!";
  font-size: 8px;
}

/* ============================================================
   NOW
   ============================================================ */
.now {
  padding: 22px clamp(16px, 3vw, 30px) 26px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.now-hero {
  display: grid;
  grid-template-columns: 1.45fr .9fr;
  gap: 16px;
  align-items: stretch;
}

.now-hero__main {
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.now-hero__main h2 {
  font-family: var(--font-zh);
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.45;
  letter-spacing: .01em;
}

.now-hero__main h2 mark {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 -10px 0 var(--accent-3);
}

.now-hero__main p {
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 46ch;
}

.now-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.now-side {
  background: var(--paper-2);
  border: 2px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--lo), 4px 4px 0 var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
}

.now-side__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  border-bottom: 1px dashed color-mix(in srgb, var(--line) 35%, transparent);
  padding-bottom: 7px;
}

.now-side__row span:first-child {
  color: var(--ink-soft);
  font-family: var(--font-en);
  font-size: 7px;
  line-height: 1.8;
}

.now-side__row span:last-child {
  text-align: right;
}

.now-side__avatar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.now-side__avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--line);
}

.now-side__avatar b {
  display: block;
  font-family: var(--font-en);
  font-size: 10px;
}

.now-side__avatar small {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
}

.now-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.now-card {
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.now-card h3 {
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: .06em;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.now-card h3 em {
  font-family: var(--font-zh);
  font-style: normal;
  font-size: 11px;
  color: var(--ink-soft);
}

.now-card .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.now-timeline {
  border: 2px solid var(--line);
  background: var(--paper);
  padding: 16px;
  box-shadow: 4px 4px 0 var(--shadow);
}

.now-timeline h3 {
  font-family: var(--font-en);
  font-size: 9px;
  margin-bottom: 10px;
}

.timeline__item {
  position: relative;
  margin-left: 8px;
  padding: 0 0 16px 22px;
  border-left: 2px solid var(--paper-3);
}

.timeline__item:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 5px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border: 2px solid var(--line);
  box-shadow: 2px 2px 0 var(--shadow);
}

.timeline__date {
  font-family: var(--font-en);
  font-size: 7px;
  letter-spacing: .05em;
  color: var(--accent);
  margin-bottom: 3px;
}

.timeline__text {
  font-size: 13px;
  line-height: 1.7;
}

/* ============================================================
   BOOKS
   ============================================================ */
.books {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.books__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 11px 14px;
  background: var(--paper-2);
  border-bottom: 2px solid var(--line);
}

.books__bar .stat-row {
  margin-left: auto;
}

.books__layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
}

.books__grid {
  overflow: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 12px 10px;
  align-content: start;
}

.book {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px;
  border: 2px solid transparent;
  text-align: left;
  color: var(--ink);
  background: transparent;
  transition: background var(--speed), border-color var(--speed);
}

.book:hover,
.book.is-active {
  background: var(--paper-2);
  border-color: var(--line);
}

.book.is-active {
  box-shadow: 3px 3px 0 var(--shadow);
}

.book__cover {
  position: relative;
  aspect-ratio: 3 / 4;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(155deg, var(--a, #1058c5), var(--b, #0b2a4a));
  border: 2px solid var(--line);
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, .28), 4px 4px 0 rgba(0, 0, 0, .22);
  overflow: hidden;
}

.book__cover::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, .35);
  pointer-events: none;
}

.book__cover::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 8px;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, .25);
  border: 1px solid rgba(255, 255, 255, .4);
}

.book__cover b {
  font-family: var(--font-zh);
  font-size: 15px;
  line-height: 1.4;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .35);
  position: relative;
  z-index: 1;
}

.book__cover small {
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: .04em;
  opacity: .9;
  position: relative;
  z-index: 1;
}

.book__name {
  font-size: 12px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.book__author {
  font-size: 10px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.stars {
  font-family: var(--font-en);
  font-size: 7px;
  letter-spacing: 1px;
  color: var(--accent);
  white-space: nowrap;
}

.stars .off {
  color: var(--paper-3);
}

.book__status {
  font-size: 10px;
  padding: 0 5px;
  border: 1px solid var(--line);
  background: var(--paper-3);
}

.book__status[data-s="done"] {
  background: var(--accent-3);
}

.book__status[data-s="reading"] {
  background: var(--sun);
  color: var(--note-ink);
}

.books__detail {
  border-left: 2px solid var(--line);
  background: var(--paper-2);
  padding: 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.books__detail-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.books__detail-cover {
  width: 96px;
  flex: none;
  aspect-ratio: 3 / 4;
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--shadow);
  background: linear-gradient(155deg, var(--a, #1058c5), var(--b, #0b2a4a));
  color: #fff;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  line-height: 1.4;
}

.books__detail h2 {
  font-family: var(--font-zh);
  font-size: 22px;
  line-height: 1.45;
  margin-bottom: 4px;
}

.books__detail .author {
  font-size: 12px;
  color: var(--ink-soft);
}

.books__note {
  font-size: 13px;
  line-height: 1.9;
  background: var(--paper);
  border: 2px solid var(--line);
  padding: 12px 14px;
  box-shadow: inset 2px 2px 0 var(--lo);
  position: relative;
}

.books__note::before {
  content: "NOTE";
  position: absolute;
  top: -8px;
  left: 10px;
  background: var(--paper);
  padding: 0 5px;
  font-family: var(--font-en);
  font-size: 6px;
  color: var(--accent);
}

.books__detail .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* ============================================================
   MUSIC
   ============================================================ */
.music {
  display: grid;
  grid-template-columns: 286px 1fr;
  height: 100%;
  background: var(--paper);
}

.music__art {
  border-right: 2px solid var(--line);
  background: var(--paper-2);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.album {
  position: relative;
  width: min(196px, 100%);
  aspect-ratio: 1;
  background: linear-gradient(150deg, var(--a, #1058c5), var(--b, #0b2a4a));
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 var(--shadow), inset 0 0 0 6px rgba(255, 255, 255, .12);
  display: grid;
  place-items: center;
  color: #fff;
  overflow: hidden;
}

.album__disc {
  position: absolute;
  inset: 0;
  background: repeating-radial-gradient(circle at 50% 50%,
      rgba(0, 0, 0, .16) 0 2px,
      transparent 2px 7px);
  opacity: .55;
}

.album__glyph {
  position: relative;
  z-index: 1;
  font-family: var(--font-en);
  font-size: 46px;
  letter-spacing: .08em;
  line-height: 1;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, .32);
}

.album::after {
  content: "";
  position: absolute;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--paper-2);
  border: 2px solid var(--line);
  z-index: 2;
}

.album.is-playing .album__disc {
  animation: spin 6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.music__badge {
  font-family: var(--font-en);
  font-size: 7px;
  letter-spacing: .06em;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.8;
}

.music__main {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  overflow: auto;
}

.music__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.music__title {
  font-family: var(--font-zh);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.35;
}

.music__artist {
  font-family: var(--font-en);
  font-size: 8px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.progress {
  height: 16px;
  padding: 2px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--lo);
  cursor: pointer;
}

.progress__fill {
  width: 0;
  height: 100%;
  background: var(--accent);
  box-shadow: inset 2px 2px 0 var(--hi);
}

.progress:hover .progress__fill {
  background: var(--accent-2);
}

.times {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-en);
  font-size: 7px;
  color: var(--ink-soft);
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 2px 0;
}

.ctrl {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--paper-2);
  border: 2px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo), 3px 3px 0 var(--shadow);
  color: var(--ink);
}

.ctrl:hover {
  background: var(--paper-3);
}

.ctrl:active {
  transform: translate(1px, 1px);
}

.ctrl svg {
  width: 18px;
  height: 18px;
}

.ctrl--play {
  width: 56px;
  height: 56px;
  background: var(--accent);
  color: var(--accent-ink);
}

.ctrl--play:hover {
  background: var(--accent-2);
}

.ctrl--play svg {
  width: 22px;
  height: 22px;
}

.music__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.volume {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-en);
  font-size: 7px;
  color: var(--ink-soft);
}

.volume input {
  width: 90px;
}

input[type="range"].px-range {
  -webkit-appearance: none;
  appearance: none;
  height: 12px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--lo);
  cursor: pointer;
  padding: 0;
  margin: 0;
}

input[type="range"].px-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 2px solid var(--line);
  box-shadow: inset 1px 1px 0 var(--hi);
}

input[type="range"].px-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 0;
  background: var(--accent);
  border: 2px solid var(--line);
}

.playlist {
  border-top: 2px solid var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.playlist__title {
  font-family: var(--font-en);
  font-size: 7px;
  color: var(--ink-soft);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.track {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 2px solid transparent;
  text-align: left;
  color: var(--ink);
  font-size: 12px;
}

.track:hover {
  background: var(--paper-2);
  border-color: var(--line);
}

.track.is-active {
  background: var(--paper-2);
  border-color: var(--accent);
}

.track__no {
  font-family: var(--font-en);
  font-size: 7px;
  color: var(--ink-soft);
}

.track__artist {
  font-size: 10px;
  color: var(--ink-soft);
}

.track__time {
  font-family: var(--font-en);
  font-size: 7px;
  color: var(--ink-soft);
}

.music__error {
  padding: 8px 10px;
  border: 2px solid var(--err);
  color: var(--err);
  font-size: 12px;
  background: color-mix(in srgb, var(--err) 8%, var(--paper));
}

/* ============================================================
   BLOG
   ============================================================ */
.blog {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog__bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--paper-2);
  border-bottom: 2px solid var(--line);
}

.blog__search {
  flex: 1;
  min-width: 170px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--lo);
}

.blog__search svg {
  width: 15px;
  height: 15px;
  color: var(--ink-soft);
  flex: none;
}

.blog__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.blog__tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.blog__list {
  flex: 1;
  overflow: auto;
  padding: 4px 16px 20px;
}

.post {
  width: 100%;
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 16px 6px;
  border-bottom: 1px dashed color-mix(in srgb, var(--line) 45%, transparent);
  text-align: left;
  color: var(--ink);
}

.post:hover {
  background: var(--paper-2);
}

.post__date {
  font-family: var(--font-en);
  font-size: 7px;
  line-height: 1.8;
  color: var(--ink-soft);
  padding-top: 4px;
}

.post__date b {
  display: block;
  font-size: 15px;
  color: var(--accent);
  line-height: 1.4;
}

.post h3 {
  font-family: var(--font-zh);
  font-size: 18px;
  line-height: 1.5;
  margin-bottom: 4px;
}

.post p {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post__tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.post__go {
  font-family: var(--font-en);
  font-size: 8px;
  color: var(--accent);
  padding-top: 5px;
  white-space: nowrap;
}

.article-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-view__bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: var(--paper-2);
  border-bottom: 2px solid var(--line);
}

.article-view__bar .spacer {
  flex: 1;
}

.article-view__scroll {
  flex: 1;
  overflow: auto;
  padding: 26px clamp(18px, 4.5vw, 52px) 40px;
}

.article-head .kicker {
  color: var(--accent);
}

.article-head h1 {
  font-family: var(--font-zh);
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.4;
  margin: 8px 0 10px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--line);
  font-family: var(--font-en);
  font-size: 7px;
  color: var(--ink-soft);
}

.article-meta .tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 2px solid var(--line);
}

.article-nav a {
  font-size: 12px;
  max-width: 46%;
}

.article-nav a:last-child {
  text-align: right;
}

/* ============================================================
   PROFILE
   ============================================================ */
.profile {
  padding: 22px clamp(16px, 3vw, 30px) 26px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.profile__hero {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 20px;
  align-items: center;
}

.profile__avatar {
  width: 118px;
  height: 118px;
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 var(--shadow), inset 0 0 0 4px var(--paper-2);
  background: var(--paper-2);
  overflow: hidden;
}

.profile__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile__hero h1 {
  font-family: var(--font-en);
  font-size: clamp(26px, 3.6vw, 36px);
  line-height: 1.2;
  letter-spacing: .01em;
}

.profile__hero h1 span {
  color: var(--accent);
}

.profile__tag {
  margin-top: 7px;
  font-size: 13px;
  color: var(--ink-soft);
}

.profile__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.profile__grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 12px;
}

.profile__card {
  border: 2px solid var(--line);
  background: var(--paper);
  padding: 14px 15px;
  box-shadow: 4px 4px 0 var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile__card h2 {
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: .05em;
  color: var(--accent);
}

.profile__card p {
  font-size: 13px;
  line-height: 1.9;
}

.profile__links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 2px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
  box-shadow: inset 2px 2px 0 var(--hi);
}

.profile__link:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.profile__link svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.profile__privacy {
  border: 2px dashed var(--line);
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  background: var(--paper-2);
}

.profile__privacy b {
  color: var(--ink);
}

/* ============================================================
   SETTINGS
   ============================================================ */
.settings {
  padding: 20px clamp(16px, 3vw, 28px) 26px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.set-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.set-group > h2 {
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.set-group > h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  opacity: .3;
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--line) 32%, transparent);
}

.set-row:last-child {
  border-bottom: 0;
}

.set-row__text {
  min-width: 0;
}

.set-row__text b {
  display: block;
  font-size: 13px;
  font-weight: normal;
}

.set-row__text p {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.toggle {
  width: 54px;
  height: 26px;
  flex: none;
  padding: 2px;
  background: var(--paper-2);
  border: 2px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--lo);
  display: flex;
  align-items: center;
}

.toggle::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background: var(--ink-soft);
  transition: transform .15s steps(3), background .15s;
}

.toggle[aria-pressed="true"] {
  background: var(--accent-3);
}

.toggle[aria-pressed="true"]::after {
  transform: translateX(26px);
  background: var(--accent);
}

.theme-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.theme-card {
  border: 2px solid var(--line);
  background: var(--paper-2);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  color: var(--ink);
  font-size: 11px;
  text-align: left;
}

.theme-card__preview {
  height: 38px;
  background: linear-gradient(135deg, var(--preview-a), var(--preview-b));
  border: 1px solid var(--line);
  position: relative;
}

.theme-card__preview::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: 4px;
  width: 10px;
  height: 10px;
  background: var(--preview-accent);
  border: 1px solid var(--line);
}

.theme-card[aria-pressed="true"] {
  background: var(--accent-3);
  box-shadow: 3px 3px 0 var(--shadow);
}

.theme-card[data-locked="true"] {
  opacity: .5;
  filter: grayscale(1);
}

.theme-card small {
  font-family: var(--font-en);
  font-size: 6px;
  color: var(--ink-soft);
}

.settings__danger {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   TROPHY
   ============================================================ */
.trophy {
  padding: 20px clamp(16px, 3vw, 26px) 26px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.trophy__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.trophy__head h1 {
  font-family: var(--font-en);
  font-size: 20px;
  line-height: 1.4;
}

.trophy__head p {
  font-size: 12px;
  color: var(--ink-soft);
}

.trophy__progress {
  width: min(260px, 100%);
}

.trophy__progress .meter {
  height: 14px;
  margin-top: 5px;
}

.trophy__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.trophy-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border: 2px solid var(--line);
  background: var(--paper-2);
  opacity: .55;
  filter: grayscale(.8);
  min-height: 76px;
}

.trophy-card.is-unlocked {
  opacity: 1;
  filter: none;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--shadow);
}

.trophy-card__icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--sun);
  border: 2px solid var(--line);
  color: var(--note-ink);
}

.trophy-card__icon svg {
  width: 20px;
  height: 20px;
}

.trophy-card.is-locked .trophy-card__icon {
  background: var(--paper-3);
  color: var(--ink-soft);
}

.trophy-card__body {
  min-width: 0;
}

.trophy-card__body b {
  display: block;
  font-family: var(--font-en);
  font-size: 7px;
  line-height: 1.8;
  letter-spacing: .03em;
}

.trophy-card__body p {
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.trophy-card__body small {
  display: block;
  margin-top: 3px;
  font-family: var(--font-en);
  font-size: 6px;
  color: var(--accent);
}

/* ============================================================
   TERMINAL
   ============================================================ */
.term {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #06110a;
  color: #b9ffc8;
  font-family: var(--font-en);
  font-size: 10px;
  line-height: 2;
  padding: 12px 14px;
  overflow: auto;
  cursor: text;
}

.term__out {
  flex: 1;
  min-height: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.term__line {
  white-space: pre-wrap;
}

.term__line--cmd {
  color: #eafff0;
}

.term__line--ok {
  color: #ffd36b;
}

.term__line--err {
  color: #ff8fa3;
}

.term__line--muted {
  color: #6f8f78;
}

.term__line--ascii {
  color: #7fd1ff;
  line-height: 1.25;
}

.term__form {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 2px;
  border-top: 1px dashed #1d3a26;
  margin-top: 4px;
}

.term__prompt {
  color: #7fd1ff;
  white-space: nowrap;
  font-size: 9px;
}

.term input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: #eafff0;
  font-family: var(--font-en);
  font-size: 10px;
  caret-color: #b9ffc8;
  padding: 3px 0;
}

.term__hint {
  color: #4f6b58;
  font-size: 8px;
  margin-top: 2px;
}

/* ============================================================
   ROOM
   ============================================================ */
.room {
  position: relative;
  height: 100%;
  background: #141026;
  overflow: hidden;
}

.room__scene {
  width: 100%;
  height: 100%;
  display: block;
}

.room__hot {
  cursor: pointer;
  outline: none;
}

.room__hot:hover,
.room__hot:focus-visible {
  filter: drop-shadow(0 0 6px #ffd36b) brightness(1.12);
}

.room__ui {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  pointer-events: none;
}

.room__ui p {
  pointer-events: auto;
  background: rgba(6, 6, 14, .72);
  border: 2px solid #6b5cff;
  color: #e9e4ff;
  font-size: 12px;
  line-height: 1.7;
  padding: 6px 10px;
  max-width: 70%;
}

.room__note {
  position: absolute;
  inset: 12% 10% auto;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--line);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .4);
  padding: 18px 20px;
  max-height: 70%;
  overflow: auto;
  font-size: 13px;
  line-height: 1.9;
}

.room__note h3 {
  font-family: var(--font-en);
  font-size: 10px;
  margin-bottom: 8px;
  color: var(--accent);
}

.room__note .close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 2px solid var(--line);
  font-family: var(--font-en);
  font-size: 9px;
  background: var(--paper-2);
}

/* ============================================================
   README
   ============================================================ */
.readme {
  padding: 22px 24px 28px;
  overflow: auto;
  font-size: 13.5px;
  line-height: 1.95;
}

.readme__file {
  font-family: var(--font-en);
  font-size: 7px;
  letter-spacing: .08em;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.readme h1 {
  font-family: var(--font-en);
  font-size: 17px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.readme h2 {
  font-family: var(--font-en);
  font-size: 9px;
  color: var(--accent);
  margin: 22px 0 8px;
  letter-spacing: .04em;
}

.readme ul {
  padding-left: 1.2em;
  list-style: square;
}

.readme li {
  margin: 4px 0;
}

.readme code,
.readme kbd {
  font-family: var(--font-en);
  font-size: 9px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 1px 4px;
  white-space: nowrap;
}

.readme .note {
  background: var(--paper-2);
  border-left: 6px solid var(--accent);
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 12.5px;
}

.readme .sig {
  margin-top: 22px;
  text-align: right;
  font-family: var(--font-en);
  font-size: 8px;
  color: var(--ink-soft);
}

/* ============================================================
   responsive app layouts
   ============================================================ */
@media (max-width: 900px) {
  .now-hero {
    grid-template-columns: 1fr;
  }

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

  .books__layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 1fr) auto;
  }

  .books__detail {
    border-left: 0;
    border-top: 2px solid var(--line);
    max-height: 46%;
  }

  .music {
    grid-template-columns: 220px 1fr;
  }

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

  .theme-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .now,
  .profile,
  .settings,
  .trophy,
  .readme {
    padding: 16px 14px 22px;
    gap: 14px;
  }

  .now-hero__main h2 {
    font-size: 24px;
  }

  .now-side {
    display: none;
  }

  .books__layout {
    display: flex;
    flex-direction: column;
  }

  .books__grid {
    padding: 12px;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    flex: 1;
  }

  .books__detail {
    max-height: 44%;
    padding: 14px;
  }

  .books__detail-cover {
    width: 72px;
  }

  .books__detail h2 {
    font-size: 18px;
  }

  .music {
    display: flex;
    flex-direction: column;
    overflow: auto;
  }

  .music__art {
    border-right: 0;
    border-bottom: 2px solid var(--line);
    padding: 14px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
  }

  .album {
    width: 96px;
    flex: none;
    box-shadow: 4px 4px 0 var(--shadow);
  }

  .album__glyph {
    font-size: 36px;
  }

  .music__main {
    padding: 14px;
    overflow: visible;
  }

  .music__title {
    font-size: 22px;
  }

  .music__foot {
    justify-content: flex-start;
  }

  .post {
    grid-template-columns: 54px 1fr;
    gap: 10px;
  }

  .post__go {
    display: none;
  }

  .post h3 {
    font-size: 16px;
  }

  .article-view__scroll {
    padding: 18px 14px 30px;
  }

  .article-head h1 {
    font-size: 24px;
  }

  .profile__hero {
    grid-template-columns: 84px 1fr;
    gap: 14px;
  }

  .profile__avatar {
    width: 84px;
    height: 84px;
  }

  .profile__hero h1 {
    font-size: 24px;
  }

  .theme-cards {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .term {
    font-size: 9px;
    line-height: 1.9;
    padding: 10px;
  }

  .term input {
    font-size: 16px; /* prevents iOS zoom */
  }

  .room__ui p {
    max-width: 100%;
    font-size: 11px;
  }
}
/* terminal keeps the prompt pinned at the bottom */
.term {
  overflow: hidden;
}

.term__out {
  overflow: auto;
  scrollbar-width: thin;
}
