.character-page {
  background:
    linear-gradient(rgba(158, 182, 214, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(158, 182, 214, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 40px 40px;
}

.character-page .topbar {
  background: rgba(5, 8, 15, 0.92);
  border-color: var(--line);
}

.character-top-actions {
  margin-left: auto;
}

.character-main {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 38px 24px 80px;
}

.character-message {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(520px, 100%);
  margin: 120px auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
}

.character-message strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
}

.character-message p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.character-spinner {
  width: 34px;
  height: 34px;
  flex: none;
  border: 3px solid var(--line-strong);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: character-spin 0.8s linear infinite;
}

.character-heading,
.editor-heading,
.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.character-heading {
  margin-bottom: 22px;
}

.character-heading h1,
.editor-heading h2,
.dashboard-head h2,
.character-signed-out h1 {
  margin: 3px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0;
}

.character-heading h1 {
  font-size: clamp(25px, 3.4vw, 38px);
}

.character-kicker {
  display: block;
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.character-heading-actions,
.editor-actions,
.signed-out-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-badge,
.state-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(111, 195, 255, 0.32);
  border-radius: 999px;
  background: rgba(111, 195, 255, 0.08);
  color: var(--sky);
  font-size: 11px;
  font-weight: 800;
}

.demo-badge {
  padding: 7px 11px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--text);
  cursor: pointer;
}

.icon-button:hover {
  border-color: rgba(200, 245, 66, 0.45);
  color: var(--lime);
}

.icon-button svg,
.character-button svg,
.care-button > svg,
.need-label svg,
.state-badge svg,
.play-link svg,
.wake-step svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.character-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(330px, 0.72fr);
  gap: 18px;
  align-items: stretch;
}

.character-room {
  --room-wall: #0d1625;
  --room-grid-line: rgba(111, 195, 255, 0.055);
  --room-copy: var(--muted);
  --room-floor: #111b2a;
  --room-floor-line: rgba(255, 255, 255, 0.035);
  position: relative;
  min-height: 690px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--room-wall);
  isolation: isolate;
}

.room-grid {
  position: absolute;
  inset: 0 0 29%;
  z-index: -3;
  background:
    linear-gradient(var(--room-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--room-grid-line) 1px, transparent 1px),
    var(--room-wall);
  background-size: 44px 44px;
  transition: background-color 0.8s ease, filter 0.8s ease;
}

.room-floor {
  position: absolute;
  inset: 71% 0 0;
  z-index: -2;
  background:
    linear-gradient(90deg, transparent 49.7%, var(--room-floor-line) 50%, transparent 50.3%) 0 0 / 96px 100%,
    var(--room-floor);
  border-top: 1px solid rgba(111, 195, 255, 0.12);
}

.character-room[data-wall="sky"] {
  --room-wall: #b8d5df;
  --room-grid-line: rgba(31, 79, 98, 0.1);
  --room-copy: #314f5b;
}

.character-room[data-wall="cream"] {
  --room-wall: #e7dcc7;
  --room-grid-line: rgba(103, 79, 48, 0.1);
  --room-copy: #5a4c38;
}

.character-room[data-wall="pearl"] {
  --room-wall: #dde3e7;
  --room-grid-line: rgba(56, 76, 91, 0.1);
  --room-copy: #40505d;
}

.character-room[data-floor="oak"] {
  --room-floor: #76583f;
  --room-floor-line: rgba(255, 232, 199, 0.12);
}

.character-room[data-floor="ash"] {
  --room-floor: #66717b;
  --room-floor-line: rgba(255, 255, 255, 0.11);
}

.character-room[data-floor="pale"] {
  --room-floor: #b9aa94;
  --room-floor-line: rgba(69, 55, 42, 0.12);
}

.character-room[data-floor="disco"] .room-floor {
  background:
    linear-gradient(45deg, rgba(255,255,255,.16) 25%, transparent 25% 75%, rgba(255,255,255,.16) 75%) 0 0 / 56px 56px,
    linear-gradient(45deg, #7868f2 25%, #25b9c3 25% 50%, #f2547d 50% 75%, #b8e342 75%) 28px 28px / 56px 56px;
  box-shadow: inset 0 18px 50px rgba(4, 8, 15, 0.28);
}

.room-window {
  position: absolute;
  top: 76px;
  right: 52px;
  width: 172px;
  height: 118px;
  border: 10px solid #1b2a42;
  border-radius: 6px;
  background: linear-gradient(#6bb9ef, #d7efff 74%, #b5d688 75%);
  box-shadow: inset 0 0 0 1px rgba(111, 195, 255, 0.18);
  overflow: hidden;
  transition: background 0.8s ease, box-shadow 0.8s ease;
}

.room-window::before,
.room-window::after {
  content: "";
  position: absolute;
  background: #1b2a42;
}

.room-window::before {
  left: 50%;
  top: 0;
  width: 8px;
  height: 100%;
  transform: translateX(-50%);
}

.room-window::after {
  left: 0;
  top: 50%;
  width: 100%;
  height: 8px;
  transform: translateY(-50%);
}

.room-window .window-star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 0 10px var(--sky);
}

.room-window .star-one { left: 20px; top: 20px; }
.room-window .star-two { right: 25px; top: 30px; }
.room-window .star-three { left: 55px; bottom: 18px; }

.window-sun,
.window-moon {
  position: absolute;
  z-index: 0;
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.window-sun {
  top: 18px;
  right: 24px;
  background: #ffd75e;
  box-shadow: 0 0 26px rgba(255, 215, 94, 0.65);
}

.window-moon {
  top: 16px;
  right: 22px;
  background: #dbe8ff;
  box-shadow: 0 0 24px rgba(111, 195, 255, 0.45);
  opacity: 0;
  transform: translateY(12px);
}

.window-moon::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  left: -8px;
  top: -5px;
  border-radius: 50%;
  background: #081222;
}

.character-room[data-time="day"] .window-star {
  opacity: 0;
}

.character-room[data-time="night"] {
  background: #09111f;
}

.character-room[data-time="night"] .room-grid {
  filter: brightness(0.72) saturate(0.82);
}

.character-room[data-time="night"] .room-window {
  background: linear-gradient(#06101f, #102849 72%, #091522 73%);
  box-shadow: inset 0 0 0 1px rgba(111, 195, 255, 0.22), 0 0 34px rgba(77, 148, 255, 0.08);
}

.character-room[data-time="night"] .window-sun {
  opacity: 0;
  transform: translateY(12px);
}

.character-room[data-time="night"] .window-moon {
  opacity: 1;
  transform: none;
}

.pet-bed {
  position: absolute;
  z-index: -1;
  right: 48px;
  bottom: 92px;
  width: 106px;
  height: 38px;
  border: 8px solid #30405b;
  border-top-width: 5px;
  border-radius: 50% 50% 10px 10px;
  background: #172238;
  box-shadow: 0 12px 20px rgba(2, 6, 14, 0.22);
}

.pet-bed-cushion {
  position: absolute;
  inset: 5px 10px;
  border-radius: 50%;
  background: #536781;
}

.sleeping-cat {
  position: absolute;
  z-index: 2;
  left: 15px;
  top: -35px;
  width: 76px;
  height: 51px;
  transform: rotate(-3deg);
}

.sleeping-cat i {
  position: absolute;
  display: block;
}

.cat-body {
  left: 17px;
  top: 15px;
  width: 52px;
  height: 31px;
  border: 2px solid #3c485c;
  border-radius: 58% 48% 50% 53%;
  background: #9aa9bd;
  box-shadow: inset -10px -6px 0 rgba(58, 73, 95, 0.22);
}

.cat-head {
  left: 4px;
  top: 20px;
  width: 31px;
  height: 27px;
  border: 2px solid #3c485c;
  border-radius: 48% 52% 48% 46%;
  background: #afbbca;
}

.cat-head::before,
.cat-head::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 13px solid #7c8da5;
}

.cat-head::before {
  left: 1px;
  transform: rotate(-14deg);
}

.cat-head::after {
  right: 1px;
  transform: rotate(14deg);
}

.cat-tail {
  right: 0;
  top: 17px;
  width: 31px;
  height: 23px;
  border: 8px solid #75869d;
  border-left-color: transparent;
  border-top-color: transparent;
  border-radius: 50%;
  transform: rotate(-11deg);
}

.cat-eye {
  top: 33px;
  width: 8px;
  height: 4px;
  border-bottom: 2px solid #293448;
  border-radius: 50%;
}

.cat-eye.left { left: 10px; transform: rotate(8deg); }
.cat-eye.right { left: 23px; transform: rotate(-8deg); }

.sleeping-cat::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 42px;
  width: 5px;
  height: 4px;
  border-radius: 50%;
  background: #d67f8d;
}

.sleeping-cat b {
  position: absolute;
  right: 1px;
  top: -3px;
  color: #9fd6ff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  animation: catSleep 2.8s ease-in-out infinite;
}

@keyframes catSleep {
  0%, 100% { opacity: 0.25; transform: translateY(4px) scale(0.85); }
  50% { opacity: 0.9; transform: translateY(-4px) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .sleeping-cat b {
    animation: none;
    opacity: 0.75;
  }
}

.character-room[data-time="night"] .sleeping-cat {
  filter: brightness(0.82) saturate(0.86);
}

.trophy-table {
  position: absolute;
  z-index: -1;
  left: 43px;
  bottom: 104px;
  width: 148px;
  height: 112px;
}

.trophy-row {
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 50px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
}

.trophy-row .trophy {
  width: 27px;
  height: 27px;
  filter: drop-shadow(0 7px 6px rgba(2, 6, 14, 0.28));
}

.trophy-row .gold { width: 34px; height: 34px; color: #ffcf67; }
.trophy-row .silver { color: #b7c5d7; }
.trophy-row .bronze { color: #c47a52; }

.table-top,
.table-leg {
  position: absolute;
  display: block;
  background: #263553;
}

.table-top {
  left: 0;
  right: 0;
  bottom: 42px;
  height: 12px;
  border-radius: 4px;
  box-shadow: inset 0 2px rgba(255, 255, 255, 0.07);
}

.table-leg {
  bottom: 0;
  width: 12px;
  height: 44px;
}

.table-leg.left { left: 18px; }
.table-leg.right { right: 18px; }

.room-shelf {
  position: absolute;
  left: 44px;
  top: 228px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 150px;
  height: 60px;
  padding: 0 18px 9px;
  border-bottom: 8px solid #263553;
}

.room-shelf i {
  display: block;
  width: 25px;
  height: 42px;
  border-radius: 3px 3px 0 0;
  background: var(--coral, #ff6474);
}

.room-shelf i:nth-child(2) {
  height: 52px;
  background: var(--lime);
}

.room-shelf i:nth-child(3) {
  height: 35px;
  background: var(--blue);
}

.character-stage-copy {
  position: absolute;
  z-index: 2;
  top: 34px;
  left: 34px;
  max-width: 300px;
}

.state-badge {
  padding: 7px 11px;
  border-color: rgba(61, 220, 132, 0.32);
  background: rgba(61, 220, 132, 0.09);
  color: var(--green);
}

.character-room[data-state="sleepy"] .state-badge {
  border-color: rgba(255, 184, 77, 0.35);
  background: rgba(255, 184, 77, 0.08);
  color: var(--amber);
}

.character-room[data-state="sleeping"] .state-badge {
  border-color: rgba(111, 195, 255, 0.32);
  background: rgba(111, 195, 255, 0.08);
  color: var(--sky);
}

.character-stage-copy p {
  margin: 12px 0 0;
  color: var(--room-copy);
  font-size: 13.5px;
}

.character-avatar-stage {
  position: absolute;
  left: 50%;
  bottom: 88px;
  width: min(54%, 450px);
  height: min(82%, 590px);
  transform: translateX(-50%);
}

.avatar-art {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.avatar-body,
.avatar-head {
  transform-box: fill-box;
  transform-origin: center bottom;
}

.avatar-state-active .avatar-body {
  animation: avatar-breathe 3.1s ease-in-out infinite;
}

.avatar-state-active .avatar-head {
  animation: avatar-head 5.8s ease-in-out infinite;
}

.avatar-state-sleepy .avatar-head {
  animation: avatar-sleepy 3.4s ease-in-out infinite;
}

.avatar-state-sleeping {
  filter: saturate(0.78) brightness(0.82);
}

.avatar-state-sleeping .avatar-body {
  transform: rotate(-4deg) translateY(18px);
}

.avatar-eye-line,
.avatar-mouth-line {
  fill: none;
  stroke: #47251f;
  stroke-width: 7;
  stroke-linecap: round;
}

.avatar-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: avatar-blink 6.2s infinite;
}

.care-actions {
  position: absolute;
  z-index: 4;
  left: 22px;
  right: 22px;
  bottom: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.care-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid rgba(158, 182, 214, 0.2);
  border-radius: 8px;
  background: rgba(6, 11, 20, 0.9);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.care-button:hover:not(:disabled) {
  border-color: rgba(200, 245, 66, 0.46);
  background: rgba(15, 24, 38, 0.96);
  transform: translateY(-1px);
}

.care-button:disabled {
  cursor: not-allowed;
  color: var(--muted-2);
  opacity: 0.68;
}

.care-button span {
  display: grid;
  gap: 1px;
  text-align: left;
}

.care-button strong {
  font-size: 12.5px;
}

.care-button small {
  color: var(--muted);
  font-size: 10px;
}

.character-feedback {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 92px;
  min-height: 20px;
  margin: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(5, 8, 15, 0.78);
  color: var(--lime);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.character-feedback.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.character-dashboard {
  display: grid;
  align-content: start;
  gap: 12px;
}

.dashboard-section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
}

.dashboard-head {
  margin-bottom: 20px;
}

.dashboard-head h2 {
  font-size: 18px;
}

.updated-label {
  color: var(--muted-2);
  font-size: 11px;
}

.need-list {
  display: grid;
  gap: 18px;
}

.need-label {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
  font-size: 12.5px;
}

.need-label span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.need-label strong {
  font-variant-numeric: tabular-nums;
}

.need-row[data-need="energy"] .need-label svg { color: var(--amber); }
.need-row[data-need="mood"] .need-label svg { color: var(--cyan); }
.need-row[data-need="care"] .need-label svg { color: var(--red); }

.need-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #070c15;
}

.need-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.55s cubic-bezier(0.2, 0.75, 0.25, 1);
}

[data-need="energy"] .need-track i { background: var(--amber); }
[data-need="mood"] .need-track i { background: var(--cyan); }
[data-need="care"] .need-track i { background: var(--red); }

.need-time {
  display: block;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.streak-mark,
.wake-mark {
  width: 28px;
  height: 28px;
  color: var(--amber);
}

.wake-mark {
  color: var(--sky);
}

.streak-primary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
}

.streak-primary strong {
  font-family: var(--font-display);
  font-size: 52px;
  line-height: 1;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.streak-primary span {
  color: var(--muted);
  font-size: 12px;
}

.record-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.record-line strong {
  color: var(--text);
}

.today-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(200, 245, 66, 0.16);
  border-radius: 7px;
  background: rgba(200, 245, 66, 0.05);
}

.today-progress > svg {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--lime);
}

.today-progress strong,
.today-progress small {
  display: block;
}

.daily-mark {
  width: 28px;
  height: 28px;
  color: var(--violet);
}

.daily-step,
.daily-chest {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.daily-step > svg,
.daily-chest > svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--muted-2);
}

.daily-step strong,
.daily-step small,
.daily-chest strong,
.daily-chest small {
  display: block;
}

.daily-step strong,
.daily-chest strong {
  font-size: 11.5px;
}

.daily-step small,
.daily-chest small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
}

.daily-step.done > svg {
  color: var(--green);
}

.daily-chest {
  margin-top: 5px;
  padding: 12px;
  border: 1px solid rgba(139, 123, 255, 0.22);
  border-radius: 7px;
  background: rgba(139, 123, 255, 0.06);
}

.daily-chest[data-ready="true"] {
  border-color: rgba(200, 245, 66, 0.34);
  background: rgba(200, 245, 66, 0.07);
}

.daily-chest[data-ready="true"] > svg {
  color: var(--lime);
}

.daily-note {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.5;
}

.today-progress strong {
  font-size: 12px;
}

.today-progress small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
}

.wake-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.wake-step.done {
  color: var(--green);
}

.play-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 7px;
  background: var(--lime);
  color: #111a08;
  font-size: 12px;
  font-weight: 800;
}

.room-editor,
.avatar-editor {
  scroll-margin-top: 82px;
  margin-top: 18px;
  padding: 28px;
  border-top: 1px solid var(--line-strong);
  background: #080e19;
}

.room-editor-groups {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 20px;
  margin-top: 22px;
}

.room-option-group {
  min-width: 0;
}

.room-option-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.room-option-heading strong {
  font-size: 12px;
}

.room-option-heading small {
  color: var(--muted-2);
  font-size: 9.5px;
}

.room-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

#wall-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.room-option {
  min-width: 0;
  min-height: 78px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0c1422;
  color: var(--muted);
  cursor: pointer;
}

.room-option:hover,
.room-option.active {
  border-color: rgba(200, 245, 66, 0.5);
}

.room-option.active {
  box-shadow: inset 0 0 0 1px rgba(200, 245, 66, 0.18);
  color: var(--text);
}

.room-swatch {
  display: block;
  width: 100%;
  height: 38px;
  margin-bottom: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: var(--swatch);
}

.room-swatch.floor {
  background:
    linear-gradient(90deg, transparent 49%, rgba(255,255,255,.13) 50%, transparent 51%) 0 0 / 18px 100%,
    var(--swatch);
}

.room-swatch.disco {
  background:
    linear-gradient(45deg, #7868f2 25%, #25b9c3 25% 50%, #f2547d 50% 75%, #b8e342 75%);
}

.room-option span:last-child {
  display: block;
  overflow: hidden;
  font-size: 9.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skins-preview {
  margin-top: 18px;
  padding: 28px;
  border-top: 1px solid var(--line-strong);
  background: #080e19;
}

.skins-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.skins-heading h2 {
  margin-top: 4px;
  font-size: 22px;
}

.skins-preview > p {
  max-width: 610px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.skins-lock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(200, 245, 66, 0.28);
  border-radius: 99px;
  background: rgba(200, 245, 66, 0.06);
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.skins-lock svg {
  width: 14px;
  height: 14px;
}

.skin-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.skin-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 128px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    linear-gradient(rgba(111, 195, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 195, 255, 0.04) 1px, transparent 1px),
    #0c1422;
  background-size: 22px 22px;
  color: #7890ad;
}

.skin-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 15, 0.48);
}

.skin-card svg {
  z-index: 1;
  width: 32px;
  height: 32px;
  opacity: 0.38;
}

.skin-card strong {
  z-index: 1;
  font-size: 11px;
}

.skin-arcade { color: #6fc3ff; }
.skin-cardmaster { color: #8b7bff; }
.skin-champion { color: #ffb84d; }

.premium-lab {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.premium-lab-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.premium-lab-heading h3 {
  margin-top: 4px;
  font-size: 18px;
}

.premium-lab-heading > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--violet);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.premium-lab-heading > span svg {
  width: 14px;
  height: 14px;
}

.premium-lab-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  margin-top: 18px;
}

.goblin-preview {
  display: grid;
  place-items: center;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid rgba(139, 123, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(rgba(139, 123, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 123, 255, 0.05) 1px, transparent 1px),
    #0b1220;
  background-size: 26px 26px;
}

.goblin-art {
  display: block;
  width: 230px;
  height: 310px;
}

.character-avatar-stage .goblin-art {
  width: min(100%, 360px);
  height: 100%;
}

.character-mini-avatar .goblin-art {
  width: 100%;
  height: 100%;
}

.goblin-controls {
  display: grid;
  align-content: start;
  gap: 14px;
}

.goblin-control-group strong {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.goblin-control-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.goblin-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c1422;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.goblin-option:hover,
.goblin-option.active {
  border-color: rgba(139, 123, 255, 0.58);
  color: var(--text);
}

.goblin-swatch {
  width: 15px;
  height: 15px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  background: var(--swatch);
}

.premium-note {
  margin-top: 13px;
  color: var(--muted-2);
  font-size: 10px;
}

.premium-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.premium-actions .premium-note {
  flex: 1;
  margin: 0;
}

#goblin-save-status {
  color: var(--lime);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 680px) {
  .skins-preview {
    padding: 22px 16px;
  }

  .skins-heading {
    align-items: flex-start;
  }

  .skin-cards {
    grid-template-columns: 1fr;
  }

  .skin-card {
    grid-template-columns: 32px 1fr;
    min-height: 72px;
    padding: 14px 18px;
    text-align: left;
  }

  .premium-lab-heading {
    display: grid;
  }

  .premium-lab-layout {
    grid-template-columns: 1fr;
  }

  .premium-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .goblin-preview {
    min-height: 300px;
  }
}

.editor-heading h2 {
  font-size: 22px;
}

.editor-actions > span {
  color: var(--muted);
  font-size: 11px;
}

.character-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.character-button.primary {
  background: var(--lime);
  color: #111a08;
}

.character-button.secondary {
  border-color: var(--line-strong);
  background: var(--panel-solid);
  color: var(--text);
}

.editor-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 28px;
  margin-top: 22px;
}

.editor-preview {
  display: grid;
  place-items: center;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(111, 195, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 195, 255, 0.05) 1px, transparent 1px),
    #0c1422;
  background-size: 28px 28px;
}

.editor-preview .avatar-art {
  width: 210px;
  height: 290px;
}

.editor-controls {
  min-width: 0;
}

.editor-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.editor-tab {
  flex: none;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.editor-tab.active {
  border-color: rgba(200, 245, 66, 0.44);
  background: rgba(200, 245, 66, 0.08);
  color: var(--lime);
}

.editor-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
  padding-top: 12px;
}

.avatar-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.avatar-option:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.avatar-option.active {
  border-color: var(--lime);
  box-shadow: inset 0 0 0 1px rgba(200, 245, 66, 0.24);
  color: var(--text);
}

.option-swatch {
  width: 25px;
  height: 25px;
  flex: none;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: var(--swatch, #263553);
}

.option-glyph {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: none;
  border-radius: 6px;
  background: #101a2b;
  color: var(--lime);
  font-family: var(--font-display);
  font-size: 11px;
}

.option-avatar-preview {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  overflow: hidden;
  border: 1px solid rgba(158, 182, 214, 0.16);
  border-radius: 6px;
  background: #101a2b;
}

.option-avatar-preview .avatar-art {
  width: 42px;
  height: 42px;
}

.character-mini-avatar {
  overflow: hidden;
  padding: 0 !important;
}

.character-mini-avatar .avatar-art {
  width: 100%;
  height: 100%;
  margin: 0;
}

.character-signed-out {
  display: grid;
  grid-template-columns: minmax(260px, 430px) minmax(300px, 520px);
  gap: 56px;
  align-items: center;
  min-height: 640px;
  width: min(1000px, 100%);
  margin: 0 auto;
}

.signed-out-avatar {
  display: grid;
  place-items: center;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(111, 195, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 195, 255, 0.05) 1px, transparent 1px),
    #0c1422;
  background-size: 36px 36px;
}

.signed-out-avatar .avatar-art {
  width: 340px;
  max-width: 85%;
}

.character-signed-out h1 {
  max-width: 500px;
  font-size: clamp(28px, 4vw, 44px);
}

.character-signed-out p {
  max-width: 500px;
  margin: 14px 0 22px;
  color: var(--muted);
}

.character-room.is-drinking .avatar-body {
  animation: avatar-action 0.8s ease;
}

.character-room.is-feeding .avatar-head {
  animation: avatar-nod 0.8s ease;
}

.character-room.is-playing .avatar-art {
  animation: avatar-celebrate 0.9s ease;
}

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

@keyframes avatar-breathe {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-4px) scaleY(1.008); }
}

@keyframes avatar-head {
  0%, 45%, 100% { transform: rotate(0); }
  50%, 58% { transform: rotate(2deg); }
}

@keyframes avatar-sleepy {
  0%, 100% { transform: rotate(0) translateY(0); }
  50% { transform: rotate(4deg) translateY(5px); }
}

@keyframes avatar-blink {
  0%, 44%, 48%, 100% { transform: scaleY(1); }
  46% { transform: scaleY(0.08); }
}

@keyframes avatar-action {
  0%, 100% { transform: rotate(0); }
  45% { transform: rotate(-5deg) translateY(-8px); }
}

@keyframes avatar-nod {
  0%, 100% { transform: rotate(0); }
  40% { transform: rotate(7deg) translateY(4px); }
}

@keyframes avatar-celebrate {
  0%, 100% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(-18px) rotate(-2deg); }
  65% { transform: translateY(-10px) rotate(2deg); }
}

@media (max-width: 1040px) {
  .character-workspace {
    grid-template-columns: 1fr;
  }

  .character-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wake-section {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .character-main {
    padding: 24px 16px 100px;
  }

  .character-heading {
    align-items: flex-start;
  }

  .character-heading h1 {
    font-size: 25px;
  }

  .character-room {
    min-height: 620px;
  }

  .room-window {
    top: 80px;
    right: 22px;
    width: 120px;
    height: 86px;
  }

  .room-shelf {
    left: 18px;
    top: 218px;
    transform: scale(0.78);
    transform-origin: left;
  }

  .pet-bed {
    right: 18px;
    bottom: 104px;
    transform: scale(0.82);
    transform-origin: right bottom;
  }

  .trophy-table {
    left: 14px;
    bottom: 102px;
    transform: scale(0.74);
    transform-origin: left bottom;
  }

  .character-stage-copy {
    top: 24px;
    left: 20px;
  }

  .character-avatar-stage {
    width: min(80%, 390px);
    bottom: 106px;
  }

  .care-actions {
    left: 10px;
    right: 10px;
    bottom: 10px;
    gap: 5px;
  }

  .care-button {
    min-width: 0;
    padding: 9px 5px;
    gap: 5px;
  }

  .care-button > svg {
    width: 16px;
    height: 16px;
  }

  .care-button strong {
    font-size: 10.5px;
  }

  .care-button small {
    font-size: 8.5px;
  }

  .character-dashboard {
    grid-template-columns: 1fr;
  }

  .wake-section {
    grid-column: auto;
  }

  .room-editor,
  .avatar-editor {
    margin-inline: -16px;
    padding: 24px 16px;
  }

  .room-editor-groups {
    grid-template-columns: 1fr;
  }

  .editor-heading {
    align-items: flex-start;
  }

  .editor-layout {
    grid-template-columns: 1fr;
  }

  .editor-preview {
    min-height: 270px;
  }

  .editor-preview .avatar-art {
    height: 250px;
  }

  .character-signed-out {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: auto;
  }

  .signed-out-avatar {
    min-height: 380px;
  }
}

@media (max-width: 460px) {
  .character-heading-actions .demo-badge {
    display: none;
  }

  .character-room {
    min-height: 570px;
  }

  .character-avatar-stage {
    width: 92%;
  }

  .room-window,
  .room-shelf,
  .pet-bed,
  .trophy-table {
    opacity: 0.65;
  }

  .room-options,
  #wall-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-heading {
    display: grid;
  }

  .editor-actions {
    justify-content: space-between;
  }

  .editor-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
