/* Browser-only shell. The transparent stage is a measured window into the
   shared canvas; never place an opaque DOM surface over a ready C3 preview. */
#pregame {
  --entry-gold: #d7af5c; --entry-text: #f2ead9; --entry-muted: #a9a494; --entry-line: #c9a05235;
  position: fixed; inset: 0; z-index: 10; display: flex; overflow: auto;
  color: var(--entry-text); font: 14px/1.5 'Segoe UI', system-ui, sans-serif;
  pointer-events: auto; color-scheme: dark; scrollbar-color: #706047 #151713;
}
#pregame[hidden], #pregame [hidden] { display: none !important; }
#pregame *, #pregame *::before, #pregame *::after { box-sizing: border-box; }
#pregame a { color: var(--entry-gold); text-decoration: none; }
#pregame a:hover { color: #ffe0a0; }
#pregame button, #pregame input, #pregame select { font: inherit; }
#pregame button, #pregame select { cursor: pointer; }
#pregame :is(button, a, input, select):focus-visible { outline: 2px solid var(--entry-gold); outline-offset: 3px; }
#pregame :disabled { opacity: .45; cursor: default; }
.entry-wrap { flex: 0 0 auto; width: min(1160px, 100%); padding: 24px 28px; margin: auto; }
.entry-header { display: flex; align-items: center; gap: 28px; min-height: 76px; margin-bottom: 20px; pointer-events: auto; }
.entry-brand { display: flex; align-items: center; gap: 18px; }
.entry-brand img { width: 174px; height: 76px; object-fit: contain; }
.entry-brand > span { color: var(--entry-gold); font-size: 10px; letter-spacing: .2em; }
.entry-brand > span > span { display: block; margin-top: 4px; color: var(--entry-muted); font-size: 11px; letter-spacing: .02em; }
.entry-nav { margin-inline-start: auto; display: flex; gap: 24px; align-items: center; }
#pregame .entry-nav a { color: #e0d9c8; font-size: 12px; }
.entry-nav a span { margin-inline-start: 3px; color: var(--entry-gold); }
.entry-language select { border: 1px solid var(--entry-line); border-radius: 5px; padding: 9px 10px; color: #d6ceba; background: #151713; max-width: 150px; font-size: 12px !important; }
.entry-layout { display: grid; grid-template-columns: minmax(320px, .82fr) minmax(0, 1.28fr); gap: 16px; align-items: stretch; }
.entry-panel { border: 1px solid var(--entry-line); border-radius: 9px; min-width: 0; box-shadow: 0 16px 50px #0003; }
.entry-form { background: linear-gradient(145deg, #20211cfb, #141612fa); padding: 25px 28px 20px; pointer-events: auto; }
#pregame h1, #pregame h2 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; text-wrap: balance; }
#pregame h1 { font-size: clamp(28px, 3vw, 36px); line-height: 1.12; margin: 8px 0; }
#pregame h2 { font-size: 25px; line-height: 1.2; margin: 4px 0; overflow-wrap: anywhere; }
#pregame h3 { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin: 0; color: #c6b68f; }
.entry-eyebrow { margin: 0; font-size: 9px; letter-spacing: .14em; font-weight: 600; text-transform: uppercase; color: var(--entry-gold); }
.entry-subtitle { margin: 0 0 19px; color: var(--entry-muted); font-size: 12px; }
.entry-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.entry-realm { flex-shrink: 0; color: #b7baab; font-size: 10px; }
.entry-realm-summary { display: grid; gap: 4px; text-align: end; flex-shrink: 0; }
#entry-player-count { color: #9f9e92; font-size: 10px; font-variant-numeric: tabular-nums; }
.entry-realm::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-inline-end: 6px; border-radius: 50%; background: #8b887e; }
.entry-realm[data-online="true"]::before { background: #96bf8a; box-shadow: 0 0 8px #96bf8a40; }
#pregame form { display: grid; gap: 12px; }
#pregame label { display: grid; gap: 5px; font-size: 11px; color: #c4bdaa; }
#pregame .ui-field { display: block; width: 100%; min-width: 0; min-height: 40px; padding: 8px 12px; border: 1px solid #c9a05240; border-radius: 4px; background: #0d100ee8; color: var(--entry-text); font-size: 13px; box-shadow: inset 0 1px 3px #0004; }
#pregame .ui-field:hover { border-color: #c9a05288; }
#pregame .ui-field:focus { border-color: var(--entry-gold); }
#pregame select.ui-field { padding-inline-end: 25px; }
#pregame option { background: #1b1d17; color: var(--entry-text); }
.entry-preferences { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 1px 0; }
#pregame .entry-check { display: flex; gap: 7px; align-items: center; line-height: 1.3; cursor: pointer; }
.entry-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--entry-gold); }
.entry-display { border: 0; border-top: 1px solid var(--entry-line); padding: 11px 0 0; margin: 2px 0 0; min-width: 0; }
.entry-display legend { padding-inline: 0 10px; font-size: 10px; letter-spacing: .08em; color: #c6b68f; text-transform: uppercase; }
.entry-display-controls { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; }
.entry-viewport { display: flex; align-items: center; gap: 6px; color: var(--entry-muted); font-size: 10px; margin: 9px 0 1px; }
.entry-viewport output { color: #d5cdba; margin-inline-start: auto; font-variant-numeric: tabular-nums; }
#entry-resolution { direction: ltr; unicode-bidi: isolate; }
.entry-viewport > span:last-child { border: 1px solid var(--entry-line); padding: 0 4px; border-radius: 3px; font-size: 9px; }
#pregame .ui-action { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 10px 17px; border: 1px solid var(--entry-line); border-radius: 4px; background: #23251d; color: var(--entry-text); font-weight: 600; }
#pregame .ui-action:hover { background: #303126; border-color: var(--entry-gold); }
#pregame .ui-action-primary { background: linear-gradient(110deg, #e0bc6b, #c99d42); color: #211b10; border-color: #e4bf6e; box-shadow: inset 0 1px #ffffff35, 0 3px 16px #0003; }
#pregame .ui-action-primary:hover { background: linear-gradient(110deg, #edcf8b, #d5ae58); }
#pregame .entry-play { justify-content: space-between; min-height: 46px; font-size: 15px; padding-inline: 19px; }
.entry-play > span:last-child { font-size: 21px; font-weight: 400; }
.entry-form-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 11px; }
#pregame .entry-text-button { border: 0; background: transparent; color: var(--entry-gold); padding: 4px 0; font-size: 11px; }
#pregame .entry-text-button:hover { color: #ffe0a0; }
.entry-back { margin-top: 18px; }
.entry-note { color: var(--entry-muted); font-size: 11px; margin: 8px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
#saved-credential { margin: 0; color: #adca98; }
.entry-error { color: #edb393; font-size: 12px; margin: 0; overflow-wrap: anywhere; }
#entry-message:empty, #entry-loading-message:empty { display: none; }
.entry-showcase { display: flex; flex-direction: column; position: relative; overflow: hidden; background: transparent; }
.entry-preview-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 23px 26px 15px; background: #171914f2; }
#entry-character-meta { margin: 5px 0 0; text-align: end; color: var(--entry-muted); font-size: 11px; max-width: 38%; }
.entry-preview { position: relative; display: flex; flex: 1 0 280px; min-width: 0; }
#entry-preview-stage { position: absolute; inset: 0; touch-action: none; pointer-events: auto; }
.entry-preview-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; text-align: center; background: linear-gradient(90deg, #101410f2, #15191099), url('./branding/login-splash.png') 72% 45%/cover; pointer-events: none; }
.entry-seal { width: 62px; height: 62px; display: grid; place-items: center; color: var(--entry-gold); font-size: 30px; border: 1px solid #c9a05266; border-radius: 50%; box-shadow: 0 0 0 9px #c9a05208; margin-bottom: 8px; }
#entry-preview-state { color: #d3c8ac; font-size: 12px; }
#entry-preview-retry { pointer-events: auto; }
.entry-preview[data-state="loading"] .entry-seal { animation: entry-breathe 1.8s ease-in-out infinite; }
.entry-preview-hint { position: absolute; inset: auto 0 9px; margin: 0; text-align: center; font-size: 10px; color: #b9ad92; pointer-events: none; text-shadow: 0 1px 3px #000; }
.entry-profiles { position: relative; border-top: 1px solid var(--entry-line); background: #141712fa; padding: 15px 22px 17px; pointer-events: auto; }
.entry-profiles .entry-section-heading { margin-bottom: 11px; }
#entry-profiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 150px; overflow: auto; scrollbar-width: thin; }
.entry-profile { display: flex; min-width: 0; border: 1px solid var(--entry-line); border-radius: 5px; background: #1c2019; }
.entry-profile:has([aria-pressed="true"]) { border-color: #c9a052a8; background: #332d1f; }
#pregame .entry-profile-select { display: flex; align-items: center; gap: 10px; padding: 10px; text-align: start; min-width: 0; flex: 1; color: var(--entry-text); background: transparent; border: 0; }
.entry-profile-symbol { font: 22px Georgia, serif; color: #d5b877; border-inline-end: 1px solid var(--entry-line); padding-inline-end: 10px; }
.entry-profile-name { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.entry-profile-detail { display: block; color: #a9a494; font-size: 10px; margin-top: 2px; }
.entry-profile-copy { min-width: 0; }
#pregame .entry-profile-forget { align-self: stretch; border: 0; background: transparent; color: #a49a81; padding: 0 9px; min-width: 30px; }
#pregame .entry-profile-forget:hover { color: #f1d299; background: #c9a05214; }
.entry-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.entry-loading { grid-column: 1 / -1; width: min(640px, 100%); margin: 38px auto; padding: clamp(24px, 5vw, 54px); background: linear-gradient(140deg, #22251df7, #101511f7); text-align: center; pointer-events: auto; }
.entry-loading h1 { margin-top: 14px !important; }
.entry-loading-info { display: flex; justify-content: space-between; align-items: end; gap: 14px; text-align: start; margin: 32px 0 10px; font-size: 12px; }
#entry-progress-text { margin: 0; color: #c3bca8; }
#entry-progress-value { font-variant-numeric: tabular-nums; color: #e3be6f; }
#entry-progress { display: block; width: 100%; height: 7px; border: 0; border-radius: 6px; overflow: hidden; background: #080d0a; accent-color: var(--entry-gold); }
#entry-progress::-webkit-progress-bar { background: #080d0a; }
#entry-progress::-webkit-progress-value { background: linear-gradient(90deg, #a67b32, #efd18a); border-radius: 6px; }
#entry-progress::-moz-progress-bar { background: linear-gradient(90deg, #a67b32, #efd18a); border-radius: 6px; }
.entry-loading-actions { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 25px; }
.entry-news { margin-top: 16px; background: #171a14f5; padding: 17px 24px 20px; pointer-events: auto; }
.entry-news .entry-section-heading > a { font-size: 10px; }
#entry-news-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 13px; }
.entry-news-post { min-width: 0; border-inline-start: 1px solid var(--entry-line); padding-inline-start: 16px; }
.entry-news-post:first-child { border: 0; padding-inline-start: 0; }
.entry-news-post time { font-size: 9px; color: #a49a81; letter-spacing: .04em; }
#pregame .entry-news-post a { display: block; color: #e5dcc7; font-size: 12px; line-height: 1.45; margin-top: 3px; }
#pregame .entry-news-post a:hover { color: var(--entry-gold); }
.entry-news-post p { margin: 5px 0 0; color: var(--entry-muted); font-size: 10px; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.entry-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 20px; margin-top: 15px; color: #aca794; font-size: 10px; }
.entry-discord { display: inline-flex; align-items: center; gap: 9px; pointer-events: auto; }
.entry-discord > span:first-child { color: var(--entry-gold); font-size: 9px; letter-spacing: .08em; }
.entry-discord > span:nth-child(2) { color: #bdb6a3; }
#entry-forget { width: min(420px, calc(100vw - 32px)); border: 1px solid var(--entry-gold); border-radius: 9px; background: #171a14; color: var(--entry-text); padding: 28px; pointer-events: auto; }
#entry-forget::backdrop { background: #030704bb; }
.entry-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.entry-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes entry-breathe { 50% { opacity: .4; } }
@media (max-width: 900px) {
  .entry-wrap { padding: 18px; } .entry-brand > span { display: none; } .entry-header { gap: 18px; }
  .entry-layout { grid-template-columns: minmax(290px, 1fr) minmax(0, 1fr); gap: 12px; }
  .entry-form { padding: 23px 22px 20px; } .entry-preview-header { padding: 23px 20px 15px; flex-direction: column; gap: 0; }
  #entry-character-meta { max-width: 100%; text-align: start; } #entry-profiles { grid-template-columns: 1fr; } .entry-nav { gap: 16px; }
}
@media (min-width: 641px) and (max-height: 850px) {
  .entry-wrap { padding-block: 16px; }
  .entry-header { min-height: 58px; margin-bottom: 12px; }
  .entry-brand img { height: 58px; width: 153px; }
  .entry-form { padding-block: 18px 15px; }
  #pregame h1 { font-size: 30px; margin-block: 6px; }
  .entry-subtitle { margin-bottom: 12px; }
  #pregame form { gap: 8px; }
  #pregame .ui-field { min-height: 34px; padding-block: 6px; }
  #pregame .entry-play { min-height: 40px; padding-block: 6px; }
  .entry-display { padding-top: 7px; }
  .entry-viewport { margin-top: 6px; }
  .entry-form-links { margin-top: 9px; }
  .entry-preview-header { padding-block: 17px 12px; }
  .entry-preview { flex-basis: 250px; }
  .entry-profiles { padding-block: 12px; }
  .entry-news { padding-block: 13px 15px; margin-top: 12px; }
  #entry-news-list { margin-top: 9px; }
  .entry-footer { margin-top: 10px; }
}
@media (max-width: 640px) {
  .entry-wrap { padding: 12px 14px 20px; }
  .entry-header { flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-bottom: 16px; }
  .entry-brand img { width: 151px; height: 68px; }
  .entry-nav { order: 3; width: 100%; margin: 0; padding: 9px 0; justify-content: center; gap: 32px; border-block: 1px solid var(--entry-line); }
  .entry-language select { max-width: 140px; } .entry-layout { grid-template-columns: minmax(0, 1fr); }
  .entry-form { padding: 24px; } .entry-preview { flex-basis: 310px; } .entry-preview-header { flex-direction: row; }
  #pregame .ui-field { font-size: 16px; min-height: 44px; }
  #entry-profiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .entry-profiles { padding-inline: 18px; }
  .entry-news { padding: 19px; } #entry-news-list { grid-template-columns: 1fr; gap: 14px; }
  .entry-news-post { padding: 12px 0 0; border-inline-start: 0; border-top: 1px solid var(--entry-line); }
  .entry-news-post:first-child { padding-top: 0; } .entry-footer { justify-content: center; text-align: center; }
  .entry-discord { order: -1; width: 100%; justify-content: center; padding: 5px 0; } .entry-loading { margin-block: 12px; }
}
@media (max-width: 370px) { #entry-profiles { grid-template-columns: 1fr; } .entry-form { padding: 20px; } }
@media (prefers-reduced-motion: reduce) { #pregame *, #pregame *::before { animation: none !important; transition: none !important; } }
/* Bootstrap and errors use the same family before the shared renderer is ready. */
#loading { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: linear-gradient(#0d160deb, #0d160de6), url('./branding/login-splash.png') center/cover; color: #f2ead9; text-align: center; font: 13px/1.6 'Segoe UI', sans-serif; }
.entry-boot { width: min(420px, 100%); } .entry-boot img { width: min(300px, 85%); height: auto; margin-bottom: 28px; }
.entry-boot p { color: #c9bfa6; } .entry-boot-line { height: 2px; width: 100%; background: linear-gradient(90deg, transparent, #d7af5c, transparent); margin-block: 24px; }
#runtime-failure { position: fixed; z-index: 100; inset: auto 16px 16px; margin: auto; max-width: 560px; padding: 24px; border: 1px solid #c3a252; border-radius: 9px; color: #f0e7cf; background: #171a14; font: 14px/1.5 'Segoe UI', sans-serif; }
#runtime-failure h2 { font: 25px Georgia, serif; margin: 0 0 12px; } #runtime-failure p { overflow-wrap: anywhere; }
#runtime-failure button { min-height: 44px; padding: 8px 24px; border: 0; border-radius: 4px; background: #d7af5c; color: #171713; font: inherit; }
#runtime-warning { position: fixed; z-index: 100; right: 12px; top: 12px; width: min(360px, calc(100vw - 48px)); max-height: 45vh; overflow: auto; padding: 12px; border: 1px solid #c3a252; border-radius: 6px; background: #171a14; color: #f0e7cf; font: 13px/1.4 'Segoe UI', sans-serif; }
#runtime-warning p { margin: 0 0 10px; }
#runtime-warning button { min-height: 36px; margin-right: 8px; padding: 6px 12px; border: 1px solid #c3a252; border-radius: 4px; background: #24271e; color: #f0e7cf; font: inherit; }
#runtime-warning textarea { display: block; width: 100%; box-sizing: border-box; height: 90px; margin-top: 8px; }
