/* V4: quiet, readable interface around the pixel adventure. Load last. */
:root {
  --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --paper: #fafbf8;
  --white: #ffffff;
  --ink: #263e35;
  --muted: #6c786e;
  --line: #e2e8df;
  --green: #2d5846;
  --light: #eff4eb;
  --gold: #936f33;
  --goldlight: #f8f1df;
  --shadow: 0 4px 18px #27422b08;
  font-family: var(--ui-font);
  font-size: 14px;
  line-height: 1.65;
  background: #edf0e9;
}
body { background: #edf0e9; }
.app-shell *, .modal *, .desktop-note *, #toast {
  font-family: var(--ui-font) !important;
  letter-spacing: normal !important;
}
.app-shell { background: var(--paper); box-shadow: 0 8px 60px #263b280c; }
h1, h2, h3, .m-title, .m-label { font-weight: 600; }
small { font-size: 12px; }
.topbar { height: 72px; padding: 12px 20px; border-bottom: 0; background: #fafbf8f5; }
.brand { min-height: 44px; padding: 0; }
.brand img { width: 153px; height: 35px; object-fit: contain; }
.top-title { font-size: 16px; }
.top-actions { gap: 2px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; }
.notice-dot { border-radius: 50%; }
.demo-label { font-size: 11px; }
.page { padding: 8px 22px 28px; }
.page-heading { margin-top: 12px; }
.eyebrow, .pixel-kicker { font-size: 11px; font-weight: 600; }
.eyebrow { color: #7e805f; }
.lead, .m-sub { font-size: 13px; }
.m-caption, .m-note, .m-check small, .m-link-row .m-sub, .m-list .m-card p, .m-card>p { font-size: 12px; }
.m-title { font-size: 15px; }
.m-label { font-size: 13px; }
.m-card, .quest-card, .action-card, .m-game-card, .m-hero, .portfolio-card {
  border-radius: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: none;
}
.m-card, .quest-card { padding: 18px; }
.action-card { padding: 19px; }
.m-card .m-card { border-radius: 9px; }
.m-game-card, .m-hero { background: #f1f5ec; }
.m-badge, .m-chip { font-size: 11px; border: 0; border-radius: 6px; padding: 4px 8px; }
.m-button, .btn { min-height: 46px; border-radius: 9px; font-size: 14px; font-weight: 600; box-shadow: none; border-color: #d8e1d3; }
.m-primary, .btn.primary { box-shadow: none; border-color: var(--green); background: var(--green); color: #fff; }
.m-button:active:not(:disabled), .btn:active:not(:disabled) { box-shadow: none; transform: none; }
.btn.small, .candidate-card .m-button { min-height: 44px; font-size: 13px; }
.m-input { min-height: 46px; border-radius: 8px; background: #fff; font-size: 16px; box-shadow: none; border-color: #dce3d7; }
.m-input::placeholder { font-size: 14px; }
.m-option { border-radius: 9px; }
.m-option:has(input:checked) { box-shadow: none; border-color: #78977a; }
.m-note, .secure-strip, .m-reward, .local-review { border-radius: 8px; }
.m-note { border-left: 0; }
.secure-strip { font-size: 12px; line-height: 1.75; }
.m-icon { border: 0; border-radius: 10px; background: #edf3e8; }
.m-progress, .m-meter, .mini-track { height: 5px; border-radius: 9px; box-shadow: none; }
.m-progress>span, .m-meter>span, .mini-track i { border-radius: 9px; box-shadow: none; }
.quiet-link { min-height: 44px; font-size: 13px; }
.m-text-button { min-height: 44px; }
.m-link-row { min-height: 68px; }
.nav { background: #fafbf8fa; border-top: 1px solid #e2e8df; box-shadow: none; }
.nav button { font-size: 12px; font-weight: 500; }
.nav button.active svg { filter: none; }
.nav button.active::after { width: 4px; height: 4px; border-radius: 50%; bottom: 2px; background: var(--green); }
.filter-row button { border-radius: 8px; min-height: 44px; font-size: 13px; }
.modal { border: 1px solid #e2e8df; border-radius: 20px 20px 0 0; box-shadow: 0 -12px 60px #19312318; }
.modal-inner { padding: 20px 22px max(28px, env(safe-area-inset-bottom)); }
.modal-heading { background: var(--paper); }
#toast { font-size: 13px; border: 0; border-radius: 12px; }

/* Home: words and the actor have their own space, with no text over scenery. */
.v4-home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 12px;
  align-items: center;
  min-height: 184px;
  margin: 2px 0 16px;
  padding: 10px 0 2px;
  position: relative;
  background: none;
  color: var(--ink);
}
.v4-home-copy { min-width: 0; }
.v4-home-intro h1 { font-size: clamp(24px, 6.7vw, 30px); line-height: 1.45; font-weight: 600; margin: 8px 0 10px; text-shadow: none; }
.v4-home-intro p { font-size: 13px; line-height: 1.75; color: var(--muted); }
.v4-home-intro .eyebrow { color: #8a7a55; }
.v4-character-stage { display: flex; position: relative; align-items: flex-end; justify-content: center; min-width: 0; min-height: 180px; padding: 0; background: none; isolation: isolate; }
.v4-character-stage .home-character:not(.animated-character) { position: relative; width: 128px; height: 190px; right: auto; bottom: auto; transform: none; }
.v4-character-stage .pixel-character img { filter: drop-shadow(0 7px 3px #24423118); }
.v4-character-stage .tone-sunset img { filter: hue-rotate(320deg) saturate(.95) drop-shadow(0 7px 3px #24423118); }
.v4-character-stage .tone-sky img { filter: hue-rotate(45deg) saturate(.7) drop-shadow(0 7px 3px #24423118); }
.v4-home-intro .hero-player { border: 0; border-radius: 7px; background: #eef4e9; color: #486249; font-size: 12px; text-shadow: none; margin-top: 12px; min-height: 44px; }
.v4-world-peek { height: 82px; position: relative; overflow: hidden; margin: 20px 0; border-radius: 10px; }
.v4-world-peek>img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 57%; image-rendering: pixelated; }
.v4-task-panel { display: block; position: relative; width: 100%; margin: 18px 0; padding: 17px 18px; border: 1px solid #dbe3d4; border-radius: 12px; background: #fff; box-shadow: none; color: var(--ink); text-align: left; isolation: isolate; }
.v4-task-panel .m-sub { margin-top: 5px; }
.intent-box, .pixel-intent { margin-top: 16px !important; border-radius: 13px; box-shadow: none !important; border-color: #dbe2d5; background: #fff; }
.intent-line { gap: 10px; padding: 16px; min-height: 77px; }
.intent-line label { font-size: 17px; }
.intent-line input { font-size: 16px; padding: 8px 0; }
.intent-line input::placeholder { font-size: 13px; }
.intent-line button { width: 44px; height: 44px; min-width: 44px; border-radius: 10px; }
.home-examples { gap: 8px; margin-bottom: 20px; }
.home-examples button { padding: 7px 10px; min-height: 44px; font-size: 12px; border-radius: 8px; border: 0; background: #f0f3eb; }
.next-adventure { border-radius: 12px; border: 1px solid #d8e2d0; background: #f0f5e9; box-shadow: none; padding: 16px; }
.next-adventure strong { font-size: 15px; }
.next-adventure small { font-size: 12px; }
.next-orb { width: 42px; height: 44px; border-radius: 10px; clip-path: none; }
.starlight { font-size: 13px; }
.camp-head { margin: 26px 0 14px; }
.camp-head h2 { font-size: 15px; }
.camp-head span, .camp-grid small { font-size: 11px; }
.camp-grid { gap: 10px; }
.camp-grid button { min-height: 80px; }
.camp-icon { border: 0; background: #edf3e7; border-radius: 12px; box-shadow: none; width: 48px; height: 48px; }
.camp-icon::before { display: none; }
.camp-grid strong { font-size: 13px; font-weight: 500; }
.boss-invitation { border-radius: 12px; padding: 16px; border: 0; box-shadow: none; background: #284738; }
.boss-invitation small { font-size: 11px; }
.boss-invitation .m-grow>span { font-size: 12px; }
.boss-sigil { border: 0; }

/* Task information is always on a solid panel. Keep scenery in the map only. */
.task-summary, .action-card, .quest-card, .m-quest { background-image: none; }
.quest-card::before { display: none; }
.quest-card h2 { font-size: 18px; }
.quest-card p, .candidate-card p { font-size: 13px; }
.quest-kind, .stage-label, .info-line { font-size: 12px; }
.boss-card { background: #fffdf8 !important; border: 1px solid #e2d4b6 !important; }
.quest-bottom { border-top-style: solid; }
.reward-price { font-size: 20px; }
.task-summary h1 { font-size: 24px; }
.task-tools button { border-radius: 9px; font-size: 12px; }
.prep-slot { border-radius: 9px; font-size: 12px; }
.prep-slot span { font-size: 11px; }
.candidate-avatar { border-radius: 10px; font-size: 13px; }
.empty-slot, .chat-message { border-radius: 10px; font-size: 13px; }
.chat-message small, .history-item small { font-size: 11px; }
.history-item { font-size: 12px; }
.reward-screen::before { content: none; display: none; background: none; }
.reward-screen { padding-top: 16px; background: none; }
.reward-screen>p { font-size: 13px; }
.reward-crest { box-shadow: none !important; }
.loot { border-radius: 10px; font-size: 12px; box-shadow: none; }
.loot small { font-size: 11px; }
.award { border-radius: 8px; font-size: 12px; }
.coin-mark { border-radius: 50%; font-size: 12px; box-shadow: none; }
.craft-options button { border-radius: 8px; font-size: 12px; }
.craft-options button small, .craft-note { font-size: 11px !important; }

/* Secondary areas use the same quiet typography and comfortable touch targets. */
.m-character-sheet { border: 1px solid #d7e2d1; border-radius: 14px; box-shadow: none; color: var(--ink); background: #eef4e8; }
.m-character-sheet::before { display: none; }
.m-character-title { font-size: 11px; color: #7c815c; }
.m-character-copy .m-sub { color: #64745e; font-size: 13px; }
.m-character-copy .m-badge { font-size: 11px; background: #e0ead7; color: #4d6745; border: 0; }
.m-quick-link { min-height: 88px; border-radius: 10px; box-shadow: none; font-size: 13px; border-color: var(--line); background: #fff; }
.m-quick-link:hover { box-shadow: none; }
.m-equipment-slot { border-radius: 10px; box-shadow: none; }
.m-slot-icon { border-radius: 10px; border: 0; }
.m-equipment-rarity { font-size: 11px; border-radius: 5px; }
.m-skill-node { border-radius: 10px; }
.m-skill-node .m-badge, .m-skill-node summary>.m-node-path { font-size: 11px; }
.m-star-orb { border-radius: 9px; box-shadow: 0 0 0 4px var(--paper); }
.m-star-label, .m-star-state { font-size: 11px; }
.m-demo-details summary, .m-demo-details>p { font-size: 12px; }
.m-stat span { font-size: 12px; }
.m-table { font-size: 12px; }
.m-table .m-input { font-size: 16px; }
.m-time-range>span { font-size: 12px; }
.journey-heading p { font-size: 13px; }
.journey-heading .eyebrow { font-size: 11px; }
.star-purse { border: 0; border-radius: 10px; box-shadow: none; font-size: 17px; background: #f7f0df; }
.star-purse small { font-size: 11px; }
.journey-summary { border-radius: 12px; border: 0; background: #edf3e7; color: var(--ink); }
.journey-summary p { font-size: 12px; color: #6b7965; }
.milestone-card { border-radius: 10px; box-shadow: none; }
.milestone-top { font-size: 11px; }
.milestone-rewards span { font-size: 11px; border-radius: 5px; }
.milestone-foot small { font-size: 12px; }
.milestone-foot .btn { min-height: 44px; }
.avatar-stage, .wardrobe-stage { background: #eff4e9; border: 1px solid #dce5d4; border-radius: 13px; }
.avatar-stage::before, .wardrobe-stage::before { background: #b0c2a333; border: 0; }
.avatar-stage-caption { color: var(--ink); }
.avatar-stage-caption span, .avatar-stage-caption p { color: #6e7c64; font-size: 12px; }
.avatar-choice { border-radius: 10px; background: #fff; }
.avatar-choice strong { font-size: 12px; }
.avatar-choices legend { font-size: 13px; }
.wardrobe-stage>.quiet-link { color: #557049; }
.cosmetic-orb { border-radius: 9px; box-shadow: none; }
.cosmetic p, .cosmetic small { font-size: 12px; }
.cosmetic .btn { font-size: 13px; min-height: 44px; }
.souvenir-grid button { border-radius: 10px; padding: 14px 7px; }
.souvenir-grid strong { font-size: 12px; }
.souvenir-grid small { font-size: 11px; }
.top-actions .star-shortcut { font-size: 12px; }
.desktop-note h2 { font-size: 26px; line-height: 1.5; font-weight: 500; }
.desktop-note p, .desktop-note a { font-size: 12px; }

@media (max-width: 360px) {
  .topbar { padding-left: 16px; padding-right: 16px; }
  .page { padding-left: 16px; padding-right: 16px; }
  .brand img { width: 147px; height: 34px; }
  .v4-home-intro { grid-template-columns: minmax(0, 1fr) 112px; gap: 6px; min-height: 170px; }
  .v4-home-intro h1 { font-size: 20px; }
  .v4-character-stage { min-height: 166px; }
  .v4-character-stage .home-character:not(.animated-character) { width: 112px; height: 168px; }
  .intent-line { padding: 14px 12px; gap: 8px; }
  .intent-line label { font-size: 16px; }
  .intent-line input::placeholder { font-size: 12px; }
  .m-card, .quest-card, .action-card { padding: 15px; }
  .m-button, .btn { padding: 10px 11px; }
  .m-character-copy h2 { font-size: 23px; }
  .m-character-copy .m-sub { font-size: 12px; }
  .m-character-title { font-size: 11px; }
  .camp-grid { gap: 6px; }
  .camp-grid strong { font-size: 12px; }
  .next-adventure { padding: 14px 12px; }
  .next-adventure strong { font-size: 14px; }
}
@media (min-width: 1000px) {
  .app-shell { border: 1px solid #dde4d8; border-radius: 22px; }
  .topbar { border-radius: 22px 22px 0 0; }
  .nav { border-radius: 0 0 22px 22px; }
  .modal { border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
