/* WHITEOUT ui: menu rail, catalogs, closet, sheets. Same chip language as site.css. */
.chitbox #chits { font-family: "Cooper Hewitt", "Avenir Next", sans-serif; font-weight: 700; font-size: 22px; line-height: 1; letter-spacing: -0.04em; color: #003FBA; }
.scoreblock .sub { font-size: 11px; margin-top: 2px; }
.chitbox.bump { animation: bump 0.45s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.3); } 100% { transform: scale(1); } }

#menu {
  position: fixed;
  right: 14px;
  top: calc(124px + env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 4;
}
#menu button {
  width: 62px; height: 44px;
  font-size: 12px;
  border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1.05;
  padding: 0;
  touch-action: manipulation;
}
#menu button b { font-size: 10px; color: #003FBA; display: block; }
body.in-arcade #menu, body.in-arcade #quest, body.in-arcade #line { display: none; }
body.in-arcade .keys { display: none; }

/* catalogs */
.overlay.catalog .cat-card { max-width: 760px; max-height: calc(100vh - 36px); display: flex; flex-direction: column; padding: 18px 18px 16px; }
.cat-head { display: flex; align-items: center; gap: 12px; }
.cat-head h2 { flex: 1; margin: 0 !important; }
.cat-wallet { margin: 0 !important; font-family: "Cooper Hewitt", sans-serif; color: #003FBA; font-size: 16px !important; }
.cat-x { height: 38px; padding: 0 14px; font-size: 14px; }
.cat-sub { font-size: 13px !important; margin: 4px 0 10px !important; }
.cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.cat-tab { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 999px; touch-action: manipulation; }
.cat-tab.on { background: #003FBA; color: #FFFFFF; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; overflow-y: auto; padding: 2px 2px 6px; min-height: 120px; }
.cat-grid.small { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.cat-tile { border: 3px solid #000; border-radius: 14px; padding: 8px; background: #fff; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; font-family: inherit; }
.cat-tile.deal { background: #E3F2FC; }
.cat-tile.deal::before { content: "deal"; align-self: flex-start; font: 700 10px "Cooper Hewitt", sans-serif; background: #003FBA; color: #fff; border-radius: 999px; padding: 2px 7px; margin-bottom: -16px; position: relative; z-index: 1; }
.cat-tile.wear { cursor: pointer; touch-action: manipulation; }
.cat-tile.wear.on { background: #34A1E5; }
.cat-cv { width: 96px; height: 84px; display: block; }
.cat-name { font: 700 13px "Cooper Hewitt", sans-serif !important; margin: 0 !important; line-height: 1.15 !important; }
.cat-desc { font-size: 11px !important; margin: 0 !important; line-height: 1.25 !important; color: #003FBA; }
.cat-have { font-size: 11px !important; margin: 0 !important; }
.cat-buy { height: 34px; font-size: 13px; padding: 0 10px; margin-top: auto; border-radius: 12px; touch-action: manipulation; }
.cat-buy:disabled { background: #eee; color: #555; }
.ward-wrap { display: flex; gap: 14px; min-height: 0; flex: 1; }
.ward-left { width: 190px; flex: none; display: flex; flex-direction: column; align-items: center; border: 3px solid #000; border-radius: 16px; background: #E3F2FC; padding: 8px; }
.ward-cv { width: 170px; height: 200px; display: block; }
.ward-name { font: 700 18px "Cooper Hewitt", sans-serif !important; margin: 0 0 8px !important; }
.ward-strip { height: 34px; font-size: 12px; padding: 0 10px; }
.ward-right { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ward-empty { font-size: 13px !important; grid-column: 1 / -1; }
.swatch { height: 64px; border-radius: 14px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; touch-action: manipulation; }
.swatch span { background: #fff; border: 2px solid #000; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.swatch.on { outline: 4px solid #003FBA; outline-offset: 2px; }
.swatch.locked { opacity: 0.55; }

/* generic sheet (menus, map, news, settings) */
.sheet-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.sheet-list button { height: 44px; text-align: left; padding: 0 14px; touch-action: manipulation; }
.sheet-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-row button { flex: 1; min-width: 120px; height: 44px; touch-action: manipulation; }

@media (max-width: 760px) {
  #menu { top: calc(100px + env(safe-area-inset-top)); right: 8px; gap: 5px; }
  #menu button { width: 52px; height: 38px; font-size: 11px; border-radius: 12px; }
  #menu button b { display: none; }
  .scoreblock .sub { font-size: 10px; }
  .chitbox #chits { font-size: 18px; }
  .ward-wrap { flex-direction: column; }
  .ward-left { width: 100%; flex-direction: row; justify-content: space-around; padding: 4px; }
  .ward-cv { width: 110px; height: 120px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .cat-cv { width: 80px; height: 70px; }
  .acts button { min-width: 64px; height: 56px; }
  .acts button#btn-log { min-width: 52px; }
}
@media (max-width: 400px) {
  .meters { gap: 6px; padding: 6px 8px; }
  #hearts i { width: 11px; height: 11px; }
  .acts { gap: 5px; }
  .acts button { min-width: 56px; }
}

/* hut decorating */
.deco-btn { position: fixed; left: 14px; top: calc(124px + env(safe-area-inset-top)); height: 46px; padding: 0 16px; z-index: 5; background: #34A1E5; touch-action: manipulation; }
.deco-tray { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 6; background: #fff; border: 3px solid #000; border-radius: 18px; padding: 8px 10px; box-shadow: 6px 6px 0 rgba(0,0,0,0.3); max-width: 900px; margin: 0 auto; }
body.decorating #pad, body.decorating #hint { display: none; }
.deco-top { display: flex; gap: 8px; align-items: center; }
.deco-tip { flex: 1; margin: 0; font-size: 13px; }
.deco-shop { height: 34px; font-size: 12px; padding: 0 10px; }
.deco-row { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px; }
.deco-item { flex: none; width: 104px; height: 102px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 4px; font-size: 11px; border-radius: 12px; touch-action: manipulation; }
.deco-item span { font-family: "Avenir Next", system-ui, sans-serif; font-weight: 600; line-height: 1.1; }
.deco-item.on { background: #34A1E5; }
.deco-item.out { opacity: 0.45; }
.deco-cv { width: 80px; height: 62px; display: block; }
.deco-swatches { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.deco-swatches span { font-weight: 700; margin-left: 4px; }
.deco-sw { width: 30px; height: 30px; border-radius: 50%; padding: 0; border-width: 2px; touch-action: manipulation; }
.deco-sw.on { outline: 3px solid #003FBA; outline-offset: 2px; }

/* pets */
.pet-wrap { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.pet-cv { width: 160px; height: 140px; display: block; background: #E3F2FC; border: 3px solid #000; border-radius: 16px; flex: none; margin: 0 auto 8px; }
.pet-stats { flex: 1; }
.pet-bar { display: flex; align-items: center; gap: 8px; margin: 6px 0; font: 700 13px "Cooper Hewitt", sans-serif; }
.pet-bar span { width: 34px; }
.pet-bar i { flex: 1; height: 14px; border: 2px solid #000; border-radius: 999px; overflow: hidden; background: #fff; display: block; }
.pet-bar b { display: block; height: 100%; background: #34A1E5; }
.pet-note { font-size: 12px !important; }
.adopt-sw { justify-content: center; margin: 4px 0 10px; }

/* social sheet (say / emote) */
.social-sheet { position: fixed; left: 14px; bottom: calc(140px + env(safe-area-inset-bottom)); width: min(330px, calc(100vw - 90px)); max-height: calc(100vh - 300px); display: flex; flex-direction: column; background: #fff; border: 3px solid #000; border-radius: 18px; box-shadow: 6px 6px 0 rgba(0,0,0,0.3); z-index: 8; overflow: hidden; }
.ss-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 6px 14px; border-bottom: 2px solid #000; }
.ss-head b { font: 700 16px "Cooper Hewitt", sans-serif; }
.ss-head button { height: 30px; font-size: 12px; padding: 0 10px; }
.ss-body { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.ss-body button { min-height: 38px; text-align: left; padding: 6px 12px; font-size: 14px; border-radius: 12px; touch-action: manipulation; }
.ss-phrase { font-family: "Avenir Next", system-ui, sans-serif !important; font-weight: 600 !important; letter-spacing: 0 !important; }
.ss-cat.secret { background: #1A1A1A; color: #34A1E5; }
.ss-back { background: #E3F2FC; }
.ss-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sheet-link { display: block; border: 3px solid #000; border-radius: 16px; padding: 10px 14px; font: 700 15px "Cooper Hewitt", sans-serif; color: #003FBA; background: #E3F2FC; text-decoration: none; }
.sheet-list button.danger { background: #fff; color: #A3182B; }

/* map */
.map-wrap { border: 3px solid #000; border-radius: 14px; overflow: hidden; background: #003FBA; }
.map-cv { width: 100%; height: min(52vh, 480px); display: block; cursor: pointer; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.map-legend button { height: 32px; font-size: 12px; padding: 0 10px; border-radius: 999px; touch-action: manipulation; }
.map-legend button.locked { opacity: 0.45; }
.map-plug { margin-top: 2px; font-size: 14px; }

/* bulletin */
.news-paper { overflow-y: auto; columns: 2 260px; column-gap: 18px; padding: 2px; }
.news-paper article, .news-event { break-inside: avoid; border-top: 3px solid #000; padding: 8px 0 10px; margin: 0; }
.news-paper h3 { font: 700 17px "Cooper Hewitt", sans-serif; margin: 0 0 4px; letter-spacing: -0.02em; }
.news-paper .lead h3 { font-size: 24px; line-height: 1.05; }
.news-paper p { font-size: 14px !important; line-height: 1.45 !important; margin: 4px 0 !important; text-align: left; }
.news-paper p.q { font-style: italic; color: #003FBA; }
.news-event { background: #FFF4D6; border: 3px solid #000 !important; border-radius: 14px; padding: 10px 12px !important; margin-bottom: 12px !important; }
.news-event button { height: 38px; padding: 0 12px; font-size: 13px; margin-top: 4px; }
.news-ads p { font-family: "Courier New", monospace; font-size: 12px !important; }
.news-plug .sheet-link { margin-top: 6px; font-size: 13px; padding: 8px 12px; }

/* the night desk */
#menu .phone-btn { background: #0B1638; color: #34A1E5; }
#menu .phone-btn b { color: #F2C94C; }
#menu .phone-btn.ringing { animation: ring 0.9s ease-in-out infinite; background: #F2C94C; color: #000; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }
.phone-card { background: #0B1638 !important; color: #fff !important; border-color: #34A1E5 !important; }
.phone-card h2, .phone-card .cat-sub, .phone-card .cat-wallet { color: #fff !important; }
.phone-card .sheet-list button { background: #13245A; color: #fff; border-color: #34A1E5; }
.phone-card .sheet-list button.ringing { background: #F2C94C; color: #000; }
.phone-file { border: 2px dashed #34A1E5; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; text-align: left; }
.phone-file h3 { margin: 0 0 4px; font: 700 15px "Cooper Hewitt", sans-serif; color: #F2C94C; letter-spacing: 0.04em; }
.phone-file p { margin: 3px 0 !important; font-size: 13px !important; }
.phone-file p.done { opacity: 0.55; }
.phone-file p.now { color: #34A1E5; font-weight: 700; }
.quiz-q { font: 700 18px "Cooper Hewitt", sans-serif !important; margin: 10px 0 14px !important; }
.cipher-ct { font-family: "Courier New", monospace; font-size: 15px !important; letter-spacing: 0.08em; color: #003FBA; word-break: break-word; }
.cipher-out { font-family: "Courier New", monospace; font-size: 22px !important; font-weight: 700; letter-spacing: 0.08em; background: #0B1638; color: #34A1E5; border-radius: 12px; padding: 14px; margin: 10px 0 !important; word-break: break-word; }
.cipher-out.solved { background: #F2C94C; color: #000; }
.tune-row { margin-top: 10px; }
.tune-key { height: 64px !important; font-size: 16px; }

/* stamps */
.stamp-toast { position: fixed; left: 50%; top: calc(84px + env(safe-area-inset-top)); transform: translate(-50%, -140%); z-index: 20; background: #F2C94C; border: 3px solid #000; border-radius: 999px; padding: 8px 18px; display: flex; gap: 10px; align-items: center; box-shadow: 4px 4px 0 rgba(0,0,0,0.3); transition: transform 0.35s cubic-bezier(.2,1.4,.4,1); pointer-events: none; }
.stamp-toast.show { transform: translate(-50%, 0); }
.stamp-toast b { font: 700 11px "Cooper Hewitt", sans-serif; background: #000; color: #F2C94C; border-radius: 999px; padding: 2px 8px; letter-spacing: 0.08em; }
.stamp-toast span { font: 700 16px "Cooper Hewitt", sans-serif; }
.stamp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; overflow-y: auto; padding: 2px; }
.stamp { border: 3px dashed #9AA6B8; border-radius: 14px; padding: 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; align-items: center; background: #F4F7FB; }
.stamp i { font-style: normal; font: 700 24px "Cooper Hewitt", sans-serif; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #E1E7EF; color: #9AA6B8; }
.stamp b { font: 700 13px "Cooper Hewitt", sans-serif; }
.stamp span { font-size: 11px; line-height: 1.25; color: #46546B; }
.stamp.got { border: 3px solid #000; background: #fff; }
.stamp.got i { background: #F2C94C; color: #000; border: 2px solid #000; }
.stamp.hidden b { color: #9AA6B8; }

/* starhouse telescope */
.scope-card { background: #0E2A66 !important; color: #fff !important; }
.scope-card h2, .scope-card .cat-sub, .scope-card .cat-wallet { color: #fff !important; }
.scope-card .sheet-row button { height: 34px; font-size: 12px; min-width: 70px; }
.scope-card .sheet-row button.on { background: #F2C94C; }
.scope-card .sheet-row button.done { background: #34A1E5; }
.scope-cv { width: 100%; height: min(50vh, 420px); display: block; border: 3px solid #34A1E5; border-radius: 14px; margin-top: 10px; touch-action: none; cursor: crosshair; }
.save-code { width: 100%; height: 120px; font-family: "Courier New", monospace; font-size: 11px; border: 3px solid #000; border-radius: 12px; padding: 8px; margin: 6px 0 10px; resize: none; word-break: break-all; }

/* title screen */
.title-screen { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(ellipse at 50% 30%, rgba(52,161,229,0.32), rgba(0,40,130,0.72) 75%); overflow-y: auto; transition: opacity 0.38s, transform 0.38s; }
.title-screen[hidden] { display: none; }
.title-screen.leaving { opacity: 0; transform: scale(1.04); }
body.titled #hud, body.titled #menu, body.titled #pad, body.titled #quest, body.titled #line, body.titled #hint, body.titled .netchip { visibility: hidden; }
.title-inner { width: min(560px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.logo { margin: 0; font: 700 clamp(52px, 13vw, 104px)/0.92 "Cooper Hewitt", "Avenir Next", sans-serif; letter-spacing: -0.05em; color: #fff; -webkit-text-stroke: 3px #000; paint-order: stroke fill; text-shadow: 0 5px 0 #003FBA, 0 9px 0 #000, 0 16px 22px rgba(0,0,0,0.35); animation: logo-bob 3.2s ease-in-out infinite; }
.logo span { display: inline-block; }
.logo span + span { color: #34A1E5; }
@keyframes logo-bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
.tagline { margin: 4px 0 0; color: #fff; font: 700 16px "Cooper Hewitt", sans-serif; letter-spacing: 0.01em; text-shadow: 0 2px 0 #003FBA; }
.title-cv { width: 100%; height: 170px; display: block; }
.title-new, .title-back { background: #fff; border: 3px solid #000; border-radius: 18px; padding: 12px 16px; width: 100%; box-shadow: 6px 6px 0 rgba(0,0,0,0.3); }
.title-new label { display: block; font: 700 15px "Cooper Hewitt", sans-serif; margin-bottom: 8px; }
.title-new input { width: 100%; font-size: 18px; padding: 10px 12px; border: 3px solid #000; border-radius: 12px; font-family: inherit; }
.title-new input:focus { outline: 3px solid #34A1E5; }
.title-colors-label { margin: 10px 0 6px; font-size: 13px; }
.title-colors { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.title-colors .deco-sw { width: 36px; height: 36px; }
.title-back { font: 700 20px "Cooper Hewitt", sans-serif; margin: 0; }
.title-go { margin-top: 6px; height: 62px; min-width: 220px; font-size: 26px; background: #F2C94C; border-radius: 20px; box-shadow: 0 6px 0 #000; transform: translateY(-3px); transition: transform 0.08s, box-shadow 0.08s; touch-action: manipulation; }
.title-go:hover { transform: translateY(-5px); box-shadow: 0 8px 0 #000; }
.title-go:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; background: #F2C94C; }
.title-foot { margin: 6px 0 0; color: #fff; font-size: 12px; opacity: 0.9; }
.title-foot.px-note { opacity: 0.65; }
.title-foot a { color: inherit; }
.title-fresh { background: transparent; border: none; color: #BFE6FF; font: 600 12px "Avenir Next", system-ui, sans-serif; text-decoration: underline; padding: 4px; }
@media (max-height: 640px) { .title-cv { height: 100px; } .logo { font-size: 54px; } }
/* short screens (phones on their side): centered flex content taller than the screen
   used to clip the logo off the top with no way to scroll to it. Center with auto
   margins instead (scrollable), and tighten everything so "walk in" stays in reach. */
.title-screen { align-items: flex-start; }
.title-inner { margin: auto 0; }
@media (max-height: 460px) {
  .title-screen { padding: 8px 16px; }
  .title-inner { gap: 4px; }
  .logo { font-size: 40px; text-shadow: 0 3px 0 #003FBA, 0 6px 0 #000; }
  .tagline { font-size: 13px; margin: 0; }
  .title-cv { height: 64px; }
  .title-new { padding: 8px 12px; }
  .title-new label { margin-bottom: 4px; font-size: 13px; }
  .title-new input { padding: 6px 10px; font-size: 16px; }
  .title-colors-label { margin: 6px 0 4px; }
  .title-colors .deco-sw { width: 30px; height: 30px; }
  .title-go { height: 50px; font-size: 22px; margin-top: 2px; }
  .title-foot { display: none; }
}
.cat-tile.rare { background: #FFF4D6; }
.cat-tile.rare::before { content: "rare"; align-self: flex-start; font: 700 10px "Cooper Hewitt", sans-serif; background: #8A2433; color: #fff; border-radius: 999px; padding: 2px 7px; margin-bottom: -16px; position: relative; z-index: 1; }
#quest:empty { display: none; }
.ss-body button { height: auto; }
body.in-arcade #hint { display: none; }
