/* The forge menu owns its palette; campaign screens keep their existing UI. */
.music-controls { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; padding:10px 0; color:#d5c9b4; font-size:13px; }
.music-controls input[type=range] { width:140px; min-width:90px; min-height:44px; accent-color:#dfbb75; }
.music-controls label { margin:0; }
.music-controls output { width:4ch; font-variant-numeric:tabular-nums; }
.music-controls button { min-height:44px; }
.music-controls :focus-visible { outline:3px solid #ffe0a1; outline-offset:3px; }
.music-status { flex-basis:100%; color:#efbd8d; line-height:1.5; }
.music-status:empty { display:none; }
#lobby-music-track { color:#b7ae98; }
@media(max-width:480px) { .music-controls { gap:6px 8px; }.music-controls input[type=range] { flex:1; width:90px; }.music-controls label { font-size:12px; } }
#screen-home { --accent: #e7bc67; --dim: #c0b49e; --panel2: #211c16; --line: #5a4831; --text: #f5ecd9; color: var(--text); background: #100f0c url('branding/forge-hall.jpg') center top / cover fixed; padding: 0; position: relative; isolation: isolate; }
#screen-home::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg,#08090770,#08090722 30%,#08090722 70%,#08090770),linear-gradient(#090b0ba6,#10100b44 45%,#10100beb); }
.forge-home { width: min(1080px,100%); padding: 0 32px; margin: 0 auto; position: relative; }
.forge-nav { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:64px; border-bottom:1px solid #cfad6840; }
.forge-nav-brand { color:#c7b18a; font-size:10px; letter-spacing:2px; }
.forge-nav-brand > span { color:#edc97d; font-size:24px; vertical-align:middle; margin-right:8px; }
.forge-tool { background:transparent; color:#d2c4ac; padding:9px 11px; font-size:12px; border:1px solid transparent; }
.forge-tool:hover { color:#ffe0a0; border-color:#b88d4555; background:#b88d4510; }
.forge-hero { text-align:center; padding:20px 0 23px; }
.forge-crest { display:block; width:184px; height:184px; object-fit:contain; margin:0 auto 6px; mix-blend-mode:screen; mask-image:radial-gradient(ellipse,black 56%,transparent 73%); filter:drop-shadow(0 0 18px #db862324); animation:crest-glow 6s ease-in-out infinite alternate; }
.forge-eyebrow { font-size:10px; letter-spacing:2.6px; font-weight:700; color:#cbb182; margin:0 0 9px; }
.forge-hero h1 { font-family:Georgia,serif; text-transform:uppercase; font-size:clamp(36px,5.6vw,68px); font-weight:700; line-height:1.08; letter-spacing:5px; color:#eacb88; text-shadow:0 2px #5c371a,0 5px 20px #000; margin:0 0 12px; }
.forge-motto { color:#d5c9b4; font-size:14px; margin:0; line-height:1.6; }
.forge-motto em { font-style:normal; color:#f0d595; }
.forge-divider { display:flex; align-items:center; gap:18px; font-size:9px; color:#cfb88c; letter-spacing:2px; margin:0 0 18px; text-align:center; }
.forge-divider::before,.forge-divider::after { content:''; height:1px; flex:1; background:linear-gradient(90deg,transparent,#947746); }
.forge-divider::after { transform:rotate(180deg); }
.adventure-choices { display:grid; grid-template-columns:1fr 1fr; gap:22px; }
.adventure-card { min-width:0; height:300px; position:relative; overflow:hidden; border:1px solid #987443; border-radius:5px; padding:0; text-align:left; background:#191811; color:#fff2d5; box-shadow:0 12px 30px #0006; transition:transform .25s,border-color .25s,box-shadow .25s; }
.adventure-player { border-color:#d2a65b; box-shadow:0 0 0 3px #a87b3018,0 12px 30px #0006; }
/* DM mode is still in beta: a corner sash, above the card's shading. */
.card-beta { position:absolute; top:20px; right:-38px; z-index:2; width:150px; transform:rotate(45deg); background:linear-gradient(#c8553c,#8f2f22); border-block:1px solid #f0a07f; color:#fff1e2; font-size:11px; font-weight:700; letter-spacing:3px; text-align:center; padding:5px 0; box-shadow:0 3px 10px #0008; }
.adventure-card > img { width:100%; height:100%; object-fit:cover; object-position:center 30%; position:absolute; inset:0; transition:transform .6s; }
.adventure-card::after { content:''; position:absolute; inset:0; background:linear-gradient(transparent 18%,#11100e35 40%,#11100ee8 73%,#11100e 100%); }
.adventure-card:hover { transform:translateY(-4px); border-color:#f3cf88; box-shadow:0 0 25px #d9a04e35,0 16px 32px #0007; }
.adventure-card:hover > img { transform:scale(1.035); }
.card-ribbon { position:absolute; top:15px; left:15px; z-index:1; background:#302013e8; border:1px solid #be945262; padding:7px 10px; color:#f0ce91; font-size:8px; letter-spacing:1.5px; }
.card-copy { position:absolute; bottom:0; left:0; right:0; padding:22px 25px; z-index:1; display:flex; flex-direction:column; }
.card-kicker { color:#e5bd78; font-size:9px; letter-spacing:2.2px; margin-bottom:8px; }
.card-copy strong { font-family:Georgia,serif; font-size:27px; font-weight:400; line-height:1.15; margin-bottom:10px; }
.card-copy > span:not([class]) { color:#d0c5b5; font-size:12px; line-height:1.5; font-weight:400; }
.card-action { display:flex; justify-content:space-between; border-top:1px solid #a4864e55; padding-top:13px; margin-top:17px; color:#e6bf78; font-size:12px; }
.adventure-player .card-kicker,.adventure-player .card-action { color:#bfd2aa; }
.forge-return { margin-top:22px; border:1px solid #b692554a; border-radius:4px; background:#15150fe8; padding:19px 24px; }
.invitation { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.invitation h2 { margin:0; font-size:20px; color:#eee0c4; font-weight:400; }
.invitation .forge-eyebrow { font-size:8px; margin-bottom:6px; }
.invite-controls { display:flex; gap:10px; }
#screen-home .code-input { width:104px; background:#0c100d; border-color:#796746; color:#f3dfb5; }
.forge-button { background:linear-gradient(#cba45d,#a77935); color:#19150e; border:1px solid #e1b975; border-radius:3px; font-size:12px; }
.forge-button:hover { filter:brightness(1.14); }
#join-note { font-size:11px; margin:10px 0 0; }
.campaign-journal { margin-top:18px; border-top:1px solid #9d793e55; padding-top:20px; display:flex; gap:18px; }
.journal-seal { display:grid; place-items:center; width:62px; height:78px; flex-shrink:0; border:1px solid #95623f; border-left:5px solid #95623f; border-radius:3px 8px 8px 3px; background:linear-gradient(135deg,#563026,#271c16); color:#dab576; font-size:38px; }
.journal-content { flex:1; min-width:0; }
#journal-title { color:#ecd4a0; font-size:20px; margin:0 0 6px; overflow-wrap:anywhere; }
.journal-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:12px; }
.forge-extras { display:grid; grid-template-columns:1fr 1fr; align-items:end; gap:22px; margin-top:15px; }
.forge-extras button { width:100%; text-align:left; color:#dec99f; padding:14px 8px; }
.forge-extras button > span { display:block; color:#b2a78f; font-size:11px; font-weight:400; margin:6px 0 0 16px; }
/* Beta testers benchmark on a preset, so that door gets the callout. */
.tester-tag { margin:0 0 8px; color:#f3cf88; font-size:10px; font-weight:700; letter-spacing:2.2px; }
.tester-tag b { display:inline-block; margin-left:4px; animation:tester-nudge 1.6s ease-in-out infinite; }
.forge-extras .preset-feature { position:relative; padding:14px 16px; font-size:14px; color:#f6dca4; border:1px solid #d2a65b; border-radius:4px; background:linear-gradient(90deg,#3a2a15e8,#1d1a12e0); box-shadow:0 0 0 3px #a87b3022,0 0 22px #d9a04e30; animation:tester-glow 2.4s ease-in-out infinite alternate; }
.forge-extras .preset-feature:hover { border-color:#f3cf88; background:linear-gradient(90deg,#4a3519f0,#262014e8); }
.preset-arrow { position:absolute; top:50%; right:16px; transform:translateY(-50%); color:#f3cf88; font-size:18px; }
.forge-extras .preset-feature > span { color:#cfc0a0; margin-right:28px; }
@keyframes tester-nudge { 50% { transform:translateY(3px); } }
@keyframes tester-glow { to { box-shadow:0 0 0 3px #a87b3036,0 0 30px #e8a95060; } }
.forge-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; border-top:1px solid #9474433d; padding:15px 0; color:#a99a7d; font-size:8px; letter-spacing:1.6px; }
#home-error:empty { display:none; }
.forge-dialog { color:#eee3d0; background:radial-gradient(ellipse at top,#34291d,#171712 70%); border:1px solid #b18a4d; border-radius:8px; padding:32px; width:min(550px,calc(100% - 24px)); max-height:88dvh; overflow:auto; box-shadow:0 25px 100px #000c; }
.forge-dialog::backdrop { background:#070907bb; backdrop-filter:blur(6px); }
.forge-dialog h2 { color:#ecd09a; font-size:25px; margin:0 24px 20px 0; font-weight:400; }
.forge-dialog .setup-mode h2 { font-size:19px; margin-top:22px; margin-bottom:12px; }
.forge-dialog .hint { color:#c1b6a2; line-height:1.65; }
.forge-dialog input,.forge-dialog select { color:#f4e8d1; background:#131610; border-color:#695738; }
.forge-dialog label { color:#d5c5a8; }
.forge-dialog button.primary { background:linear-gradient(#d9b16a,#ad7b37); border:1px solid #efce88; border-radius:3px; color:#1c150d; }
.forge-dialog button.secondary { color:#f4deaf; border-color:#9b7c44; }
.dialog-close { position:absolute; top:12px; right:12px; padding:5px 10px; font-size:24px; color:#ceb88f; background:transparent; }
.forge-dialog details { margin:18px 0; line-height:1.65; }
.forge-dialog summary { cursor:pointer; color:#dec795; }
.forge-dialog a { color:#e2bd79; }
.forge-dialog [hidden] { display:none !important; }
.hero-picker-art { height:105px; border:1px solid #806941; border-radius:4px; background:url('branding/hero-door.jpg') center 42% / cover; margin:14px 0; }
.forge-roll { background:#31402a; border:1px solid #839467; color:#e5edcd; width:100%; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
#screen-home :focus-visible { outline:3px solid #ffe0a1; outline-offset:4px; }
.forge-embers { pointer-events:none; position:fixed; inset:0; overflow:hidden; z-index:-1; }
.forge-embers i { position:absolute; bottom:-12px; left:var(--ember-left,8%); width:var(--ember-size,3px); height:var(--ember-size,3px); border-radius:50%; background:#ffd38b; box-shadow:0 0 6px #ffba52,0 0 16px #ef791b; animation:ember-rise var(--ember-time,7s) linear var(--ember-delay,0s) infinite; }
@keyframes ember-rise {
  0% { transform:translate3d(0,0,0) scale(.5); opacity:0; }
  12% { opacity:.9; }
  28% { transform:translate3d(calc(var(--ember-drift,80px) * .55),-28vh,0) scale(1); opacity:.75; }
  50% { transform:translate3d(calc(var(--ember-drift,80px) * -.2),-52vh,0) scale(.7); opacity:1; }
  74% { transform:translate3d(var(--ember-drift,80px),-78vh,0) scale(1.15); opacity:.8; }
  100% { transform:translate3d(calc(var(--ember-drift,80px) * .4),-110vh,0) scale(.35); opacity:0; }
}
@keyframes crest-glow { to { filter:drop-shadow(0 0 24px #db862349); } }
@media (min-width:1400px) { .forge-hero { padding-top:26px; } .forge-crest { width:210px; height:210px; } .adventure-card { height:330px; } }
@media (max-width:650px) { .forge-home { padding:0 18px; } .forge-nav-brand { font-size:8px; letter-spacing:1px; } .forge-nav-brand > span { display:none; } .forge-nav { gap:4px; } .forge-nav > div { display:flex; } .forge-tool { padding:9px 7px; font-size:11px; } .forge-hero { padding-top:16px; } .forge-crest { width:155px; height:155px; } .forge-hero h1 { letter-spacing:2px; } .forge-motto { max-width:280px; margin:auto; font-size:12px; } .forge-divider { font-size:8px; letter-spacing:1px; gap:8px; } .adventure-choices { gap:14px; grid-template-columns:1fr; } .adventure-card { height:275px; } .card-copy strong { font-size:26px; } .forge-return { padding:18px; } .invitation { align-items:flex-start; flex-direction:column; } .invite-controls { width:100%; } .invite-controls .forge-button { flex:1; } .forge-extras { gap:6px; } .forge-extras span { line-height:1.6; margin-left:0; } .forge-footer { letter-spacing:.7px; } .forge-dialog { padding:25px 20px; } .journal-seal { display:none; } }
@media (prefers-reduced-motion:reduce) { #screen-home *,#screen-home *::before,#screen-home *::after { animation:none !important; transition:none !important; scroll-behavior:auto !important; } .forge-embers { display:none; } }
/* Profile: roster, campaigns, and the roster picker in the setup dialog. */
.profile-dialog { width:min(680px,calc(100% - 24px)); }
/* Inline account actions must not inherit the stacked form button spacing. */
.profile-auth-actions { align-items:center; flex-wrap:wrap; }
.profile-auth-actions button { margin-top:0; }
.profile-auth-actions { gap:12px; }
.profile-token-note { border-top:1px solid #9d793e40; margin-top:20px; padding-top:16px; max-width:60ch; }
/* The home and account sites share the same action sizes and hierarchy. */
.forge-action { display:inline-flex; align-items:center; justify-content:center; text-align:center; text-decoration:none; font:600 14px 'Segoe UI',system-ui,sans-serif; }
.forge-action,.forge-dialog button.primary,.forge-dialog button.secondary,.forge-button { min-height:46px; padding:12px 18px; border-radius:4px; font-size:14px; line-height:1.4; }
.forge-dialog .forge-action.primary,.forge-dialog button.primary,.forge-button { background:linear-gradient(#dfbc78,#b78943); border:1px solid #edca86; color:#20180d; }
.forge-dialog .forge-action.secondary,.forge-dialog button.secondary { background:#b9985310; border:1px solid #927344; color:#edd09a; }
.forge-action:hover { filter:brightness(1.12); }
.forge-dialog .join-row { align-items:center; flex-wrap:wrap; gap:12px; }
.forge-dialog .join-row > button { margin-top:0; width:auto; }
.forge-dialog .hint { max-width:65ch; }
.forge-dialog :is(input,select,textarea) { font-size:16px; }
.forge-dialog :is(button,input,select),.forge-tool,.journal-actions button { min-height:44px; }
.forge-dialog :focus-visible { outline:3px solid #ffe0a1; outline-offset:4px; }
.forge-dialog .join-row > input { flex:1 1 160px; min-width:0; }
@media (max-width:650px) {
  .forge-crest { width:96px; height:96px; }
  .forge-hero { padding:12px 0 18px; }
  .adventure-card { height:230px; }
  .hero-picker-art { height:72px; }
  .profile-auth-actions > a { flex:1 1 180px; }
  .profile-tabs { flex-wrap:wrap; }
  .forge-dialog .join-row > button { white-space:normal; }
}
.profile-head { display:flex; justify-content:space-between; align-items:baseline; gap:12px; flex-wrap:wrap; border-bottom:1px solid #9d793e55; padding-bottom:12px; }
.profile-head strong { color:#f0d9a8; overflow-wrap:anywhere; }
.profile-head span { color:#c1b6a2; font-size:13px; }
.profile-tabs { display:flex; gap:4px; margin:16px 0 14px; border-bottom:1px solid #9d793e40; }
.profile-tabs button { background:transparent; border:0; border-bottom:2px solid transparent; border-radius:0; color:#c9b994; padding:8px 12px; font-size:13px; }
.profile-tabs button[aria-selected="true"] { color:#ffe0a0; border-bottom-color:#e7bc67; }
.roster-list, .profile-rows { display:grid; gap:10px; margin-bottom:14px; }
.roster-card, .profile-row { display:flex; align-items:center; gap:12px; border:1px solid #6e5836; border-radius:4px; background:#15140fcc; padding:10px; min-width:0; }
.roster-card > img, .profile-row > img, .roster-blank { width:56px; height:56px; flex-shrink:0; border-radius:4px; object-fit:cover; border:1px solid #806941; }
.roster-blank { display:grid; place-items:center; color:#a68b5b; font-size:24px; background:#211c16; }
.roster-card > div:not(.roster-actions), .profile-row > div { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.roster-card strong, .profile-row strong { color:#f0d9a8; overflow-wrap:anywhere; }
.roster-card span, .profile-row span { color:#c1b6a2; font-size:12px; }
.roster-card p { margin:4px 0 0; color:#b3a88f; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.roster-actions { display:flex; flex-direction:column; gap:6px; }
.roster-form { border-top:1px solid #9d793e55; margin-top:6px; padding-top:6px; }
.roster-form h3 { color:#ecd09a; font-weight:400; margin:12px 0; }
.roster-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 14px; }
.roster-portrait { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-bottom:12px; }
.roster-portrait img { width:84px; height:84px; object-fit:cover; border-radius:4px; border:1px solid #806941; }
.roster-portrait label.mini { cursor:pointer; border:1px solid #9b7c44; border-radius:3px; padding:6px 10px; color:#f4deaf; }
.roster-portrait:has(input:focus-visible) label.mini { outline:3px solid #ffe0a1; outline-offset:2px; }
/* The framer previews exactly the square that gets saved; the ring shows the
   circle most of the game crops it to (lobby seats, chat, initiative). */
/* Outside #screen-home (KAN-43), so it carries that screen's colours itself. */
#portrait-framer { --accent:#e7bc67; --dim:#c0b49e; --panel2:#211c16; --line:#5a4831; --text:#f5ecd9; }
.portrait-framer { margin:0 0 16px; }
.portrait-framer .hint { margin:0 0 10px; }
.framer-stage { position:relative; width:min(280px,100%); aspect-ratio:1; border:1px solid #806941; border-radius:4px; overflow:hidden; background:#131610; }
.framer-stage canvas { display:block; width:100%; height:100%; cursor:grab; touch-action:none; }
.framer-stage canvas:active { cursor:grabbing; }
.framer-stage canvas:focus-visible { outline:3px solid #ffe0a1; outline-offset:-3px; }
.framer-stage::after { content:""; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(circle closest-side, transparent calc(100% - 2px), #ffe0a1cc calc(100% - 2px), #ffe0a1cc 100%, #0008 100%); }
.framer-zoom { display:flex; align-items:center; gap:10px; width:min(280px,100%); margin:10px 0; }
.framer-zoom input { flex:1; min-height:44px; accent-color:#d9b16a; }
.roster-note { border:1px solid #9b7c4466; border-left:3px solid #e7bc67; border-radius:3px; background:#2a21167a; padding:10px 12px; color:#d8ccb4; font-size:13px; line-height:1.6; }
.roster-pick .roster-card { margin-top:10px; }
.lobby-roster { margin:10px 0 14px; }
.lobby-roster .roster-card { cursor:pointer; }
.lobby-roster .roster-card input { width:20px; height:20px; flex-shrink:0; accent-color:#e7bc67; }
.lobby-roster .roster-card.seated { opacity:.55; cursor:default; }
/* A brought character has its own name, so the name box goes too. */
.roster-chosen #home-name-field, .roster-chosen #setup-hero .field, .roster-chosen #setup-hero .hero-picker-art, .roster-chosen #roll-hero, .roster-chosen #roll-result, .roster-chosen #setup-hero .backstory-writer { display:none; }
@media (max-width:650px) { .roster-grid { grid-template-columns:1fr; } .roster-card, .profile-row { flex-wrap:wrap; } .roster-actions { flex-direction:row; width:100%; } }
.prune-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:12px; font-size:13px; color:#c1b6a2; }
.prune-bar select { width:auto; }
.import-label { cursor:pointer; border:1px solid #9b7c44; border-radius:3px; padding:6px 10px; color:#f4deaf; }
.prune-bar:focus-within .import-label { outline:3px solid #ffe0a1; outline-offset:2px; }

.game-music-panel { padding:8px 14px; border-bottom:1px solid #69552f; flex-shrink:0; max-height:45vh; overflow:auto; }
.game-music-panel summary { cursor:pointer; min-height:32px; padding:6px 0; color:#dfbb75; }
.game-music-panel .hint { font-size:12px; margin:5px 0; }
.game-music-panel select { width:100%; min-height:44px; }
.game-music-panel [data-music-toggle] { flex-basis:100%; }

/* Balance the short display lines; prose keeps a useful final phrase. */
.forge-nav-brand, .forge-eyebrow, .card-kicker, .card-copy strong, .forge-divider { text-wrap: balance; }
.forge-motto, .card-copy > span, .forge-extras span, .forge-footer { text-wrap: pretty; }
@media (max-width: 400px) {
  .forge-hero h1 { font-size: clamp(28px, 8.4vw, 34px); letter-spacing: 1px; }
  .forge-extras { grid-template-columns: minmax(0, 1fr); }
}
.forge-nav-brand { flex: 1; min-width: 0; }
.forge-nav .forge-tool { display: inline-flex; align-items: center; gap: 4px; }
.forge-footer { flex-wrap: wrap; }
.forge-footer .forge-tool { flex: 0 0 auto; }

/* Henry stays unobstructed on the left; menu choices sit below the painting. */
.forge-hero.henry-welcome { position:relative; isolation:isolate; overflow:hidden; min-height:450px; display:flex; align-items:center; justify-content:flex-end; padding:32px; margin:12px 0 26px; border:1px solid #98744380; border-radius:5px; background:#100f0c; }
.henry-art { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:left top; z-index:-2; }
.henry-welcome::after { content:''; position:absolute; inset:0; z-index:-1; background:linear-gradient(90deg,transparent 38%,#100f0c99 60%,#100f0cee); }
.henry-copy { width:43%; text-align:left; }
.henry-welcome h1 { font-size:clamp(32px,4vw,54px); letter-spacing:2px; }
@media (max-width:700px) {
  .forge-hero.henry-welcome { display:block; min-height:0; padding:0; }
  .henry-art { position:relative; display:block; height:auto; aspect-ratio:1672/941; object-fit:contain; z-index:0; }
  .henry-welcome::after { display:none; }
  .henry-copy { width:100%; padding:22px 18px; text-align:center; }
}
