/*
Theme Name: Crowns & Realms
Theme URI: https://crownsandrealms.com/
Description: Field manuals for Crowns & Realms. Parchment, oak, and bronze, like the game.
Version: 1.0.0
Author: Crowns & Realms
Text Domain: crowns-realms
*/

:root {
  --parch: #e9dcbe;
  --parch-2: #ddcaa4;
  --ink: #2e2114;
  --ink-soft: #4c3a24;
  --oak: #3b2a17;
  --oak-2: #56401f;
  --bronze: #8a6a35;
  --bronze-lt: #c9a55a;
  --gold: #c9a227;
  --gold-lt: #e8cf7a;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body.manual-body {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, #3a2c1a 0%, transparent 60%),
    repeating-linear-gradient(45deg, #241a0e 0 2px, #221809 2px 6px),
    #221809;
  min-height: 100vh;
}
a { color: #5a3e12; }
img { max-width: 100%; height: auto; }

.cr-wrap { max-width: 980px; margin: 0 auto; padding: 18px 16px 48px; }

.cr-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 14px;
}
.cr-brand {
  display: flex; align-items: center; gap: 12px;
  color: #f3e7c9; text-decoration: none;
}
.cr-brand img {
  width: 56px; height: 56px; border-radius: 8px;
  border: 2px solid var(--bronze); background: #1c1409;
}
.cr-brand strong {
  display: block; letter-spacing: .14em; font-size: 1.15rem; font-weight: normal;
  color: #f6edd4;
}
.cr-brand em {
  display: block; margin-top: 2px; font-size: .9rem; color: #c9a55a;
}
.cr-enter {
  display: inline-block; padding: 8px 14px;
  color: #fff5dc !important; text-decoration: none !important;
  background: linear-gradient(180deg, #b08d3c, #8a6a25 60%, #6e541c);
  border: 1px solid #e8cf7a; border-radius: 6px;
  letter-spacing: .04em; font-size: .88rem;
  box-shadow: inset 0 1px 0 rgba(255,230,170,.25);
}
.cr-enter:hover { filter: brightness(1.08); }

.codex-nav { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 auto 16px; }
.codex-kicker {
  font-size: .68rem; letter-spacing: .28em; text-transform: uppercase; color: #e8cf7a;
}
.codex-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.codex-link {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  min-width: 7.2rem; padding: 8px 14px 9px;
  background:
    linear-gradient(180deg, rgba(255,220,150,.12), rgba(0,0,0,.28)),
    linear-gradient(180deg, #56401f, #3b2a17 70%, #291d0e);
  border: 1px solid #c9a55a; border-radius: 6px;
  color: #f1e3bb !important; text-decoration: none !important;
  font-size: .82rem; letter-spacing: .04em;
  box-shadow: inset 0 1px 0 rgba(255,230,170,.2), 0 2px 6px rgba(0,0,0,.4);
}
.codex-link:hover, .codex-link.on {
  color: #fff8dc !important; border-color: #e8cf7a;
  background:
    linear-gradient(180deg, rgba(255,230,160,.22), rgba(0,0,0,.2)),
    linear-gradient(180deg, #6a5028, #43301a 70%, #2c1f10);
}
.codex-i {
  width: 14px; height: 14px; display: inline-block; background: currentColor;
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat;
}
.codex-i-scroll { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M3 2h8a2 2 0 012 2v9H5a2 2 0 01-2-2V2zm2 2v8h7V4H5z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M3 2h8a2 2 0 012 2v9H5a2 2 0 01-2-2V2zm2 2v8h7V4H5z'/></svg>"); }
.codex-i-swords { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M2 2l5 5-1.5 1.5L2 4.5 2 2zm12 0v2.5L10.5 8.5 9 7l5-5zM6.5 9.5L4 14h2l2-3 3 3h2l-3.5-4.5L8 11z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M2 2l5 5-1.5 1.5L2 4.5 2 2zm12 0v2.5L10.5 8.5 9 7l5-5zM6.5 9.5L4 14h2l2-3 3 3h2l-3.5-4.5L8 11z'/></svg>"); }
.codex-i-star { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M8 1l1.8 4.6L15 6.2l-3.5 3.2L12.4 15 8 12.6 3.6 15l.9-5.6L1 6.2l5.2-.6z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M8 1l1.8 4.6L15 6.2l-3.5 3.2L12.4 15 8 12.6 3.6 15l.9-5.6L1 6.2l5.2-.6z'/></svg>"); }
.codex-i-folk { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M8 2a2.5 2.5 0 110 5 2.5 2.5 0 010-5zM3 14c0-3 2.2-5 5-5s5 2 5 5H3z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M8 2a2.5 2.5 0 110 5 2.5 2.5 0 010-5zM3 14c0-3 2.2-5 5-5s5 2 5 5H3z'/></svg>"); }
.codex-i-banner { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M3 1h2v14H3V1zm3 1h8l-2 3 2 3H6V2z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M3 1h2v14H3V1zm3 1h8l-2 3 2 3H6V2z'/></svg>"); }
.codex-i-map { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M1 3l5-1 4 1 5-1v11l-5 1-4-1-5 1V3zm5 0v10l4 1V4L6 3z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M1 3l5-1 4 1 5-1v11l-5 1-4-1-5 1V3zm5 0v10l4 1V4L6 3z'/></svg>"); }
.codex-i-scales { -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M8 1h1v2h4l-2 4a3 3 0 01-6 0L3 3h4V1h1zM2 14h12v1H2v-1zm5-1h2V8H7v5z'/></svg>"); mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='black' d='M8 1h1v2h4l-2 4a3 3 0 01-6 0L3 3h4V1h1zM2 14h12v1H2v-1zm5-1h2V8H7v5z'/></svg>"); }

.manual-wrap { max-width: 920px; margin: 0 auto; }
.manual-card {
  background: linear-gradient(180deg, #e9dcbe, #ddcaa4);
  border: 2px solid #1d140a; border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
  padding: 22px 26px 32px; color: #2e2114;
}
.manual-card h1 {
  margin: 0 0 6px; font-size: 1.55rem; letter-spacing: .08em;
  text-transform: uppercase; color: #3b2a17; font-weight: normal;
}
.manual-card .lede { font-style: italic; color: #4c3a24; margin: 0 0 18px; }
.manual-card h2 {
  font-size: 1.15rem; margin: 1.4em 0 .5em; border-bottom: 1px solid #c9a55a; padding-bottom: 4px;
  font-weight: normal;
}
.manual-card h3 { font-size: 1rem; margin: 1em 0 .35em; }
.manual-card p, .manual-card li { line-height: 1.45; }
.manual-card table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: .6em 0 1em; }
.manual-card th, .manual-card td { border: 1px solid #c4ad7a; padding: 5px 7px; text-align: left; vertical-align: top; }
.manual-card th { background: #d3bd91; }
.manual-card tr:nth-child(even) td { background: rgba(255,255,255,.25); }
.note { background: #efe3c4; border-left: 4px solid #8a6a35; padding: 8px 12px; margin: 12px 0; }
.muted { color: #5a4a32; font-size: .88rem; }
.manual-card table { display: block; overflow-x: auto; }

.cr-foot { text-align: center; color: #8a744d; font-size: .78rem; margin-top: 18px; }
.cr-foot p { margin: 8px 0 0; font-style: italic; }
.cr-legal { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin-top: 8px; }
.cr-legal a, .cr-legal button {
  color: #c9a55a; background: none; border: 0; padding: 0;
  font: inherit; cursor: pointer; text-decoration: underline;
}

.cr-consent {
  position: fixed; z-index: 10000; left: 16px; right: 16px; bottom: 16px;
  max-width: 720px; margin: 0 auto; max-height: 70vh; overflow: auto;
  background: linear-gradient(180deg, #e9dcbe, #ddcaa4);
  border: 2px solid #1d140a; border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
  padding: 14px 16px 16px; color: #2e2114;
  font-family: Georgia, "Palatino Linotype", serif; font-size: .92rem;
}
.cr-consent[hidden] { display: none !important; }
.cr-consent p { margin: 0 0 8px; line-height: 1.4; }
.cr-consent-links a { color: #5a3e12; }
.cr-consent-actions, .cr-consent-settings { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cr-consent button {
  font: inherit; cursor: pointer; color: #f3e7c9;
  background: linear-gradient(180deg, #7c5c2c, #55401e 60%, #443316);
  border: 1px solid #c9a55a; border-radius: 6px; padding: 7px 12px;
}
.cr-consent button.primary {
  background: linear-gradient(180deg, #b08d3c, #8a6a25 60%, #6e541c); color: #fff5dc;
}
.cr-consent-settings { margin-top: 10px; }
.cr-consent-settings[hidden] { display: none !important; }
.cr-consent-settings label { display: flex; gap: 8px; align-items: flex-start; flex: 1 1 240px; }

@media (max-width: 640px) {
  .cr-banner { flex-direction: column; align-items: flex-start; }
  .codex-link { min-width: 0; padding: 7px 10px; font-size: .75rem; }
  .manual-card { padding: 16px 14px 22px; }
  .cr-brand strong { letter-spacing: .08em; font-size: 1rem; }
}
