:root {
  --bg: #15131a;
  --panel: #231f2a;
  --panel-2: #2c2734;
  --ink: #fff8ee;
  --muted: #cabfc2;
  --line: #403846;
  --green: #7ee2a8;
  --cyan: #72d6e7;
  --amber: #ffd166;
  --coral: #ef7d72;
  --pink: #f5a3c7;
  --lime: #c8ef83;
  --violet: #b7a4ff;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(126, 226, 168, 0.18), transparent 23rem),
    radial-gradient(circle at 88% 0%, rgba(255, 209, 102, 0.16), transparent 21rem),
    linear-gradient(135deg, #15131a 0%, #1e1a22 45%, #171c20 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.topbar h1,
.section-head h2,
.avatar-copy h2,
.quick-panel h2,
.random-event-card h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(2.2rem, 4vw, 4.5rem);
  line-height: 0.95;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-id,
.wallet {
  display: grid;
  gap: 3px;
  justify-items: end;
  color: var(--muted);
}

.hero-id strong,
.wallet strong {
  color: var(--ink);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(9, minmax(86px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.tab,
.primary-button,
.ghost-button,
.reward-button,
.skill-button,
.inventory-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    opacity 150ms ease;
}

.tab:hover,
.primary-button:hover,
.ghost-button:hover,
.reward-button:hover:not(:disabled),
.skill-button:hover:not(:disabled),
.inventory-button:hover:not(:disabled),
.avatar-device:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 209, 102, 0.72);
}

.tab.is-active {
  background: #26392f;
  border-color: var(--green);
  color: var(--green);
  font-weight: 850;
}

.screen {
  display: none;
}

.screen.is-visible {
  display: block;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.12fr) minmax(260px, 0.88fr);
  gap: 16px;
}

.avatar-panel,
.summary-panel,
.stats-panel,
.quick-panel,
.market-card,
.history-card,
.quest-card,
.random-event-card,
.inventory-card,
.achievement-card,
.skill-branch,
.result-card,
.avatar-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(35, 31, 42, 0.9);
  box-shadow: var(--shadow);
}

.avatar-panel {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 22px;
  align-items: center;
  padding: 20px;
}

.avatar-device {
  position: relative;
  display: grid;
  place-items: center;
  width: 220px;
  height: 260px;
  border: 2px solid #58495f;
  border-radius: 8px;
  background:
    linear-gradient(155deg, #ffd166, #f29f67 48%, #72d6e7 49%, #66b9c8);
  box-shadow:
    inset 0 -18px 0 rgba(0, 0, 0, 0.14),
    0 16px 28px rgba(0, 0, 0, 0.22);
}

button.avatar-device {
  padding: 0;
}

.device-light {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 16px var(--green);
}

.avatar-screen {
  position: relative;
  display: grid;
  place-items: center;
  width: 164px;
  height: 150px;
  border: 4px solid #201a24;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent),
    #d7f7da;
  overflow: visible;
}

.pixel-stars {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(#ffffff4d 2px, transparent 2px),
    linear-gradient(90deg, #ffffff3a 2px, transparent 2px);
  background-size: 32px 32px;
  animation: pixel-drift 7s linear infinite;
}

.avatar-body {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 3px solid #1c2d24;
  border-radius: 38% 42% 44% 38%;
  background: var(--green);
  color: #17251d;
  font-weight: 900;
  animation: bob 2.7s ease-in-out infinite;
}

.avatar-body::before,
.avatar-body::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 28px;
  height: 28px;
  border: 3px solid #1c2d24;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  background: var(--avatar-secondary, inherit);
}

.avatar-body::before {
  left: 8px;
  transform: rotate(-18deg);
}

.avatar-body::after {
  right: 8px;
  transform: rotate(18deg);
}

.avatar-face {
  z-index: 2;
  font-size: 2.05rem;
  letter-spacing: 0;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.2));
}

.avatar-accessory {
  position: absolute;
  top: -23px;
  right: -12px;
  z-index: 3;
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  border-radius: 999px;
  background: var(--avatar-accent, var(--amber));
  color: #17130d;
  font-size: 1.15rem;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.14);
}

.avatar-body {
  width: 116px;
  height: 124px;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  overflow: visible;
}

.avatar-body::before,
.avatar-body::after,
.avatar-body > .avatar-accessory,
.avatar-face {
  display: none;
}

.mii-avatar {
  position: relative;
  width: 116px;
  height: 124px;
}

.mii-head,
.mii-ear,
.mii-neck,
.mii-shirt,
.mii-hair,
.mii-brow,
.mii-eye,
.mii-nose,
.mii-mouth,
.mii-cheek,
.mii-accessory {
  position: absolute;
}

.mii-neck {
  left: 45px;
  top: 79px;
  width: 26px;
  height: 24px;
  border: 3px solid #2a1c19;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: var(--skin);
  z-index: 1;
}

.mii-shirt {
  left: 24px;
  top: 96px;
  width: 68px;
  height: 32px;
  border: 3px solid #201a24;
  border-radius: 28px 28px 10px 10px;
  background:
    linear-gradient(90deg, transparent 45%, var(--shirt-trim) 46%, var(--shirt-trim) 54%, transparent 55%),
    var(--shirt);
  z-index: 0;
}

.mii-head {
  left: 20px;
  top: 8px;
  width: 76px;
  height: 82px;
  border: 4px solid #201a24;
  border-radius: 42% 42% 48% 48%;
  background: var(--skin);
  overflow: hidden;
  z-index: 3;
}

.face-oval .mii-head {
  height: 88px;
  border-radius: 46% 46% 52% 52%;
}

.face-square .mii-head {
  border-radius: 32% 32% 42% 42%;
}

.face-heart .mii-head {
  border-radius: 48% 48% 58% 58%;
}

.type-robot .mii-head,
.type-robot .mii-ear,
.type-robot .mii-neck {
  background: linear-gradient(180deg, #d7e2e8, #95a3ad);
}

.type-robot .mii-head {
  border-radius: 20px;
}

.type-fantasy .mii-ear {
  width: 20px;
  border-radius: 12px 999px 999px 12px;
}

.type-sporty .mii-shirt {
  background:
    linear-gradient(90deg, transparent 42%, var(--shirt-trim) 43%, var(--shirt-trim) 57%, transparent 58%),
    linear-gradient(180deg, var(--shirt), #2e9c75);
}

.type-cozy .mii-shirt {
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 40%, var(--shirt-trim) 0 4px, transparent 5px),
    var(--shirt);
}

.type-focus .mii-eye {
  box-shadow: 0 0 10px rgba(114, 214, 231, 0.8);
}

.mii-ear {
  top: 38px;
  width: 16px;
  height: 23px;
  border: 3px solid #201a24;
  border-radius: 999px;
  background: var(--skin);
  z-index: 2;
}

.mii-ear-left {
  left: 12px;
}

.mii-ear-right {
  right: 12px;
}

.mii-hair {
  inset: -5px -3px auto -3px;
  height: 30px;
  border-bottom: 4px solid #201a24;
  background: var(--hair);
  z-index: 3;
}

.hair-short .mii-hair {
  border-radius: 30px 30px 14px 14px;
}

.hair-messy .mii-hair {
  height: 34px;
  clip-path: polygon(0 0, 100% 0, 100% 62%, 82% 47%, 70% 76%, 54% 48%, 38% 78%, 22% 50%, 0 68%);
}

.hair-side .mii-hair {
  height: 34px;
  clip-path: polygon(0 0, 100% 0, 100% 56%, 66% 46%, 43% 75%, 0 64%);
}

.hair-curls .mii-hair {
  height: 34px;
  border-radius: 26px 26px 18px 18px;
  box-shadow:
    inset 11px -9px 0 rgba(255, 255, 255, 0.12),
    inset -12px -10px 0 rgba(0, 0, 0, 0.12);
}

.hair-buzz .mii-hair {
  height: 16px;
  border-radius: 30px 30px 8px 8px;
}

.hair-long .mii-hair {
  height: 62px;
  border-radius: 30px 30px 26px 26px;
}

.mii-eye {
  top: 38px;
  width: 9px;
  height: 12px;
  border-radius: 999px;
  background: var(--eye);
  z-index: 4;
}

.mii-eye-left {
  left: 23px;
}

.mii-eye-right {
  right: 23px;
}

.eyes-happy .mii-eye {
  height: 7px;
  border-radius: 0;
  background: transparent;
  border-top: 4px solid var(--eye);
}

.eyes-bright .mii-eye {
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.86);
}

.eyes-sleepy .mii-eye {
  height: 3px;
  margin-top: 5px;
  border-radius: 0;
}

.eyes-wide .mii-eye {
  width: 12px;
  height: 14px;
  background:
    radial-gradient(circle at center, var(--eye) 0 36%, #fff 38% 100%);
  border: 2px solid var(--eye);
}

.mii-brow {
  top: 29px;
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: var(--hair);
  z-index: 4;
}

.mii-brow-left {
  left: 18px;
}

.mii-brow-right {
  right: 18px;
}

.brows-thick .mii-brow {
  height: 6px;
}

.brows-focused .mii-brow-left {
  transform: rotate(12deg);
}

.brows-focused .mii-brow-right {
  transform: rotate(-12deg);
}

.brows-raised .mii-brow {
  top: 25px;
  transform: rotate(-6deg);
}

.mii-nose {
  left: 35px;
  top: 49px;
  width: 9px;
  height: 14px;
  border-right: 3px solid rgba(32, 26, 36, 0.72);
  border-bottom: 3px solid rgba(32, 26, 36, 0.72);
  border-radius: 0 0 8px 0;
  z-index: 4;
}

.nose-round .mii-nose {
  width: 12px;
  height: 10px;
  border: 3px solid rgba(32, 26, 36, 0.72);
  border-top: 0;
  border-left: 0;
}

.nose-long .mii-nose {
  height: 19px;
}

.mii-mouth {
  left: 27px;
  top: 66px;
  width: 22px;
  height: 10px;
  border-bottom: 4px solid #7a342f;
  border-radius: 0 0 999px 999px;
  z-index: 4;
}

.mouth-flat .mii-mouth {
  top: 70px;
  height: 3px;
  border-bottom: 4px solid #7a342f;
  border-radius: 999px;
}

.mouth-open .mii-mouth {
  left: 30px;
  width: 16px;
  height: 14px;
  border: 3px solid #7a342f;
  border-radius: 999px;
  background: #7a342f;
}

.mouth-worry .mii-mouth {
  top: 72px;
  border-top: 4px solid #7a342f;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.mouth-smirk .mii-mouth {
  width: 24px;
  transform: rotate(-7deg);
}

.mii-cheek {
  top: 58px;
  width: 10px;
  height: 6px;
  border-radius: 999px;
  background: rgba(245, 163, 199, 0.38);
  z-index: 3;
}

.mii-cheek-left {
  left: 11px;
}

.mii-cheek-right {
  right: 11px;
}

.mii-accessory {
  z-index: 7;
  pointer-events: none;
}

.accessory-glasses .mii-accessory {
  left: 12px;
  top: 35px;
  width: 52px;
  height: 18px;
  border-left: 3px solid #201a24;
  border-right: 3px solid #201a24;
  border-radius: 999px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.accessory-glasses .mii-accessory::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 6px;
  width: 10px;
  height: 3px;
  background: #201a24;
}

.accessory-cap .mii-accessory {
  left: 16px;
  top: -4px;
  width: 44px;
  height: 18px;
  border: 3px solid #201a24;
  border-radius: 999px 999px 8px 8px;
  background: var(--avatar-accent);
}

.accessory-cap .mii-accessory::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 9px;
  width: 24px;
  height: 7px;
  border: 3px solid #201a24;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  background: var(--avatar-accent);
}

.accessory-headphones .mii-accessory {
  left: 2px;
  top: 29px;
  width: 72px;
  height: 38px;
  border: 5px solid #201a24;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.accessory-headphones .mii-accessory::before,
.accessory-headphones .mii-accessory::after {
  content: "";
  position: absolute;
  top: 21px;
  width: 11px;
  height: 22px;
  border: 3px solid #201a24;
  border-radius: 6px;
  background: var(--avatar-accent);
}

.accessory-headphones .mii-accessory::before {
  left: -7px;
}

.accessory-headphones .mii-accessory::after {
  right: -7px;
}

.accessory-coffee .mii-accessory,
.accessory-coin .mii-accessory,
.accessory-tennis .mii-accessory,
.accessory-laptop .mii-accessory,
.accessory-sword .mii-accessory,
.accessory-backpack .mii-accessory {
  right: -12px;
  bottom: -25px;
  width: 28px;
  height: 28px;
  border: 3px solid #201a24;
  border-radius: 8px;
  background: var(--avatar-accent);
}

.accessory-backpack .mii-accessory {
  left: 3px;
  right: auto;
  bottom: 6px;
  width: 23px;
  height: 38px;
  border-radius: 10px;
  z-index: 1;
}

.accessory-coffee .mii-accessory::after {
  content: "";
  position: absolute;
  right: -9px;
  top: 6px;
  width: 9px;
  height: 11px;
  border: 3px solid #201a24;
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

.accessory-coin .mii-accessory {
  border-radius: 999px;
}

.accessory-tennis .mii-accessory {
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 45%, #201a24 46%, #201a24 54%, transparent 55%),
    var(--avatar-accent);
}

.accessory-laptop .mii-accessory {
  width: 38px;
  height: 23px;
  border-radius: 4px;
  transform: translateX(5px);
}

.accessory-sword .mii-accessory {
  width: 9px;
  height: 42px;
  border-radius: 999px;
  transform: rotate(38deg);
}

.accessory-aura .mii-head {
  box-shadow: 0 0 0 5px rgba(255, 209, 102, 0.24), 0 0 28px rgba(255, 209, 102, 0.46);
}

.avatar-shadow {
  position: absolute;
  bottom: 18px;
  width: 86px;
  height: 12px;
  border-radius: 999px;
  background: rgba(31, 40, 31, 0.18);
  animation: shadow-pulse 2.7s ease-in-out infinite;
}

.device-buttons {
  position: absolute;
  bottom: 16px;
  display: flex;
  gap: 12px;
}

.device-buttons span {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  background: #fff4e2;
}

.avatar-device.state-cansado .avatar-body {
  animation-name: sleepy;
}

.avatar-device.state-estresado .avatar-body {
  animation-name: shake;
  animation-duration: 0.44s;
}

.avatar-device.state-productivo .device-light,
.avatar-device.state-ahorrador .device-light,
.avatar-device.state-feliz .device-light {
  animation: glow 1.6s ease-in-out infinite;
}

.avatar-device.state-lesionado .avatar-body {
  animation-name: tiny-wobble;
}

.summary-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.level-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.level-row div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.level-row strong {
  font-size: 1.85rem;
}

.xp-block {
  display: grid;
  gap: 8px;
}

.xp-head,
.stat-head,
.market-card-head,
.history-meta,
.item-row,
.achievement-head,
.skill-head,
.result-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid #423847;
  border-radius: 999px;
  background: #121016;
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 300ms ease;
}

.xp-fill {
  background: linear-gradient(90deg, var(--green), var(--amber));
}

.income-strip {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(126, 226, 168, 0.28);
  border-radius: 8px;
  background: rgba(126, 226, 168, 0.08);
}

.income-strip span,
.income-strip small,
.screen-note,
.quick-panel p,
.history-card p,
.quest-card p,
.market-card p,
.inventory-card p,
.achievement-card p,
.skill-branch p,
.random-event-card p,
.result-card p,
.avatar-copy p,
.tiny-feedback {
  color: var(--muted);
}

.income-strip strong {
  font-size: 1.5rem;
}

.day-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.random-event-card,
.stats-panel,
.quick-panel,
.cloud-panel {
  padding: 20px;
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.stats-panel,
.quick-panel,
.cloud-panel {
  margin-top: 16px;
}

.cloud-panel {
  border: 1px solid rgba(114, 214, 231, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(114, 214, 231, 0.09), rgba(126, 226, 168, 0.06)),
    rgba(35, 31, 42, 0.9);
  box-shadow: var(--shadow);
}

.compact-head {
  margin-bottom: 8px;
}

.cloud-form {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) 2fr;
  gap: 10px;
  margin-top: 14px;
}

.cloud-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.stat-head strong {
  font-size: 1.2rem;
}

.stat-card small {
  color: var(--muted);
}

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

.primary-button {
  border-color: transparent;
  background: linear-gradient(135deg, #7ee2a8, #72d6e7);
  color: #091614;
  font-weight: 900;
  padding: 0 18px;
}

.ghost-button,
.skill-button,
.inventory-button {
  padding: 0 14px;
}

.ghost-button.is-danger {
  border-color: rgba(239, 125, 114, 0.55);
  color: #ffb2aa;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.tiny-feedback {
  min-height: 22px;
  margin: 10px 0 0;
  font-weight: 800;
}

.checkin-form,
.avatar-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 20px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141119;
  color: var(--ink);
  padding: 12px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(114, 214, 231, 0.16);
}

input[type="color"] {
  min-height: 47px;
  padding: 5px;
}

.switch-row {
  display: flex;
  min-height: 73px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141119;
}

.switch-row input {
  width: 24px;
  height: 24px;
  accent-color: var(--green);
}

.wide-field,
.form-actions {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#checkinFeedback {
  min-height: 24px;
  margin: 0;
  color: var(--green);
  font-weight: 850;
}

.market-grid,
.quest-grid,
.inventory-grid,
.achievement-grid,
.skill-grid,
.result-grid,
.avatar-editor-grid {
  display: grid;
  gap: 12px;
}

.market-grid,
.quest-grid,
.inventory-grid,
.achievement-grid {
  grid-template-columns: repeat(3, 1fr);
}

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

.result-grid,
.avatar-editor-grid {
  grid-template-columns: 1fr 1fr;
}

.market-card,
.quest-card,
.history-card,
.inventory-card,
.achievement-card,
.skill-branch,
.result-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.market-card h3,
.quest-card h3,
.history-card h3,
.inventory-card h3,
.achievement-card h3,
.skill-branch h3,
.result-card h3 {
  margin: 0;
}

.cost-pill,
.tag-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.12);
  color: var(--amber);
  font-weight: 900;
}

.status-pill.is-good {
  background: rgba(126, 226, 168, 0.12);
  color: var(--green);
}

.status-pill.is-muted {
  background: rgba(202, 191, 194, 0.12);
  color: var(--muted);
}

.status-pill.is-hot {
  background: rgba(239, 125, 114, 0.14);
  color: #ffafa6;
}

.reward-button,
.skill-button,
.inventory-button {
  width: 100%;
  font-weight: 900;
}

.reward-button:disabled,
.skill-button:disabled,
.inventory-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.item-row {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-card {
  background: rgba(35, 31, 42, 0.9);
}

.history-stats,
.mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quest-card strong {
  color: var(--green);
}

.quest-card.is-completed {
  border-color: rgba(126, 226, 168, 0.58);
  background: rgba(46, 73, 56, 0.72);
}

.quest-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid rgba(126, 226, 168, 0.4);
  border-radius: 8px;
  background: rgba(126, 226, 168, 0.08);
  color: var(--ink);
  font-weight: 900;
}

.quest-check[aria-pressed="true"] {
  border-color: var(--green);
  background: rgba(126, 226, 168, 0.18);
  color: var(--green);
}

.quest-check:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.check-box {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 6px;
  font-size: 0.68rem;
  line-height: 1;
}

.achievement-card.is-unlocked {
  border-color: rgba(255, 209, 102, 0.62);
  background: rgba(74, 61, 34, 0.45);
}

.skill-node {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.skill-node.is-owned {
  border-color: rgba(126, 226, 168, 0.6);
  background: rgba(126, 226, 168, 0.09);
}

.result-hero {
  margin-bottom: 12px;
  padding: 22px;
  border: 1px solid rgba(126, 226, 168, 0.45);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(126, 226, 168, 0.16), rgba(114, 214, 231, 0.1)),
    rgba(35, 31, 42, 0.94);
}

.result-hero h3 {
  margin: 0;
  font-size: 1.8rem;
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.editor-preview {
  align-self: start;
}

.toast-pop {
  animation: pop 420ms ease;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-7px) rotate(2deg);
  }
}

@keyframes sleepy {
  0%,
  100% {
    transform: translateY(2px) rotate(-1deg) scale(1);
  }
  50% {
    transform: translateY(5px) rotate(1deg) scale(0.98);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  75% {
    transform: translateX(2px);
  }
}

@keyframes tiny-wobble {
  0%,
  100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(4deg);
  }
}

@keyframes shadow-pulse {
  0%,
  100% {
    transform: scaleX(1);
    opacity: 0.55;
  }
  50% {
    transform: scaleX(0.78);
    opacity: 0.3;
  }
}

@keyframes pixel-drift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 32px 32px, 32px 32px;
  }
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 10px var(--green);
  }
  50% {
    box-shadow: 0 0 22px var(--green);
  }
}

@keyframes pop {
  0% {
    transform: scale(0.98);
  }
  60% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 1060px) {
  .tabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-grid,
  .avatar-panel,
  .result-grid,
  .avatar-editor-grid,
  .skill-grid {
    grid-template-columns: 1fr;
  }

  .avatar-panel {
    justify-items: center;
    text-align: center;
  }

  .stats-grid,
  .market-grid,
  .quest-grid,
  .inventory-grid,
  .achievement-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 20px, 1220px);
    padding-top: 18px;
  }

  .topbar,
  .section-head,
  .quick-panel,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-id,
  .wallet {
    justify-items: start;
  }

  .tabs,
  .stats-grid,
  .market-grid,
  .quest-grid,
  .inventory-grid,
  .achievement-grid,
  .level-row,
  .day-panel,
  .checkin-form,
  .avatar-form,
  .cloud-form,
  .cloud-actions {
    grid-template-columns: 1fr;
  }

  .avatar-device {
    width: 100%;
    max-width: 220px;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }
}
