/* Crown & Ember / BASIC ATS 3.11.79 — global readability and combat-food UI */
:root{
  --read-text:#f3f6f8;
  --read-body:#d3dbe3;
  --read-muted:#b2bec9;
  --read-faint:#94a4b4;
  --read-gold:#f0ca72;
  --read-green:#65df98;
  --read-red:#f08a8f;
}

/* Site-wide dark-theme readability. Keep buttons/badges/status colors intact. */
body{color:var(--read-text)}
body:not(.game-authenticated) p,
body:not(.game-authenticated) li,
body:not(.game-authenticated) dd{color:var(--read-body)}
body:not(.game-authenticated) .muted,
body:not(.game-authenticated) .help,
body:not(.game-authenticated) .notice,
body:not(.game-authenticated) .pkg-note,
body:not(.game-authenticated) .source-note,
body:not(.game-authenticated) .download-sub,
body:not(.game-authenticated) small{color:var(--read-muted)}
body:not(.game-authenticated) h1,
body:not(.game-authenticated) h2,
body:not(.game-authenticated) h3,
body:not(.game-authenticated) h4,
body:not(.game-authenticated) h5,
body:not(.game-authenticated) h6,
body:not(.game-authenticated) strong{color:var(--read-text)}

/* Server manager uses its own inline theme, so lift only its secondary copy. */
body .setting-name small,
body .server-title p,
body .monitor-head p,
body .console-head span,
body .stateText{color:#b8c2c9}

/* Crown & Ember: all old parchment/dark-brown copy is converted to the new dark UI palette. */
body.game-authenticated #game-panel p,
body.game-authenticated #game-panel li,
body.game-authenticated #game-panel dd,
body.game-authenticated #game-panel .game-book-detail-page span,
body.game-authenticated #game-panel .game-book-detail-page small,
body.game-authenticated #game-panel .game-guide-info-block span,
body.game-authenticated #game-panel .game-guide-info-block small,
body.game-authenticated #game-panel .game-help-book span,
body.game-authenticated #game-panel .game-help-book small,
body.game-authenticated #game-panel .game-adventure-parchment span,
body.game-authenticated #game-panel .game-adventure-parchment small,
body.game-authenticated #game-panel .game-realm-book span,
body.game-authenticated #game-panel .game-realm-book small,
body.game-authenticated #game-panel .game-universal-guidebook span,
body.game-authenticated #game-panel .game-universal-guidebook small,
body.game-authenticated #game-panel .game-items-trade-guidebook span,
body.game-authenticated #game-panel .game-items-trade-guidebook small,
body.game-authenticated #game-panel .game-shop-book span,
body.game-authenticated #game-panel .game-shop-book small{
  color:var(--read-body)!important;
}
body.game-authenticated #game-panel small,
body.game-authenticated #game-panel .game-panel-head p,
body.game-authenticated #game-panel .game-book-recipe-row p,
body.game-authenticated #game-panel .game-book-recipe-row small,
body.game-authenticated #game-panel .game-item small,
body.game-authenticated #game-panel .game-monster small{
  color:var(--read-muted)!important;
}
body.game-authenticated #game-panel h1,
body.game-authenticated #game-panel h2,
body.game-authenticated #game-panel h3,
body.game-authenticated #game-panel h4,
body.game-authenticated #game-panel h5,
body.game-authenticated #game-panel h6,
body.game-authenticated #game-panel .game-book-detail-page b,
body.game-authenticated #game-panel .game-book-detail-page strong,
body.game-authenticated #game-panel .game-guide-info-block b,
body.game-authenticated #game-panel .game-guide-info-block strong,
body.game-authenticated #game-panel .game-help-book b,
body.game-authenticated #game-panel .game-help-book strong,
body.game-authenticated #game-panel .game-adventure-parchment b,
body.game-authenticated #game-panel .game-adventure-parchment strong,
body.game-authenticated #game-panel .game-realm-book b,
body.game-authenticated #game-panel .game-realm-book strong{
  color:var(--read-text)!important;
  text-shadow:none!important;
}

/* Recipe / crafting details that were especially hard to read. */
body.game-authenticated .game-book-detail-head p{color:#d5dde5!important}
body.game-authenticated .game-book-detail-columns>section>h4,
body.game-authenticated .game-guide-info-block>h4,
body.game-authenticated .game-book-craft-row small,
body.game-authenticated .game-book-mastery-note b,
body.game-authenticated .game-book-stat-list em,
body.game-authenticated .game-book-row-mastery b,
body.game-authenticated .game-book-row-mastery strong{
  color:var(--read-gold)!important;
}
body.game-authenticated .game-book-material b,
body.game-authenticated .game-book-material span,
body.game-authenticated .game-book-craft-row b,
body.game-authenticated .game-book-craft-row span,
body.game-authenticated .game-book-mastery-note span,
body.game-authenticated .game-guide-steps strong,
body.game-authenticated .game-guide-steps p,
body.game-authenticated .game-guide-material-source>span b,
body.game-authenticated .game-guide-material-source>span small,
body.game-authenticated .game-guide-subsection>b,
body.game-authenticated .game-guide-loot-use>b,
body.game-authenticated .game-guide-objective-help div>b,
body.game-authenticated .game-guide-objective-help div>small{
  color:var(--read-body)!important;
}
body.game-authenticated .game-book-material strong,
body.game-authenticated .game-craft-status-ready,
body.game-authenticated .game-food-status-ready,
body.game-authenticated .ready{color:var(--read-green)!important}
body.game-authenticated .game-book-material.short strong,
body.game-authenticated .short,
body.game-authenticated .bad{color:var(--read-red)!important}
body.game-authenticated .game-book-mastery-note,
body.game-authenticated .game-guide-info-block,
body.game-authenticated .game-guide-material-source,
body.game-authenticated .game-guide-objective-help{
  background:#263442!important;
  border-color:#46586b!important;
}
body.game-authenticated .game-guide-info-block>h4{
  background:#4b341b!important;
  border:1px solid #6d552b!important;
}
body.game-authenticated .game-guide-steps>li>b{
  background:#7a541f!important;
  color:#fff2c8!important;
  border:1px solid #a8782c!important;
}
body.game-authenticated .game-book-stat-list,
body.game-authenticated .game-book-stat-list span{border-color:#435466!important}

/* Forms and table copy */
body.game-authenticated #game-panel input,
body.game-authenticated #game-panel select,
body.game-authenticated #game-panel textarea{color:#f4f7f9!important}
body.game-authenticated #game-panel option{color:#f4f7f9;background:#18212b}
body.game-authenticated #game-panel table td{color:#dce3ea!important}
body.game-authenticated #game-panel table th{color:#f2f5f7!important}

/* 3.11.79 equipped-food + auto-use control */
body.game-authenticated .game-combat-support-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  align-items:stretch;
}
body.game-authenticated .game-food-control{display:grid!important;gap:10px!important;align-content:start}
body.game-authenticated .game-food-equipped{display:grid;grid-template-columns:52px minmax(0,1fr);gap:10px;align-items:center}
body.game-authenticated .game-food-equipped-icon{width:52px;height:52px;display:grid;place-items:center;border:1px solid #52657a;border-radius:4px;background:#101820;overflow:hidden;color:#8fa1b3;font-size:24px;font-weight:900}
body.game-authenticated .game-food-art{width:48px;height:48px;object-fit:contain!important}
body.game-authenticated .game-food-equipped>div:last-child{display:grid;gap:2px;min-width:0}
body.game-authenticated .game-food-equipped>div:last-child>b{font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:#91a6b8!important}
body.game-authenticated .game-food-equipped strong{font-size:14px;color:#fff!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.game-authenticated .game-food-equipped span{font-size:10px;color:#c2ced9!important;line-height:1.35}
body.game-authenticated .game-food-actions{display:flex;gap:6px;flex-wrap:wrap}
body.game-authenticated .game-food-picker{display:grid;grid-template-columns:1fr 1fr;gap:6px;max-height:185px;overflow:auto;padding-right:2px}
body.game-authenticated .game-food-choice{display:grid;grid-template-columns:34px minmax(0,1fr);gap:7px;align-items:center;border:1px solid #435365;border-radius:4px;background:#18232e;color:#edf3f8;padding:6px;text-align:left;cursor:pointer}
body.game-authenticated .game-food-choice:hover{border-color:#6685a3;background:#21303e}
body.game-authenticated .game-food-choice.active{border-color:#d1a34b;background:#3b3425;box-shadow:inset 0 0 0 1px rgba(235,192,98,.18)}
body.game-authenticated .game-food-choice-art{width:32px;height:32px;object-fit:contain!important}
body.game-authenticated .game-food-choice span{display:grid;gap:1px;min-width:0}
body.game-authenticated .game-food-choice b{font-size:10px;color:#f5f7f9!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.game-authenticated .game-food-choice small{font-size:8px;color:#b7c4d0!important}
body.game-authenticated .game-food-empty{grid-column:1/-1;padding:10px;border:1px dashed #49596a;border-radius:4px;color:#aebbc7!important;font-size:10px}
body.game-authenticated .game-auto-eat-control{display:grid!important;align-content:start;gap:12px!important}
body.game-authenticated .game-auto-eat-toggle{display:flex;align-items:center;gap:9px;width:max-content;max-width:100%;cursor:pointer;user-select:none}
body.game-authenticated .game-auto-eat-toggle input{position:absolute;opacity:0;pointer-events:none}
body.game-authenticated .game-auto-eat-toggle i{position:relative;width:42px;height:22px;flex:0 0 42px;border-radius:999px;background:#3d4752;border:1px solid #566574;transition:.15s}
body.game-authenticated .game-auto-eat-toggle i:after{content:'';position:absolute;width:16px;height:16px;left:2px;top:2px;border-radius:50%;background:#e6edf3;transition:.15s}
body.game-authenticated .game-auto-eat-toggle.on i{background:#28744b;border-color:#54c47e}
body.game-authenticated .game-auto-eat-toggle.on i:after{transform:translateX(20px);background:#dffff0}
body.game-authenticated .game-auto-eat-toggle>span{font-size:10px;font-weight:900;letter-spacing:.07em;color:#dce5ed!important}
body.game-authenticated .game-auto-eat-toggle.disabled{opacity:.48;cursor:not-allowed}
body.game-authenticated .game-auto-eat-note{display:block;color:#e6b86a!important;font-size:9px!important;line-height:1.35}

@media(max-width:1250px){
  body.game-authenticated .game-combat-support-grid{grid-template-columns:1fr 1fr!important}
  body.game-authenticated .game-food-control{grid-column:1/-1}
}
@media(max-width:760px){
  body.game-authenticated .game-combat-support-grid{grid-template-columns:1fr!important}
  body.game-authenticated .game-food-control{grid-column:auto}
  body.game-authenticated .game-food-picker{grid-template-columns:1fr}
}
