/* ===========================================================================
   The Emberwake Accords: "The Guild Board". The wanted posters pinned to a
   board (they straighten when you point at them), the quests as parchment
   notices, the session count as a wax seal, standing as meters. A poster
   opens its character's file (ewa.js); the files sit hidden on the page.
   =========================================================================== */

.wp-site-blocks:has(> .wam-page.wam-ewa) { background: #1c0f0a; }
.wam-page.wam-ewa {
  --ewa-wood: #1c0f0a;
  --ewa-ember: #ff6a00;
  --ewa-ember-2: #ffb27a;
  --ewa-parch: #efe0c4;
  --ewa-ink: #2a170e;
  --ewa-board: #5a3a26;
  position: relative;
  isolation: isolate;
  padding-bottom: clamp(64px, 8vw, 100px);
  background: radial-gradient(1000px 500px at 50% -5%, rgba(255, 106, 0, 0.28), transparent 70%), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0 2px, transparent 2px 120px), var(--ewa-wood);
  color: var(--wam-white);
}
.wam-ewa .wp-block-group > *, .wam-ewa .wp-block-image { margin-block: 0; }
.wam-ewa p { margin: 0; }
.wam-ewa img { max-width: 100%; height: auto; }
.wam-ewa .wam-ewa-h1, .wam-ewa .wam-ewa-h2, .wam-ewa-file-name, .wam-ewa .ewa-quest-title { font-family: "Cinzel", Georgia, serif; }
.wam-ewa-wrap { max-width: 1200px; margin-inline: auto; padding-inline: 24px; }
.wam-ewa .wam-ewa-eyebrow { color: var(--ewa-ember-2); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }

/* Hero */
.wam-ewa-hero { position: relative; overflow: hidden; }
.wam-ewa .wam-ewa-banner img { display: block; width: 100%; height: 320px; object-fit: cover; opacity: 0.45; -webkit-mask: linear-gradient(#000 40%, transparent); mask: linear-gradient(#000 40%, transparent); }
.wam-ewa-hero-in { position: relative; max-width: 1200px; margin: -210px auto 0; padding-inline: 24px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; align-items: end; animation: wam-rise 0.8s var(--wam-ease) both; }
.wam-ewa .wam-ewa-logo img { display: block; width: 150px; filter: drop-shadow(0 10px 30px rgba(255, 106, 0, 0.5)); }
.wam-ewa-id { display: grid; gap: 8px; justify-items: start; }
.wam-ewa .wam-ewa-h1 { margin: 0; color: var(--wam-white); font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; line-height: 1; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.7); text-wrap: balance; }
.wam-ewa-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.wam-ewa .wam-ewa-tag { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); font-size: 0.8rem; font-weight: 700; }
.wam-ewa-link p, .wam-ewa-link .wp-block-paragraph { margin: 0; text-align: left !important; }
.wam-ewa-link a { color: var(--wam-gold); }
.wam-ewa-link:not(:has(a)) { display: none; }
.wam-ewa-seal { display: grid; place-content: center; width: 132px; height: 132px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c0392b, #6b0f0f 70%); box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.25), inset 0 0 0 9px rgba(255, 180, 120, 0.25), 0 14px 30px rgba(0, 0, 0, 0.5); text-align: center; transform: rotate(-8deg); }
.wam-ewa .wam-ewa-seal-label { color: #ffd6b0; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.wam-ewa .wam-ewa-seal-num { font-size: 2.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }

/* Board and rail */
.wam-ewa-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; margin-top: 40px; }
.wam-ewa-board { padding: 30px 24px; border-radius: 22px; background: linear-gradient(135deg, #3a2417, #2a170e); box-shadow: inset 0 0 0 3px var(--ewa-board), inset 0 0 50px rgba(0, 0, 0, 0.6), 0 30px 60px rgba(0, 0, 0, 0.5); }
.wam-ewa .wam-ewa-h2 { margin: 0 0 18px; color: var(--wam-white); font-size: 1.5rem; font-weight: 700; }
.wam-ewa-posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 30px 20px; }
.wam-ewa-poster { --r: -2deg; position: relative; display: grid; gap: 4px; justify-items: center; transform: rotate(var(--r)); transition: transform 0.35s var(--wam-spring); }
.wam-ewa-poster:nth-child(3n+2) { --r: 2.5deg; }
.wam-ewa-poster:nth-child(3n) { --r: -1deg; }
.wam-ewa-poster:hover, .wam-ewa-poster:focus-within { transform: rotate(0) translateY(-6px) scale(1.04); z-index: 2; }
.wam-ewa-poster::before { content: ""; position: absolute; top: -8px; left: 50%; z-index: 2; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffdf8a, #b07a10); box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6); }
.wam-ewa .wam-ewa-poster-art { width: 100%; }
.wam-ewa .wam-ewa-poster-art a { display: block; border-radius: 6px; }
.wam-ewa .wam-ewa-poster-art img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; box-shadow: 0 14px 26px rgba(0, 0, 0, 0.55); }
.wam-ewa .wam-ewa-poster-art a:focus-visible { outline: 2px solid var(--wam-gold); outline-offset: 4px; }
.wam-ewa .wam-ewa-poster-name { margin-top: 6px; font-size: 0.95rem; font-weight: 800; text-align: center; }
.wam-ewa-poster-player, .wam-ewa-file-player { display: flex; align-items: center; justify-content: center; gap: 7px; }
.wam-ewa .wam-ewa-poster-who { color: #e8c8a8; font-size: 0.8rem; }
.wam-ewa .wam-ewa-face, .wam-ewa-modal .wam-ewa-face { flex: none; width: 24px; }
.wam-ewa .wam-ewa-face img, .wam-ewa-modal .wam-ewa-face img { display: block; width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

.wam-ewa-rail { display: grid; gap: 22px; }
.wam-ewa-quests { display: grid; gap: 12px; }
/* Quest notices ([wam_ewa_quests]): pinned parchment. */
.wam-ewa-notices { display: grid; gap: 22px; padding-top: 8px; }
.wam-ewa-notice { position: relative; display: grid; gap: 8px; padding: 22px 20px 18px; border-radius: 6px; background: var(--ewa-parch); color: var(--ewa-ink); box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5); transform: rotate(1.2deg); }
.wam-ewa-notice:nth-child(even) { transform: rotate(-1deg); }
.wam-ewa-notice::before { content: ""; position: absolute; top: -8px; left: 24px; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8a8a, #8b0000); box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5); }
.wam-ewa .wam-ewa-notice-label { color: #8b0000; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.wam-ewa .wam-ewa-notice-title { margin: 0; color: var(--ewa-ink); font: 700 1.35rem/1.15 "Cinzel", Georgia, serif; }
.wam-ewa .wam-ewa-notice-prev { color: #6b3f22; font-size: 0.82rem; }
.wam-ewa .wam-ewa-notice-body { font-size: 0.95rem; line-height: 1.55; }
.wam-ewa .wam-ewa-notice-rewards { margin: 0; padding: 0; list-style: none; color: #8b2a00; font-weight: 700; }
.wam-ewa .wam-ewa-notice-rewards li::before { content: "+ "; }
.wam-ewa .wam-ewa-notice-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin: 0; padding-top: 10px; border-top: 1px dashed rgba(42, 23, 14, 0.3); font-size: 0.84rem; }
.wam-ewa .wam-ewa-notice-facts dt { font-weight: 800; }
.wam-ewa .wam-ewa-notice-facts dd { margin: 0; }
.wam-ewa .wam-ewa-quiet { color: rgba(255, 255, 255, 0.56); font-style: italic; }

.wam-ewa-standing { padding: 20px; border-radius: 18px; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px rgba(255, 180, 120, 0.18); }
.wam-ewa-standing .wam-ewa-h2 { font-size: 1.2rem; margin-bottom: 12px; }
.wam-ewa-meters { display: grid; gap: 10px; }
.wam-ewa-meter { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 4px 10px; align-items: center; font-size: 0.88rem; }
.wam-ewa-meter b { text-align: right; font-variant-numeric: tabular-nums; }
.wam-ewa-meter i { position: relative; grid-column: 1 / -1; display: block; height: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.wam-ewa-meter em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ewa-ember), #ffd36b); transform-origin: left; animation: wam-ewa-fill 1.1s var(--wam-ease) both; }
.wam-ewa-meter s { position: absolute; top: 0; right: 0; height: 100%; background: #c0392b; }
@keyframes wam-ewa-fill { from { transform: scaleX(0); } }

/* Files: hidden on the page, shown in the modal. */
.wam-ewa-files { display: none; }
.wam-ewa-modal { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 20px; background: rgba(8, 2, 0, 0.86); backdrop-filter: blur(6px); color: var(--wam-white); font-family: var(--wam-font); }
.wam-ewa-modal[hidden] { display: none; }
html.wam-ewa-locked { overflow: hidden; }
.wam-ewa-modal-in { position: relative; width: min(1000px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 28px; border-radius: 26px; background: linear-gradient(135deg, #2b1810, #1a0d08); box-shadow: inset 0 0 0 2px #6b4128, 0 40px 80px rgba(0, 0, 0, 0.6); animation: wam-ewa-pop 0.35s var(--wam-spring) both; }
.wam-ewa-modal-in.is-haml3t { background: radial-gradient(600px 400px at 20% 20%, rgba(0, 120, 20, 0.35), transparent 70%), #0e1a0e; box-shadow: inset 0 0 0 2px #2e6b36, 0 40px 80px rgba(0, 0, 0, 0.6); }
.wam-ewa-modal-in.is-nexoma { background: radial-gradient(600px 400px at 20% 20%, rgba(150, 0, 0, 0.4), transparent 70%), #160606; box-shadow: inset 0 0 0 2px #7a1414, 0 40px 80px rgba(0, 0, 0, 0.6); }
@keyframes wam-ewa-pop { from { transform: scale(0.95); } }
.wam-ewa-modal .wam-ewa-x { position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; margin: 0; padding: 0; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 50%; background: rgba(0, 0, 0, 0.4); color: var(--wam-white); font: 400 1.3rem/1 var(--wam-font); cursor: pointer; }
.wam-ewa-modal .wam-ewa-x:focus-visible, .wam-ewa-modal a:focus-visible { outline: 2px solid var(--wam-gold); outline-offset: 3px; }
.wam-ewa-modal .wam-ewa-file { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 26px; }
.wam-ewa-modal .wp-block-group > *, .wam-ewa-modal .wp-block-image { margin-block: 0; }
.wam-ewa-modal p { margin: 0; }
.wam-ewa-modal .wam-ewa-file-art img { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); }
.wam-ewa-modal .wam-ewa-file-text { display: grid; gap: 10px; align-content: start; min-width: 0; padding-right: 40px; }
.wam-ewa-modal .wam-ewa-file-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wam-ewa-modal .wam-ewa-file-head p:has(a) { line-height: 0; }
.wam-ewa-modal .wam-ewa-file-head a { color: #ff4b4b; animation: wam-ewa-flick 2.6s steps(1) infinite; }
@keyframes wam-ewa-flick { 0%, 48%, 52%, 81%, 100% { opacity: 1; } 50% { opacity: 0.2; } 80% { opacity: 0.5; } }
.wam-ewa-modal .wam-ewa-file-name { font-family: "Cinzel", Georgia, serif; font-size: 1.9rem; line-height: 1.1; word-break: break-word; }
.wam-ewa-modal .wam-ewa-file-title { color: var(--ewa-ember-2, #ffb27a); }
.wam-ewa-modal .wam-ewa-file-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.wam-ewa-modal .wam-ewa-file-fact { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); font-size: 0.82rem; font-weight: 700; }
.wam-ewa-modal .wam-ewa-file-player { justify-content: flex-start; }
.wam-ewa-modal .wam-ewa-file-who { color: var(--wam-faded); font-size: 0.9rem; font-weight: 600; }
.wam-ewa-modal .wam-ewa-file-bio { color: var(--wam-faded); line-height: 1.7; }
.wam-ewa-modal .wam-ewa-file-bio a { color: #ffb27a; }
.wam-ewa-modal .wam-ewa-file-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 6px; }
.wam-ewa-modal .wam-ewa-file-label { margin-bottom: 6px; color: rgba(255, 255, 255, 0.56); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.wam-ewa-modal .wam-ewa-file-ul { margin: 0; padding-left: 18px; color: var(--wam-faded); font-size: 0.9rem; line-height: 1.6; }
.wam-ewa-modal .is-nexoma .wam-ewa-file-text, .wam-ewa-modal .is-nexoma .wam-ewa-file-ul { font-family: ui-monospace, "Cascadia Mono", monospace; letter-spacing: 0.03em; color: #8dff9f; word-break: break-word; }
.wam-ewa-modal .is-nexoma .wam-ewa-file-name { font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 1.4rem; }

@media (max-width: 960px) {
  .wam-ewa-cols { grid-template-columns: minmax(0, 1fr); }
  .wam-ewa-hero-in { grid-template-columns: minmax(0, 1fr); margin-top: -170px; }
  .wam-ewa-seal { width: 100px; height: 100px; position: absolute; top: 0; right: 24px; }
  .wam-ewa .wam-ewa-seal-num { font-size: 2rem; }
  .wam-ewa .wam-ewa-logo img { width: 110px; }
}
@media (max-width: 720px) {
  .wam-ewa-modal { padding: 10px; }
  .wam-ewa-modal-in { padding: 20px; max-height: calc(100vh - 20px); }
  .wam-ewa-modal .wam-ewa-file { grid-template-columns: minmax(0, 1fr); }
  .wam-ewa-modal .wam-ewa-file-art { max-width: 240px; }
  .wam-ewa-modal .wam-ewa-file-lists { grid-template-columns: minmax(0, 1fr); }
  .wam-ewa-modal .wam-ewa-file-text { padding-right: 0; }
  .wam-ewa-posters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .wam-ewa-board { padding: 24px 14px; }
}
@media (max-width: 640px) { .wam-ewa-wrap, .wam-ewa-hero-in { padding-inline: 16px; } }
@media (prefers-reduced-motion: reduce) {
  .wam-ewa *, .wam-ewa *::before, .wam-ewa *::after, .wam-ewa-modal * { animation: none !important; transition-duration: 0.01ms !important; }
}
