/*
 * Book Club visual system v1
 *
 * The interface follows the illustrated campus world: warm paper, garden
 * greens, terracotta accents and quiet ink. The map is treated as a large
 * game surface; controls stay outside it so the background gets the room it
 * needs on phones and desktop screens.
 */
:root {
  --book-ink: #26352f;
  --book-ink-soft: #526259;
  --book-paper: #fff9e9;
  --book-paper-deep: #f1dfb8;
  --book-sand: #e8c991;
  --book-coral: #d76d5d;
  --book-coral-dark: #9c4b43;
  --book-green: #5d8b67;
  --book-green-dark: #3d654f;
  --book-blue: #6988a0;
  --book-gold: #d39c45;
  --book-shadow: 0 7px 0 rgba(38, 53, 47, .18), 0 14px 28px rgba(61, 54, 39, .08);
  --book-font: "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  --book-display: "Aptos Display", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
}

.bookclub-app,
.bookclub-app * { box-sizing: border-box; }

.bookclub-app {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 112px;
  overflow-x: hidden;
  color: var(--book-ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(255,255,255,.8), transparent 27rem),
    linear-gradient(180deg, #f3e7c8 0%, #f9edcf 42%, #e8d4a8 100%);
  font-family: var(--book-font);
  font-size: calc(16px * var(--ui-font-scale, 1));
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.bookclub-app button,
.bookclub-app input,
.bookclub-app select,
.bookclub-app textarea { font-family: var(--book-font); }

.bookclub-app .pixel-header,
.bookclub-app .music-bar,
.bookclub-app .tab-bar {
  width: min(100% - 24px, 1480px);
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgba(61, 101, 79, .44);
  border-radius: 16px;
  box-shadow: 0 4px 0 rgba(38, 53, 47, .12), 0 10px 22px rgba(61, 54, 39, .08);
}

.bookclub-app .pixel-header {
  position: sticky;
  top: 10px;
  z-index: 30;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  color: var(--book-ink);
  background: rgba(255, 249, 233, .94);
  backdrop-filter: blur(12px);
}

.bookclub-app .header-left,
.bookclub-app .brand-lockup,
.bookclub-app .user-stats-row,
.bookclub-app .header-right { min-width: 0; display: flex; align-items: center; }
.bookclub-app .header-left { gap: 16px; }
.bookclub-app .brand-lockup { gap: 10px; }

.bookclub-app .brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  padding: 3px;
  background: linear-gradient(145deg, #456f59, #244638);
  border: 2px solid #d8b05f;
  border-radius: 12px;
  box-shadow: 3px 3px 0 rgba(38, 53, 47, .2), inset 0 0 0 1px rgba(255,255,255,.25);
}
.bookclub-app .bookcoin-brand-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bookclub-app .brand {
  overflow: hidden;
  color: var(--book-ink);
  font: 900 clamp(15px, 2vw, 20px)/1.15 var(--book-font);
  letter-spacing: .02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bookclub-app .brand-kicker { margin-top: 4px; color: var(--book-green); font: 700 9px/1 var(--book-display); letter-spacing: .14em; }
.bookclub-app .user-stats-row { gap: 7px; flex-wrap: wrap; }

.bookclub-app .coin-badge,
.bookclub-app .streak-badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  color: var(--book-ink);
  background: #f8e8bf;
  border: 1px solid #d9b874;
  border-radius: 999px;
  font: 800 11px/1 var(--book-display);
  white-space: nowrap;
}
.bookclub-app .coin-badge strong { color: var(--book-coral-dark); }
.bookclub-app .streak-badge { background: #e2efdf; border-color: #a6c59c; }
.bookclub-app .streak-badge strong { color: var(--book-green-dark); }

.bookclub-app .bookcoin-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  vertical-align: middle;
}
.bookclub-app .bookcoin-icon .coin-face { fill: #f5c963; stroke: #9c672e; stroke-width: 1.8; }
.bookclub-app .bookcoin-icon .book-mark { fill: #fff9e9; stroke: #9c672e; stroke-width: 1.5; stroke-linejoin: round; }
.bookclub-app .bookcoin-icon .shine { fill: #fff2b7; }

.bookclub-app .header-right { gap: 8px; flex: 0 0 auto; }
.bookclub-app .audio-toggle,
.bookclub-app .user-pill {
  min-height: 44px;
  border: 1px solid #b8c8ad;
  border-radius: 12px;
  color: var(--book-ink);
  background: #fffdf4;
  box-shadow: 0 3px 0 rgba(38, 53, 47, .12);
}
.bookclub-app .audio-toggle { width: 44px; padding: 5px; }
.bookclub-app .user-pill { display: flex; max-width: 260px; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; text-align: left; }
.bookclub-app .user-pill:hover,
.bookclub-app .audio-toggle:hover { color: var(--book-coral-dark); border-color: var(--book-coral); background: #fff2df; }
.bookclub-app .avatar-pixel-sm { width: 32px; height: 32px; border: 1px solid var(--book-coral); border-radius: 9px; background: #f8e2bf; }
.bookclub-app .user-pill > span:nth-child(2) { overflow: hidden; max-width: 110px; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.bookclub-app .role-badge { overflow: hidden; max-width: 110px; color: var(--book-green-dark); font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.bookclub-app .daily-mood-indicator { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; margin-left: -3px; border-radius: 50%; background: #fff0d9; font-size: 14px; }

.bookclub-app .music-bar {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 7px 12px;
  color: var(--book-ink);
  background: rgba(255, 253, 244, .82);
}
.bookclub-app .music-title-scroll { overflow: hidden; color: var(--book-green-dark); font: 700 12px/1.25 var(--book-font); text-overflow: ellipsis; white-space: nowrap; }
.bookclub-app .music-controls { display: flex; flex: 0 0 auto; gap: 6px; }

.bookclub-app button:is(.music-btn,.scene-pill,.hud-btn,.tab-btn,.action-btn,.pixel-btn-sm,.pixel-btn-primary,.pixel-btn-secondary,.review-btn,.audio-toggle,.user-pill,.close-btn,.press-start-btn) {
  min-height: 44px;
  border: 1px solid #a9bba0;
  border-radius: 11px;
  color: var(--book-ink);
  background: #fffdf5;
  box-shadow: 0 3px 0 rgba(38, 53, 47, .13);
  font: 800 13px/1.2 var(--book-font);
  letter-spacing: .01em;
  text-shadow: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.bookclub-app button:is(.music-btn,.scene-pill,.hud-btn,.tab-btn,.action-btn,.pixel-btn-sm,.pixel-btn-primary,.pixel-btn-secondary,.review-btn,.audio-toggle,.user-pill,.close-btn,.press-start-btn):hover {
  color: var(--book-coral-dark);
  background: #fff0d9;
  border-color: #d88a72;
}
.bookclub-app button:is(.music-btn,.scene-pill,.hud-btn,.tab-btn,.action-btn,.pixel-btn-sm,.pixel-btn-primary,.pixel-btn-secondary,.review-btn,.audio-toggle,.user-pill,.close-btn,.press-start-btn):active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(38, 53, 47, .12);
}
.bookclub-app .music-btn { min-width: 44px; padding: 8px 11px; }
.bookclub-app .music-playlist-btn { min-width: 94px; }
.bookclub-app button:focus-visible,
.bookclub-app input:focus-visible,
.bookclub-app select:focus-visible,
.bookclub-app textarea:focus-visible,
.bookclub-app a:focus-visible { outline: 3px solid #d39c45; outline-offset: 3px; }
.bookclub-app button:disabled { opacity: .58; cursor: not-allowed; }

/* Map surface */
.bookclub-app .office-viewport {
  position: relative;
  display: flex;
  width: min(100% - 24px, 1480px);
  height: auto !important;
  min-height: 0;
  flex-direction: column;
  margin: 14px auto 0;
  overflow: hidden;
  background: #71875f;
  border: 2px solid #4c5e4d;
  border-radius: 18px;
  box-shadow: 0 8px 0 rgba(38, 53, 47, .15), 0 18px 30px rgba(61, 54, 39, .12);
}
.bookclub-app .map-scroll {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  flex: 0 0 auto;
  overflow: hidden;
  background: #8ea26d;
  border: 0;
  border-radius: 15px 15px 0 0;
  cursor: grab;
  scrollbar-width: none;
  touch-action: none;
  overscroll-behavior: none;
}
.bookclub-app .map-scroll:active { cursor: grabbing; }
.bookclub-app .map-scroll::-webkit-scrollbar { display: none; }
.bookclub-app #officeCanvas { display: block; width: 100%; height: 100%; image-rendering: auto; touch-action: none; }

.bookclub-app .office-hud-left,
.bookclub-app .office-world-meta,
.bookclub-app .office-hud-right { position: absolute; z-index: 5; }
.bookclub-app .office-hud-left {
  top: 14px;
  left: 16px;
  max-width: min(42%, 430px);
  padding: 7px 11px;
  color: #fffdf2;
  background: rgba(38, 53, 47, .78);
  border: 1px solid rgba(255, 253, 244, .55);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(4px);
}
.bookclub-app .office-world-meta {
  top: 54px;
  left: 16px;
  max-width: 44%;
  padding: 4px 8px;
  color: #fff1c5;
  background: rgba(38, 53, 47, .62);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
}
.bookclub-app .office-hud-right { top: 14px; right: 16px; }
.bookclub-app .hud-btn { padding: 8px 12px; color: #fffaf0; background: var(--book-coral); border-color: #f3c08e; }
.bookclub-app .hud-btn:hover { color: #fffaf0; background: var(--book-coral-dark); }

.bookclub-app .map-tools {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 7px 12px;
  color: var(--book-ink);
  background: rgba(255, 249, 233, .96);
  border-top: 1px solid rgba(61, 101, 79, .25);
  font-size: 12px;
  font-weight: 800;
}
.bookclub-app .map-tools label { white-space: nowrap; }
.bookclub-app .map-tools input[type="range"] { width: 124px; min-height: 28px; accent-color: var(--book-coral); }
.bookclub-app .map-tools output { min-width: 42px; color: var(--book-coral-dark); font-weight: 900; }
.bookclub-app .map-tools span { margin-left: auto; color: var(--book-green-dark); font-size: 11px; }


/* Quest and tabs */
.bookclub-app .page-container { width: min(100% - 24px, 1120px); margin: 0 auto; padding: 22px 0; }
.bookclub-app .daily-atelier {
  display: grid;
  grid-template-areas: "copy portrait" "note portrait";
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px 24px;
  margin-bottom: 18px;
  padding: 22px;
  overflow: hidden;
  position: relative;
  background: rgba(255, 249, 233, .92);
  border: 1px solid #d1bd8e;
  border-radius: 18px;
  box-shadow: var(--book-shadow);
}
.bookclub-app .daily-atelier::before { background: #e7d5a4; opacity: .3; }
.bookclub-app .atelier-copy h1 { color: var(--book-ink); font-family: var(--book-font); letter-spacing: -.03em; }
.bookclub-app .eyebrow { color: var(--book-green); font: 900 10px/1 var(--book-display); letter-spacing: .16em; }
.bookclub-app .atelier-copy p { color: var(--book-ink-soft); }
.bookclub-app .quest-track-label { color: var(--book-ink); }
.bookclub-app .quest-track-label strong { color: var(--book-coral-dark); }
.bookclub-app .quest-track-bar { height: 13px; padding: 2px; background: #f0e1bf; border: 1px solid #a8b99e; border-radius: 999px; }
.bookclub-app .quest-track-bar span { background: linear-gradient(90deg, var(--book-green), #d5a44f, var(--book-coral)); border-radius: 999px; }
.bookclub-app .atelier-stats { color: var(--book-ink-soft); }
.bookclub-app .atelier-stats b { color: var(--book-coral-dark); }
.bookclub-app .atelier-portrait-wrap { min-height: 220px; border: 1px solid #a9b58d; border-radius: 14px; background: linear-gradient(160deg, #dfeacb, #f2d7b6); box-shadow: 4px 4px 0 rgba(38, 53, 47, .13); grid-template-rows: auto minmax(150px, 1fr) auto auto; gap: 5px; padding: 8px; }
.bookclub-app .leader-sheet-art {
  background: transparent;
  image-rendering: auto;
}
.bookclub-app .atelier-portrait-caption { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; color: #466850; font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.bookclub-app .atelier-portrait-caption strong { max-width: 65%; overflow: hidden; color: #8a5742; text-overflow: ellipsis; white-space: nowrap; }
.bookclub-app .atelier-wardrobe-status {
  display: block;
  min-width: 0;
  padding: 4px 6px;
  color: #6f5b4e;
  background: rgba(255, 249, 224, .76);
  border: 1px solid rgba(170, 142, 98, .42);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.bookclub-app .atelier-wardrobe-status.is-upgraded {
  color: #315c43;
  background: rgba(239, 248, 215, .9);
  border-color: #a4b981;
}
.bookclub-app .atelier-wardrobe-growth {
  display: grid;
  gap: 4px;
  padding: 6px 7px 7px;
  color: #6f5b4e;
  background: rgba(255, 249, 224, .7);
  border: 1px solid rgba(170, 142, 98, .38);
  border-radius: 7px;
  font-size: 9px;
}
.bookclub-app .atelier-growth-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.bookclub-app .atelier-growth-heading b { color: #5f6248; }
.bookclub-app .atelier-growth-track { display: block; height: 6px; overflow: hidden; background: #e7d9b4; border: 1px solid #c8b483; border-radius: 999px; }
.bookclub-app .atelier-growth-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #6b936f, #d69b48); border-radius: inherit; transition: width .25s ease; }
.bookclub-app .atelier-growth-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.bookclub-app .atelier-growth-slots span { padding: 2px 1px; overflow: hidden; color: #8b806b; background: rgba(255,255,255,.4); border-radius: 3px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.bookclub-app .atelier-growth-slots span.is-equipped { color: #315c43; background: #e9f3d5; box-shadow: inset 0 -2px #a4b981; }
.bookclub-app .atelier-next-goal { margin-top: 2px; color: #795925; font-size: 10px; font-weight: 800; line-height: 1.4; }
.bookclub-app .atelier-growth-actions { display: flex; justify-content: flex-start; margin-top: 2px; }
.bookclub-app .atelier-growth-actions button { min-height: 34px; padding: 5px 11px; }
.bookclub-app .leader-modal-art {
  position: relative;
  overflow: hidden;
  margin: 0 auto 12px;
  border: 1px solid #c9b58d;
  border-radius: 13px;
  background: radial-gradient(ellipse at 50% 38%, #fff8e8 0%, #f1dfbd 78%);
  box-shadow: 0 8px 18px rgba(47, 57, 43, .15);
}
.bookclub-app .leader-modal-portrait > img,
.bookclub-app .leader-modal-portrait > canvas {
  position: absolute;
  inset: 8px 5px 5px;
  display: block;
  width: calc(100% - 10px);
  height: calc(100% - 13px);
  object-fit: contain;
  image-rendering: auto;
}
.bookclub-app .leader-modal-portrait > img { transition: opacity .16s ease; }
.bookclub-app .leader-modal-portrait > canvas { opacity: 0; transition: opacity .16s ease; }
.bookclub-app .leader-modal-portrait.is-ready > img { opacity: 0; }
.bookclub-app .leader-modal-portrait.is-ready > canvas { opacity: 1; }
.bookclub-app .teacher-character-caption {
  margin: 2px 0 0;
  color: var(--book-ink-soft);
  font-size: 11px;
}
.bookclub-app .portrait-sticker { right: 8px; bottom: 8px; padding: 6px 8px; color: #fffaf0; background: var(--book-coral); border: 1px solid var(--book-coral-dark); border-radius: 7px; font: 800 10px/1.25 var(--book-font); transform: rotate(-3deg); }
.bookclub-app .atelier-note { padding: 11px 13px; color: var(--book-ink-soft); background: #eef2df; border-left: 4px solid var(--book-green); border-radius: 8px; }
.bookclub-app .atelier-note strong { color: var(--book-ink); }
.bookclub-app .note-pin { color: var(--book-coral); }

.bookclub-app .tab-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-bottom: 18px; padding: 7px; background: rgba(255, 249, 233, .9); }
.bookclub-app .tab-btn { width: 100%; min-width: 0; padding: 8px 10px; }
.bookclub-app .tab-btn.active { color: #fffaf0; background: var(--book-coral); border-color: var(--book-coral-dark); box-shadow: 0 3px 0 rgba(38, 53, 47, .2); }
.bookclub-app .section-heading { color: var(--book-ink); }
.bookclub-app .section-heading small { color: var(--book-ink-soft); }
.bookclub-app .pixel-card,
.bookclub-app .post-card { background: rgba(255, 249, 233, .92); border: 1px solid #d1bd8e; border-radius: 16px; box-shadow: 0 4px 0 rgba(38, 53, 47, .12); }
.bookclub-app .post-card { background: rgba(255, 253, 245, .95); }
.bookclub-app .section-title { color: var(--book-ink); border-bottom-color: #dfc995; }
.bookclub-app .section-chip { color: var(--book-green-dark); border-color: #9eb795; border-radius: 999px; }

/* Forms, cards and action buttons */
.bookclub-app .pixel-input,
.bookclub-app .pixel-textarea,
.bookclub-app input[type="file"] {
  min-height: 44px;
  color: var(--book-ink);
  background: #fffdf5;
  border: 1px solid #c9b887;
  border-radius: 10px;
}
.bookclub-app .pixel-textarea { min-height: 120px; }
.bookclub-app .form-label { color: var(--book-ink); font-weight: 800; }
.bookclub-app .field-note { color: var(--book-ink-soft); font-size: 11px; }
.bookclub-app .video-upload-guidance { padding: 11px 13px; background: #f1f4e8; border: 1px solid #d4dcbf; border-left: 4px solid var(--book-green); border-radius: 9px; line-height: 1.55; }
.bookclub-app .video-upload-guidance strong { color: var(--book-ink); font-size: 12px; }
.bookclub-app .video-upload-guidance ul { display: grid; gap: 4px; margin: 0; padding-left: 1.2em; }
.bookclub-app .video-upload-progress { display: grid; gap: 7px; margin-top: 9px; padding: 10px 12px; border: 1px solid #d4dcbf; border-radius: 9px; color: var(--book-ink); background: #fbfcf5; font-size: 12px; }
.bookclub-app .video-upload-progress[hidden] { display: none; }
.bookclub-app .video-upload-progress-label { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bookclub-app .video-upload-progress-label span:first-child { min-width: 0; overflow-wrap: anywhere; }
.bookclub-app .video-upload-progress-label span:last-child { flex: 0 0 auto; color: var(--book-green-dark); font-variant-numeric: tabular-nums; font-weight: 800; }
.bookclub-app .video-upload-progress progress { display: block; width: 100%; height: 9px; overflow: hidden; border: 0; border-radius: 999px; background: #e4e9d8; accent-color: var(--book-green); }
.bookclub-app .video-upload-progress progress::-webkit-progress-bar { border-radius: 999px; background: #e4e9d8; }
.bookclub-app .video-upload-progress progress::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, #5e9270, #91ad5c); transition: width .15s linear; }
.bookclub-app .video-upload-progress progress::-moz-progress-bar { border-radius: 999px; background: linear-gradient(90deg, #5e9270, #91ad5c); }
.bookclub-app .ai-manual-tools .radar-btn { min-height: 42px; border: 1px solid #8fa891; border-radius: 9px; background: #f4f6ec; color: #355a46; box-shadow: 0 2px 0 rgba(46, 73, 56, .12); font-weight: 800; }
.bookclub-app .ai-manual-tools .radar-btn:disabled { opacity: .65; cursor: progress; }
.bookclub-app .pixel-btn-primary { color: #fffaf0; background: var(--book-coral); border-color: var(--book-coral-dark); }
.bookclub-app .pixel-btn-primary:hover { color: #fffaf0; background: var(--book-coral-dark); }
.bookclub-app .pixel-btn-secondary { color: var(--book-green-dark); background: #e6f0dd; border-color: #9cb993; }
.bookclub-app .pixel-btn-secondary:hover { color: var(--book-green-dark); background: #d7e9cb; }
.bookclub-app .pixel-btn-danger { color: #fffaf0; background: #a9564f; border-color: #7c3f3b; }
.bookclub-app .full-width { width: 100%; }
.bookclub-app .post-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bookclub-app .post-actions .action-btn { min-width: 100px; }
.bookclub-app .video-wrap video { width: 100%; max-height: 520px; border-radius: 11px; background: #27362f; }
.bookclub-app .character-workshop-card { display: grid; gap: 14px; }
.bookclub-app .workshop-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 4px; border-bottom: 1px solid #dfc995; }
.bookclub-app .workshop-heading h3 { margin: 0; color: var(--book-ink); font-size: 20px; }
.bookclub-app .workshop-heading p { margin: 4px 0 0; color: var(--book-ink-soft); font-size: 12px; }
.bookclub-app .character-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bookclub-app .character-option { display: grid; gap: 5px; color: var(--book-ink); font-size: 12px; font-weight: 900; }
.bookclub-app .character-preview-wrap { display: grid; min-height: 334px; place-items: center; overflow: hidden; background: linear-gradient(145deg, #f8e8c4, #e9d2a4); border: 1px solid #d1bd8e; border-radius: 14px; }
.bookclub-app #characterPreview { display: block; width: min(100%, 240px); height: 320px; image-rendering: auto; }
.bookclub-app .character-match-status { min-height: 42px; margin: 0; padding: 9px 11px; color: var(--book-ink-soft); background: #eef2df; border-left: 4px solid var(--book-green); border-radius: 8px; font-size: 12px; }
.bookclub-app .character-match-status.is-saving { color: #66501e; background: #fff3d4; border-left-color: #c28b32; }
.bookclub-app .character-match-status.is-success { color: var(--book-green-dark); border-left-color: var(--book-green-dark); }
.bookclub-app .character-match-status.is-error { color: #8c3f3a; background: #fae5da; border-left-color: var(--book-coral-dark); }
.bookclub-app .video-retry-note { display: block; margin-top: 6px; color: var(--text-muted); font-size: 11px; }
.bookclub-app .emotions-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bookclub-app .emotion-box { display: grid; min-height: 100px; gap: 3px; place-items: center; padding: 8px 5px; color: var(--book-ink); background: #fffdf5; border: 1px solid #d6c18d; border-radius: 11px; cursor: pointer; text-align: center; }
.bookclub-app .emotion-box:hover { border-color: var(--book-coral); background: #fff0d9; }
.bookclub-app .emotion-thumb { display: grid; width: 40px; height: 40px; place-items: center; overflow: hidden; border-radius: 10px; font-size: 24px; }
.bookclub-app .emotion-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bookclub-app .emotion-label { font-size: 11px; font-weight: 900; }
.bookclub-app .emotion-desc { color: var(--book-ink-soft); font-size: 9px; }
.bookclub-app .workshop-footer { display: flex; justify-content: space-between; gap: 8px; color: var(--book-ink-soft); font-size: 10px; }

/* Clean modal framing */
.bookclub-app .modal-overlay { background: rgba(38, 53, 47, .52); backdrop-filter: blur(4px); }
.bookclub-app .modal-drawer { width: min(100% - 24px, 660px); max-height: calc(100dvh - 28px); color: var(--book-ink); background: var(--book-paper); border: 1px solid #9bad8c; border-radius: 18px; box-shadow: 0 12px 0 rgba(38, 53, 47, .22), 0 22px 55px rgba(38, 53, 47, .2); }
.bookclub-app .modal-header { border-bottom: 1px solid #ddca99; }
.bookclub-app .close-btn { width: 44px; padding: 7px; }
.bookclub-app .profile-quick-drawer { width: min(100% - 24px, 560px); padding-bottom: 18px; }
.bookclub-app .quick-profile-grid { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; align-items: center; padding: 16px 0 12px; }
.bookclub-app .quick-avatar-preview { display: grid; width: 92px; height: 92px; place-items: center; overflow: hidden; color: var(--book-green-dark); background: #f3dfb8; border: 2px solid var(--book-coral); border-radius: 16px; font-size: 36px; }
.bookclub-app .quick-avatar-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bookclub-app .quick-profile-copy { display: grid; gap: 5px; color: var(--book-ink-soft); font-size: 12px; }
.bookclub-app .quick-profile-copy strong { color: var(--book-ink); font-size: 16px; }
.bookclub-app .quick-file-btn { display: inline-flex; width: fit-content; min-height: 44px; align-items: center; justify-content: center; padding: 8px 12px; cursor: pointer; }
.bookclub-app .quick-mood-group { display: grid; gap: 8px; padding: 12px; background: #f7e8c2; border: 1px solid #dfc995; border-radius: 13px; }
.bookclub-app .quick-mood-row { display: flex; align-items: center; gap: 10px; }
.bookclub-app .quick-mood-row .pixel-input { flex: 0 1 220px; }
.bookclub-app .member-daily-mood { margin-top: 7px; padding: 6px 8px; border-left: 3px solid var(--book-coral); background: #fff1d9; color: var(--book-green-dark); font-size: 12px; line-height: 1.45; }
.bookclub-app .quick-mood-row .field-note { margin: 0; }

/* Check-in celebration */
.bookclub-app .punch-celebration[hidden] { display: none; }
.bookclub-app .punch-celebration {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.bookclub-app .celebration-card {
  display: grid;
  min-width: min(86vw, 330px);
  place-items: center;
  gap: 5px;
  padding: 22px 28px 19px;
  color: var(--book-ink);
  background: rgba(255, 249, 233, .97);
  border: 2px solid #d39c45;
  border-radius: 18px;
  box-shadow: 0 8px 0 rgba(38, 53, 47, .2), 0 16px 38px rgba(38, 53, 47, .22);
  opacity: 0;
  transform: translateY(12px) scale(.92);
}
.bookclub-app .punch-celebration.is-active .celebration-card { animation: celebrationCard .55s cubic-bezier(.2,.8,.25,1) forwards; }
.bookclub-app .celebration-icon { display: grid; width: 54px; height: 54px; place-items: center; }
.bookclub-app .celebration-icon .bookcoin-icon { width: 54px; height: 54px; }
.bookclub-app .celebration-card strong { color: var(--book-coral-dark); font-size: 20px; }
.bookclub-app .celebration-card span { color: var(--book-green-dark); font-weight: 900; }
.bookclub-app .celebration-card small { color: var(--book-ink-soft); }
.bookclub-app .celebration-coins { position: absolute; inset: 0; overflow: hidden; }
.bookclub-app .coin-particle { position: absolute; left: 50%; top: 50%; display: block; width: 24px; height: 24px; opacity: 0; transform: translate(-50%, -50%); }
.bookclub-app .punch-celebration.is-active .coin-particle { animation: coinBurst 1.2s cubic-bezier(.15,.72,.2,1) var(--delay) forwards; }
.bookclub-app .coin-particle .bookcoin-icon { width: 100%; height: 100%; }
@keyframes celebrationCard { 0% { opacity: 0; transform: translateY(18px) scale(.86); } 62% { opacity: 1; transform: translateY(-3px) scale(1.03); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes coinBurst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(0); } 18% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotate(220deg); } }

.bookclub-app .fab-punch-container {
  position: static;
  inset: auto;
  z-index: auto;
  width: 100%;
  margin: 14px auto 0;
  pointer-events: auto;
}
.bookclub-app .fab-punch-btn { min-height: 52px; padding: 10px 16px; color: #fffaf0; background: var(--book-coral); border: 1px solid var(--book-coral-dark); border-radius: 999px; box-shadow: 0 5px 0 rgba(38, 53, 47, .22), 0 10px 22px rgba(38, 53, 47, .15); font-weight: 900; }
.bookclub-app .fab-punch-btn:hover { color: #fffaf0; background: var(--book-coral-dark); }
.bookclub-app .fab-coin-badge { color: #fff0b6; font-size: 10px; }

@media (max-width: 760px) {
  .bookclub-app .pixel-header,
  .bookclub-app .music-bar,
  .bookclub-app .office-viewport,
  .bookclub-app .tab-bar { width: calc(100% - 12px); }
  .bookclub-app .pixel-header {
    top: 5px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand controls" "stats stats";
    align-items: center;
    min-height: 62px;
    gap: 5px 7px;
    padding: 7px 8px;
    border-radius: 13px;
  }
  .bookclub-app .header-left { display: contents; }
  .bookclub-app .brand-lockup { grid-area: brand; max-width: 100%; gap: 7px; }
  .bookclub-app .brand-lockup > div { min-width: 0; }
  .bookclub-app .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
  .bookclub-app .brand {
    max-width: min(165px, calc(100vw - 184px));
    font-size: clamp(12px, 3.75vw, 14px);
    letter-spacing: 0;
    text-overflow: clip;
  }
  .bookclub-app .brand-kicker,
  .bookclub-app .streak-badge,
  .bookclub-app .role-badge,
  .bookclub-app .user-pill > span:nth-child(2) { display: none; }
  .bookclub-app .user-stats-row { grid-area: stats; display: flex; width: 100%; min-width: 0; flex-wrap: nowrap; gap: 6px; margin-top: 1px; }
  .bookclub-app .coin-badge { min-width: 0; min-height: 30px; flex: 0 1 auto; padding: 4px 6px; font-size: 10px; white-space: nowrap; }
  .bookclub-app .coin-badge .bookcoin-icon { width: 19px; height: 19px; }
  .bookclub-app .streak-badge { display: inline-flex; min-height: 30px; flex: 0 0 auto; padding: 4px 7px; font-size: 10px; white-space: nowrap; }
  .bookclub-app .header-right { grid-area: controls; justify-self: end; gap: 4px; }
  .bookclub-app .user-pill { width: 44px; padding: 4px; }
  .bookclub-app .music-bar { gap: 6px; min-height: 46px; margin-top: 7px; padding: 5px 7px; border-radius: 12px; }
  .bookclub-app .music-title-scroll { font-size: 10px; }
  .bookclub-app .music-controls { gap: 4px; }
  .bookclub-app .music-btn { min-width: 42px; min-height: 42px; padding: 6px; }
  .bookclub-app .music-playlist-btn { min-width: 74px; }
  .bookclub-app .office-viewport { margin-top: 8px; border-radius: 14px; }
  .bookclub-app .map-scroll { height: clamp(420px, 118vw, 560px); aspect-ratio: auto; border-radius: 12px 12px 0 0; }
  .bookclub-app .office-hud-left { top: 10px; left: 10px; max-width: 62%; padding: 5px 7px; font-size: 10px; }
  .bookclub-app .office-world-meta,
  .bookclub-app .office-hud-right { display: none; }
  .bookclub-app .map-tools { gap: 5px; padding: 6px 8px; font-size: 10px; }
  .bookclub-app .map-tools input[type="range"] { width: 75px; min-height: 26px; }
  .bookclub-app .map-tools output { min-width: 34px; font-size: 10px; }
  .bookclub-app .map-tools span { margin-left: 0; font-size: 10px; }
  .bookclub-app .quick-profile-grid { grid-template-columns: 76px minmax(0, 1fr); gap: 10px; }
  .bookclub-app .quick-avatar-preview { width: 76px; height: 76px; border-radius: 13px; }
  .bookclub-app .quick-mood-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .bookclub-app .quick-mood-row .pixel-input { width: 100%; }
  .bookclub-app .page-container { width: calc(100% - 12px); padding-top: 15px; }
  .bookclub-app .daily-atelier { grid-template-areas: "copy" "portrait" "note"; grid-template-columns: 1fr; gap: 13px; padding: 15px; border-radius: 14px; }
  .bookclub-app .atelier-portrait-wrap { min-height: 190px; }
  .bookclub-app .tab-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 6px; }
  .bookclub-app .tab-btn { min-height: 44px; }
  .bookclub-app .section-heading { display: block; font-size: 18px; }
  .bookclub-app .section-heading small { display: block; margin-top: 3px; }
  .bookclub-app .pixel-card,
  .bookclub-app .post-card { padding: 14px; border-radius: 13px; }
  .bookclub-app .workshop-heading { display: grid; gap: 7px; }
  .bookclub-app .character-options { gap: 8px; }
  .bookclub-app .emotions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bookclub-app .workshop-footer { display: grid; gap: 2px; }
  .bookclub-app .fab-punch-container { width: 100%; margin: 12px auto; }
  .bookclub-app .fab-punch-btn { width: 100%; min-height: 50px; }
}

/* Full character dossier: one premium scene instead of a narrow portrait
   stuck beside a large empty beige panel. */
.bookclub-app .member-showcase-card { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px; background: linear-gradient(145deg, #fff8e7, #e9dfbf); border: 2px solid #c2a46f; box-shadow: 0 6px 0 rgba(75, 55, 32, .13); }
.bookclub-app .member-showcase-card .member-character-heading,
.bookclub-app .member-showcase-card .member-character-stage,
.bookclub-app .member-showcase-card > p { grid-column: 1; grid-row: auto; }
.bookclub-app .member-showcase-card .member-character-heading { padding: 2px 3px 0; font-size: 17px; }
.bookclub-app .member-showcase-card .member-character-stage { min-height: 360px; height: clamp(360px, 42vw, 520px); background: linear-gradient(160deg, #dfeacb, #d8b57e); border: 1px solid #a98a62; border-radius: 14px; }
.bookclub-app .member-showcase-card .member-character-stage canvas { width: 100%; height: 100%; max-width: 520px; max-height: none; }
.bookclub-app .member-showcase-card .member-character-condition { width: fit-content; max-width: 100%; margin: 0; font-size: 13px; }
.bookclub-app .member-showcase-card > p.member-showcase-hint { margin: 0; padding: 9px 10px; background: rgba(255,255,255,.48); border: 1px solid #d8bf8d; border-radius: 9px; font-size: 12px; }
@media (max-width: 760px) {
  .bookclub-app .member-showcase-card { padding: 11px; }
  .bookclub-app .member-showcase-card .member-character-stage { min-height: 300px; height: min(82vw, 390px); }
  .bookclub-app .member-showcase-card .member-character-heading { font-size: 15px; }
}

/* v1 eight-fix pass: the feed is summary-first and all full content lives in
   the one shared drawer. The rules below intentionally override the older
   compact-feed experiments without changing the warm illustrated system. */
html, body.bookclub-app { max-width: 100%; overflow-x: clip; }
.bookclub-app .atelier-hub-character { display: none !important; }
.bookclub-app .post-media-state { display: flex; min-width: 0; align-items: center; gap: 8px; min-height: 24px; margin: 8px 0 2px; }
.bookclub-app .post-media-summary { color: var(--book-ink-soft); font-size: 10px; font-weight: 800; }
.bookclub-app .post-media-summary--video { color: var(--book-coral-dark); }
.bookclub-app .post-actions .action-btn { min-height: 42px; }
.bookclub-app .post-actions .action-btn.is-disabled,
.bookclub-app .post-actions .action-btn:disabled { color: #9d927d; background: #eee5d4; border-color: #d8cdb7; cursor: not-allowed; opacity: .78; }
.bookclub-app .post-copy-drawer,
.bookclub-app .post-video-drawer { display: grid; gap: 12px; min-width: 0; color: var(--book-ink); }
.bookclub-app .post-copy-drawer-book { color: var(--book-coral-dark); font-size: 14px; font-weight: 900; line-height: 1.4; }
.bookclub-app .post-copy-drawer-author { color: var(--book-ink-soft); font-size: 11px; }
.bookclub-app .post-copy-full { margin: 0; padding: 15px; color: var(--book-ink); background: #fffdf5; border: 1px solid #ddcda8; border-radius: 12px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.bookclub-app .post-video-drawer .video-wrap { width: 100%; aspect-ratio: 16 / 9; min-height: 0; margin: 0; display: grid; place-items: center; background: #27362f; border-radius: 12px; }
.bookclub-app .post-video-drawer .video-wrap > video { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.bookclub-app .post-video-empty { display: grid; min-height: 150px; place-items: center; padding: 18px; color: var(--book-ink-soft); background: #f5ead0; border: 1px dashed #cbb589; border-radius: 12px; line-height: 1.6; text-align: center; }
.bookclub-app .post-video-caption { margin: 0; color: var(--book-ink-soft); font-size: 11px; line-height: 1.5; }
.bookclub-app .post-video-external { justify-self: start; min-height: 44px; display: inline-grid; place-items: center; }
.bookclub-app .member-post-copy { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.bookclub-app .app-drawer-root[data-mode="post-video"] .app-drawer-body,
.bookclub-app .app-drawer-root[data-mode="post-copy"] .app-drawer-body { padding-bottom: 22px; }
.bookclub-app .app-drawer-root.is-open ~ .mobile-game-nav,
body.bookclub-app:has(.app-drawer-root.is-open) .mobile-game-nav { visibility: hidden; pointer-events: none; }

@media (max-width: 760px) {
  .bookclub-app .mobile-game-nav { right: max(8px, env(safe-area-inset-right, 0px)); left: max(8px, env(safe-area-inset-left, 0px)); width: auto; max-width: calc(100% - 16px); box-sizing: border-box; bottom: env(safe-area-inset-bottom, 0px); padding-bottom: max(6px, env(safe-area-inset-bottom, 0px)); }
  .bookclub-app .mobile-game-nav button { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bookclub-app .post-actions .action-btn { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .bookclub-app .post-actions .action-btn:nth-last-child(-n + 2) { flex-basis: 100%; }
}

/* Preview-board HUD fit: enlarge the brand while keeping the coin button,
   audio toggle and avatar growth HUD inside the viewport at 390px. */
.bookclub-app .pixel-header {
  box-sizing: border-box;
  min-width: 0;
  overflow: visible;
}
.bookclub-app .brand-lockup,
.bookclub-app .brand-lockup > div,
.bookclub-app .user-stats-row,
.bookclub-app .header-right { min-width: 0; }
.bookclub-app .brand {
  max-width: min(300px, 35vw);
  overflow: hidden;
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bookclub-app .header-profile-stack { flex: 0 0 auto; }
@media (max-width: 760px) {
  .bookclub-app .pixel-header { min-height: 116px; }
  .bookclub-app .brand { max-width: min(190px, calc(100vw - 190px)); font-size: 17px; }
  .bookclub-app .brand-kicker { font-size: 8px; }
  .bookclub-app .header-left { gap: 7px; }
  .bookclub-app .user-stats-row { min-width: 0; }
  .bookclub-app .coin-badge-button { min-width: 126px; max-width: 146px; }
  .bookclub-app .header-right { min-width: 0; }
  .bookclub-app .header-profile-stack { min-width: 100px; }
  .bookclub-app .header-avatar-growth { max-width: 100px; }
}
@media (max-width: 390px) {
  .bookclub-app .brand { max-width: 170px; font-size: 16px; }
  .bookclub-app .coin-badge-button { min-width: 116px; max-width: 126px; padding-inline: 5px; font-size: 8px; }
  .bookclub-app .header-profile-stack { min-width: 92px; }
  .bookclub-app .header-profile-stack .user-pill { width: 66px; height: 66px; min-width: 66px; }
  .bookclub-app .header-profile-stack .avatar-pixel-sm { width: 52px; height: 52px; flex-basis: 52px; }
  .bookclub-app .header-avatar-growth { width: 92px; font-size: 7px; }
}
html.bookclub-app { scroll-padding-top: 132px; }
.bookclub-app .tab-content,
.bookclub-app .shop-growth-passport { scroll-margin-top: 132px; }

/* Absolute final v1 profile/quest overrides. This file contains historical
   responsive blocks below the first showcase fix, so these rules deliberately
   live at EOF to win the cascade. */
.bookclub-app .daily-atelier {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-areas: "copy" "note" !important;
}
.bookclub-app .daily-atelier .atelier-portrait-wrap { display: none !important; }
.bookclub-app .member-showcase-card {
  grid-template-columns: minmax(0, 1fr) !important;
}
.bookclub-app .member-showcase-card .member-character-heading,
.bookclub-app .member-showcase-card .member-character-stage,
.bookclub-app .member-showcase-card > p {
  grid-column: 1 !important;
  grid-row: auto !important;
}
.bookclub-app .member-showcase-card .member-character-stage {
  width: 100% !important;
  min-width: 0;
  min-height: 0;
  height: auto !important;
  aspect-ratio: 8 / 9;
}
.bookclub-app .member-showcase-card .member-character-stage canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: fill !important;
}

/* Consolidate the homepage role summary into map/member-profile clicks. The
   old portrait column duplicated the growth passport and left a blank right
   panel when its Canvas was intentionally removed. */
.bookclub-app .daily-atelier {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "copy" "note";
}
.bookclub-app .daily-atelier .atelier-portrait-wrap { display: none !important; }

/* Final member-profile grid override. Legacy two-column rules used to win at
   this point in the stylesheet, leaving the portrait Canvas in a narrow left
   column with an empty beige column on the right. */
.bookclub-app .member-showcase-card {
  grid-template-columns: minmax(0, 1fr) !important;
}
.bookclub-app .member-showcase-card .member-character-heading,
.bookclub-app .member-showcase-card .member-character-stage,
.bookclub-app .member-showcase-card > p {
  grid-column: 1 !important;
  grid-row: auto !important;
}
.bookclub-app .member-showcase-card .member-character-stage {
  width: 100%;
  min-width: 0;
  aspect-ratio: 8 / 9;
}
.bookclub-app .member-showcase-card .member-character-stage canvas {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: fill;
}

/* Member showcase fit contract. The canvas is authored at 320x360 (8:9),
   so the stage must keep that same aspect ratio. The old contain rule placed
   the portrait inside a taller box and created visible blank bands above and
   below the library scene. */
.bookclub-app .member-showcase-card .member-character-stage {
  display: flex;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: min(70dvh, 620px);
  align-items: center;
  justify-content: center;
  aspect-ratio: 8 / 9;
  overflow: hidden;
}
.bookclub-app .member-showcase-card .member-character-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: 8 / 9;
  object-fit: fill;
}
@media (max-width: 760px) {
  .bookclub-app .member-showcase-card .member-character-stage {
    height: auto;
    max-height: min(60dvh, 430px);
    aspect-ratio: 8 / 9;
  }
  .bookclub-app .member-showcase-card .member-character-stage canvas {
    width: 100%;
    height: 100%;
    object-fit: fill;
  }
}

/* Keep the full Canvas roster visible below the legacy POC selector. */
.bookclub-app .map-scroll[data-world-runtime="phaser"] #officeCanvas { visibility: visible !important; }
.bookclub-app .map-scroll[data-world-runtime="phaser"] .phaser-world { background: transparent; }
.bookclub-app .phaser-world canvas { background: transparent !important; }

/* Owner/user HUD and wallet ledger drawer. */
.bookclub-app .coin-badge-button { display: inline-flex; min-width: 148px; min-height: 34px; align-items: center; justify-content: center; gap: 6px; padding: 5px 11px; cursor: pointer; font: 900 11px/1 var(--book-display); }
.bookclub-app .coin-badge-button:hover, .bookclub-app .coin-badge-button:focus-visible { border-color: #a86a36; box-shadow: 0 0 0 3px rgba(168,106,54,.18), inset 0 -2px 0 rgba(114,70,30,.14); transform: translateY(-1px); }
.bookclub-app .coin-badge-button:active { transform: translateY(1px); box-shadow: inset 0 2px 0 rgba(114,70,30,.16); }
.bookclub-app .header-profile-stack { display: grid; justify-items: center; gap: 4px; min-width: 104px; }
.bookclub-app .header-profile-stack .user-pill { width: 64px; height: 64px; min-width: 64px; justify-content: center; padding: 4px; border-radius: 17px; }
.bookclub-app .header-profile-stack .avatar-pixel-sm { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 14px; overflow: hidden; }
.bookclub-app .header-avatar-growth { display: grid; width: 104px; gap: 3px; color: #5d765c; font-size: 10px; font-weight: 900; text-align: center; }
.bookclub-app .header-avatar-growth > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bookclub-app .header-avatar-xp-track { display: block; width: 100%; height: 8px; overflow: hidden; background: #e2d5b1; border: 1px solid #9ab18c; border-radius: 999px; }
.bookclub-app .header-avatar-xp-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #5e936b, #dfad52, #c96848); border-radius: inherit; transition: width .25s ease; }
.bookclub-app .pixel-header { min-height: 108px; overflow: visible; }
.bookclub-app .wallet-ledger-drawer { display: grid; gap: 12px; color: var(--book-ink); }
.bookclub-app .wallet-ledger-balance { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 14px; background: #eef3df; border: 1px solid #b4c99d; border-radius: 12px; }
.bookclub-app .wallet-ledger-balance span { color: #5e765c; font-size: 11px; font-weight: 800; }
.bookclub-app .wallet-ledger-balance strong { color: #8c572f; font-size: 18px; }
.bookclub-app .wallet-ledger-list { display: grid; gap: 7px; }
.bookclub-app .wallet-ledger-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 10px 11px; background: #fffdf5; border: 1px solid #dfcda7; border-left: 4px solid #9cab8b; border-radius: 10px; }
.bookclub-app .wallet-ledger-row.is-credit { border-left-color: #638b68; }
.bookclub-app .wallet-ledger-row.is-debit { border-left-color: #bd6748; }
.bookclub-app .wallet-ledger-row > div { display: grid; min-width: 0; gap: 2px; }
.bookclub-app .wallet-ledger-row strong { overflow: hidden; color: #4a3829; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.bookclub-app .wallet-ledger-row small, .bookclub-app .wallet-ledger-row time { color: #8b775d; font-size: 10px; }
.bookclub-app .wallet-ledger-row b { flex: 0 0 auto; color: #4e8058; font-size: 15px; }
.bookclub-app .wallet-ledger-row.is-debit b { color: #aa5b43; }
.bookclub-app .wallet-ledger-empty { padding: 24px 12px; color: #8b775d; background: #f8eed7; border: 1px dashed #cbb589; border-radius: 10px; text-align: center; }
.bookclub-app .post-drawer-comment { display: grid; gap: 8px; padding: 12px; background: #eef3df; border: 1px solid #b4c99d; border-radius: 12px; }
.bookclub-app .post-drawer-comment label { display: grid; gap: 5px; color: #557153; font-size: 11px; font-weight: 800; }
.bookclub-app .post-drawer-comment textarea { width: 100%; box-sizing: border-box; resize: vertical; line-height: 1.55; }
.bookclub-app .post-drawer-comment-status { min-height: 1.2em; margin: 0; color: #5a795a; font-size: 11px; }
@media (max-width: 760px) {
  .bookclub-app .pixel-header { min-height: 112px; align-items: flex-start; overflow: visible; }
  .bookclub-app .header-profile-stack { min-width: 92px; }
  .bookclub-app .header-profile-stack .user-pill { width: 60px; height: 60px; min-width: 60px; }
  .bookclub-app .header-profile-stack .avatar-pixel-sm { width: 50px; height: 50px; flex-basis: 50px; }
  .bookclub-app .header-avatar-growth { width: 92px; font-size: 8px; }
  .bookclub-app .coin-badge-button { min-width: 132px; padding-inline: 7px; font-size: 9px; }
  .bookclub-app .user-stats-row { flex-wrap: wrap; }
  .bookclub-app .wallet-ledger-balance { display: grid; gap: 3px; }
}

/* Phaser forwards camera/touch input to the full Canvas roster. It stays
   transparent and never hides the authoritative character compositor. */
.bookclub-app .map-scroll[data-world-runtime="phaser"] #officeCanvas { visibility: visible; }
.bookclub-app .map-scroll[data-world-runtime="phaser"] .phaser-world { background: transparent; }
.bookclub-app .phaser-world canvas { background: transparent !important; }

@media (max-width: 300px) {
  .bookclub-app .brand-lockup { gap: 5px; }
  .bookclub-app .brand-mark { width: 34px; height: 34px; }
  .bookclub-app .brand {
    max-width: min(120px, calc(100vw - 164px));
    font-size: 11px;
    line-height: 1.08;
    white-space: normal;
    overflow: visible;
  }
}

/* Profile HUD fit contract: the avatar button is a real square control; the
   nickname/role text belongs in the growth summary below it. Keeping the
   mood badge inside the control prevents the portrait and header edge from
   competing for the same flex row at desktop and mobile widths. */
.bookclub-app .header-profile-stack { min-width: 112px; }
.bookclub-app .header-profile-stack .user-pill {
  position: relative;
  display: grid;
  width: 74px;
  height: 74px;
  min-width: 74px;
  place-items: center;
  padding: 6px;
  overflow: visible;
}
.bookclub-app .header-profile-stack .avatar-pixel-sm {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  place-items: center;
  overflow: hidden;
  border-radius: 15px;
}
.bookclub-app .header-profile-stack .user-pill > span:nth-child(2),
.bookclub-app .header-profile-stack .user-pill .role-badge { display: none; }
.bookclub-app .header-profile-stack .daily-mood-indicator {
  position: absolute;
  top: -3px;
  right: -3px;
  z-index: 2;
  width: 24px;
  height: 24px;
  margin: 0;
  pointer-events: none;
  border: 1px solid #d8b05f;
  box-shadow: 0 2px 0 rgba(38, 53, 47, .16);
}
.bookclub-app .header-avatar-growth { width: 112px; }

@media (max-width: 760px) {
  .bookclub-app .header-profile-stack { min-width: 100px; }
  .bookclub-app .header-profile-stack .user-pill {
    width: 70px;
    height: 70px;
    min-width: 70px;
  }
  .bookclub-app .header-profile-stack .avatar-pixel-sm {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
  }
  .bookclub-app .header-avatar-growth { width: 100px; font-size: 8px; }
}

/* Compact member-account review controls for group leaders. */
.bookclub-app .leader-group-card[hidden] { display: none !important; }
.bookclub-app .leader-group-member { align-items: center; flex-wrap: wrap; }
.bookclub-app .leader-group-member > strong { min-width: 100px; }
.bookclub-app .leader-member-identity { display: grid; min-width: 0; gap: 4px; }
.bookclub-app .leader-member-identity small { color: var(--book-ink-soft); font-size: 11px; line-height: 1.45; }
.bookclub-app .leader-group-member > span { color: var(--book-ink-soft); font-size: 11px; }
.bookclub-app .leader-group-member .pixel-btn-sm { min-height: 42px; margin-left: auto; }
.bookclub-app .leader-member-disable { color: #9a413d; border-color: #c67868; }
.bookclub-app .leader-member-reset { color: #76542f; border-color: #c19a62; }
.bookclub-app .leader-member-restore { color: #286744; border-color: #65a27b; }
.bookclub-app .leader-group-member.is-deactivated { padding: 10px; background: #fff5eb; border: 1px solid #ecd2b5; border-radius: 8px; }
.bookclub-app .leader-account-events { display: grid; gap: 7px; }
.bookclub-app .leader-account-event { display: grid; gap: 3px; padding: 9px 10px; background: #f4edda; border-left: 3px solid #bd665e; }
.bookclub-app .leader-account-event.is-restored { border-left-color: #4f8b62; }
.bookclub-app .leader-account-event strong { color: var(--book-ink); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.bookclub-app .leader-account-event small { color: var(--book-ink-soft); font-size: 10px; line-height: 1.4; }
.bookclub-app .yiruma-official-card { display: grid; gap: 10px; margin-top: 12px; padding: 14px; background: #f4edda; border: 1px solid var(--book-line); border-radius: 12px; }
.bookclub-app .yiruma-official-card > div:first-child strong,
.bookclub-app .yiruma-official-card > div:first-child span { display: block; }
.bookclub-app .yiruma-official-card > div:first-child strong { color: var(--book-ink); font-size: 15px; }
.bookclub-app .yiruma-official-card > div:first-child span { margin-top: 3px; color: var(--book-ink-soft); font-size: 11px; line-height: 1.5; }
.bookclub-app .yiruma-official-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.bookclub-app .yiruma-official-player { display: block; width: 100%; height: 450px; border: 0; border-radius: 9px; background: #fffdf6; }
.bookclub-app .yiruma-official-link { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 8px 10px; color: var(--book-ink); background: #fffdf6; border: 1px solid #c8b98e; border-radius: 8px; font-size: 12px; font-weight: 800; text-decoration: none; }
.bookclub-app .yiruma-official-link:hover { color: var(--book-coral-dark); border-color: #d88a72; }
.bookclub-app .yiruma-official-link span { color: var(--book-coral-dark); }

@media (max-width: 760px) {
  .bookclub-app .music-playlist-btn { display: inline-flex; min-width: 70px; padding: 6px 7px; font-size: 9px; white-space: nowrap; }
  .bookclub-app .leader-group-member { align-items: flex-start; }
  .bookclub-app .yiruma-official-player { height: 430px; }
}

@media (max-width: 360px) {
  .bookclub-app .coin-badge { gap: 4px; font-size: 9px; }
  .bookclub-app .streak-badge { gap: 3px; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .bookclub-app *,
  .bookclub-app *::before,
  .bookclub-app *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Character nameplates are DOM hotspots over the animated canvas so both
   pointer and keyboard users can open the exact learner profile reliably. */
.bookclub-app .actor-interaction-layer {
  position: absolute;
  z-index: 4;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity .18s ease;
}
.bookclub-app .actor-profile-hotspot {
  position: absolute;
  display: block;
  width: 48px;
  min-width: 48px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  overflow: visible;
  transform: translateX(-50%);
  appearance: none;
  color: #fff9df;
  background: transparent;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}
.bookclub-app .actor-profile-hotspot[hidden] { display: none; }
.bookclub-app .actor-profile-hotspot:focus-visible { outline: 3px solid #fff1a8; outline-offset: 2px; }
.bookclub-app .actor-nameplate {
  position: absolute;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 1px;
  width: max-content;
  max-width: 146px;
  padding: 3px 5px 4px;
  color: #fffbea;
  background: #172d2a;
  border: 1px solid #f3d078;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(17, 25, 23, .38);
  text-align: center;
  white-space: nowrap;
  pointer-events: auto;
}
.bookclub-app .actor-nameplate--overlap-front {
  opacity: .68;
  transition: opacity 90ms linear;
}
.bookclub-app .actor-nameplate-badges { display: flex; max-width: 100%; justify-content: center; gap: 2px; }
.bookclub-app .actor-nameplate-badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  padding: 1px 4px;
  color: #173329;
  background: linear-gradient(180deg, #ffefbd, #e5bd69);
  border: 1px solid #fff0c5;
  border-radius: 999px;
  font: 800 calc(9px * var(--ui-font-scale, 1))/1.2 var(--book-font);
  text-overflow: ellipsis;
}
.bookclub-app .actor-nameplate-badge--checkin { color: #153c2d; background: linear-gradient(180deg, #dff5c9, #91c28a); }
.bookclub-app .actor-nameplate-badge--streak { color: #643725; background: linear-gradient(180deg, #ffe0bd, #ef9d68); }
.bookclub-app .actor-nameplate-badge--member { color: #314851; background: linear-gradient(180deg, #e4eff5, #b1ced8); }
.bookclub-app .actor-nameplate-badge--mentor { color: #49351b; }
.bookclub-app .actor-nameplate-badge--guide { color: #513843; background: linear-gradient(180deg, #ffe0e2, #e89ca5); }
.bookclub-app .actor-nameplate-badge-icon { flex: 0 0 auto; }
.bookclub-app .actor-nameplate-name {
  display: block;
  max-width: 144px;
  overflow: hidden;
  color: #fffdf2;
  font: 900 calc(13px * var(--ui-font-scale, 1))/1.2 var(--book-font);
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px #0e201a;
}
.bookclub-app .actor-profile-hotspot--leader .actor-nameplate { max-width: 154px; border-color: #ffd36b; background: #192d43; }
.bookclub-app .actor-profile-hotspot--leader .actor-nameplate-badge { font-size: calc(8px * var(--ui-font-scale, 1)); }
@media (prefers-reduced-motion: reduce) {
  .bookclub-app .actor-nameplate--overlap-front { transition: none; }
}

/* Scrolling credits for long classical titles; short titles stay still. */
.bookclub-app .music-title-scroll { min-width: 0; }
.bookclub-app .music-title-track { display: flex; width: max-content; align-items: center; gap: 48px; white-space: nowrap; }
.bookclub-app .music-title-copy { display: block; flex: 0 0 auto; }
.bookclub-app .music-title-scroll.is-overflowing .music-title-track {
  animation: bookclubMusicMarquee var(--music-duration, 26s) linear infinite;
  animation-delay: .7s;
}
.bookclub-app .music-title-scroll:hover .music-title-track,
.bookclub-app .music-title-scroll:focus-within .music-title-track { animation-play-state: paused; }
@keyframes bookclubMusicMarquee { to { transform: translateX(calc(-1 * var(--music-distance, 220px))); } }

.release-notice {
  width: min(520px, calc(100vw - 28px));
  max-width: none;
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - max(env(safe-area-inset-top, 0px), 0px) - max(env(safe-area-inset-bottom, 0px), 0px) - 28px);
  padding: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  color: #253b35;
  background: transparent;
  border: 0;
}
.release-notice::backdrop { background: rgba(20, 28, 32, .72); }
.release-notice-card {
  display: flex;
  min-height: 0;
  max-height: inherit;
  flex-direction: column;
  padding: clamp(20px, 5vw, 32px);
  overflow: hidden;
  background: #fff8e7;
  border: 2px solid #456d5a;
  border-radius: 16px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .32);
}
.release-notice-kicker { margin: 0 0 8px; color: #41765c; font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.release-notice-card h2 { margin: 0; color: #253b35; font-size: clamp(20px, 5vw, 26px); }
.release-notice-card ul { display: grid; min-height: 0; flex: 1 1 auto; gap: 10px; max-height: min(52vh, 440px); max-height: min(52dvh, 440px); overflow-x: hidden; overflow-y: auto; margin: 18px 0 22px; padding: 0 10px 0 1.3em; line-height: 1.6; overscroll-behavior: contain; scrollbar-gutter: stable; -webkit-overflow-scrolling: touch; }
.release-notice-card li::marker { color: #d17e55; }
.release-notice-card button { min-height: 48px; flex: 0 0 auto; }

/* Keep the saved workshop character upright and centered in its portrait card. */
.bookclub-app .atelier-portrait-wrap {
  display: grid;
  height: clamp(300px, 32vw, 380px);
  min-height: 300px;
  align-items: stretch;
  justify-items: stretch;
}
.bookclub-app .atelier-portrait.leader-sheet-art {
  display: block;
  width: auto;
  height: 100%;
  min-height: 0;
  max-width: 100%;
  aspect-ratio: 0.712 / 1;
  object-fit: contain;
  background: transparent;
  justify-self: center;
}
.bookclub-app .atelier-portrait-wrap { grid-template-rows: auto minmax(0, 1fr); gap: 5px; padding: 8px; }
.bookclub-app .atelier-portrait-caption { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; color: #466850; font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.bookclub-app .atelier-portrait-caption strong { max-width: 65%; overflow: hidden; color: #8a5742; text-overflow: ellipsis; white-space: nowrap; }
.bookclub-app .leader-modal-art { width: 148px; height: auto; aspect-ratio: 0.712 / 1; }

/* One vector seal is reused in the header, reward card, and coin burst. */
.bookclub-app img.bookcoin-icon {
  display: inline-block;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(75, 49, 20, .35));
}
.bookclub-app .bookcoin-brand-icon { filter: drop-shadow(0 2px 3px rgba(65, 46, 21, .36)); }
.bookclub-app .celebration-icon .bookcoin-icon { filter: drop-shadow(0 3px 4px rgba(100, 66, 28, .36)); }

@media (max-width: 760px) {
  .bookclub-app .scene-pill { min-height: 44px; }
  .bookclub-app .actor-nameplate { max-width: 142px; padding: 3px 4px 4px; }
  .bookclub-app .actor-nameplate-name { max-width: 132px; font-size: calc(12px * var(--ui-font-scale, 1)); }
  .bookclub-app .actor-nameplate-badge { font-size: calc(8px * var(--ui-font-scale, 1)); }
  .bookclub-app .actor-profile-hotspot--leader .actor-nameplate { max-width: 164px; }
  .bookclub-app .atelier-portrait-wrap { height: 320px; min-height: 320px; }
  .bookclub-app .video-upload-guidance { padding: 9px 10px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .bookclub-app .music-title-scroll.is-overflowing { overflow-x: auto; }
  .bookclub-app .music-title-scroll.is-overflowing .music-title-track { animation: none; }
}

/* Learner portrait shows both the private profile photo and the saved in-world
   character, so the workshop selection is verifiable from the map modal. */
.bookclub-app .member-character-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px;
  background: linear-gradient(135deg, #fff8e7, #efe0bd);
  border: 1px solid #d3bd8d;
  border-radius: 12px;
}
.bookclub-app .member-character-heading {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--book-ink);
}
.bookclub-app .member-character-heading span { color: var(--book-ink-soft); font-size: 11px; }
.bookclub-app .member-character-stage {
  display: grid;
  grid-column: 2;
  grid-row: 2 / span 2;
  min-height: 180px;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, .45);
  border-radius: 10px;
}
.bookclub-app .member-character-stage canvas { display: block; width: 140px; height: 180px; object-fit: contain; }
.bookclub-app .member-character-stage img { display: block; width: 140px; max-height: 180px; object-fit: contain; }
.bookclub-app .member-character-stage img[hidden],
.bookclub-app .member-character-stage canvas[hidden] { display: none; }
.bookclub-app .member-showcase-card .member-character-stage {
  min-height: 360px;
  height: clamp(360px, 42vw, 520px);
  background: linear-gradient(160deg, #dfeacb, #d8b57e);
  border: 1px solid #a98a62;
}
.bookclub-app .member-showcase-card .member-character-stage canvas {
  width: 100%;
  height: 100%;
  max-width: 520px;
  max-height: none;
  image-rendering: auto;
}
.bookclub-app .member-character-card > p {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  color: var(--book-ink-soft);
  font-size: 12px;
  line-height: 1.55;
}
.bookclub-app .member-showcase-card > p.member-showcase-hint {
  grid-column: 1;
  grid-row: 3;
  margin: 6px 0 0;
  color: var(--book-ink-soft);
  font-size: 11px;
  line-height: 1.5;
}
.bookclub-app .member-character-condition {
  align-self: center;
  padding: 6px 8px;
  color: #6f5b4e;
  background: #fff7df;
  border: 1px solid #d8bf8d;
  border-radius: 7px;
  font-weight: 800;
}
.bookclub-app .member-character-condition.is-upgraded {
  color: #315c43;
  background: #eef8d7;
  border-color: #a4b981;
}
.bookclub-app .leader-group-card { display: grid; gap: 10px; margin-bottom: 14px; }
.bookclub-app .leader-group-note { margin: 0; color: var(--book-ink-soft); font-size: 13px; line-height: 1.55; }
.bookclub-app .leader-group-error { margin: 0; padding: 10px; color: #7b2929; background: #fff0e8; border-left: 4px solid var(--book-coral); }
.bookclub-app .leader-group-credentials {
  display: grid;
  gap: 9px;
  padding: 12px;
  background: #f0f5e8;
  border: 1px solid #8eae82;
  border-radius: 10px;
}
.bookclub-app .leader-group-credentials label { display: grid; gap: 4px; color: var(--book-ink-soft); font-size: 12px; }
.bookclub-app .leader-group-credentials input { width: 100%; min-width: 0; min-height: 42px; padding: 8px; color: var(--book-ink); background: #fffdf6; border: 1px solid #afbd9d; border-radius: 8px; }
.bookclub-app .leader-group-credentials p { margin: 0; color: var(--book-coral-dark); font-size: 12px; line-height: 1.5; }
.bookclub-app .leader-group-member { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #e3d6b8; }
.bookclub-app .leader-group-member:last-child { border-bottom: 0; }

@media (max-width: 760px) {
  .bookclub-app .tab-bar.has-leader-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bookclub-app .member-character-card { grid-template-columns: minmax(0, 1fr) 118px; padding: 10px; }
  .bookclub-app .member-character-stage { min-height: 156px; }
  .bookclub-app .member-character-stage canvas,
  .bookclub-app .member-character-stage img { width: 112px; height: 150px; max-height: 150px; }
  .bookclub-app .member-showcase-card .member-character-stage { min-height: 300px; height: min(82vw, 390px); }
  .bookclub-app .member-showcase-card .member-character-stage canvas { width: 100%; height: 100%; max-height: none; }
}
/* v1 reading-hub visual direction: the homepage itself is the illustrated
   reading village, while the old map remains available below for interaction. */
.daily-atelier {
  min-height: 620px;
  grid-template-columns: minmax(0, 1fr) 270px;
  grid-template-areas: "copy portrait" "note portrait";
  padding: 30px;
  background-color: #d9c18f;
  background-image: linear-gradient(90deg, rgba(34, 43, 27, .2), rgba(255, 246, 215, .06)), url('../assets/world/v1-reading-cabin-hub-v1.png?v=20260930-hub1');
  background-position: center;
  background-size: cover;
  border: 3px solid #4b3b2b;
  box-shadow: 0 7px 0 rgba(54, 42, 28, .32), inset 0 0 0 2px rgba(255, 245, 207, .46);
}
.daily-atelier::before { width: 310px; height: 260px; right: -35px; bottom: -55px; background: rgba(255, 238, 182, .32); opacity: .7; }
.atelier-copy {
  position: relative; z-index: 3; align-self: start; max-width: 700px; padding: 22px 24px;
  background: rgba(255, 248, 225, .9); border: 2px solid rgba(79, 60, 38, .75); border-radius: 10px;
  box-shadow: 5px 5px 0 rgba(64, 44, 27, .22);
}
.atelier-copy h1 { color: #2e251d; text-shadow: 1px 2px 0 rgba(255, 247, 215, .85); }
.atelier-copy p { color: #584535; }
.quest-track-bar { background: #f5e5bb; border-color: #5b4631; }
.quest-track-bar span { background: linear-gradient(90deg, #5f8960, #d09a43); }
.atelier-stats { color: #5a4935; }
.atelier-stats b { color: #2f5e46; }
.atelier-portrait-wrap {
  position: relative; z-index: 4; background: rgba(219, 229, 188, .86); border: 2px solid #6f5b3b;
  box-shadow: 5px 5px 0 rgba(61, 47, 29, .3); border-radius: 14px;
}
.atelier-portrait-caption { padding: 8px 10px; color: #3c5b3f; }
.atelier-portrait-caption strong { color: #8b522e; }
.atelier-portrait { min-height: 270px; }
.atelier-wardrobe-status, .atelier-wardrobe-growth { margin-inline: 8px; }
.atelier-note { position: relative; z-index: 3; align-self: end; background: rgba(233, 243, 214, .9); border-left-color: #5f926d; color: #4a6048; border-radius: 0 9px 9px 0; }
.atelier-hub-character { position: absolute; z-index: 2; left: 38%; bottom: 18px; width: min(310px, 27vw); height: 440px; pointer-events: none; filter: drop-shadow(0 8px 5px rgba(45, 33, 23, .22)); }
.atelier-hub-character canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 760px) {
  .daily-atelier { min-height: 610px; grid-template-columns: minmax(0, 1fr) 142px; padding: 14px; background-position: 42% center; }
  .atelier-copy { padding: 14px; }
  .atelier-copy h1 { font-size: 25px; }
  .atelier-hub-character { left: 28%; bottom: 20px; width: 220px; height: 310px; }
  .atelier-portrait-wrap { min-height: 210px; }
  .atelier-portrait { min-height: 190px; }
}

/* Match the base selector specificity so the illustrated reading-world
   background actually replaces the legacy cream card on the live homepage. */
.bookclub-app .daily-atelier {
  min-height: 620px;
  grid-template-columns: minmax(0, 1fr) 270px;
  grid-template-areas: "copy portrait" "note portrait";
  padding: 30px;
  background-color: #d9c18f;
  background-image: linear-gradient(90deg, rgba(34, 43, 27, .2), rgba(255, 246, 215, .06)), url('../assets/world/v1-reading-cabin-hub-v1.png?v=20260930-hub2');
  background-position: center;
  background-size: cover;
  border: 3px solid #4b3b2b;
  box-shadow: 0 7px 0 rgba(54, 42, 28, .32), inset 0 0 0 2px rgba(255, 245, 207, .46);
}
.bookclub-app .daily-atelier::before { width: 310px; height: 260px; right: -35px; bottom: -55px; background: rgba(255, 238, 182, .32); opacity: .7; }
.bookclub-app .atelier-copy { position: relative; z-index: 3; align-self: start; max-width: 700px; padding: 22px 24px; background: rgba(255, 248, 225, .9); border: 2px solid rgba(79, 60, 38, .75); border-radius: 10px; box-shadow: 5px 5px 0 rgba(64, 44, 27, .22); }
.bookclub-app .atelier-note { position: relative; z-index: 3; align-self: end; background: rgba(233, 243, 214, .9); border-left-color: #5f926d; color: #4a6048; border-radius: 0 9px 9px 0; }
.bookclub-app .atelier-hub-character { position: absolute; z-index: 2; left: 38%; bottom: 18px; width: min(310px, 27vw); height: 440px; pointer-events: none; filter: drop-shadow(0 8px 5px rgba(45, 33, 23, .22)); }
@media (max-width: 760px) {
  .bookclub-app .daily-atelier { min-height: 610px; grid-template-columns: minmax(0, 1fr) 142px; grid-template-areas: "copy portrait" "note note"; padding: 14px; background-position: 42% center; }
  .bookclub-app .atelier-copy { padding: 14px; }
  .bookclub-app .atelier-hub-character { left: 28%; bottom: 20px; width: 220px; height: 310px; }
  .bookclub-app .atelier-portrait-wrap { min-height: 210px; }
  .bookclub-app .atelier-portrait { min-height: 190px; }
}

/* Feed scale: compact summaries first, expensive media and comments on demand. */
.bookclub-app #postsContainer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.bookclub-app #postsContainer > .post-card { min-width: 0; margin: 0; content-visibility: visible; }
.bookclub-app #postsContainer > .feed-load-more,
.bookclub-app #postsContainer > .feed-show-more,
.bookclub-app #postsContainer > .empty-state { grid-column: 1 / -1; }
.bookclub-app .post-card--compact { padding: 14px; }
.bookclub-app .post-card--compact .post-content--summary { display: -webkit-box; max-height: 8.1em; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.bookclub-app .post-card--compact .video-wrap { margin-top: 10px; }
.bookclub-app .video-lazy { display: grid; min-height: 190px; aspect-ratio: 16 / 9; place-items: center; background: linear-gradient(135deg, #243a34, #17251f); border: 0; }
.bookclub-app .video-load-button { display: grid; min-width: 190px; place-items: center; gap: 5px; padding: 13px 18px; color: #fff8e5; background: rgba(25, 39, 33, .9); border: 2px solid #e9bd70; border-radius: 12px; cursor: pointer; box-shadow: 0 5px 0 rgba(8, 15, 12, .3); }
.bookclub-app .video-load-button:hover, .bookclub-app .video-load-button:focus-visible { background: #3f6a55; }
.bookclub-app .video-load-button span { color: #ffd481; font-size: 25px; line-height: 1; }
.bookclub-app .video-load-button b { font-size: 12px; }
.bookclub-app .video-load-button small { color: #d9e7d5; font-size: 9px; }
.bookclub-app .video-lazy > video { width: 100%; height: 100%; min-height: 190px; object-fit: contain; border-radius: 11px; background: #182923; }
.bookclub-app .post-details { margin-top: 10px; border-top: 1px dashed #d6c18d; }
.bookclub-app .post-details-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0 4px; color: var(--book-green-dark); cursor: pointer; font-size: 11px; font-weight: 900; list-style: none; }
.bookclub-app .post-details-toggle::-webkit-details-marker { display: none; }
.bookclub-app .post-details-toggle::after { content: '＋'; color: var(--book-coral-dark); font-size: 15px; }
.bookclub-app .post-details[open] .post-details-toggle::after { content: '−'; }
.bookclub-app .post-details-toggle span { margin-left: auto; color: var(--book-ink-soft); font-size: 10px; font-weight: 600; }
.bookclub-app .post-details-body { min-width: 0; }
.bookclub-app .post-details-body .comment-area { margin-top: 8px; }

@media (max-width: 900px) {
  .bookclub-app #postsContainer { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .bookclub-app #postsContainer { display: grid; gap: 10px; }
  .bookclub-app .post-card--compact { padding: 12px; }
  .bookclub-app .post-card--compact .post-content--summary { max-height: 6.3em; -webkit-line-clamp: 3; }
  .bookclub-app .video-lazy { min-height: 165px; }
  .bookclub-app .video-lazy > video { min-height: 165px; }
}

/* Unified game surfaces and one shared drawer host. */
.bookclub-app {
  --surface-radius: 16px;
  --surface-border: 2px solid rgba(75, 59, 43, .32);
  --surface-shadow: 0 5px 0 rgba(54, 42, 28, .16);
}
.bookclub-app .app-drawer-root[hidden] { display: none !important; }
.bookclub-app .app-drawer-root { position: fixed; z-index: 240; inset: 0; }
.bookclub-app .app-drawer-scrim { position: absolute; inset: 0; background: rgba(28, 24, 24, .48); opacity: 0; transition: opacity .18s ease; }
.bookclub-app .app-drawer-panel { position: absolute; top: 0; right: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(480px, 94vw); height: 100%; overflow: hidden; padding: 0 16px 16px; color: var(--book-ink); background: #fff7df; border-left: 3px solid #6c4a35; box-shadow: -12px 0 34px rgba(44, 31, 19, .25); transform: translateX(104%); transition: transform .2s ease; }
.bookclub-app .app-drawer-root.is-open .app-drawer-scrim { opacity: 1; }
.bookclub-app .app-drawer-root.is-open .app-drawer-panel { transform: translateX(0); }
.bookclub-app .app-drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; padding: 12px 2px; border-bottom: 1px solid #e0cfa5; }
.bookclub-app .app-drawer-kicker { color: #a26c41; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.bookclub-app .app-drawer-header h2 { margin: 2px 0 0; color: #4a3225; font: 900 23px/1.1 Georgia, 'Songti SC', serif; }
.bookclub-app .app-drawer-close { display: grid; width: 40px; height: 40px; place-items: center; color: #573526; background: #f5e3b9; border: 1px solid #c9a56d; border-radius: 50%; cursor: pointer; font-size: 24px; line-height: 1; }
.bookclub-app .app-drawer-body { min-height: 0; overflow: auto; padding: 14px 0 8px; scrollbar-gutter: stable; }
.bookclub-app .app-drawer-body > .asset-store-drawer-inline { display: block; min-height: 100%; padding: 0; overflow: visible; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.bookclub-app .app-drawer-body > .asset-preview-panel { position: static; display: grid; width: auto; height: auto; min-height: 100%; padding: 0; overflow: visible; border: 0; box-shadow: none; animation: none; }
.bookclub-app .app-drawer-body > .asset-preview-panel canvas { min-height: 300px; }
.bookclub-app .app-drawer-body > .asset-preview-panel .asset-preview-heading { display: none; }
.bookclub-app .app-drawer-body > .modal-drawer { width: auto; max-width: none; max-height: none; margin: 0; padding: 0; overflow: visible; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.bookclub-app .app-drawer-body > .modal-drawer .modal-header { position: sticky; top: 0; z-index: 2; margin-bottom: 12px; background: #fff7df; }
.bookclub-app .app-drawer-body > .modal-drawer .close-btn { display: none; }
.bookclub-app .map-scroll { position: relative; }
.bookclub-app .phaser-world { position: absolute; z-index: 3; inset: 0; overflow: hidden; background: transparent; touch-action: none; }
.bookclub-app .phaser-world[hidden] { display: none !important; }
.bookclub-app .phaser-world canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.bookclub-app .map-scroll[data-world-runtime="phaser"] #officeCanvas { visibility: visible !important; }
.bookclub-app .map-scroll[data-world-runtime="phaser"] .phaser-world { display: block; }
.bookclub-app .phaser-world-fallback { display: grid; height: 100%; place-items: center; color: #f5e5bb; background: linear-gradient(135deg, #274d43, #162b28); font-weight: 900; }
.bookclub-app .phaser-dialogue-overlay { position: absolute; z-index: 12; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; width: min(470px, calc(100% - 24px)); padding: 10px 12px; color: #3f312b; background: rgba(255, 248, 225, .96); border: 2px solid #573d31; border-radius: 12px; box-shadow: 5px 5px 0 rgba(43, 30, 24, .32); cursor: pointer; text-align: left; transform: translateY(-50%); }
.bookclub-app .phaser-dialogue-overlay[hidden] { display: none !important; }
.bookclub-app .phaser-dialogue-name { align-self: start; padding: 5px 8px; color: #fff9e7; background: #4f8066; border: 1px solid #355c48; border-radius: 6px; font-size: 10px; font-weight: 900; white-space: nowrap; }
.bookclub-app .phaser-dialogue-copy { min-width: 0; font-size: 12px; line-height: 1.45; }
.bookclub-app .phaser-dialogue-next { color: #bd6748; font-size: 24px; font-weight: 900; }
@media (max-width: 760px) {
  .bookclub-app .phaser-dialogue-overlay { gap: 6px; padding: 8px 9px; }
  .bookclub-app .phaser-dialogue-copy { font-size: 11px; }
}
.bookclub-app .mobile-game-nav { display: none; }

@media (max-width: 760px) {
  .bookclub-app .app-drawer-panel { top: auto; right: 0; bottom: 0; width: 100%; height: min(78dvh, 720px); padding: 0 12px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 3px solid #6c4a35; border-left: 0; border-radius: 20px 20px 0 0; transform: translateY(104%); }
  .bookclub-app .app-drawer-root.is-open .app-drawer-panel { transform: translateY(0); }
  .bookclub-app .app-drawer-header { min-height: 58px; }
  .bookclub-app .app-drawer-header::before { position: absolute; top: 7px; left: 50%; width: 42px; height: 4px; background: #c5a474; border-radius: 99px; content: ''; transform: translateX(-50%); }
  .bookclub-app .app-drawer-body { padding-top: 9px; }
  .bookclub-app .mobile-game-nav { position: fixed; z-index: 180; right: 8px; bottom: env(safe-area-inset-bottom, 0px); left: 8px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; padding: 6px; background: rgba(46, 34, 39, .96); border: 2px solid #6f4a50; border-radius: 17px; box-shadow: 0 -5px 16px rgba(45, 30, 25, .18); }
  .bookclub-app .mobile-game-nav button { display: grid; min-height: 48px; place-items: center; gap: 2px; padding: 3px 2px; color: #e4cfd0; background: transparent; border: 0; border-radius: 11px; cursor: pointer; font-size: 9px; font-weight: 900; }
  .bookclub-app .mobile-game-nav button span { color: #f6bc76; font-size: 17px; line-height: 1; }
  .bookclub-app .mobile-game-nav button.is-active, .bookclub-app .mobile-game-nav button:hover { color: #3d2a27; background: #f1b06b; }
  .bookclub-app .mobile-game-nav button.is-active span, .bookclub-app .mobile-game-nav button:hover span { color: #563c34; }
  .bookclub-app .tab-bar { position: static; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; padding: 5px; }
  .bookclub-app .tab-bar .tab-btn { min-height: 38px; padding: 6px 3px; font-size: 10px; }
}

@media (min-width: 761px) {
  .bookclub-app .app-drawer-root[data-mode="asset-store"] .app-drawer-body > .asset-store-drawer-inline .asset-store-categories { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .bookclub-app .app-drawer-root[data-mode="asset-store"] .app-drawer-body > .asset-store-drawer-inline .shop-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Final responsive quest safety layout: the task owns its text and CTA; the
   character portrait owns its own column. No absolute artwork may cover the
   Streak/ten-minute task copy. */
:root {
  --header-safe-space: 86px;
  --mobile-bottom-safe-space: calc(76px + env(safe-area-inset-bottom, 0px));
}
html { scroll-padding-top: var(--header-safe-space); }
body.bookclub-app { padding-bottom: max(104px, var(--mobile-bottom-safe-space)); }
.bookclub-app .daily-atelier {
  grid-template-columns: minmax(0, 1fr) clamp(230px, 26vw, 300px);
  grid-template-areas: "copy portrait" "note portrait";
  align-items: stretch;
  overflow: visible;
}
.bookclub-app .atelier-copy {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 0;
}
.bookclub-app .atelier-copy h1,
.bookclub-app .atelier-copy p,
.bookclub-app .quest-track,
.bookclub-app .atelier-stats { min-width: 0; overflow-wrap: anywhere; }
.bookclub-app .atelier-task-actions { display: flex; min-width: 0; margin-top: 16px; }
.bookclub-app .atelier-task-actions .fab-punch-btn { width: min(100%, 460px); min-height: 50px; }
.bookclub-app .atelier-hub-character[hidden] { display: none !important; }
.bookclub-app .atelier-portrait-wrap { min-width: 0; min-height: 300px; height: auto; }

@media (min-width: 761px) and (max-width: 1100px) {
  :root { --header-safe-space: 78px; }
  .bookclub-app .daily-atelier { grid-template-columns: minmax(0, 1fr) 240px; gap: 15px; padding: 22px; }
  .bookclub-app .atelier-copy h1 { font-size: clamp(24px, 3.5vw, 32px); }
}

@media (max-width: 760px) {
  :root { --header-safe-space: 76px; }
  body.bookclub-app { padding-bottom: var(--mobile-bottom-safe-space); }
  .bookclub-app .daily-atelier {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "portrait" "note";
    min-height: 0;
    gap: 14px;
    padding: 14px;
    overflow: visible;
  }
  .bookclub-app .atelier-copy { padding: 15px; }
  .bookclub-app .atelier-copy h1 { max-width: 100%; font-size: clamp(25px, 7.3vw, 32px); }
  .bookclub-app .atelier-copy p { max-width: 100%; font-size: 12px; }
  .bookclub-app .quest-track { width: 100%; }
  .bookclub-app .atelier-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .bookclub-app .atelier-stats span { min-width: 0; padding: 6px; background: rgba(255,255,255,.54); border: 1px solid rgba(111,91,59,.25); border-radius: 7px; font-size: 9px; }
  .bookclub-app .atelier-stats b { display: block; font-size: 16px; }
  .bookclub-app .atelier-task-actions { margin-top: 13px; }
  .bookclub-app .atelier-task-actions .fab-punch-btn { width: 100%; }
  .bookclub-app .atelier-portrait-wrap { min-height: 272px; height: 272px; }
  .bookclub-app .atelier-note { min-width: 0; }
}

/* Final v1 eight-fix overrides. Keep these last so legacy page rules cannot
   re-enable the duplicate hub layer or stretch the mobile dock. */
html, body.bookclub-app { max-width: 100%; overflow-x: clip; }
.bookclub-app .atelier-hub-character { display: none !important; }
.bookclub-app .post-media-state { display: flex; min-width: 0; align-items: center; gap: 8px; min-height: 24px; margin: 8px 0 2px; }
.bookclub-app .post-media-summary { color: var(--book-ink-soft); font-size: 10px; font-weight: 800; }
.bookclub-app .post-media-summary--video { color: var(--book-coral-dark); }
.bookclub-app .post-actions .action-btn { min-height: 42px; }
.bookclub-app .post-actions .action-btn.is-disabled,
.bookclub-app .post-actions .action-btn:disabled { color: #9d927d; background: #eee5d4; border-color: #d8cdb7; cursor: not-allowed; opacity: .78; }
.bookclub-app .post-copy-drawer,
.bookclub-app .post-video-drawer { display: grid; gap: 12px; min-width: 0; color: var(--book-ink); }
.bookclub-app .post-copy-drawer-book { color: var(--book-coral-dark); font-size: 14px; font-weight: 900; line-height: 1.4; }
.bookclub-app .post-copy-drawer-author { color: var(--book-ink-soft); font-size: 11px; }
.bookclub-app .post-copy-full { margin: 0; padding: 15px; color: var(--book-ink); background: #fffdf5; border: 1px solid #ddcda8; border-radius: 12px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.bookclub-app .post-video-drawer .video-wrap { width: 100%; aspect-ratio: 16 / 9; min-height: 0; margin: 0; display: grid; place-items: center; background: #27362f; border-radius: 12px; }
.bookclub-app .post-video-drawer .video-wrap > video { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.bookclub-app .post-video-empty { display: grid; min-height: 150px; place-items: center; padding: 18px; color: var(--book-ink-soft); background: #f5ead0; border: 1px dashed #cbb589; border-radius: 12px; line-height: 1.6; text-align: center; }
.bookclub-app .post-video-caption { margin: 0; color: var(--book-ink-soft); font-size: 11px; line-height: 1.5; }
.bookclub-app .post-video-external { justify-self: start; min-height: 44px; display: inline-grid; place-items: center; }
.bookclub-app .member-post-copy { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.bookclub-app .app-drawer-root.is-open ~ .mobile-game-nav,
body.bookclub-app:has(.app-drawer-root.is-open) .mobile-game-nav { visibility: hidden; pointer-events: none; }
@media (max-width: 760px) {
  .bookclub-app .mobile-game-nav { right: max(8px, env(safe-area-inset-right, 0px)); left: max(8px, env(safe-area-inset-left, 0px)); width: auto; max-width: calc(100% - 16px); box-sizing: border-box; bottom: env(safe-area-inset-bottom, 0px); padding-bottom: max(6px, env(safe-area-inset-bottom, 0px)); }
  .bookclub-app .mobile-game-nav button { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bookclub-app .post-actions .action-btn { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .bookclub-app .post-actions .action-btn:nth-last-child(-n + 2) { flex-basis: 100%; }
}

/* FINAL PREVIEW HUD OVERRIDE: keep the larger brand and avatar growth HUD
   after all legacy mobile header experiments. */
.bookclub-app .pixel-header { box-sizing: border-box; min-width: 0; overflow: visible; }
.bookclub-app .brand-lockup,
.bookclub-app .brand-lockup > div,
.bookclub-app .user-stats-row,
.bookclub-app .header-right { min-width: 0; }
.bookclub-app .brand {
  max-width: min(300px, 35vw);
  overflow: hidden;
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bookclub-app .header-profile-stack { flex: 0 0 auto; }
@media (max-width: 760px) {
  .bookclub-app .pixel-header { min-height: 116px; }
  .bookclub-app .brand { max-width: min(190px, calc(100vw - 190px)); font-size: 17px; }
  .bookclub-app .brand-kicker { font-size: 8px; }
  .bookclub-app .header-left { gap: 7px; }
  .bookclub-app .user-stats-row { min-width: 0; }
  .bookclub-app .coin-badge-button { min-width: 126px; max-width: 146px; }
  .bookclub-app .header-right { min-width: 0; }
  .bookclub-app .header-profile-stack { min-width: 100px; }
  .bookclub-app .header-avatar-growth { max-width: 100px; }
}
@media (max-width: 390px) {
  .bookclub-app .brand { max-width: 170px; font-size: 16px; }
  .bookclub-app .coin-badge-button { min-width: 116px; max-width: 126px; padding-inline: 5px; font-size: 8px; }
  .bookclub-app .header-profile-stack { min-width: 92px; }
  .bookclub-app .header-profile-stack .user-pill { width: 66px; height: 66px; min-width: 66px; }
  .bookclub-app .header-profile-stack .avatar-pixel-sm { width: 52px; height: 52px; flex-basis: 52px; }
  .bookclub-app .header-avatar-growth { width: 92px; font-size: 7px; }
}
