:root {
  --background: #111111;
  --panel: #1a1a1a;
  --panel-soft: #202020;
  --border: #4a4a4a;
  --border-strong: #6b6b6b;
  --text: #eeeeee;
  --text-muted: #a6a6a6;
  --accent: #bcbcbc;
  --danger: #d86868;
  --focus: #ffffff;
  --radius: 10px;
  --content-max: 1600px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--text); font-family: Arial, "Noto Sans", "Noto Sans CJK SC", sans-serif; line-height: 1.35; overflow: hidden; }
a { color: inherit; }
button, input, select { font: inherit; }
button, select, input { border-radius: 6px; }
button, select, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header { border-bottom: 1px solid var(--border); background: var(--panel); }
.brand-row { width: min(var(--content-max), calc(100% - 32px)); height: 82px; margin: 0 auto; display: grid; grid-template-columns: minmax(210px, 0.9fr) minmax(420px, 1.6fr) minmax(190px, 0.8fr); align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; min-width: 0; }
.placeholder, .feature-icon, .social-placeholder { border: 1px solid var(--border-strong); background: var(--panel-soft); color: var(--text-muted); }
.logo-placeholder { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-size: 12px; }
.title-placeholder { padding: 10px 14px; min-width: 140px; text-align: center; font-size: 17px; font-weight: 700; }
.primary-nav { display: flex; justify-content: center; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.primary-nav a { padding: 10px 12px; border: 1px solid transparent; text-decoration: none; white-space: nowrap; font-size: 14px; color: var(--text-muted); }
.primary-nav a:hover, .primary-nav a:focus-visible { border-color: var(--border-strong); color: var(--text); }
.language-control { justify-self: end; display: flex; align-items: center; gap: 10px; color: var(--text-muted); }
.locale-mark { min-width: 32px; padding: 6px 8px; text-align: center; border: 1px solid var(--border); }
select, input { color: var(--text); background: var(--panel); border: 1px solid var(--border); }
select { min-height: 42px; padding: 0 34px 0 10px; }

.page-shell { width: min(var(--content-max), calc(100% - 32px)); height: calc(100vh - 82px); margin: 0 auto; padding: 26px 0 22px; display: grid; grid-template-columns: minmax(520px, 1.05fr) minmax(620px, 1.25fr); gap: 42px; align-items: stretch; overflow: hidden; }
.content-column { min-width: 0; }
.eyebrow { margin: 0 0 10px; color: var(--text-muted); font-size: 13px; letter-spacing: .14em; }
h1, h2, h3, p { margin-top: 0; }
.eyebrow { margin-bottom: 8px; }
h1 { max-width: 620px; margin-bottom: 12px; font-size: clamp(2rem, 3.3vw, 3.5rem); line-height: 1.04; }
h2 { margin-bottom: 14px; font-size: clamp(1.25rem, 2vw, 1.75rem); }
.intro-copy { max-width: 620px; margin-bottom: 0; color: var(--text-muted); font-size: .98rem; }
.features-section { margin-top: 14px; }
.features-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.feature-item { min-width: 0; min-height: 82px; padding: 8px 7px; border: 1px solid var(--border); background: var(--panel); }
.feature-icon { width: 28px; height: 28px; display: grid; place-items: center; margin-bottom: 6px; font-size: 8px; }
.feature-item h3 { margin: 0; font-size: 11px; line-height: 1.15; font-weight: 600; color: var(--text); }
.auth-section { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.panel { border: 1px solid var(--border-strong); background: var(--panel); padding: 10px; }
.register-panel { min-height: 260px; }
.auth-panel[hidden] { display: none; }
.auth-switch { margin-top: 2px; }
.logged-in-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 12px 0 16px; }
.logged-in-summary p { margin: 0; color: var(--text-muted); }
.logged-in-summary strong { color: var(--text); font-size: 1.15rem; }
.logged-in-actions { display: flex; gap: 8px; }
.logged-in-actions .button { flex: 1; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.register-panel h2 { margin-bottom: 8px; font-size: 1.35rem; }
.register-panel form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; align-items: end; }
.register-panel form .button-primary { grid-column: 1 / -1; }
.field-group { display: grid; gap: 5px; margin-bottom: 0; }
label { color: var(--text-muted); font-size: 12px; }
input { width: 100%; min-height: 32px; padding: 6px 8px; }
input:focus, select:focus { border-color: var(--focus); }
.password-row { position: relative; }
.password-row input { min-width: 0; }
.password-toggle { position: absolute; top: 2px; right: 2px; height: calc(100% - 4px); max-width: 88px; padding: 0 4px; overflow: hidden; color: var(--text-muted); border: 0; background: var(--panel); cursor: pointer; font-size: 10px; line-height: 1.1; white-space: nowrap; text-overflow: ellipsis; }
.password-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.button { width: 100%; min-height: 34px; border: 1px solid var(--border-strong); cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.button-primary { background: var(--accent); color: #111; font-weight: 700; }
.button-primary:hover, .button-primary:focus-visible { background: var(--text); }
.button-secondary { min-height: 42px; background: transparent; color: var(--text); }
.button-secondary:hover, .button-secondary:focus-visible { background: var(--panel-soft); }
.form-message { grid-column: 1 / -1; min-height: 0; margin: 0; color: var(--danger); font-size: 13px; }
.form-message.success { color: var(--text); }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 6px 0; color: var(--text-muted); font-size: 11px; }
.or-divider::before, .or-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.social-placeholder { min-height: 32px; display: grid; place-items: center; font-size: 10px; }
.hero-column { min-width: 0; }
.hero-media { height: 100%; min-height: 0; border: 1px solid var(--border-strong); background: var(--panel); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; text-align: center; color: var(--text-muted); padding: 30px; }
.hero-media span { font-size: clamp(1.1rem, 2.4vw, 2rem); color: var(--text); }
.hero-media small { max-width: 360px; font-size: 14px; }

/* Tablets need a scrollable landing page: the desktop viewport lock used by
   the wide layout otherwise hides the lower login form. */
@media (max-width: 1300px) and (min-width: 761px) {
  body { overflow-x: hidden; overflow-y: auto; }
  .page-shell { height: auto; min-height: calc(100vh - 82px); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; overflow: visible; }
  .hero-media { min-height: calc(100vh - 150px); height: auto; }
}

@media (max-width: 1050px) {
  .brand-row { grid-template-columns: 1fr; height: auto; gap: 12px; padding: 16px 0; }
  .primary-nav { justify-content: flex-start; }
  .language-control { justify-self: start; }
  .page-shell { height: calc(100vh - 158px); grid-template-columns: minmax(300px, 0.9fr) minmax(400px, 1.1fr); gap: 24px; }
}

@media (max-width: 760px) {
  .site-header { position: sticky; top: 0; z-index: 5; }
  .brand-row, .page-shell { width: min(100% - 28px, 560px); }
  .brand-row { grid-template-columns: 1fr; height: 138px; padding: 8px 0; gap: 6px; }
  .brand { gap: 10px; }
  .logo-placeholder { width: 52px; height: 52px; }
  .title-placeholder { min-width: 0; flex: 1; text-align: left; }
  .primary-nav { order: 2; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; overflow: hidden; }
  .primary-nav a { min-width: 0; padding: 6px 2px; text-align: center; font-size: 10px; line-height: 1.1; white-space: normal; }
  .language-control { order: 3; justify-self: stretch; justify-content: space-between; }
  .language-control select { flex: 1; }
  .page-shell { width: min(100% - 20px, 560px); height: calc(100vh - 138px); display: block; padding-top: 44px; overflow: hidden; }
  .hero-column { display: none; }
  h1 { font-size: 1.7rem; margin-bottom: 8px; }
  .intro-copy { font-size: .78rem; }
  .features-section { margin-top: 12px; }
  .features-grid { gap: 5px; }
  .feature-item { min-height: 72px; padding: 6px 4px; }
  .feature-icon { width: 24px; height: 24px; margin-bottom: 5px; font-size: 7px; }
  .feature-item h3 { font-size: 9px; }
  .auth-section { margin-top: 10px; }
  .panel { padding: 9px; }
  .register-panel { min-height: 0; }
  .register-panel form { grid-template-columns: 1fr 1fr; gap: 8px; }
  .field-group:first-child { grid-column: 1 / -1; }
  .form-message { font-size: 11px; }
  .button { min-height: 34px; }
  .or-divider { margin: 10px 0; }
}

@media (max-width: 390px) {
  .brand-row, .page-shell { width: min(100% - 16px, 560px); }
  h1 { font-size: 1.6rem; }
  .intro-copy { font-size: .76rem; }
  .feature-item h3 { font-size: 8px; }
  .password-toggle { padding-inline: 6px; font-size: 10px; }
}

body.cooperation-body { overflow-x: hidden; overflow-y: auto; }
.cooperation-page { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 72px; }
.cooperation-intro { max-width: 780px; margin: 0 auto 36px; padding-bottom: 36px; border-bottom: 1px solid var(--border); }
.cooperation-intro h1 { margin-bottom: 12px; }
.cooperation-subtitle { margin-bottom: 20px; color: var(--text); font-size: clamp(1.1rem, 2vw, 1.45rem); }
.cooperation-copy p, .cooperation-section > p, .cooperation-contact > p { max-width: 70ch; margin: 0 0 14px; color: var(--text-muted); line-height: 1.62; }
.cooperation-statement { margin: 22px 0 0 !important; padding: 14px 18px; border-left: 3px solid var(--border-strong); background: var(--panel); color: var(--text) !important; font-weight: 700; }
.cooperation-section { max-width: 780px; margin: 0 auto; padding: 34px 0; border-bottom: 1px solid var(--border); }
.cooperation-section h2, .cooperation-contact h2 { margin-bottom: 18px; }
.cooperation-categories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cooperation-category { padding: 16px; border: 1px solid var(--border); background: var(--panel); }
.cooperation-category h3 { margin: 0 0 8px; font-size: 1rem; }
.cooperation-category p { margin: 0; color: var(--text-muted); font-size: .94rem; line-height: 1.5; }
.cooperation-section ul { margin: 10px 0 0; padding-left: 22px; color: var(--text-muted); columns: 2; }
.cooperation-section li { margin: 7px 0; break-inside: avoid; }
.cooperation-contact { max-width: 780px; margin: 36px auto 0; padding: 22px; }
.cooperation-email { display: inline-block; margin: 0 0 18px; color: var(--text); font-size: 1.15rem; font-weight: 700; }
.cooperation-form { padding-top: 22px; border-top: 1px solid var(--border); }
.cooperation-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cooperation-message-field { grid-column: 1 / -1; }
.cooperation-form textarea { width: 100%; resize: vertical; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 10px; font: inherit; }
.cooperation-form textarea:focus { border-color: var(--focus); outline: 3px solid var(--focus); outline-offset: 1px; }
.cooperation-actions { display: flex; gap: 10px; margin-top: 14px; }
.cooperation-actions .button { width: auto; min-width: 150px; padding: 0 16px; }

@media (max-width: 760px) {
  .cooperation-page { width: min(100% - 28px, 600px); padding: 34px 0 48px; }
  .cooperation-intro { margin-bottom: 24px; padding-bottom: 28px; }
  .cooperation-intro h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .cooperation-section { padding: 28px 0; }
  .cooperation-categories, .cooperation-fields { grid-template-columns: 1fr; }
  .cooperation-section ul { columns: 1; }
  .cooperation-message-field { grid-column: auto; }
  .cooperation-contact { padding: 16px; }
  .cooperation-actions { flex-direction: column; }
  .cooperation-actions .button { width: 100%; }
}

@media (max-width: 390px) { .cooperation-page { width: min(100% - 20px, 600px); } }

body.faq-body { overflow-x: hidden; overflow-y: auto; }
.faq-page { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 72px; }
.faq-intro { max-width: 780px; margin: 0 auto 30px; padding-bottom: 34px; border-bottom: 1px solid var(--border); }
.faq-intro h1 { margin-bottom: 14px; }
.faq-intro > p:last-child { margin: 0; color: var(--text-muted); font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.5; }
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); background: var(--panel); }
.faq-item + .faq-item { margin-top: 10px; }
.faq-question { width: 100%; min-height: 66px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 0; background: transparent; color: var(--text); cursor: pointer; text-align: left; font-size: 1.1rem; font-weight: 700; }
.faq-question:hover, .faq-question:focus-visible { background: var(--panel-soft); }
.faq-icon { flex: 0 0 auto; color: var(--text-muted); font-size: 1.5rem; font-weight: 400; }
.faq-answer { padding: 0 20px 20px; border-top: 1px solid var(--border); }
.faq-answer p { max-width: 68ch; margin: 18px 0 0; color: var(--text-muted); font-size: 1rem; line-height: 1.6; }
.faq-ask { max-width: 780px; margin: 34px auto 0; padding: 22px; }
.faq-ask h2 { margin-bottom: 8px; }
.faq-ask-copy { margin: 0 0 18px; color: var(--text-muted); }
.faq-open-form { width: auto; min-width: 190px; padding: 0 18px; }
.faq-form { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
.faq-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.faq-question-field { grid-column: 1 / -1; }
.faq-form textarea { width: 100%; resize: vertical; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 10px; font: inherit; }
.faq-form textarea:focus { border-color: var(--focus); outline: 3px solid var(--focus); outline-offset: 1px; }
.faq-form .form-message { margin: 14px 0; }
.faq-form-actions { display: flex; gap: 10px; }
.faq-form-actions .button { width: auto; min-width: 160px; padding: 0 16px; }

@media (max-width: 760px) {
  .faq-page { width: min(100% - 28px, 600px); padding: 34px 0 48px; }
  .faq-intro { margin-bottom: 24px; padding-bottom: 28px; }
  .faq-intro h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .faq-question { min-height: 60px; padding: 14px 15px; font-size: 1rem; }
  .faq-answer { padding: 0 15px 16px; }
  .faq-ask { padding: 16px; }
  .faq-fields { grid-template-columns: 1fr; }
  .faq-question-field { grid-column: auto; }
  .faq-form-actions { flex-direction: column; }
  .faq-form-actions .button { width: 100%; }
}

@media (max-width: 390px) {
  .faq-page { width: min(100% - 20px, 600px); }
}

body.world-body { overflow-x: hidden; overflow-y: auto; }
.world-page { width: min(var(--content-max), calc(100% - 32px)); margin: 0 auto; padding: 54px 0 72px; }
.world-intro { width: min(820px, 100%); margin: 0 auto 28px; padding-bottom: 38px; border-bottom: 1px solid var(--border); }
.world-intro h1 { margin-bottom: 14px; }
.world-lead { max-width: 760px; margin: 0; color: var(--text-muted); font-size: clamp(1.1rem, 2vw, 1.45rem); line-height: 1.5; }
.lore-showcase .feature-showcase-copy { max-width: 590px; }
.lore-showcase .feature-showcase-copy p { max-width: 62ch; }
.lore-statement { margin-top: 24px !important; }
.lore-media-placeholder { min-height: 280px; }
.world-final { width: min(920px, 100%); margin: 0 auto; padding: 68px 0 20px; text-align: center; }
.world-final h2 { margin-bottom: 16px; font-size: clamp(1.7rem, 4vw, 3rem); }
.world-final p { margin: 0 auto; color: var(--text); font-size: clamp(1.15rem, 2.4vw, 1.7rem); font-weight: 700; line-height: 1.45; }

@media (max-width: 760px) {
  .world-page { width: min(100% - 28px, 600px); padding: 34px 0 48px; }
  .world-intro { margin-bottom: 0; padding-bottom: 28px; }
  .world-intro h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .lore-showcase { padding: 34px 0; gap: 20px; }
  .lore-media-placeholder { min-height: 0; }
  .world-final { padding-top: 44px; }
}

@media (max-width: 390px) {
  .world-page { width: min(100% - 20px, 600px); }
  .lore-showcase { padding: 28px 0; }
}

body.features-body { overflow-x: hidden; overflow-y: auto; }
.features-page { width: min(var(--content-max), calc(100% - 32px)); margin: 0 auto; padding: 54px 0 72px; }
.features-intro { max-width: 820px; margin: 0 auto 28px; padding-bottom: 38px; border-bottom: 1px solid var(--border); }
.features-intro h1 { margin-bottom: 14px; }
.features-lead { margin-bottom: 10px; color: var(--text); font-size: clamp(1.1rem, 2vw, 1.45rem); }
.features-description { max-width: 760px; margin: 0; color: var(--text-muted); font-size: 1rem; line-height: 1.6; }
.feature-showcase { width: min(1180px, 100%); margin: 0 auto; padding: 56px 0; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 52px; align-items: center; border-bottom: 1px solid var(--border); }
.feature-showcase.media-left { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); }
.feature-showcase-copy { min-width: 0; max-width: 560px; }
.feature-showcase h2 { margin-bottom: 16px; font-size: clamp(1.65rem, 3vw, 2.7rem); line-height: 1.12; }
.feature-showcase-copy p { max-width: 58ch; margin: 0 0 14px; color: var(--text-muted); font-size: 1rem; line-height: 1.62; }
.feature-showcase-copy .feature-highlight { margin-bottom: 22px; color: var(--text); font-size: 1.12rem; font-weight: 700; }
.feature-media-placeholder { width: 100%; aspect-ratio: 16 / 9; min-height: 240px; border: 1px solid var(--border-strong); background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; color: var(--text); }
.feature-media-placeholder span { font-size: clamp(.9rem, 1.7vw, 1.25rem); letter-spacing: .04em; }
.feature-media-placeholder small { max-width: 340px; color: var(--text-muted); font-size: .85rem; line-height: 1.45; }

@media (max-width: 900px) {
  .feature-showcase, .feature-showcase.media-left { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .feature-showcase.media-left .feature-showcase-copy { grid-row: 1; }
  .feature-showcase.media-left .feature-media-placeholder { grid-row: 2; }
}

@media (max-width: 760px) {
  .features-page { width: min(100% - 28px, 600px); padding: 34px 0 48px; }
  .features-intro { margin-bottom: 0; padding-bottom: 28px; }
  .features-intro h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .feature-showcase { padding: 34px 0; gap: 20px; }
  .feature-showcase h2 { font-size: clamp(1.45rem, 7vw, 2rem); }
  .feature-showcase-copy p { font-size: .98rem; line-height: 1.58; }
  .feature-media-placeholder { min-height: 0; aspect-ratio: 16 / 9; padding: 16px; }
}

@media (max-width: 390px) {
  .features-page { width: min(100% - 20px, 600px); }
  .feature-showcase { padding: 28px 0; }
  .feature-media-placeholder span { font-size: .78rem; }
}

/* About page keeps the landing-page tokens and header, but uses a readable scroll layout. */
body.about-body { overflow-x: hidden; overflow-y: auto; }
.about-page { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 72px; }
.about-section { max-width: 780px; margin: 0 auto; padding: 38px 0; border-bottom: 1px solid var(--border); }
.about-section:last-child { border-bottom: 0; }
.about-section h1, .about-section h2 { max-width: 760px; margin-bottom: 18px; line-height: 1.12; }
.about-section h1 { font-size: clamp(2.2rem, 5vw, 4.4rem); }
.about-section h2 { font-size: clamp(1.55rem, 3vw, 2.35rem); }
.about-section p { max-width: 720px; margin-bottom: 14px; color: var(--text-muted); font-size: 1rem; line-height: 1.65; }
.about-section .eyebrow { margin-bottom: 12px; font-size: 13px; letter-spacing: .14em; }
.about-section ul { max-width: 680px; margin: 8px 0 20px; padding-left: 22px; color: var(--text-muted); }
.about-section li { margin: 8px 0; line-height: 1.5; }
.about-section .about-statement { margin-top: 22px; margin-bottom: 0; padding: 14px 18px; border-left: 3px solid var(--border-strong); background: var(--panel); color: var(--text); font-weight: 700; }
.about-intro { padding-top: 0; }

@media (max-width: 760px) {
  .about-page { width: min(100% - 28px, 600px); padding: 34px 0 48px; }
  .about-section { padding: 28px 0; }
  .about-section h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .about-section h2 { font-size: clamp(1.4rem, 7vw, 2rem); }
  .about-section p { font-size: .98rem; line-height: 1.58; }
}

@media (max-width: 390px) {
  .about-page { width: min(100% - 20px, 600px); }
  .about-section { padding: 24px 0; }
  .about-section .about-statement { padding: 12px 14px; }
}

body.character-body { overflow-x: hidden; overflow-y: auto; }
.character-page { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 72px; }
.character-layout { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.7fr); gap: 24px; align-items: start; }
.character-preview, .character-wizard, .game-placeholder { border: 1px solid var(--border-strong); background: var(--panel); padding: 24px; }
.character-preview { position: sticky; top: 20px; }
.portrait-placeholder { min-height: 260px; border: 1px dashed var(--border-strong); display: grid; place-items: center; padding: 20px; text-align: center; color: var(--text-muted); }
.character-preview h2 { margin: 22px 0 8px; font-size: 1.2rem; }
.character-preview p { color: var(--text-muted); }
.character-wizard { min-width: 0; }
.creation-stepper { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0 22px; border-bottom: 1px solid var(--border); }
.creation-stepper span { padding: 7px 10px; border: 1px solid var(--border); color: var(--text-muted); font-size: .82rem; }
.creation-stepper .active { border-color: var(--text); color: var(--text); }
.creation-stepper .done { color: var(--text); }
.creation-content { min-height: 360px; padding: 28px 0; }
.creation-content h2 { margin-bottom: 18px; }
.creation-content label { display: block; margin-bottom: 8px; color: var(--text); }
.creation-content input, .creation-content textarea { width: 100%; box-sizing: border-box; }
.creation-content small { display: block; margin-top: 8px; color: var(--text-muted); line-height: 1.45; }
.creation-card { display: flex; flex-direction: column; gap: 8px; width: 100%; min-height: 116px; padding: 16px; border: 1px solid var(--border); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.creation-card:hover, .creation-card:focus-visible, .creation-card.selected { border-color: var(--text); background: rgba(255,255,255,.04); }
.creation-card span { color: var(--text-muted); font-size: .92rem; line-height: 1.45; }
.creation-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.creation-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.creation-options .creation-card { min-height: auto; padding: 13px; }
.creation-lore { margin-top: 16px; padding: 16px; border-left: 3px solid var(--border-strong); background: rgba(255,255,255,.03); }
.creation-lore h3 { margin-bottom: 8px; }
.creation-lore p { margin: 0; color: var(--text-muted); line-height: 1.55; }
.compact { width: auto; margin-top: 12px; }
.points-counter { padding: 12px 14px; border: 1px solid var(--border); color: var(--text-muted); }
.ability-list { display: grid; gap: 10px; }
.ability-control { display: grid; grid-template-columns: 1fr 42px 90px 42px; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--border); }
.ability-control small { display: inline; margin-left: 8px; }
.ability-control button { min-height: 38px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; font-size: 1.2rem; }
.ability-control output { text-align: center; font-size: 1.1rem; }
.ability-control output span { margin-left: 5px; color: var(--text-muted); font-size: .9rem; }
.creation-actions { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); padding-top: 20px; }
.creation-actions .button { min-width: 170px; }
.review-grid { display: grid; gap: 12px; }
.review-grid p { margin: 0; padding: 12px; border-bottom: 1px solid var(--border); color: var(--text-muted); line-height: 1.55; }
.game-placeholder { width: min(720px, calc(100% - 32px)); margin: 72px auto; }
.game-placeholder h1 { margin-bottom: 14px; }
.game-placeholder p { margin-bottom: 22px; color: var(--text-muted); }
@media (max-width: 840px) { .character-layout { grid-template-columns: 1fr; } .character-preview { position: static; } .portrait-placeholder { min-height: 120px; } }
@media (max-width: 600px) { .character-page { width: min(100% - 24px, 600px); padding: 28px 0 48px; } .character-preview, .character-wizard { padding: 16px; } .creation-stepper { max-height: 52px; overflow: hidden; } .creation-cards, .creation-options { grid-template-columns: 1fr; } .ability-control { grid-template-columns: 1fr 38px 76px 38px; } .creation-actions { flex-direction: column-reverse; } .creation-actions .button { width: 100%; } }
@media (max-width: 600px) { .logged-in-summary { grid-template-columns: 1fr; } .logged-in-actions { flex-direction: column; } }

body.game-body { overflow: hidden; }
.game-header { position: relative; z-index: 20; }
.game-screen { width: 100%; height: calc(100dvh - 76px); display: grid; grid-template-columns: minmax(150px, 0.18fr) minmax(0, 1.65fr) minmax(300px, 1fr); gap: 12px; padding: 12px; box-sizing: border-box; }
.game-sidebar, .game-main, .character-panel { min-height: 0; overflow: hidden; }
.game-sidebar { display: flex; flex-direction: column; padding: 14px 10px; }
.sidebar-title { padding: 8px; margin-bottom: 12px; color: var(--text); font-size: .8rem; letter-spacing: .18em; text-align: center; }
.game-nav-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 12px 9px; border: 0; border-left: 2px solid transparent; background: transparent; color: var(--text-muted); text-align: left; cursor: pointer; }
.game-nav-item.active { border-left-color: var(--text); background: rgba(255,255,255,.05); color: var(--text); }
.game-nav-item.disabled { cursor: not-allowed; opacity: .5; }
.nav-dot { width: 12px; color: var(--text-muted); font-size: .62rem; }
.sidebar-home { margin-top: auto; padding: 12px 8px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .8rem; text-decoration: none; }
.game-main { position: relative; display: flex; flex-direction: column; padding: 18px; }
.chat-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.chat-header h1 { margin: 0 0 5px; font-size: clamp(1.45rem, 2.6vw, 2.1rem); }
.chat-header p:last-child { margin: 0; color: var(--text-muted); font-size: .85rem; }
.message-list { flex: 1; min-height: 120px; overflow-y: auto; padding: 18px 4px; }
.game-message { max-width: 84%; margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--border); background: rgba(255,255,255,.025); }
.game-message p { margin: 8px 0 0; color: var(--text-muted); line-height: 1.55; white-space: pre-wrap; }
.gm-message { margin-right: auto; }
.player-message { margin-left: auto; border-color: var(--border-strong); background: rgba(255,255,255,.07); }
.system-message { margin: 10px auto; max-width: 72%; text-align: center; background: transparent; }
.message-meta { display: flex; justify-content: space-between; gap: 14px; color: var(--text); font-size: .82rem; }
.message-meta time { color: var(--text-muted); font-size: .75rem; }
.check-message { max-width: 300px; margin: 16px auto; background: var(--panel); }
.check-roll { display: flex; justify-content: space-between; align-items: center; margin: 12px 0; color: var(--text-muted); }
.check-roll b { color: var(--text); font-size: 1.45rem; }
.check-message small { color: var(--text); }
.scene-media { flex: 0 0 auto; min-height: 160px; aspect-ratio: 16 / 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px; border: 1px dashed var(--border-strong); background: rgba(255,255,255,.025); text-align: center; }
.scene-media strong { font-size: clamp(.85rem, 1.8vw, 1.1rem); letter-spacing: .04em; }
.scene-media span { max-width: 420px; color: var(--text-muted); font-size: .78rem; }
.game-input { margin-top: 14px; }
.game-input textarea { width: 100%; min-height: 72px; box-sizing: border-box; resize: vertical; }
.input-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-action { padding: 8px 10px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; font-size: .76rem; }
.quick-action:hover, .quick-action:focus-visible { border-color: var(--text); color: var(--text); }
.character-panel { overflow-y: auto; padding: 16px; }
.character-panel-head { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.portrait-small { width: 64px; height: 64px; display: grid; place-items: center; border: 1px dashed var(--border-strong); color: var(--text-muted); font-size: .6rem; text-align: center; }
.character-panel-head h2 { margin: 0 0 5px; font-size: 1.15rem; }
.character-panel-head p, .character-panel-head small { margin: 0; color: var(--text-muted); font-size: .78rem; }
.resource-bar { padding: 14px 0; border-bottom: 1px solid var(--border); }
.resource-bar div:first-child { display: flex; justify-content: space-between; color: var(--text-muted); font-size: .8rem; }
.resource-bar strong { color: var(--text); }
.bar { height: 6px; margin-top: 8px; background: rgba(255,255,255,.1); }
.bar i { display: block; height: 100%; background: var(--text); }
.character-tabs { display: flex; gap: 4px; padding: 12px 0; overflow-x: auto; }
.character-tabs button { flex: 1; min-width: max-content; padding: 8px 9px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: .74rem; }
.character-tabs button.active { border-color: var(--text); color: var(--text); }
.character-section { padding: 12px 0; border-top: 1px solid var(--border); }
.character-section h3 { margin: 0 0 10px; font-size: .95rem; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat-row { display: grid; grid-template-columns: 1fr auto auto; gap: 5px; align-items: center; padding: 7px; border: 1px solid var(--border); font-size: .75rem; }
.stat-row small { color: var(--text-muted); }
.character-section input { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.inventory-list, .skill-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.inventory-list li, .skill-list li { display: flex; gap: 7px; align-items: center; padding: 7px; border: 1px solid var(--border); color: var(--text-muted); font-size: .76rem; }
.inventory-list li small { margin-left: auto; color: var(--text); }
.item-icon { color: var(--text); }
.equipment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.equipment-list { display: flex; flex-direction: column; gap: 5px; }
.equipment-slot { min-height: 45px; display: flex; flex-direction: column; justify-content: center; padding: 6px; border: 1px dashed var(--border); }
.equipment-slot small { color: var(--text-muted); font-size: .7rem; }
.equipment-slot span { color: var(--text); font-size: .76rem; }
.map-section { padding-top: 4px; }
.map-hint { margin: 0 0 10px; color: var(--text-muted); font-size: .75rem; line-height: 1.4; }
.map-viewport { position: relative; min-height: 440px; overflow: hidden; border: 1px solid var(--border); background: radial-gradient(circle at center, rgba(255,255,255,.055), transparent 48%), var(--panel-soft); cursor: grab; touch-action: none; }
.map-viewport.dragging { cursor: grabbing; }
.map-canvas { position: absolute; width: 900px; height: 600px; left: 0; top: 0; transform-origin: top left; }
.map-links { position: absolute; inset: 0; width: 900px; height: 600px; pointer-events: none; }
.map-links line { stroke: var(--border-strong); stroke-width: 3; stroke-dasharray: 8 8; }
.map-node { position: absolute; transform: translate(-50%, -50%); min-width: 130px; padding: 14px 16px; border: 1px solid var(--text-muted); border-radius: 50%; background: #202020; color: var(--text); box-shadow: 0 0 0 6px rgba(255,255,255,.025), 0 10px 25px rgba(0,0,0,.35); cursor: pointer; font: inherit; font-size: .78rem; }
.map-node:hover, .map-node:focus-visible { border-color: var(--text); outline: none; box-shadow: 0 0 0 6px rgba(255,255,255,.08), 0 10px 25px rgba(0,0,0,.35); }
.journal-quest { padding: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.025); }
.journal-quest h3 { margin: 0 0 6px; }
.journal-quest p, .panel-empty { margin: 0; color: var(--text-muted); font-size: .8rem; }
.bestiary-section { padding-top: 4px; }
.bestiary-intro { margin: 0 0 10px; color: var(--text-muted); font-size: .78rem; line-height: 1.4; }
.bestiary-entry { border: 1px solid var(--border); background: rgba(255,255,255,.02); }
.bestiary-entry + .bestiary-entry { margin-top: 6px; }
.bestiary-entry summary { display: flex; align-items: center; justify-content: space-between; padding: 10px; color: var(--text); cursor: pointer; list-style: none; }
.bestiary-entry summary::-webkit-details-marker { display: none; }
.bestiary-entry summary small { color: var(--text-muted); font-size: 1rem; }
.bestiary-entry[open] summary { border-bottom: 1px solid var(--border); }
.bestiary-entry[open] summary small { transform: rotate(45deg); }
.bestiary-entry-body { padding: 10px; }
.bestiary-entry-body p { margin: 10px 0 0; color: var(--text-muted); font-size: .8rem; line-height: 1.5; }
.bestiary-image-placeholder { min-height: 110px; display: grid; place-items: center; border: 1px dashed var(--border-strong); color: var(--text-muted); font-size: .68rem; letter-spacing: .08em; text-align: center; }
.sidebar-bottom-actions { margin-top: auto; }
.sidebar-bottom-actions .game-nav-item { margin-top: 8px; }
.sidebar-bottom-actions .sidebar-home { display: block; margin-top: 8px; }
.settings-section { padding-top: 4px; }
.settings-toggle { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--text); font-size: .82rem; }
.settings-label { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--text-muted); font-size: .78rem; }
.settings-section input[type="range"] { width: 100%; accent-color: var(--text); }
.settings-buttons { display: flex; gap: 6px; margin-top: 12px; }
.settings-buttons .button { flex: 1; }
.settings-section .panel-empty { margin-top: 16px; }
.account-panel { grid-column: 2; min-width: 0; min-height: 0; overflow-y: auto; padding: 24px; }
.account-panel[hidden] { display: none; }
.game-screen.account-open { grid-template-columns: 150px minmax(0, 1fr); }
.game-screen.account-open .game-main, .game-screen.account-open #rightPanel { display: none; }
.account-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.account-header h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.4rem); }
.account-card { max-width: 820px; margin-top: 20px; padding: 18px; border: 1px solid var(--border); background: rgba(255,255,255,.025); }
.account-card > p { margin: 0 0 18px; color: var(--text-muted); line-height: 1.5; }
.account-data { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.account-data div { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border); }
.account-data small { color: var(--text-muted); }
.account-placeholder { min-height: 180px; display: grid; place-items: center; border: 1px dashed var(--border-strong); color: var(--text-muted); text-align: center; }
.mobile-menu-button { display: none; }
@media (max-width: 1050px) and (min-width: 761px) { .game-screen.account-open { grid-template-columns: 72px minmax(0, 1fr); } }
@media (max-width: 760px) {
  .mobile-menu-button { display: inline-grid; position: absolute; z-index: 90; top: 8px; left: 8px; place-items: center; width: 38px; height: 38px; border: 1px solid var(--border); background: var(--panel-soft); color: var(--text); border-radius: 50%; cursor: pointer; font-size: 1.15rem; line-height: 1; }
  .game-screen { position: relative; padding-top: 58px; }
  .game-screen .game-sidebar { display: none; }
  .game-screen.mobile-menu-open .game-sidebar { display: flex; position: absolute; z-index: 80; top: 58px; left: 8px; bottom: 8px; width: min(280px, 42vw); min-width: 180px; height: auto; box-sizing: border-box; box-shadow: 14px 0 34px rgba(0,0,0,.42); }
  .game-screen.mobile-menu-open .game-nav-item { justify-content: flex-start; padding: 10px 9px; font-size: .9rem; }
  .game-screen.mobile-menu-open .sidebar-title { font-size: .8rem; }
  .game-screen.mobile-menu-open .sidebar-title::after { content: none; }
  .game-screen.mobile-panel-open .game-main { display: none; }
  .game-screen.mobile-panel-open .character-panel { display: block; position: static; width: auto; max-height: none; min-height: calc(100dvh - 92px); margin-top: 0; overflow-y: auto; }
  .game-screen.mobile-panel-open .account-panel { display: none; }
  .game-screen:not(.mobile-panel-open):not(.account-open) .character-panel { display: none; }
  .account-panel { grid-column: 1; padding: 58px 16px 16px; }
  .game-screen.account-open { display: block; min-height: calc(100dvh - 92px); }
  .account-data { grid-template-columns: 1fr; }
}
.quest-title { margin: 0 0 4px; color: var(--text); font-size: .82rem; }
.character-section > small { color: var(--text-muted); line-height: 1.4; }
.game-context-menu { position: fixed; z-index: 100; min-width: 190px; padding: 6px; border: 1px solid var(--border-strong); background: var(--panel); box-shadow: 0 12px 30px rgba(0,0,0,.42); }
.game-context-menu[hidden] { display: none; }
.context-menu-title { padding: 7px 9px; color: var(--text-muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }
.game-context-menu button { width: 100%; padding: 9px; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.game-context-menu button:hover, .game-context-menu button:focus-visible { background: rgba(255,255,255,.09); outline: none; }
.game-context-menu button.danger { color: #e4aaaa; }
.game-context-menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }
.mobile-only { display: none; }
@media (max-width: 1050px) { .game-screen { grid-template-columns: 72px minmax(0, 1fr) minmax(260px, .75fr); } .game-nav-item { justify-content: center; padding: 12px 5px; font-size: 0; } .nav-dot { font-size: .75rem; } .sidebar-title { font-size: 0; } .sidebar-title::after { content: "A20"; font-size: .75rem; } }
@media (max-width: 760px) { body.game-body { overflow: auto; } .game-header .primary-nav { display: none; } .game-screen { height: calc(100dvh - 76px); min-height: 620px; display: block; padding: 8px; } .game-sidebar { display: none; } .game-main { height: 100%; } .character-panel { position: fixed; z-index: 50; top: 76px; right: 8px; bottom: 8px; width: min(360px, calc(100% - 16px)); transform: translateX(calc(100% + 16px)); transition: transform .2s ease; } .character-panel.mobile-open { transform: translateX(0); } .mobile-only { display: inline-flex; } .message-list { min-height: 150px; } .scene-media { min-height: 120px; } .input-footer { align-items: stretch; flex-direction: column; } .quick-actions { order: 2; } .game-input .button { width: 100%; } }
@media (max-width: 390px) { .game-screen { padding: 5px; } .game-main { padding: 12px; } .game-message { max-width: 94%; } .quick-action { flex: 1 1 calc(50% - 6px); } }

/* Floating game windows: the chat remains the only permanent play surface. */
.game-screen { grid-template-columns: 150px minmax(0, 1.65fr) minmax(300px, .82fr); }
.game-screen.panel-closed { grid-template-columns: 150px minmax(0, 1fr); }
.game-main { min-width: 0; }
.character-panel { position: static; width: auto; max-height: none; min-height: 0; overflow-y: auto; transform: none; }
.character-panel[hidden] { display: none; }
.character-panel .game-window-header { cursor: default; }
.right-panel-close { width: 30px; height: 30px; border: 0; background: transparent; color: #ed2323; cursor: pointer; font-size: 2.1rem; font-weight: 700; line-height: .8; }
.right-panel-close:hover, .right-panel-close:focus-visible { color: #ff5b5b; background: transparent; }
.panel-placeholder { min-height: 180px; display: grid; place-items: center; color: var(--text-muted); text-align: center; }
.scene-media { display: none; }
.game-window { position: fixed; top: 104px; left: clamp(180px, 24vw, 430px); right: auto; bottom: auto; transform: none; z-index: 60; width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 128px); overflow-y: auto; padding: 14px 16px; box-shadow: 0 18px 48px rgba(0,0,0,.55); }
.game-window[hidden] { display: none; }
.game-window-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: -2px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); cursor: move; user-select: none; touch-action: none; }
.game-window-header h2 { margin: 0; font-size: 1.1rem; }
.window-close { width: 30px; height: 30px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; font-size: 1.25rem; line-height: 1; }
.window-close:hover, .window-close:focus-visible { background: var(--panel-soft); border-color: var(--border-strong); }
.game-window .character-panel-head { padding-top: 2px; }
.game-window .character-section:first-of-type { padding-top: 0; border-top: 0; }
.game-window .inventory-section { padding-top: 0; border-top: 0; }
.chat-image { display: block; width: min(100%, 720px); max-height: 440px; object-fit: contain; border: 1px solid var(--border); background: var(--panel); }
.mobile-window-actions { display: flex; gap: 6px; }
@media (max-width: 760px) {
  .game-screen { display: block; }
  .game-main { height: auto; min-height: calc(100dvh - 92px); }
  .chat-header { padding-left: 48px; }
  .character-panel { position: static; width: auto; max-height: none; margin-top: 8px; }
  .game-screen.mobile-panel-open .game-window-header { padding-left: 48px; }
}
@media (max-width: 1050px) and (min-width: 761px) {
  .game-screen { grid-template-columns: 72px minmax(0, 1fr) minmax(260px, .75fr); }
  .game-screen.panel-closed { grid-template-columns: 72px minmax(0, 1fr); }
}
