.community-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: #14232e;
  border-bottom: 1px solid #344451;
  flex-wrap: wrap;
}
.community-bar strong {
  margin-right: auto;
  font-size: 13px;
  color: #dcc28c;
}
.community-bar button,
.community-bar a,
.dialog-actions button,
.dialog-actions a {
  padding: 8px 12px;
  color: #dce7ef;
  border: 1px solid #466071;
  background: #1c3040;
  border-radius: 5px;
  text-decoration: none;
  font-size: 12px;
}
.community-bar button:disabled {
  opacity: 0.4;
}
.credit {
  padding: 15px 24px;
  color: #9badbb;
  font-size: 12px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.credit button {
  color: #d8b777;
  background: none;
  border: 0;
  cursor: pointer;
}
.plan-author {
  font-size: 11px;
  color: #a9bdc9;
  margin: 5px 0;
}
.community-dialog {
  width: min(740px, 94vw);
  max-height: 88vh;
  background: #12222e;
  color: #e0e9ef;
  border: 1px solid #506b7c;
  border-radius: 10px;
  padding: 24px;
  overflow: auto;
  box-shadow: 0 15px 80px #0008;
}
.community-dialog::backdrop {
  background: #050c12cc;
}
.community-dialog h2 {
  margin: 0 0 12px;
}
.community-dialog h3 {
  font-size: 16px;
}
.community-dialog p {
  color: #aebfcb;
  line-height: 1.55;
}
.community-dialog label {
  display: block;
  font-size: 12px;
  color: #b9cad6;
  margin: 14px 0 5px;
}
.community-dialog input,
.community-dialog textarea,
.community-dialog select {
  width: 100%;
  box-sizing: border-box;
  color: #e2eaf0;
  background: #0b1923;
  border: 1px solid #486273;
  padding: 10px;
  border-radius: 5px;
  font: inherit;
}
.community-dialog textarea {
  min-height: 85px;
  resize: vertical;
}
.community-dialog input[type='checkbox'] {
  width: auto;
  margin-right: 8px;
}
.dialog-top,
.dialog-actions,
.plan-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dialog-top {
  justify-content: space-between;
}
.dialog-top button {
  background: none;
  color: #b9cad6;
  border: 0;
  font-size: 24px;
}
.dialog-actions {
  margin-top: 18px;
}
.dialog-actions .primary {
  background: #d3b67a;
  color: #15212c;
  border-color: #d3b67a;
}
.plan-row {
  border-top: 1px solid #344b5b;
  padding: 12px 0;
}
.plan-row > div {
  flex: 1;
  min-width: 160px;
}
.plan-row small {
  display: block;
  color: #93a9ba;
  padding-top: 5px;
}
.error-message {
  color: #ffabb0 !important;
  min-height: 20px;
}
.ticket-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.roster-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.step-editor {
  border-top: 1px solid #344b5b;
  margin-top: 16px;
}
.diagram-editor {
  width: min(940px, 96vw);
}
.diagram-editor svg {
  display: block;
  width: min(570px, 100%);
  margin: auto;
  background: #0c1b25;
  touch-action: none;
  max-height: 60vh;
}
.diagram-editor svg [data-item] {
  cursor: grab;
}
.diagram-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.diagram-tools button {
  background: #243b4c;
  color: #dce8ef;
  border: 1px solid #506778;
  padding: 8px;
}
.diagram-tools input {
  max-width: 125px;
  padding: 5px;
}
.support-contact {
  padding: 14px;
  border-left: 3px solid #d8b777;
  background: #20323e;
}
.support-contact strong {
  color: #e3c48b;
  font-size: 20px;
}
.save-status {
  color: #a9d8bd;
  font-size: 12px;
}
.present .community-bar,
.present .credit {
  display: none;
}
#roster span {
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 650px) {
  .community-bar {
    padding: 10px 14px;
  }
  .community-bar strong {
    width: 100%;
  }
  .credit {
    padding: 14px;
  }
  .community-dialog {
    padding: 16px;
  }
  .roster-fields {
    grid-template-columns: 1fr;
  }
}

.phase-heading {
  padding: 16px 10px 8px;
  color: #d8b777;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 1px solid #344754;
  margin-top: 8px;
}
.community-bar [hidden] {
  display: none !important;
}

.role-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 16px;
  font-size: 11px;
  color: #b9cad6;
}
.role-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.role-legend i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.role-legend small {
  color: #92a6b7;
}
.diagram-tools select {
  max-width: 110px;
}

.party-summary {
  padding: 0 18px 12px;
  color: #b8c9d5;
  font-size: 11px;
  line-height: 1.7;
}
.party-summary span,
.party-summary small {
  display: block;
}
.party-summary small {
  color: #8fa5b5;
  margin-top: 5px;
}
.walkthrough {
  margin-top: 20px;
  border: 1px solid #36505f;
  border-radius: 8px;
  background: #101f29;
  padding: 14px;
}
.walkthrough summary {
  cursor: pointer;
  color: #d8b777;
  font-size: 14px;
}
.walkthrough ol {
  margin: 12px 0 0;
  padding-left: 24px;
}
.walkthrough li {
  padding: 4px;
  color: #91a7b7;
}
.walkthrough button {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  background: transparent;
  color: #a8bac7;
  padding: 8px;
  cursor: pointer;
}
.walkthrough button strong,
.walkthrough button span {
  display: block;
}
.walkthrough button span {
  font-size: 12px;
  line-height: 1.6;
  margin-top: 4px;
}
.walkthrough .current {
  border-left: 3px solid #d8b777;
  background: #23343e;
}
.walkthrough .current button {
  color: #f0e6d1;
}
.walkthrough .reviewed {
  opacity: 0.7;
}
.diagram-caption {
  padding: 10px 18px;
  margin-top: 8px;
  background: #182d39;
  color: #d9c28f;
  font-size: 12px;
  border: 1px solid #36505f;
  border-radius: 6px 6px 0 0;
}
.wave-mapping {
  font-size: 12px;
  line-height: 1.6;
  color: #bad0df;
  background: #20313d;
  padding: 12px;
  border-radius: 6px;
}

.step-tabs {
  flex-wrap: wrap;
}
.instructions,
.board {
  min-width: 0;
}
.step-tabs button {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.walkthrough,
.wave-mapping {
  overflow-wrap: anywhere;
}

.step-tabs button {
  flex: 0 1 auto;
  min-width: 100px;
  padding: 8px 10px;
  overflow-wrap: normal;
}

.color-choice {
  display: block;
  margin: 14px 0;
  color: #d8b777;
  font-size: 13px;
}
.color-choice[hidden] {
  display: none;
}
.color-choice select {
  display: block;
  max-width: 100%;
  padding: 9px;
  margin-top: 6px;
}

.site-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  padding: 12px 28px;
  border-bottom: 1px solid #304352;
}
.site-nav a {
  color: #d8b777;
  text-decoration: none;
}
.brand .sigil {
  object-fit: contain;
}
.library {
  max-width: 1100px;
  margin: 40px auto;
  padding: 24px;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 18px;
}
.library-card {
  display: block;
  padding: 24px;
  border: 1px solid #354956;
  background: #172733;
  border-radius: 12px;
  color: #e4dccb;
  text-decoration: none;
}
.library-card:hover {
  border-color: #d8b777;
}
.library-card small {
  display: block;
  margin-top: 12px;
  color: #a0b6c5;
}
.library h1,
.library h2 {
  color: #d8b777;
}
.simulator {
  width: 100%;
  height: 80vh;
  border: 1px solid #354956;
  border-radius: 12px;
}
#public-status {
  color: #a0b6c5;
}
/* Preserve semantic hidden state when component rules set display explicitly. */
[hidden] {
  display: none !important;
}
.korean-boss {
  font-size: 14px;
  color: #a6bac5;
  margin: 5px 0 12px;
}

/* Encounter artwork stays behind readable titles, away from mechanic diagrams. */
.library-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 190px;
  display: flex;
  align-items: flex-end;
  background: #172733;
}
.encounter-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform 0.25s ease;
}
.library-card:after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(6, 14, 22, 0.12),
    rgba(6, 14, 22, 0.55) 38%,
    rgba(6, 14, 22, 0.97)
  );
  z-index: -1;
}
.encounter-label {
  display: block;
  text-shadow: 0 2px 5px #000;
}
.library-card strong {
  font-size: 20px;
  color: #fff0d3;
}
.library-card small {
  color: #d5e0e8;
}
.library-card:hover .encounter-art {
  transform: scale(1.04);
}
.library-card:focus-visible {
  outline: 3px solid #eac778;
  outline-offset: 4px;
}
.art-credit {
  text-align: center;
  font-size: 12px;
  color: #a0b6c5;
  padding: 0 24px;
}
.art-credit a {
  color: #d8b777;
}
.guide-tabs button.encounter-tab {
  background-image: linear-gradient(rgba(8, 17, 25, 0.76), rgba(8, 17, 25, 0.9)), var(--encounter-art);
  background-size: cover;
  background-position: center;
  min-height: 88px;
  text-shadow: 0 1px 4px #000;
}
.guide-tabs button.encounter-tab.active {
  background-image: linear-gradient(rgba(8, 17, 25, 0.5), rgba(8, 17, 25, 0.78)), var(--encounter-art);
}
@media (prefers-reduced-motion: reduce) {
  .encounter-art {
    transition: none;
  }
  .library-card:hover .encounter-art {
    transform: none;
  }
}

.site-nav a,
.site-nav button {
  border: 1px solid #52616b;
  border-radius: 8px;
  padding: 10px 16px;
  background: #172733;
  color: #e4c582;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.site-nav {
  gap: 10px;
}
.site-nav a:hover,
.site-nav button:hover {
  border-color: #e4c582;
  background: #283947;
}
.simulator-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 2px solid #d8b777;
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
  background: #172733;
}
.simulator-switch label {
  cursor: pointer;
}
.simulator-switch span {
  display: block;
  margin-top: 8px;
  color: #bbcad4;
}
.simulator-switch input {
  appearance: none;
  flex-shrink: 0;
  width: 64px;
  height: 34px;
  border-radius: 20px;
  background: #46535f;
  position: relative;
  cursor: pointer;
}
.simulator-switch input:before {
  content: '';
  position: absolute;
  left: 4px;
  top: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.simulator-switch input:checked {
  background: #ae873b;
}
.simulator-switch input:checked:before {
  transform: translateX(30px);
}
.simulator-switch input:focus-visible {
  outline: 3px solid #e4c582;
  outline-offset: 4px;
}

.library-card {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
}
.library-card small + small {
  margin-top: 4px;
}
.library-card .guide-rank {
  color: #f2c94c;
  letter-spacing: 2px;
  font-size: 15px;
  text-shadow: 0 1px 4px #000;
}
.library-card.is-unavailable {
  min-height: 190px;
  background: radial-gradient(circle at 82% 14%, rgba(242, 201, 76, 0.15), transparent 38%), #172733;
  border-style: dashed;
  cursor: default;
}
.library-card.is-unavailable:after {
  display: none;
}
.library-card.is-unavailable .guide-status {
  color: #a0b6c5;
}
.community-plan-card .encounter-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.community-plan-card .community-plan-source {
  margin-top: 7px;
  color: #f0d69f;
  font-weight: 700;
}
.community-plan-card .community-plan-author {
  margin-top: 5px;
  color: #d5e0e8;
}
.community-plan-card:not(:has(.encounter-art)) {
  background: radial-gradient(circle at 85% 15%, rgba(102, 213, 208, 0.12), transparent 36%), #172733;
}
#discord .provider-icon {
  background: #5865f2;
}
.provider-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.provider-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 60px;
  padding: 12px 20px;
  border: 1px solid #8e918f;
  border-radius: 10px;
  background: #131314;
  color: #e3e3e3;
  font: 500 16px system-ui;
  text-decoration: none;
  cursor: pointer;
}
.provider-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 6px;
  flex-shrink: 0;
}
.provider-icon img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.provider-button:hover {
  outline: 2px solid #d8b777;
  outline-offset: 2px;
}
.provider-button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.provider-button:focus-visible {
  outline: 3px solid #e4c582;
  outline-offset: 4px;
}

header {
  flex-wrap: wrap;
  gap: 14px;
}
.account-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}
.online-slider {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 126px;
  overflow: hidden;
  border: 1px solid #365466;
  border-radius: 999px;
  padding: 9px 13px;
  background: linear-gradient(100deg, #142936 0%, #183444 48%, #142936 100%);
  color: #cde9dc;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgb(102 213 160 / 5%);
}
.online-slider::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 15%, rgb(102 213 160 / 10%) 48%, transparent 75%);
  content: '';
  transform: translateX(-110%);
  animation: online-slide 4s ease-in-out infinite;
  pointer-events: none;
}
.online-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #66d5a0;
  box-shadow:
    0 0 0 4px rgb(102 213 160 / 12%),
    0 0 11px rgb(102 213 160 / 55%);
}
.online-count {
  position: relative;
  z-index: 1;
}
@keyframes online-slide {
  0%,
  60% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(110%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .online-slider::after {
    animation: none;
  }
}
.account-menu a,
.account-menu button,
.account-signin {
  display: inline-block;
  background: #1c3040;
  color: #ead5a5;
  border: 1px solid #63717c;
  border-radius: 8px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.account-menu a:hover,
.account-menu button:hover {
  border-color: #d8b777;
  background: #283947;
}
.account-menu a:focus-visible,
.account-menu button:focus-visible {
  outline: 3px solid #e4c582;
  outline-offset: 3px;
}
.shared-header {
  display: flex;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid #304352;
  background: #101a23;
}
.shared-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d8b777;
  text-decoration: none;
}
.shared-header .brand img {
  width: 44px;
  height: 44px;
}
#nightmare {
  margin-top: 44px;
}
body:has(#enter) .community-dialog img {
  width: auto;
}
@media (max-width: 650px) {
  header,
  .shared-header {
    padding: 16px;
  }
  .account-menu {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .shared-header .brand span {
    font-size: 14px;
  }
}
.provider-button[hidden] {
  display: none;
}

.account-menu form {
  margin: 0;
}
.account-menu button {
  max-width: 320px;
  overflow-wrap: anywhere;
}
.site-nav .discord-community {
  margin-left: auto;
  border-color: #8c91f4;
  background: #30355e;
  color: #fff;
}

.tools-page {
  display: block;
  width: min(1180px, calc(100% - 36px));
  min-height: calc(100vh - 260px);
  margin: 0 auto;
  padding: 54px 0 72px;
}
.tools-hero {
  position: relative;
  display: block;
  height: auto;
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid #314a5b;
  border-radius: 20px;
  padding: clamp(32px, 6vw, 64px);
  background:
    radial-gradient(circle at 84% 20%, rgb(102 213 208 / 18%), transparent 31%),
    linear-gradient(135deg, #132633, #0d171f 62%);
  box-shadow: 0 24px 55px rgb(0 0 0 / 24%);
}
.tools-hero::after {
  position: absolute;
  right: -52px;
  bottom: -88px;
  width: 260px;
  height: 260px;
  border: 1px solid rgb(216 183 119 / 22%);
  border-radius: 50%;
  content: '';
  box-shadow:
    0 0 0 34px rgb(216 183 119 / 4%),
    0 0 0 68px rgb(216 183 119 / 3%);
}
.tools-eyebrow,
.tool-type {
  color: #66d5d0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.17em;
}
.tools-hero h1 {
  max-width: 760px;
  margin: 10px 0 12px;
  color: #f0cc83;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.02;
}
.tools-hero p {
  max-width: 720px;
  margin: 0;
  color: #c0d2dc;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.65;
}
.tools-grid {
  display: grid;
  gap: 18px;
}
.tool-card {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #304a5b;
  border-radius: 16px;
  padding: 26px 28px;
  background: linear-gradient(120deg, #142631, #101b24);
  box-shadow: 0 16px 34px rgb(0 0 0 / 18%);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}
.tool-card:hover {
  border-color: #6b8b9b;
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgb(0 0 0 / 24%);
}
.tool-number {
  position: absolute;
  top: 13px;
  right: 18px;
  color: rgb(216 183 119 / 20%);
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
}
.tool-icon {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 1px solid rgb(102 213 208 / 55%);
  border-radius: 18px;
  background: rgb(102 213 208 / 9%);
  color: #8ae4df;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 24px rgb(102 213 208 / 7%);
}
.tool-card-codex .tool-icon {
  border-color: rgb(216 183 119 / 60%);
  background: rgb(216 183 119 / 9%);
  color: #f0cc83;
  box-shadow: inset 0 0 24px rgb(216 183 119 / 7%);
}
.tool-copy h2 {
  margin: 5px 0 8px;
  color: #f5f8fa;
  font-size: 26px;
}
.tool-copy p {
  max-width: 720px;
  margin: 0 0 12px;
  color: #bdd0da;
  line-height: 1.55;
}
.tool-copy ul {
  display: flex;
  gap: 8px 22px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  color: #8fa7b4;
  font-size: 13px;
  list-style: none;
}
.tool-copy li::before {
  margin-right: 7px;
  color: #66d5d0;
  content: '◆';
  font-size: 8px;
}
.tool-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-width: 176px;
  border: 1px solid #6b8290;
  border-radius: 10px;
  padding: 12px 16px;
  background: #1c3040;
  color: #f0cc83;
  font-weight: 750;
  text-decoration: none;
}
.tool-link:hover,
.tool-link:focus-visible {
  border-color: #f0cc83;
  background: #273b49;
  outline: none;
}
.tools-note {
  margin: 22px 0 0;
  color: #718a98;
  font-size: 13px;
  text-align: center;
}
@media (max-width: 800px) {
  .tool-card {
    grid-template-columns: 62px minmax(0, 1fr);
    padding: 24px 20px;
  }
  .tool-icon {
    width: 58px;
    height: 58px;
  }
  .tool-link {
    grid-column: 1 / -1;
    width: 100%;
  }
}
@media (max-width: 520px) {
  .tools-page {
    width: min(100% - 24px, 1180px);
    padding-top: 28px;
  }
  .tools-hero {
    padding: 28px 22px;
  }
  .tool-card {
    grid-template-columns: 1fr;
  }
  .tool-icon {
    width: 56px;
  }
  .tool-link {
    grid-column: auto;
  }
}
.plan-row > a,
.plan-row > button,
.community-dialog form > button {
  display: inline-block;
  border: 1px solid #647889;
  border-radius: 7px;
  background: #20384a;
  color: #ead5a5;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.community-dialog form > button {
  margin-top: 16px;
}
.community-dialog label {
  font-size: 14px;
}
@media (max-width: 650px) {
  .site-nav .discord-community {
    margin-left: 0;
  }
}
.support-file-help {
  display: block;
  margin-top: 6px;
  color: #8fa5b3;
}
.support-screenshot {
  display: block;
  width: min(100%, 720px);
  max-height: 520px;
  object-fit: contain;
  margin: 14px 0;
  border: 1px solid #4b6372;
  border-radius: 8px;
  background: #081119;
}
.community-dialog input[type='file'] {
  padding: 8px;
}
.community-dialog input[type='file']::file-selector-button {
  margin-right: 10px;
  border: 1px solid #617789;
  border-radius: 6px;
  padding: 8px 11px;
  background: #20384a;
  color: #ead5a5;
  cursor: pointer;
}
.dialog-actions .remove {
  color: #ffabb0;
  border-color: #75444a;
}
