/* Shared finishing layer: readable cards and the softer account/settings shapes. */
.join-invitation {
  margin: 32px auto 0;
  width: min(1200px, calc(100% - 48px));
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line, #3d4048);
  border-radius: 16px;
  background: var(--panel, #191b20);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.join-invitation[hidden] {
  display: none;
}
.join-invitation h2 {
  font-size: clamp(25px, 3vw, 36px);
  margin: 8px 0 12px;
}
.join-invitation p:not(.eyebrow) {
  font-size: 17px;
  line-height: 1.6;
  max-width: 65ch;
  margin: 0;
}
.join-invitation .button {
  flex-shrink: 0;
}
@media (max-width: 760px) {
  .join-invitation {
    flex-direction: column;
    align-items: flex-start;
    width: calc(100% - 32px);
  }
}
:root {
  --radius-card: 12px;
  --radius-control: 8px;
  --radius-dialog: 16px;
}
.combat-role-icon {
  display: none;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid #555;
  border-radius: 8px;
  background: var(--combat-role-color);
  overflow: hidden;
  position: relative;
  vertical-align: middle;
  margin-right: 6px;
}
.combat-role-icon::before {
  content: '';
  position: absolute;
  inset: 2px;
  background: #fff;
  mask-image: url('assets/roles/role-symbols.png');
  mask-mode: luminance;
  mask-repeat: no-repeat;
  mask-size: 533.333% 153.333%;
  mask-position: var(--combat-role-position) 31.25%;
}
.combat-role-icon-tank {
  --combat-role-color: #60adf5;
  --combat-role-position: 3.846%;
}
.combat-role-icon-healer {
  --combat-role-color: #62d68a;
  --combat-role-position: 34.615%;
}
.combat-role-icon-melee {
  --combat-role-color: #f16b66;
  --combat-role-position: 65.385%;
}
.combat-role-icon-ranged {
  --combat-role-color: #f16b66;
  --combat-role-position: 96.154%;
}
html[data-theme='light'] .combat-role-icon-tank {
  --combat-role-color: #246fae;
}
html[data-theme='light'] .combat-role-icon-healer {
  --combat-role-color: #268747;
}
html[data-theme='light'] :is(.combat-role-icon-melee, .combat-role-icon-ranged) {
  --combat-role-color: #c53d38;
}
.event-role-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 12px 0;
  font-size: 13px;
}
body .event-role-counts > span,
html[data-theme='light'] .event-role-counts > span {
  background: transparent;
  border: 0;
  padding: 0;
}

/* A short introduction leaves the journal as the main homepage content. */
.community-welcome {
  width: min(1200px, calc(100% - 48px));
  margin: 40px auto;
  padding: clamp(24px, 4vw, 44px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-dialog);
  background: var(--panel);
}
.community-welcome[hidden] {
  display: none;
}
.community-welcome h2 {
  font-size: clamp(36px, 4vw, 54px);
  line-height: 1.08;
  margin: 12px 0 18px;
}
.welcome-copy {
  max-width: 65ch;
  font-size: 17px;
  line-height: 1.75;
  color: var(--muted);
  margin: 0;
}
.welcome-copy + .welcome-copy {
  margin-top: 12px;
}
.welcome-promise {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.7;
  margin: 18px 0 0;
}
.welcome-steps-heading {
  font-size: 26px;
  margin: 28px 0 16px;
}
.welcome-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.welcome-steps li {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.welcome-steps li[aria-current='step'] {
  border-color: var(--red);
}
.welcome-step-status {
  font-size: 13px;
  color: var(--muted);
}
.welcome-steps h3 {
  font-size: 24px;
  margin: 10px 0;
}
.welcome-steps p {
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
  color: var(--muted);
}
@media (max-width: 1000px) {
  .welcome-steps {
    grid-template-columns: 1fr;
  }
}
.community-welcome > img {
  width: 100%;
  height: auto;
  object-fit: contain;
}
.welcome-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 24px;
}
.welcome-actions .text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  transform: translateY(-200%);
  padding: 14px 20px;
  border-radius: var(--radius-control);
  background: var(--text);
  color: var(--bg);
}
.skip-link:focus {
  transform: translateY(0);
}
body :is(select, textarea, summary):focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}
body :is(.nav-cta, .home-event-mini, .timeline-images button, .community-signup-form) {
  border-radius: var(--radius-control);
}
#account > a {
  border-radius: var(--radius-control);
}
.header-view-control select {
  width: 230px;
  max-width: 100%;
}
.local-preview-label {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
@media (max-width: 900px) {
  body > header {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  body > header > .brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }
  body > header nav {
    grid-column: 1;
    grid-row: 2;
  }
  body > header #account {
    grid-column: 1;
    grid-row: 3;
    justify-self: stretch;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    width: 100%;
    max-width: none;
  }
  #account .header-view-control {
    flex: 1 1 130px;
    min-width: 0;
  }
  #account .account-settings-button {
    max-width: 110px;
    min-width: 0;
    font-size: 11px;
  }
  .header-view-control label {
    width: 100%;
  }
  .header-view-control select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    font-size: 12px;
  }
  #account .local-preview-label {
    position: absolute;
    top: 20px;
    right: 5%;
  }
  body > header .brand img {
    width: 56px;
    height: 56px;
  }
  body > header .brand {
    grid-template-columns: 56px auto;
  }
}
.view-as-bar {
  position: sticky;
  top: var(--header-height, 118px);
  z-index: 19;
  justify-content: center;
  align-items: center;
  text-align: center;
}
html[data-theme='light'] .view-as-bar,
html[data-theme='light'] .view-as-bar > span {
  color: #593d12;
}
.news-feed .news-members-only:not(.news-draft) .news-audience {
  background: #203b53;
  border-color: #5685ac;
  color: #c6e5ff;
}
html[data-theme='light'] .news-feed .news-members-only:not(.news-draft) .news-audience {
  background: #e2effa;
  border-color: #7399b9;
  color: #204d73;
}
header nav {
  font-size: 14px;
}
#current-news > .section-head h1 {
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.1;
}
.home-event-panel.compact-event-panel .home-event-mini time,
.home-event-panel.compact-event-panel .home-event-mini-kind {
  font-size: 13px;
  line-height: 1.6;
}
.timeline-era-content > p:not(.eyebrow) {
  font-size: 16px;
  line-height: 1.85;
}
.timeline-details summary {
  padding: 18px 22px;
  font-size: 15px;
}
.timeline-details li {
  padding: 26px 0;
}
.timeline .timeline-details li > p:not(.timeline-milestone-date) {
  font-size: 15px;
  line-height: 1.8;
  max-width: 65ch;
}
.timeline .timeline-details p.timeline-milestone-date,
.timeline-era .timeline-date > span {
  font-size: 12px;
  line-height: 1.6;
}
.timeline-details .text-link,
.timeline-images span,
.timeline-note {
  font-size: 14px;
  line-height: 1.75;
}
.timeline-images {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  max-width: 560px;
}
.timeline-images button {
  overflow: hidden;
}
html[data-theme='light'] .community-welcome {
  background: var(--light-surface);
  border-color: var(--light-border);
}
html[data-theme='light'] .welcome-copy {
  color: var(--light-muted);
}
@media (max-width: 760px) {
  .community-welcome {
    width: calc(100% - 32px);
    margin: 24px auto;
    grid-template-columns: 1fr;
    gap: 0;
  }
  .community-welcome > img {
    display: none;
  }
  .welcome-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body
  :is(
    .news-entry,
    .home-event-panel,
    .hub-card,
    .member-card,
    .media-card,
    .timeline-details,
    .character-build,
    .character-context,
    .setup-note,
    .management-entry,
    .view-as-control,
    .agenda-row,
    .roster-summary,
    .roster-stat-panel,
    .roster-statistics,
    .community-member-card,
    .community-empty,
    .unified-media-card
  ) {
  border-radius: var(--radius-card);
}
.news-feed .news-entry {
  border-radius: var(--radius-card);
}
.news-feed .news-entry.news-draft {
  border: 2px solid #e3b341;
}
.news-feed .news-draft .news-audience {
  background: #e3b341;
  border-color: #e3b341;
  color: #241b08;
  font-weight: 700;
}
.management-table-wrap {
  border-radius: var(--radius-card);
}
.unified-media-card {
  overflow: hidden;
}
.media-card-copy p {
  font-size: 14px;
  line-height: 1.6;
}
.media-kind {
  border-radius: 6px;
  font-size: 11px;
}
.timeline-details summary {
  border-radius: var(--radius-card);
}
.timeline-details[open] summary {
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}
body :is(.news-dialog, .community-dialog, #editor, #viewer) {
  border-radius: var(--radius-dialog);
}
body
  :is(
    .button,
    .outline-button,
    button.text-link,
    .close,
    .theme-choice-buttons button,
    .account-menu > summary,
    .account-menu-items
  ) {
  border-radius: var(--radius-control);
}
body :is(.button, .outline-button) {
  min-height: 44px;
  line-height: 1.4;
}
.filters button {
  border-radius: 999px;
  min-height: 40px;
}
.account-tabs a {
  border-radius: var(--radius-control);
}
#account .account-menu-items :is(a, button) {
  border-radius: 6px;
}
body
  :is(.form-panel, .hub-card, .character-build, .character-context, .team-selector, .filters)
  :is(input:not([type='checkbox']):not([type='radio']), select, textarea),
.search,
.management-character-search {
  border-radius: var(--radius-control);
}
.community-members :is(input, select),
.media-browser :is(input, select) {
  border-radius: var(--radius-control);
  min-height: 44px;
}
.roster-statistics > summary {
  border-radius: var(--radius-card);
}
.roster-stat-panel > .muted-copy,
.agenda-row .muted-copy,
.community-empty {
  font-size: 14px;
  line-height: 1.75;
}
.form-panel :is(input:not([type='checkbox']):not([type='radio']), select),
.team-selector select,
.management-character-search {
  min-height: 44px;
}

/* News metadata stays subordinate without becoming tiny. */
.news-feed .news-entry .eyebrow {
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 1px;
}
.news-feed .news-origin,
.news-dialog .news-origin {
  font-size: 14px;
  line-height: 1.6;
}
.news-feed .news-audience {
  font-size: 12px;
  line-height: 1.4;
  padding: 5px 9px;
  border-radius: 6px;
}
.news-feed .news-feature-label {
  font-size: 12px;
}
.news-feed .news-excerpt,
.news-feed .news-featured .news-excerpt,
.news-feed .news-archive-grid .news-excerpt {
  font-size: 16px;
  line-height: 1.75;
}
.news-feed .news-archive-grid .news-entry-text {
  height: auto;
  min-height: 0;
  flex: 1;
  padding: 24px;
}
.news-feed .news-archive-grid .news-entry h3 {
  font-size: 31px;
  line-height: 1.15;
  min-height: 0;
}
.news-feed .news-archive-grid .news-excerpt {
  -webkit-line-clamp: 3;
  margin-bottom: 20px;
}
.news-feed .news-read {
  font-size: 14px;
  line-height: 1.5;
  min-height: 40px;
}
.news-feed .news-archive-grid .news-read {
  margin-top: auto;
}
.news-dialog .news-paragraph,
.news-dialog .discord-message-content {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
}
.news-dialog {
  --discord-meta-size: 14px;
}
.news-dialog .news-source {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.news-dialog :is(.news-full-image, .discord-attachment img) {
  display: block;
  width: 100%;
  max-height: min(60vh, 520px);
  object-fit: contain;
  border-radius: var(--radius-control);
  background: transparent;
}
.news-dialog .news-paragraph a {
  color: #a9bfff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
html[data-theme='light'] .news-dialog .news-paragraph a {
  color: #285d96;
}
.news-dialog .news-website-link {
  display: inline-flex;
  align-items: center;
  margin: 8px 0 24px;
  font-size: 17px;
}
.news-dialog .eyebrow {
  font-size: 12px;
  line-height: 1.6;
}
.home-event-panel :is(p, .home-event-meta),
.home-event-panel .text-link {
  font-size: 15px;
  line-height: 1.7;
}

/* Use the same reading scale in account and management cards. */
.hub-content .hub-card p,
.hub-content .settings-card > p {
  font-size: 15px;
  line-height: 1.8;
}
.hub-content .hub-card small {
  font-size: 13px;
  line-height: 1.6;
}
.hub-content .hub-card .discord-message-content {
  font-size: 15px;
}
.hub-content .inline-label,
.hub-content .form-panel label {
  font-size: 14px;
}
.hub-content .badge {
  font-size: 12px;
  line-height: 1.5;
  border-radius: 6px;
}
.community-dialog :is(p, label),
.community-dialog .signup-row {
  font-size: 15px;
  line-height: 1.7;
}

@media (max-width: 600px) {
  .news-feed .news-archive-grid .news-entry-text {
    min-height: 0;
    padding: 22px;
  }
  .news-feed .news-archive-grid .news-entry h3 {
    min-height: 0;
    font-size: 30px;
  }
  .news-feed .news-origin,
  .news-dialog .news-origin {
    font-size: 13px;
  }
  .news-dialog .news-paragraph,
  .news-dialog .discord-message-content {
    font-size: 16px;
  }
  .filters button {
    min-height: 44px;
  }
}
