/* The directory shares its functional colors with dialogs and the floating lounge. */
:where(.directory, dialog, .chat-widget, .site-footer) {
  --pw-black: #171e19;
  --pw-yellow: #ffe17c;
  --pw-sage: #b7c6c2;
  --pw-wash: #f5f7f5;
  --ink: var(--pw-black);
  --muted: #52605a;
  --accent: #273f33;
  --line: rgb(23 30 25 / 17%);
}

.directory {
  padding-block-start: clamp(30px, 4vw, 60px);
  scroll-margin-block-start: 90px;
}
.directory-controls { margin-bottom: clamp(18px, 2.4vw, 30px); }
.directory-search, .directory-controls .kakao-invite { align-self: end; }
:is(.directory, dialog) .section-code { color: #47564e; }
:is(.directory, dialog) .section-code span { background: var(--pw-black); }
.directory .section-code b { font: 700 10px/1.4 var(--body); letter-spacing: .16em; }
.directory .title-line { align-items: center; gap: 12px; margin-top: 6px; }
.directory .title-line h2,
:is(dialog, .footer-about, .footer-intro, .traffic-header) h2 {
  font-family: var(--display);
}
.directory .title-line h2 {
  min-width: 0;
  font-size: clamp(32px, 4.4vw, 60px);
  letter-spacing: normal;
  line-height: 1.12;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.directory .total {
  flex: none;
  padding: 4px 10px;
  color: var(--pw-black);
  background: var(--pw-yellow);
  border: 0;
  border-radius: 3px;
  font: 700 13px/1.35 var(--body);
  font-variant-numeric: tabular-nums;
}
.directory .search-control {
  min-width: 0;
  height: auto;
  min-height: 44px;
  background: white;
  border-radius: 8px;
  color: var(--muted);
}
.directory .search-control:focus-within { border-color: var(--pw-black); box-shadow: 0 0 0 2px var(--pw-yellow); }
.directory .search-control input { height: auto; align-self: stretch; }
.directory kbd { border-color: var(--line); background: var(--pw-wash); color: var(--muted); }
.directory-views { margin-top: clamp(12px, 1.8vw, 24px); border-color: var(--line); }
.directory-views .nav-link { min-height: 43px; color: var(--muted); }
.directory-views .nav-link:is(:hover, [aria-current="page"]) { color: var(--pw-black); }
.directory-views .nav-link[aria-current="page"]::after {
  background: var(--pw-yellow);
  border-top: 1px solid var(--pw-black);
  height: 4px;
}
.directory #saved-count { color: var(--pw-black); background: var(--pw-yellow); }
.directory .sort { color: var(--muted); }
.directory .sort select { color: var(--ink); }
.directory-controls .filters { gap: 6px; padding-block: 14px; }
.filter, .all-filters { color: #37443b; background: white; border-color: var(--line); border-radius: 5px; }
.directory-controls .filter { min-height: 33px; padding-inline: 9px; }
.filter small { color: #5f6c64; }
.filter[aria-pressed="true"] { background: var(--pw-black); border-color: var(--pw-black); color: white; }
.filter[aria-pressed="true"] small { color: var(--pw-yellow); }
.directory-controls .more-categories, .directory-controls .all-filters { background: var(--pw-wash); color: var(--ink); }
.filter:hover, .directory-controls .all-filters:hover { border-color: var(--pw-black); }

.cards { gap: clamp(15px, 2vw, 28px) clamp(11px, 1.5vw, 22px); }
.world-card {
  background: white;
  border-color: var(--line);
  border-radius: 8px;
  color: var(--ink);
  transition: border-color 300ms cubic-bezier(.4, 0, .2, 1), box-shadow 300ms cubic-bezier(.4, 0, .2, 1);
}
.world-card:focus-within { border-color: var(--pw-black); }
.world-card .cover { background: #e7ece8; border-color: rgb(23 30 25 / 10%); }
.world-card .card-body { padding: clamp(10px, 1.25vw, 17px); }
.world-card .meta { font-size: 11px; color: #415148; }
.world-card .dot { border-radius: 50%; }
.world-card h3 { font: 700 clamp(16px, 1.4vw, 21px)/1.35 var(--body); letter-spacing: -.025em; }
.world-card .summary { color: var(--muted); font-size: 13px; }
.world-card .card-credit { color: #617167; padding-top: 10px; }
.world-card .card-foot { border-color: var(--line); margin-top: 8px; padding-top: 6px; }
.pick-badge, .rank-badge {
  border: 0;
  border-radius: 3px;
  padding: 3px 8px;
  background: var(--pw-yellow);
  color: var(--ink);
  font: 700 10px/1.5 var(--body);
  letter-spacing: .055em;
}
.pick-badge .icon { color: currentColor; }
.rank-badge { color: white; background: var(--pw-black); }
.save { background: #fffffff2; color: var(--ink); border-color: rgb(23 30 25 / 12%); }
.save[aria-pressed="true"] { background: var(--pw-yellow); color: var(--ink); }
.save[aria-pressed="true"] .icon { fill: var(--ink); }
.social { color: var(--muted); border-radius: 4px; }
.social:hover { color: var(--ink); background: var(--pw-wash); }
.like[aria-pressed="true"] { color: #aa363a; }
.like[aria-pressed="true"] .icon { fill: #f5bcc1; }
.world-card .enter { color: var(--ink); }
.enter:hover, .title-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.directory #notice, .directory .empty { background: var(--pw-wash); border-color: var(--line); }
.directory .more {
  min-height: 46px;
  margin-top: 28px;
  padding: 10px 24px;
  border: 1px solid var(--pw-black);
  background: white;
  color: var(--ink);
  border-radius: 999px;
  font-weight: 700;
}
.directory .more:hover { background: var(--pw-yellow); }
.directory .more small { color: var(--muted); }
@media (hover: hover) and (pointer: fine) {
  .world-card:hover { border-color: #75847b; box-shadow: 0 10px 24px -11px rgb(23 30 25 / 36%); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .world-card, .cover-trigger > :is(img, .fallback) {
    transition: transform 300ms cubic-bezier(.4, 0, .2, 1), box-shadow 300ms cubic-bezier(.4, 0, .2, 1), border-color 300ms cubic-bezier(.4, 0, .2, 1);
  }
  .world-card:hover { transform: translateY(-4px) scale(1.012); }
  .world-card:hover .cover-trigger > :is(img, .fallback) { transform: scale(1.07); }
}

/* Keep status colors independent of the brand accent. */
.server-status[data-state="fast"] { color: #206d43; }
.server-status[data-state="normal"] { color: #345e87; }
.server-status[data-state="slow"] { color: #895515; }
.server-status[data-state="offline"] { color: #a8393e; }

dialog, #change-dialog { border-color: var(--line); border-radius: 12px; background: white; }
dialog::backdrop { background: rgb(16 22 18 / 65%); }
dialog .dialog-close, #change-dialog .dialog-close { background: white; color: var(--ink); border: 1px solid var(--line); }
dialog .dialog-close:hover { background: var(--pw-yellow); }
.detail-text h2, .entry-form h2, .directory-dialog h2 { color: var(--ink); line-height: 1.2; }
.detail-guide { padding: 16px 18px; background: var(--pw-wash); border-color: var(--pw-yellow); }
.detail-guide li::marker { color: #627368; }
.guide-citation, #comment-thread article { border-color: var(--line); }
.detail-text .tag { color: #36463d; background: #e9efeb; }
dialog .primary, #change-dialog .primary, #feedback-form .primary {
  background: var(--pw-yellow);
  color: var(--pw-black);
  border: 1px solid transparent;
  border-radius: 7px;
}
dialog .primary:hover, #change-dialog .primary:hover, #feedback-form .primary:hover {
  background: #f5d265;
  color: var(--pw-black);
  text-decoration: none;
}
.entry-form :is(input, select, textarea), #comment-form :is(input, textarea),
#change-fields > :is(input, select, textarea), #feedback-form :is(select, textarea) {
  border-color: rgb(23 30 25 / 24%);
  background: var(--pw-wash);
  color: var(--ink);
}
.change-types span { border-color: var(--line); }
.change-notice, #change-confirmation { color: #45390f; background: #fff3c6; }

.site-footer {
  --ink: white;
  --muted: #b7c6c2;
  --line: rgb(183 198 194 / 21%);
  --accent: #ffe17c;
  margin-top: 0;
  color: white;
  background: var(--pw-black);
  border-top: 1px solid var(--line);
}
.footer-inner { padding-block-start: clamp(14px, 2vw, 32px); }
.footer-feedback summary {
  border-color: var(--line);
  color: white;
  background: transparent;
}
.footer-feedback summary .icon:first-child { color: var(--pw-yellow); }
.footer-feedback summary:hover, .footer-feedback[open] summary { border-color: var(--pw-yellow); }
.footer-intro {
  margin-block: clamp(24px, 3vw, 42px) 20px;
  padding: 0;
  color: white;
  border: 0;
  background: transparent;
}
.footer-intro h2 { font-size: clamp(22px, 2.8vw, 38px); }
.footer-intro p { max-width: 78ch; }
.footer-action, .footer-action.featured-action {
  background: #242d27;
  color: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.footer-action.featured-action { background: var(--pw-yellow); border-color: var(--pw-yellow); color: var(--pw-black); }
.featured-action span { color: #494225; }
.featured-action b { padding: 4px 10px; background: var(--pw-black); color: white; border-radius: 999px; }
.footer-actions .footer-action:hover { color: white; background: #2e3a31; border-color: var(--pw-yellow); }
.footer-actions .featured-action:hover { background: #ffea9d; color: var(--pw-black); }
.footer-week { margin-top: 12px; color: var(--pw-yellow); }
.footer-traffic dl, .footer-guide, #feedback-form { background: #242d27; border: 1px solid var(--line); border-radius: 8px; }
.footer-traffic dl div + div { border-color: var(--line); }
.footer-traffic dd { color: var(--pw-yellow); }
.footer-facts a { text-underline-offset: 4px; }
.footer-guide ul { color: var(--muted); }
.footer-guide li::marker { color: var(--pw-yellow); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 20px; }
#feedback-form :is(select, textarea) { color: var(--pw-black); }

#chat-launcher { background: var(--pw-black); border-color: #455149; color: white; box-shadow: 0 5px 18px #17231d38; }
#chat-launcher .icon, .chat-head small { color: var(--pw-yellow); }
#chat-launcher:hover, #chat-close:hover { background: #314137; }
#guide-chat, .chat-tabs, #chat-form { background: white; border-color: var(--line); }
.chat-head { background: var(--pw-black); color: white; }
.chat-avatar { color: var(--pw-black); background: var(--pw-yellow); border-color: transparent; }
.chat-tabs button[aria-selected="true"] { color: var(--ink); border-bottom: 3px solid #d0a947; }
.chat-widget :is(#chat-log, #chat-input, .activity-summary, .activity-row) { color: var(--ink); background: var(--pw-wash); }
.chat-bubble, .chat-world { background: white; border-color: var(--line); }
.chat-question, .chat-prompts button:hover, .chat-next:hover { background: #fff0b5; color: var(--ink); }
.chat-prompts button, .chat-next { background: white; border-color: var(--line); color: var(--ink); }
.chat-world:hover { border-color: var(--pw-black); }
.chat-category, .activity-event, .activity-time, #chat-activity-state { color: var(--muted); }
.chat-enter { color: var(--ink); }
#chat-send, .activity-cta { background: var(--pw-yellow); color: var(--ink); }
#chat-send:disabled { background: #e8ece9; color: #647369; }

:is(.directory, dialog, .chat-widget, .site-footer) :focus-visible { outline: 2px solid #597364; outline-offset: 2px; }
.site-footer :focus-visible, .chat-head :focus-visible { outline-color: var(--pw-yellow); }
.directory .search-control input:focus { outline: none; }

@media (max-width: 760px) {
  .directory-controls .filter { padding-inline: 7px; }
  .directory-views { flex-wrap: wrap; }
  .directory-views .sort { margin-inline-start: auto; }
}
@media (max-width: 565px) {
  .directory .title-line { gap: 8px; }
  .directory-controls .filters { gap: 5px; padding: 10px 0; }
  .directory-controls .filter { min-height: 29px; padding-inline: 6px; }
  .directory-views nav { flex-wrap: wrap; row-gap: 0; }
  .directory-views .nav-link { min-height: 36px; }
  .directory .search-control { gap: 6px; padding-inline: 9px; }
  .world-card .card-body { padding: 9px; }
  .world-card h3 { font-size: 15px; }
  .world-card .summary { font-size: 12px; }
  .world-card .meta { font-size: 10px; }
  .world-card .card-foot { padding-top: 4px; margin-top: 6px; flex-wrap: wrap; column-gap: 2px; }
  .pick-badge, .rank-badge { padding: 2px 5px; font-size: 9px; }
  .cards { gap: 14px 9px; }
}
