/* BADING TAMBAYAN — site-wide theme and contrast system
   Shared tokens keep every page, form, card and control in the selected theme.
   World-specific illustrations and signature artwork remain intentionally distinct. */
:root{
  --bt-surface:var(--panel);
  --bt-surface-raised:var(--panel2);
  --bt-text:var(--text);
  --bt-muted:var(--muted);
  --bt-border:var(--line);
  --bt-accent:var(--accent);
  --bt-accent-strong:var(--accent2);
}
body[data-theme="violet"]{
  --bg:#100d20;--panel:#1b1630;--panel2:#292044;--text:#f7f1ff;--muted:#c8bdd8;
  --accent:#c6a5ff;--accent2:#8d65db;--line:#ffffff24;--shadow:0 18px 55px #05030d66;color-scheme:dark;
  background:radial-gradient(ellipse at 12% 0%,#432a6c70,transparent 38%),radial-gradient(ellipse at 94% 38%,#542b6250,transparent 34%),var(--bg);
}
body[data-theme="rose"]{
  --bg:#21121f;--panel:#321d31;--panel2:#472747;--text:#fff2f8;--muted:#d8b8c8;
  --accent:#ffc0d9;--accent2:#d66d9f;--line:#ffffff25;--shadow:0 18px 48px #13081255;color-scheme:dark;
  background:radial-gradient(ellipse at 12% 0%,#71334f66,transparent 38%),radial-gradient(ellipse at 95% 40%,#8b3d6944,transparent 34%),var(--bg);
}
body[data-theme="ocean"]{
  --bg:#0c1b2a;--panel:#142b40;--panel2:#1d3a53;--text:#eff8ff;--muted:#b5cadb;
  --accent:#a9e1ff;--accent2:#4b9dc9;--line:#ffffff24;--shadow:0 18px 48px #030d1855;color-scheme:dark;
  background:radial-gradient(ellipse at 12% 0%,#1c547466,transparent 38%),radial-gradient(ellipse at 95% 40%,#28678a44,transparent 34%),var(--bg);
}
body[data-theme="midnight"]{
  --bg:#080b17;--panel:#13192b;--panel2:#1c2540;--text:#f0f3ff;--muted:#b9c5e0;
  --accent:#c0d0ff;--accent2:#738fd9;--line:#ffffff24;--shadow:0 18px 48px #02040d66;color-scheme:dark;
  background:radial-gradient(ellipse at 15% 0%,#283b7566,transparent 38%),radial-gradient(ellipse at 95% 45%,#35265d44,transparent 34%),var(--bg);
}
body[data-theme="cloud"]{
  --bg:#f4f0f8;--panel:#fffdfd;--panel2:#eee7f5;--text:#30283a;--muted:#655a70;
  --accent:#76549b;--accent2:#9877b7;--line:#57466b30;--shadow:0 12px 35px #47365714;color-scheme:light;
  background:radial-gradient(ellipse at 12% 0%,#e4d7f288,transparent 38%),radial-gradient(ellipse at 95% 35%,#f4ddeb99,transparent 34%),var(--bg);
}
body[data-theme="peach"]{
  --bg:#fff3e9;--panel:#fffaf5;--panel2:#f8e5d8;--text:#402d27;--muted:#70594f;
  --accent:#a85c43;--accent2:#c77b5d;--line:#704b3a30;--shadow:0 12px 35px #79503b14;color-scheme:light;
  background:radial-gradient(ellipse at 12% 0%,#f8d9c788,transparent 38%),radial-gradient(ellipse at 95% 35%,#f6dce099,transparent 34%),var(--bg);
}
body[data-theme="matcha"]{
  --bg:#f0f4e9;--panel:#fbfdf6;--panel2:#e5edd9;--text:#29382b;--muted:#596b55;
  --accent:#55764c;--accent2:#78966b;--line:#405b3d30;--shadow:0 12px 35px #34452d14;color-scheme:light;
  background:radial-gradient(ellipse at 12% 0%,#dce9ccaa,transparent 38%),radial-gradient(ellipse at 95% 35%,#e9efd999,transparent 34%),var(--bg);
}

/* Shared page surfaces */
body{color:var(--bt-text);background-color:var(--bg)}
.topbar,.subnav,.site-nav,.mobile-nav,.bottom-nav{
  background:color-mix(in srgb,var(--panel) 94%,transparent);
  color:var(--bt-text);border-color:var(--bt-border);
}
.panel,.modal,.theme-panel,.shop-panel,.collection-panel,.achievements-panel,
.hangout-card,.game-card,.tool-card,.stat,.world-card,.settings-card,
.settings-panel,.profile-card,.account-card,.section-card{
  color:var(--bt-text);border-color:var(--bt-border);
}
.panel,.modal,.theme-panel,.shop-panel,.collection-panel,.achievements-panel,
.hangout-card,.settings-card,.settings-panel,.profile-card,.account-card,.section-card{
  background:var(--bt-surface);box-shadow:var(--shadow);
}
.game-card,.tool-card,.stat,.world-card,.shop-item,.collection-pill,.chip,.kind-item{
  color:var(--bt-text);border-color:var(--bt-border);
}
.panel h1,.panel h2,.panel h3,.panel h4,.panel h5,
.modal h1,.modal h2,.modal h3,.modal h4,
.section-heading,.section-heading h1,.section-heading h2,.section-heading h3,
h1,h2,h3,h4,h5,h6{color:var(--bt-text)}
p,li,label,small,summary,figcaption{color:inherit}
.muted,.section-note,.footer,.hint,.help-text,.form-hint{color:var(--bt-muted)}
a:not(.primary-btn):not(.soft-btn):not(.world-card):not(.game-card):not(.tool-card){color:var(--bt-accent)}
a:hover{color:var(--bt-accent-strong)}
button,.primary-btn,.soft-btn,.secondary-btn,.theme-choice,.icon-btn,
input,textarea,select{
  border-color:var(--bt-border);
}
input,textarea,select{
  background:var(--bt-surface-raised);color:var(--bt-text);
}
input::placeholder,textarea::placeholder{color:var(--bt-muted);opacity:.82}
input:focus,textarea:focus,select:focus{
  border-color:var(--bt-accent);outline-color:var(--bt-accent);
}
.soft-btn,.theme-choice,.icon-btn,.chip,.collection-pill{
  background:var(--bt-surface-raised);color:var(--bt-text);
}
.primary-btn{
  background:linear-gradient(135deg,var(--bt-accent-strong),var(--bt-accent));
  color:#fff;border-color:transparent;
}
.theme-choice.active,.tab.active,[aria-selected="true"]{
  border-color:var(--bt-accent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--bt-accent) 35%,transparent);
}
hr,.divider{border-color:var(--bt-border)}
.modal::backdrop{background:color-mix(in srgb,var(--bg) 76%,#05030d 24%)}
.toast{background:var(--bt-surface-raised);color:var(--bt-text);border:1px solid var(--bt-border)}
::selection{background:color-mix(in srgb,var(--bt-accent) 35%,transparent);color:var(--bt-text)}

/* Keep the live chat readable while matching the selected surface palette. */
#onlineTambayan .online-panel,#onlineTambayan .online-room,
#onlineTambayan .online-members-panel{color:var(--bt-text);border-color:var(--bt-border)}
#onlineTambayan input,#onlineTambayan textarea{color:var(--bt-text)}
#onlineTambayan input::placeholder{color:var(--bt-muted)}
#onlineTambayan .online-message-content{overflow-wrap:anywhere}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}

/* Strong typography pass: override legacy hard-coded font colors site-wide. */
body,
body :is(h1,h2,h3,h4,h5,h6,p,li,label,small,summary,figcaption,
  .hero-text,.section-note,.world-card p,.game-card p,.tool-card p,
  .comfort-panel p,.hangout-card p,.diary-entry p,.entry-meta,
  .form-note,.empty-state,.theme-panel p,.footer,.muted,.hint,
  .help-text,.form-hint,.stat span,.stat small,.diary-form label,
  .modal label,.shop-item p,.feed-item small,.prompt-box p){
  color:var(--bt-text)!important;
}
body :is(.muted,.section-note,.footer,.hint,.help-text,.form-hint,
  .form-note,.empty-state,.entry-meta,.stat span,.stat small,
  .diary-form label,.modal label,.shop-item p,.feed-item small,
  .prompt-box p){
  color:var(--bt-muted)!important;
}
body :is(.eyebrow,.world-kicker,.world-card b,.tool-card strong,
  .feed-item b,.tiny-link,.entry-actions button,.brand-mark,
  .hero h1 em,.footer>span){
  color:var(--bt-accent)!important;
}
body :is(.topbar,.subnav,.site-nav,.mobile-nav,.bottom-nav){
  color:var(--bt-text)!important;
}
body :is(.topbar,.subnav,.site-nav,.mobile-nav,.bottom-nav) :is(a,button,span,strong,small){
  color:inherit;
}
body :is(.panel,.modal,.theme-panel,.shop-panel,.collection-panel,
  .achievements-panel,.hangout-card,.game-card,.tool-card,.stat,
  .world-card,.settings-card,.settings-panel,.profile-card,
  .account-card,.section-card,.shop-item,.collection-pill,.chip,.kind-item){
  color:var(--bt-text);
}
body :is(input,textarea,select,option){
  color:var(--bt-text)!important;
  background-color:var(--bt-surface-raised);
}
body :is(input,textarea,select)::placeholder{
  color:var(--bt-muted)!important;opacity:1;
}
body :is(button,.primary-btn,.soft-btn,.secondary-btn,.small-btn,
  .choice-btn,.theme-choice,.icon-btn){
  color:var(--bt-text);
}
body :is(.primary-btn,.small-btn,.danger-btn){
  color:#fff!important;
}
/* Keep chat message bubbles legible; the message text itself stays white. */
#onlineTambayan .online-message-content,
#onlineTambayan .online-message-content *{
  color:#fff!important;
}

/* Accessible foreground colors for theme-colored buttons and accents. */
body[data-theme="violet"],body[data-theme="rose"],
body[data-theme="ocean"],body[data-theme="midnight"]{
  --bt-on-accent:#21172e;
  --bt-on-accent-strong:#ffffff;
}
body[data-theme="cloud"],body[data-theme="peach"],body[data-theme="matcha"]{
  --bt-on-accent:#ffffff;
  --bt-on-accent-strong:#ffffff;
}
body :is(.primary-btn,.small-btn){
  color:var(--bt-on-accent)!important;
  text-shadow:none!important;
}
body :is(.danger-btn){
  color:#32101a!important;
}
/* Text on raised controls stays theme-aware, while action labels keep contrast. */
body :is(.soft-btn,.secondary-btn,.choice-btn,.theme-choice,.icon-btn){
  color:var(--bt-text)!important;
}
body :is(.primary-btn,.small-btn):disabled{opacity:.72}

/* Section headers for the six worlds and all other destination sections. */
body .section-heading h1,
body .section-heading h2,
body .section-heading h3{
  color:var(--bt-text)!important;
  opacity:1!important;
  text-shadow:none;
}
body .section-heading .eyebrow{
  color:var(--bt-accent)!important;
  opacity:1!important;
  text-shadow:none;
}
body .section-heading .section-note{
  color:var(--bt-muted)!important;
  opacity:1!important;
}
/* Homepage's editorial worlds heading uses a dark hero-like backdrop. */
body #home > .section-heading#worlds h2{
  color:var(--bt-text)!important;
}
body #home > .section-heading#worlds .eyebrow{
  color:var(--bt-accent)!important;
}

/* Final override for the six world section headers.
   The homepage redesign stylesheet assigns fixed colors to these headings,
   so target the actual section IDs with higher specificity. */
body #home > section.section-heading#games h2,
body #home > section.section-heading#comfort h2,
body #home > section.section-heading#lab h2,
body #home > section.section-heading#mystery h2,
body #home > section.section-heading#diary h2,
body #home > section.section-heading#hangout h2{
  color:var(--bt-text)!important;
  -webkit-text-fill-color:var(--bt-text)!important;
  opacity:1!important;
  text-shadow:none!important;
}
body #home > section.section-heading#games .eyebrow,
body #home > section.section-heading#comfort .eyebrow,
body #home > section.section-heading#lab .eyebrow,
body #home > section.section-heading#mystery .eyebrow,
body #home > section.section-heading#diary .eyebrow,
body #home > section.section-heading#hangout .eyebrow{
  color:var(--bt-accent)!important;
  -webkit-text-fill-color:var(--bt-accent)!important;
  opacity:1!important;
  text-shadow:none!important;
}
body #home > section.section-heading#games .section-note,
body #home > section.section-heading#comfort .section-note,
body #home > section.section-heading#lab .section-note,
body #home > section.section-heading#mystery .section-note,
body #home > section.section-heading#diary .section-note,
body #home > section.section-heading#hangout .section-note{
  color:var(--bt-muted)!important;
  -webkit-text-fill-color:var(--bt-muted)!important;
  opacity:1!important;
}

/* FINAL SITE-WIDE TEXT CONTRAST OVERRIDES
   Legacy world/page styles contain more-specific fixed font colors. These
   scoped selectors deliberately outrank them while preserving artwork,
   status colors, controls, and the live-chat bubble text. */
html body[data-theme] #home :is(
  h1,h2,h3,h4,h5,h6,p,li,label,small,summary,figcaption,
  blockquote,dt,dd,time,.eyebrow,.section-note,.muted,.hint,
  .help-text,.form-hint,.form-note,.empty-state,.entry-meta,
  .hero-text,.world-kicker,.world-card p,.game-card p,.tool-card p,
  .comfort-panel p,.comfort-tool p,.hangout-card p,.diary-entry p,
  .diary-entry h4,.diary-list-head h3,.collection-panel h3,
  .collection-sets-wrap h3,.shop-item p,.feed-item small,
  .prompt-box p,.stat span,.stat small,.daily-challenge-copy p,
  .shared-space-card p,.shared-spaces-intro-copy
){
  color:var(--bt-text)!important;
  -webkit-text-fill-color:var(--bt-text)!important;
  opacity:1;
}
html body[data-theme] #home :is(
  .section-note,.muted,.hint,.help-text,.form-hint,.form-note,
  .empty-state,.entry-meta,.stat span,.stat small,
  .diary-form label,.comfort-journal-footer,.shared-spaces-intro-copy,
  .comfort-tool>p:not(.eyebrow),.daily-challenge-copy p
){
  color:var(--bt-muted)!important;
  -webkit-text-fill-color:var(--bt-muted)!important;
}
html body[data-theme] #home :is(
  .eyebrow,.world-kicker,.daily-challenge-reward,
  .daily-challenge-status,.brand-mark
){
  color:var(--bt-accent)!important;
  -webkit-text-fill-color:var(--bt-accent)!important;
}
html body[data-theme] #home > footer.footer,
html body[data-theme] #home > footer.footer :is(span,p,button,a){
  color:var(--bt-muted)!important;
  -webkit-text-fill-color:var(--bt-muted)!important;
}
html body[data-theme] :is(.topbar,.subnav,.site-nav,.mobile-nav,.bottom-nav)
  :is(a,span,strong,small){
  color:var(--bt-text)!important;
  -webkit-text-fill-color:var(--bt-text)!important;
}
html body[data-theme] :is(.modal,.theme-panel,.shop-panel,.collection-panel,
  .achievements-panel,.settings-panel,.profile-card,.account-card)
  :is(h1,h2,h3,h4,h5,h6,p,li,label,small,span,strong,b,em,summary){
  color:var(--bt-text)!important;
  -webkit-text-fill-color:var(--bt-text)!important;
}
html body[data-theme] :is(.modal,.theme-panel,.shop-panel,.collection-panel,
  .achievements-panel,.settings-panel,.profile-card,.account-card)
  :is(.eyebrow,.muted,.hint,.help-text,.form-hint,.form-note,.empty-state){
  color:var(--bt-muted)!important;
  -webkit-text-fill-color:var(--bt-muted)!important;
}
/* Keep chat messages white regardless of the selected site theme. */
html body[data-theme] #onlineTambayan .online-message-content,
html body[data-theme] #onlineTambayan .online-message-content *{
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}


/* COMPLETE THEME POLISH — coordinated color, surface and typography system.
   Each palette keeps its own accent identity; muted text remains readable rather
   than being flattened to pure black/white. */
body[data-theme="violet"] {
  --bt-text:#f7f1ff; --bt-muted:#d2c5e4; --bt-accent:#d2b4ff;
  --bt-accent-strong:#a982ec; --bt-border:#ffffff2b;
  --bt-on-accent:#241632; --bt-surface:#1b1630; --bt-surface-raised:#292044;
}
body[data-theme="rose"] {
  --bt-text:#fff2f8; --bt-muted:#e5c6d5; --bt-accent:#ffc5dc;
  --bt-accent-strong:#e58ab3; --bt-border:#ffffff30;
  --bt-on-accent:#35182a; --bt-surface:#321d31; --bt-surface-raised:#472747;
}
body[data-theme="ocean"] {
  --bt-text:#eff8ff; --bt-muted:#c5d9e8; --bt-accent:#b6e6ff;
  --bt-accent-strong:#70b9df; --bt-border:#ffffff2d;
  --bt-on-accent:#10283a; --bt-surface:#142b40; --bt-surface-raised:#1d3a53;
}
body[data-theme="midnight"] {
  --bt-text:#f0f3ff; --bt-muted:#cbd4ec; --bt-accent:#c8d5ff;
  --bt-accent-strong:#91a9ed; --bt-border:#ffffff2b;
  --bt-on-accent:#171d36; --bt-surface:#13192b; --bt-surface-raised:#1c2540;
}
body[data-theme="cloud"] {
  --bt-text:#30283a; --bt-muted:#62566d; --bt-accent:#76549b;
  --bt-accent-strong:#9a78bb; --bt-border:#57466b35;
  --bt-on-accent:#24152f; --bt-surface:#fffdfd; --bt-surface-raised:#eee7f5;
}
body[data-theme="peach"] {
  --bt-text:#402d27; --bt-muted:#70564c; --bt-accent:#a85c43;
  --bt-accent-strong:#c77b5d; --bt-border:#704b3a38;
  --bt-on-accent:#2c1712; --bt-surface:#fffaf5; --bt-surface-raised:#f8e5d8;
}
body[data-theme="matcha"] {
  --bt-text:#29382b; --bt-muted:#53664f; --bt-accent:#55764c;
  --bt-accent-strong:#78966b; --bt-border:#405b3d38;
  --bt-on-accent:#182519; --bt-surface:#fbfdf6; --bt-surface-raised:#e5edd9;
}

/* Semantic text roles across every world, dialog, form, menu and footer. */
html body[data-theme] {
  color:var(--bt-text);
  background-color:var(--bg);
  font-family:'DM Sans',Arial,sans-serif;
}
html body[data-theme] :is(
  h1,h2,h3,h4,h5,h6,p,li,label,small,strong,b,em,i,
  summary,figcaption,blockquote,dt,dd,time,legend,caption,
  .hero-text,.world-card p,.game-card p,.tool-card p,.comfort-panel p,
  .comfort-tool p,.hangout-card p,.diary-entry p,.entry-meta,
  .form-note,.empty-state,.theme-panel p,.footer,.muted,.hint,
  .help-text,.form-hint,.stat span,.stat small,.diary-form label,
  .modal label,.shop-item p,.feed-item small,.prompt-box p,
  .section-note,.shared-space-card p,.shared-spaces-intro-copy,
  .daily-challenge-copy p,.online-members-panel
) {
  color:var(--bt-text) !important;
  -webkit-text-fill-color:var(--bt-text) !important;
  opacity:1;
}
html body[data-theme] :is(
  .muted,.section-note,.footer,.hint,.help-text,.form-hint,.form-note,
  .empty-state,.entry-meta,.stat span,.stat small,.diary-form label,
  .modal label,.shop-item p,.feed-item small,.prompt-box p,
  .shared-spaces-intro-copy,.comfort-journal-footer
) {
  color:var(--bt-muted) !important;
  -webkit-text-fill-color:var(--bt-muted) !important;
}
html body[data-theme] :is(
  .eyebrow,.world-kicker,.world-card b,.tool-card strong,.feed-item b,
  .tiny-link,.entry-actions button,.brand-mark,.footer>span,
  .daily-challenge-reward,.daily-challenge-status
) {
  color:var(--bt-accent) !important;
  -webkit-text-fill-color:var(--bt-accent) !important;
}

/* Keep the display typography expressive and the reading typography calm. */
html body[data-theme] #home .hero h1,
html body[data-theme] #home .section-heading h2,
html body[data-theme] .world-card h3,
html body[data-theme] .game-card h3,
html body[data-theme] .comfort-panel h3,
html body[data-theme] .lounge-section > h3 {
  font-family:'Playfair Display',Georgia,serif;
  letter-spacing:-.025em;
}
html body[data-theme] #home .hero-text,
html body[data-theme] .world-card p,
html body[data-theme] .game-card p,
html body[data-theme] .tool-card p {
  font-family:'DM Sans',Arial,sans-serif;
  line-height:1.65;
}

/* Theme-aware cards and controls, retaining each world's decorative artwork. */
html body[data-theme] :is(
  .theme-panel,.shop-panel,.collection-panel,.achievements-panel,
  .settings-card,.settings-panel,.profile-card,.account-card,
  .section-card,.diary-form,.diary-list-panel,.hangout-card
) {
  color:var(--bt-text);
  border-color:var(--bt-border);
}
html body[data-theme] :is(
  .game-card,.tool-card,.stat,.world-card,.shop-item,.collection-pill,
  .chip,.kind-item,.theme-choice,.soft-btn,.secondary-btn,.choice-btn,
  .icon-btn,.collection-pill
) {
  color:var(--bt-text);
  border-color:var(--bt-border);
}
html body[data-theme] :is(input,textarea,select,option) {
  color:var(--bt-text) !important;
  -webkit-text-fill-color:var(--bt-text) !important;
  background-color:var(--bt-surface-raised) !important;
  border-color:var(--bt-border) !important;
}
html body[data-theme] :is(input,textarea,select)::placeholder {
  color:var(--bt-muted) !important;
  -webkit-text-fill-color:var(--bt-muted) !important;
  opacity:1 !important;
}
html body[data-theme] :is(button,.soft-btn,.secondary-btn,.choice-btn,.theme-choice,.icon-btn) {
  color:var(--bt-text);
  border-color:var(--bt-border);
}
html body[data-theme] :is(.primary-btn,.small-btn) {
  background:linear-gradient(125deg,var(--bt-accent-strong),var(--bt-accent)) !important;
  color:var(--bt-on-accent) !important;
  -webkit-text-fill-color:var(--bt-on-accent) !important;
  border:1px solid transparent;
  font-weight:800;
}
html body[data-theme] .theme-choice.active,
html body[data-theme] [aria-selected="true"] {
  border-color:var(--bt-accent) !important;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--bt-accent) 24%,transparent);
}
html body[data-theme] :is(.topbar,.subnav,.site-nav,.mobile-nav,.bottom-nav) {
  color:var(--bt-text) !important;
  background:color-mix(in srgb,var(--bt-surface) 94%,transparent) !important;
  border-color:var(--bt-border) !important;
}
html body[data-theme] :is(.topbar,.subnav,.site-nav,.mobile-nav,.bottom-nav) :is(a,button,span,strong,small) {
  color:var(--bt-text) !important;
  -webkit-text-fill-color:var(--bt-text) !important;
}
html body[data-theme] a:not(.primary-btn):not(.soft-btn):not(.world-card):not(.game-card):not(.tool-card) {
  color:var(--bt-accent);
}
html body[data-theme] :is(.section-heading h1,.section-heading h2,.section-heading h3) {
  color:var(--bt-text) !important;
  -webkit-text-fill-color:var(--bt-text) !important;
  opacity:1 !important;
}
html body[data-theme] :is(.section-heading .eyebrow,.section-heading .world-kicker) {
  color:var(--bt-accent) !important;
  -webkit-text-fill-color:var(--bt-accent) !important;
}
html body[data-theme] :is(.footer,.section-note,.form-note,.empty-state) { opacity:1 !important; }

/* Chat uses its own dark conversation surface in every site theme. */
html body[data-theme] #onlineTambayan .online-message-content,
html body[data-theme] #onlineTambayan .online-message-content * {
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}
html body[data-theme] #onlineTambayan .online-compose,
html body[data-theme] #onlineTambayan .online-compose input,
html body[data-theme] #onlineTambayan #onlineMessageInput {
  background:#171126 !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}
html body[data-theme] #onlineTambayan #onlineMessageInput::placeholder {
  color:#c9bddb !important;
  -webkit-text-fill-color:#c9bddb !important;
}



/* Mobile live chat: give the conversation and composer more room. */
@media (max-width: 760px) {
  html body #onlineTambayan {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  html body #onlineTambayan .online-room,
  html body #onlineTambayan .online-columns,
  html body #onlineTambayan .online-columns > .online-box {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  html body #onlineTambayan .online-columns > .online-box:first-child {
    padding: 14px !important;
  }
  html body #onlineTambayan .online-messages {
    height: min(64vh, 620px) !important;
    min-height: 420px !important;
    max-height: 620px !important;
    padding: 14px !important;
    gap: 12px !important;
    box-sizing: border-box !important;
  }
  html body #onlineTambayan .online-message {
    max-width: 96% !important;
    padding: 13px 15px !important;
    font-size: 16px !important;
    line-height: 1.55 !important;
  }
  html body #onlineTambayan .online-message-content {
    font-size: 16px !important;
    line-height: 1.55 !important;
  }
  html body #onlineTambayan .online-compose {
    display: flex !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 8px !important;
    margin-top: 12px !important;
    box-sizing: border-box !important;
    background: #171126 !important;
    border: 1px solid rgba(194,158,255,.28) !important;
    border-radius: 16px !important;
  }
  html body #onlineTambayan .online-compose input,
  html body #onlineTambayan #onlineMessageInput {
    flex: 1 1 auto !important;
    width: 0 !important;
    min-width: 0 !important;
    min-height: 58px !important;
    height: 58px !important;
    box-sizing: border-box !important;
    padding: 13px 14px !important;
    margin: 0 !important;
    background: #0f0b1c !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    font-size: 17px !important;
    line-height: 1.4 !important;
    opacity: 1 !important;
  }
  html body #onlineTambayan .online-compose input::placeholder,
  html body #onlineTambayan #onlineMessageInput::placeholder {
    color: #c9bddb !important;
    -webkit-text-fill-color: #c9bddb !important;
    opacity: 1 !important;
  }
  html body #onlineTambayan .online-compose button {
    min-height: 58px !important;
    flex-shrink: 0 !important;
    font-size: 15px !important;
    padding: 10px 13px !important;
  }
}


/* Dark-theme contrast repairs for the specific areas reported by members.
   Keep each world's colors and artwork; only strengthen text contrast. */
html body:is([data-theme="violet"],[data-theme="rose"],[data-theme="ocean"],[data-theme="midnight"]) {
  --bt-text:#ffffff;
  --bt-muted:#eee6fa;
}
html body:is([data-theme="violet"],[data-theme="rose"],[data-theme="ocean"],[data-theme="midnight"]) #onlineTambayan :is(
  .section-heading h2,.section-note,.online-panel h3,.online-box h3,
  #onlineAccountBox strong,#onlineMyRoomsBox p,.online-grid label,
  .online-muted,.online-status,.online-notification-settings span
) {
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  opacity:1 !important;
}
html body:is([data-theme="violet"],[data-theme="rose"],[data-theme="ocean"],[data-theme="midnight"]) #onlineTambayan :is(
  .online-muted,.online-status,.online-notification-settings span
) {
  color:#e6ddf4 !important;
  -webkit-text-fill-color:#e6ddf4 !important;
}
html body:is([data-theme="violet"],[data-theme="rose"],[data-theme="ocean"],[data-theme="midnight"]) #home :is(
  .attic-drawer strong,.attic-drawer small,
  .garden-landscape-copy,.garden-landscape-copy *,
  .garden-paths-heading,.garden-paths-heading *,
  .garden-spot,.garden-spot *,
  .garden-path-toggle,.garden-path-button,.garden-path-button *,
  .shop-panel,.shop-panel *, .collection-panel,.collection-panel *
) {
  opacity:1 !important;
}
html body:is([data-theme="violet"],[data-theme="rose"],[data-theme="ocean"],[data-theme="midnight"]) #home :is(
  .attic-drawer strong,.garden-landscape-copy strong,.garden-paths-heading h4,
  .garden-spot strong,.garden-path-button strong,
  .shop-panel h3,.collection-panel h3,.shop-item strong,.shop-item h4
) {
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}
html body:is([data-theme="violet"],[data-theme="rose"],[data-theme="ocean"],[data-theme="midnight"]) #home :is(
  .attic-drawer small,.garden-landscape-copy > span,
  .garden-spot small,.garden-path-button small,
  .shop-season-note,.shop-item p,.collection-panel p
) {
  color:#eee6fa !important;
  -webkit-text-fill-color:#eee6fa !important;
}


/* FINAL ACCESSIBILITY PASS — readable text in every theme.
   Light palettes use deep ink; dark palettes use clean white. Headings never
   inherit low-opacity decorative/accent colors. World artwork is untouched. */
html body[data-theme="violet"],
html body[data-theme="rose"],
html body[data-theme="ocean"],
html body[data-theme="midnight"]{--bt-text:#ffffff;--bt-muted:#eee6fa}
html body[data-theme="cloud"],
html body[data-theme="peach"],
html body[data-theme="matcha"]{--bt-text:#292431;--bt-muted:#514958}
html body[data-theme] :is(
  h1,h2,h3,h4,h5,h6,.section-heading,.section-heading h1,.section-heading h2,
  .section-heading h3,.world-card h3,.game-card h3,.tool-card h3,
  .diary-room h4,.attic-drawer strong,.garden-paths-heading h4,
  .garden-landscape-copy strong,#onlineTambayan h2,#onlineTambayan h3,
  #onlineAccountBox strong
){
  color:var(--bt-text)!important;-webkit-text-fill-color:var(--bt-text)!important;
  opacity:1!important;text-shadow:none!important
}
html body[data-theme] :is(
  p,li,label,small,summary,figcaption,blockquote,.hero-text,.section-note,
  .world-card p,.game-card p,.tool-card p,.diary-room p,.attic-drawer small,
  .garden-intro,.garden-landscape-copy>span,.garden-spot small,
  .garden-path-button small,.shop-season-note,.online-muted,.online-status,
  .online-notification-settings span,.shared-spaces-intro-copy,.footer
){
  color:var(--bt-muted)!important;-webkit-text-fill-color:var(--bt-muted)!important;
  opacity:1!important
}
html body[data-theme] :is(.eyebrow,.world-kicker,.garden-kicker){
  color:var(--bt-text)!important;-webkit-text-fill-color:var(--bt-text)!important;
  opacity:1!important
}
html body[data-theme] #onlineTambayan :is(
  h2,h3,p,small,label,strong,.online-muted,.online-status,#onlineAccountEmailDisplay
){
  color:var(--bt-text)!important;-webkit-text-fill-color:var(--bt-text)!important;
  opacity:1!important
}
html body[data-theme] #onlineTambayan :is(.online-muted,.online-status){
  color:var(--bt-muted)!important;-webkit-text-fill-color:var(--bt-muted)!important
}
html body[data-theme] #onlineTambayan .online-message-content,
html body[data-theme] #onlineTambayan .online-message-content *{
  color:#fff!important;-webkit-text-fill-color:#fff!important
}


/* OCEAN THEME — distinct aqua typography for the collection, personalization,
   and achievements sections. Keep readable body copy softer than headings. */
html body[data-theme="ocean"] #home .collection-panel h3,
html body[data-theme="ocean"] #home .theme-panel h3,
html body[data-theme="ocean"] #home .achievements-panel h3,
html body[data-theme="ocean"] #home .collection-panel .eyebrow,
html body[data-theme="ocean"] #home .theme-panel .eyebrow,
html body[data-theme="ocean"] #home .achievements-panel .eyebrow {
  color:#a9e5ff!important;
  -webkit-text-fill-color:#a9e5ff!important;
  text-shadow:0 0 14px rgba(91,190,235,.16);
}
html body[data-theme="ocean"] #home .collection-panel :is(p,small,span,li),
html body[data-theme="ocean"] #home .theme-panel :is(p,small,span,label),
html body[data-theme="ocean"] #home .achievements-panel :is(p,small,span,li) {
  color:#c5d9e8!important;
  -webkit-text-fill-color:#c5d9e8!important;
}
html body[data-theme="ocean"] #home .collection-panel .shop-item strong,
html body[data-theme="ocean"] #home .collection-panel .earned-badge b,
html body[data-theme="ocean"] #home .collection-panel .collection-pill,
html body[data-theme="ocean"] #home .achievements-panel .chip {
  color:#e4f6ff!important;
  -webkit-text-fill-color:#e4f6ff!important;
}


/* Ocean theme: section titles sit OUTSIDE their content panels, so style the
   adjacent headings as well as the panels themselves. */
html body[data-theme="ocean"] #home > .section-heading:has(+ .panel.collection-panel) h2,
html body[data-theme="ocean"] #home > .section-heading:has(+ .panel.theme-panel) h2,
html body[data-theme="ocean"] #home > .section-heading:has(+ .panel.achievements-panel) h2 {
  color:#a9e5ff!important;
  -webkit-text-fill-color:#a9e5ff!important;
  text-shadow:0 0 16px rgba(91,190,235,.2)!important;
}
html body[data-theme="ocean"] #home > .section-heading:has(+ .panel.collection-panel) .eyebrow,
html body[data-theme="ocean"] #home > .section-heading:has(+ .panel.theme-panel) .eyebrow,
html body[data-theme="ocean"] #home > .section-heading:has(+ .panel.achievements-panel) .eyebrow {
  color:#70c9ef!important;
  -webkit-text-fill-color:#70c9ef!important;
}
html body[data-theme="ocean"] #home .collection-panel h3,
html body[data-theme="ocean"] #home .theme-panel h3,
html body[data-theme="ocean"] #home .achievements-panel h3 {
  color:#a9e5ff!important;
  -webkit-text-fill-color:#a9e5ff!important;
}


/* Cosmic Frontier: readable ocean-theme typography (keeps the space artwork intact). */
body[data-theme="ocean"] #cosmicFrontier{
  --cf-text:#e8f7ff;
  --cf-muted:#bfd8e8;
  --cf-blue:#9fe3ff;
  --cf-violet:#a8cfff;
}
body[data-theme="ocean"] #cosmicFrontier :is(h1,h2,h3,h4,h5,h6){
  color:#a9e1ff!important;
  -webkit-text-fill-color:#a9e1ff!important;
  text-shadow:0 0 16px #398eb955;
}
body[data-theme="ocean"] #cosmicFrontier :is(p,li,label,.cosmic-briefing-foot,.cosmic-selection-status,.cosmic-footer){
  color:#c5ddec!important;
  -webkit-text-fill-color:#c5ddec!important;
}
body[data-theme="ocean"] #cosmicFrontier :is(.cosmic-kicker,.cosmic-planet-tag,.cosmic-destination-count,.cosmic-label){
  color:#8edcff!important;
  -webkit-text-fill-color:#8edcff!important;
}
body[data-theme="ocean"] #cosmicFrontier :is(.cosmic-hero-stats small,.cosmic-window small,.cosmic-planet-card small,.cosmic-find small,.cosmic-log-entry small,.cosmic-progress-card small,.cosmic-log-heading>span){
  color:#b5d2e5!important;
  -webkit-text-fill-color:#b5d2e5!important;
}
body[data-theme="ocean"] #cosmicFrontier :is(.cosmic-command h3,.cosmic-section-heading h3,.cosmic-briefing h4,.cosmic-log-heading h4){
  color:#a9e1ff!important;
  -webkit-text-fill-color:#a9e1ff!important;
}
body[data-theme="ocean"] #cosmicFrontier .cosmic-hero h2{
  color:#d0f1ff!important;
  -webkit-text-fill-color:#d0f1ff!important;
}
body[data-theme="ocean"] #cosmicFrontier :is(.cosmic-planet-card,.cosmic-find,.cosmic-back,.cosmic-action-button){
  color:#e2f5ff!important;
  -webkit-text-fill-color:#e2f5ff!important;
}
body[data-theme="ocean"] #cosmicFrontier :is(.cosmic-planet-card b,.cosmic-inventory-items b,.cosmic-log-entry>b){
  color:#9fe3ff!important;
  -webkit-text-fill-color:#9fe3ff!important;
}
