:root {
  --page: #bbbbcc;
  --ink: #000000;
  --muted: #666666;
  --card: #ffffff;
  --locked: #dddde0;
  --locked-ink: #666666;
  --hot: #aa0033;
  --over: #ffdddd;
  --tip: #ffffdd;
  --line: #f7f7fb;
  --line-edge: #4e4e60;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

html.i18n-wait body { visibility: hidden; }

body.lang-ar .menu-wrap,
body.lang-ar .hint,
body.lang-ar .dialog { direction: rtl; }
body.lang-ar .toolbar { direction: ltr; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: "Segoe UI", "Yu Gothic UI", "Yu Gothic", "Malgun Gothic", "Microsoft YaHei", "Microsoft JhengHei", "Leelawadee UI", "Hiragino Sans", sans-serif;
  font-size: 12px;
}

button, input, select { font-family: inherit; }

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 10px;
  background: var(--page);
  border-bottom: 1px solid #9a9aaf;
}

.status {
  min-width: 280px;
  padding: 3px 8px;
  background: #fff;
  white-space: nowrap;
  order: 1;
}

.status.over { background: var(--over); }

.status .hot { color: var(--hot); }

.status .sub {
  font-size: 10px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  order: 3;
  flex: 1 1 100%;
}

.controls label { white-space: nowrap; }

select, input[type="text"] {
  font-size: 12px;
  color: #000;
  background: #fff;
  border: 1px solid #000;
}

input[type="text"] { width: 120px; padding: 1px 4px; }

#slotSelect { width: 220px; }

button.link {
  appearance: none;
  background: none;
  border: 0;
  padding: 0 1px;
  color: #000;
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  text-decoration: underline;
  cursor: pointer;
}

button.link:hover,
a.link:hover { color: #880000; }

a.link {
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  color: #000;
  text-decoration: underline;
}

.lang-switch {
  display: inline-flex;
  align-items: stretch;
  min-height: 32px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #efe8f8 100%);
  border: 2px solid #5c4578;
  border-radius: 8px;
  box-shadow: 0 1px 0 #fff inset, 2px 2px 0 #8a7aa0;
}

.toolbar .lang-switch {
  order: 2;
  margin-left: auto;
}

.lang-switch-mark {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: #5c4578;
  color: #efe4f8;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.lang-select {
  appearance: none;
  min-width: 13.5em;
  max-width: none;
  padding: 5px 30px 5px 10px;
  border: 0;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235c4578' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  font-size: 13px;
  font-weight: bold;
  color: #2a1a40;
  cursor: pointer;
}

.lang-select:focus {
  outline: none;
  background-color: #f7f2ff;
}

.hint {
  padding: 4px 12px 0;
  color: #333348;
  font-size: 11px;
}

.board-scroll {
  overflow: visible;
  padding: 8px 12px 8px;
}

.board {
  position: relative;
  width: 1040px;
  height: 600px;
}

.links {
  position: absolute;
  inset: 0;
  width: 1040px;
  height: 600px;
  overflow: visible;
  pointer-events: none;
}

.shade {
  position: absolute;
  background: #aaaabb;
  pointer-events: none;
}

.links path.edge {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.links path.edge.lit {
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  shape-rendering: geometricPrecision;
  stroke-dasharray: 12 16;
  animation: rainbow-flow 0.85s linear infinite;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.95));
}

@keyframes rainbow-flow {
  to { stroke-dashoffset: -28; }
}

.skill.lit-req,
.skill.lit-target {
  z-index: 5;
  animation: req-card 1.2s linear infinite;
}

@keyframes req-card {
  0% { box-shadow: 0 0 0 1px #fff, 0 0 8px 2px #ff4d4d; }
  20% { box-shadow: 0 0 0 1px #fff, 0 0 8px 2px #ffb020; }
  40% { box-shadow: 0 0 0 1px #fff, 0 0 8px 2px #ffe14a; }
  60% { box-shadow: 0 0 0 1px #fff, 0 0 8px 2px #5dff7a; }
  80% { box-shadow: 0 0 0 1px #fff, 0 0 8px 2px #3ec6ff; }
  100% { box-shadow: 0 0 0 1px #fff, 0 0 8px 2px #9b7dff; }
}

.req-label {
  fill: #ffffff;
  font-size: 11px;
  font-weight: bold;
  font-family: Arial, sans-serif;
}

.req-label.lit {
  fill: #fff;
  stroke: #221428;
  stroke-width: 3px;
  paint-order: stroke fill;
}

.skill {
  position: absolute;
  width: 168px;
  height: 28px;
  background-color: var(--card);
  background-image: url("../img/bar.png");
  background-repeat: no-repeat;
  background-position: -840px 0;
  color: var(--ink);
  user-select: none;
  cursor: pointer;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.18);
}

.skill.locked {
  background-color: var(--locked);
  color: var(--locked-ink);
}

.skill.quest {
  background-image: none;
  cursor: default;
}

.skill.quest .name {
  height: 28px;
  line-height: 28px;
}

.skill .icon {
  position: absolute;
  left: 0;
  top: 1px;
  width: 26px;
  height: 26px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  cursor: help;
}

.skill .name {
  position: absolute;
  left: 26px;
  top: 0;
  width: 140px;
  height: 16px;
  line-height: 16px;
  font-size: 12px;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: help;
}

.need-lv {
  position: absolute;
  right: 1px;
  top: 0;
  z-index: 4;
  height: 15px;
  padding: 0 3px;
  background: #3a2060;
  color: #ffe14a;
  font-size: 11px;
  font-weight: bold;
  line-height: 15px;
  pointer-events: none;
}

.skill .zero {
  display: none;
  position: absolute;
  top: 16px;
  width: 14px;
  height: 12px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #aa0033;
  font-size: 15px;
  font-weight: bold;
  line-height: 10px;
  cursor: pointer;
  z-index: 4;
}

.skill.has-lv:hover .zero { display: block; }

.tip {
  position: fixed;
  z-index: 40;
  display: none;
  width: min(440px, calc(100vw - 24px));
  background: var(--tip);
  border: 1px solid #000;
  line-height: 1.45;
}

.tip-delay {
  position: absolute;
  top: 4px;
  right: 24px;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #2244aa;
  font-size: 11px;
  font-weight: bold;
  line-height: 18px;
  cursor: pointer;
  text-decoration: underline;
}

.tip-close {
  position: absolute;
  top: 3px;
  right: 5px;
  z-index: 1;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #aa0033;
  font-size: 18px;
  font-weight: bold;
  line-height: 18px;
  cursor: pointer;
}

.tip-body {
  max-height: 70vh;
  overflow: auto;
  padding: 22px 22px 10px 12px;
}

.tip h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: bold;
}

.tip .meta { color: #553333; margin-bottom: 4px; }

.tip .desc { margin: 0 0 6px; }

.tip .desc-line {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.tip ul {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #000;
}

.tip li { padding: 1px 0; }

.tip li.now { color: var(--hot); font-weight: bold; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  background: rgba(0, 0, 0, 0.28);
}

.overlay.show { display: block; }

.dialog {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100% - 32px));
  min-height: 160px;
  padding: 22px 18px;
  background: #fff;
  text-align: center;
}

.dialog.wide {
  width: min(560px, calc(100% - 24px));
  padding: 16px 14px 18px;
}

.delay-box h3 {
  margin: 0 0 8px;
  padding: 6px 8px;
  background: #d6e4ff;
  color: #223366;
  font-size: 14px;
}

.delay-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 auto 12px;
  font-size: 12px;
  text-align: center;
}

.delay-table th,
.delay-table td {
  border: 1px solid #9aaad4;
  padding: 4px 6px;
}

.delay-table thead th {
  background: #d6e4ff;
  color: #223366;
  font-weight: bold;
}

.delay-table tbody th {
  background: #eef3ff;
  font-weight: bold;
}

.delay-table tbody tr.now td,
.delay-table tbody tr.now th {
  background: #fff3c4;
}

.dialog p { margin: 0 0 14px; line-height: 1.6; }

.dialog .actions { display: flex; justify-content: center; gap: 16px; }

.dialog button.act {
  min-width: 88px;
  padding: 4px 12px;
  font-size: 13px;
  background: #fff;
  border: 1px solid #000;
  cursor: pointer;
}

.dialog input.url {
  width: 100%;
  margin-top: 8px;
}

.menu-wrap {
  width: min(1040px, calc(100% - 28px));
  margin: 28px auto 48px;
}

.menu-hero {
  position: relative;
  padding: 18px 168px 16px 20px;
  margin-bottom: 22px;
  background: linear-gradient(160deg, #ececf8 0%, #d8d8ea 55%, #c8c8dc 100%);
  border: 1px solid #fff;
  box-shadow: 0 1px 0 #fff inset, 2px 3px 0 #8a8a9e;
  border-radius: 12px;
}

.menu-kicker {
  width: fit-content;
  margin: 2px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #c9a227;
  color: #2c2340;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}

.menu-kicker span {
  color: #9a7420;
  font-weight: 700;
  letter-spacing: 0.04em;
}

a.menu-kicker,
a.menu-kicker:visited {
  display: inline-block;
  color: #2c2340;
  text-decoration: none;
}

.toolbar .menu-kicker {
  order: 0;
  flex: 1 1 100%;
  margin: 0 0 6px;
}

.menu-wrap h1 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: 0.06em;
}

.menu-wrap .lead {
  margin: 0;
  color: #333;
  line-height: 1.6;
  font-size: 13px;
}

.lead-warn {
  margin: 16px -148px 0 0;
  padding: 12px 14px 12px 16px;
  background: #fff4d4;
  border: 1px solid #c45c1a;
  border-left-width: 6px;
  border-radius: 8px;
  color: #7a1a12;
  font-size: 13px;
  font-weight: bold;
  line-height: 1.7;
}

.lead-warn[hidden] { display: none; }

.lead-warn p { margin: 0; }

.lead-warn p + p { margin-top: 0.4em; }

body.sim .lead-warn {
  margin: 8px 12px 4px;
}

.menu-hero .lang-switch {
  position: absolute;
  top: 14px;
  right: 16px;
}

.job-group { margin-bottom: 28px; }

.job-group h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.job-group h2 span {
  display: inline-block;
  min-width: 42px;
  padding: 3px 8px;
  background: #5c4578;
  color: #efe4f8;
  font-size: 12px;
  letter-spacing: 0.08em;
  border-radius: 999px;
  text-align: center;
}

.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.job-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 96px;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
  background: linear-gradient(180deg, #ffffff 0%, #f4f4fb 100%);
  border: 1px solid #e4e4f0;
  border-left-width: 6px;
  border-radius: 12px;
  box-shadow: 0 1px 0 #fff inset, 2px 3px 0 #8a8a9e;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.job-card:hover,
.job-card:focus-visible {
  background: linear-gradient(180deg, #ffffff 0%, #ececff 100%);
  transform: translateY(-2px);
  box-shadow: 0 1px 0 #fff inset, 3px 6px 0 #7a7a90;
  outline: none;
}

.job-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  image-rendering: pixelated;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  background-repeat: no-repeat;
  background-position: 0 0;
}

.job-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.job-card strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.job-card em {
  font-style: normal;
  font-size: 11px;
  color: #666;
  margin: 2px 0 6px;
}

.job-card .job-copy > span {
  color: #333;
  font-size: 12px;
  line-height: 1.45;
}

.job-go {
  font-size: 11px;
  font-weight: bold;
  color: #aa0033;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.job-card[data-job="knt"] { border-left-color: #8b1e1e; }
.job-card[data-job="knt"] .job-thumb { background-color: #8b1e1e; background-image: url("../img/icon_knt.png"); background-size: 480px 48px; }
.job-card[data-job="wiz"] { border-left-color: #3d4ea8; }
.job-card[data-job="wiz"] .job-thumb { background-color: #3d4ea8; background-image: url("../img/icon_wiz.png"); background-size: 624px 48px; }
.job-card[data-job="hun"] { border-left-color: #2f7a3a; }
.job-card[data-job="hun"] .job-thumb { background-color: #2f7a3a; background-image: url("../img/icon_hnt.png"); background-size: 816px 48px; }
.job-card[data-job="pri"] { border-left-color: #c9a227; }
.job-card[data-job="pri"] .job-thumb { background-color: #c9a227; background-image: url("../img/icon_pri.png"); background-size: 864px 48px; }
.job-card[data-job="asn"] { border-left-color: #4a3a6a; }
.job-card[data-job="asn"] .job-thumb { background-color: #4a3a6a; background-image: url("../img/icon_ass.png"); background-size: 480px 48px; }
.job-card[data-job="bsm"] { border-left-color: #8a6230; }
.job-card[data-job="bsm"] .job-thumb { background-color: #8a6230; background-image: url("../img/icon_bsm.png"); background-size: 1008px 48px; }
.job-card[data-job="cru"] { border-left-color: #c45c1a; }
.job-card[data-job="cru"] .job-thumb { background-color: #c45c1a; background-image: url("../img/icon_cru.png"); background-size: 864px 48px; }
.job-card[data-job="sag"] { border-left-color: #2a7a8a; }
.job-card[data-job="sag"] .job-thumb { background-color: #2a7a8a; background-image: url("../img/icon_sag.png"); background-size: 960px 48px; }
.job-card[data-job="brd"] { border-left-color: #6a4ac4; }
.job-card[data-job="brd"] .job-thumb { background-color: #6a4ac4; background-image: url("../img/icon_brd.png"); background-size: 384px 48px; }
.job-card[data-job="dnc"] { border-left-color: #c43a7a; }
.job-card[data-job="dnc"] .job-thumb { background-color: #c43a7a; background-image: url("../img/icon_dan.png"); background-size: 384px 48px; }
.job-card[data-job="mnk"] { border-left-color: #6b3a1e; }
.job-card[data-job="mnk"] .job-thumb { background-color: #6b3a1e; background-image: url("../img/icon_mon.png"); background-size: 720px 48px; }
.job-card[data-job="rog"] { border-left-color: #3a5a4a; }
.job-card[data-job="rog"] .job-thumb { background-color: #3a5a4a; background-image: url("../img/icon_rog.png"); background-size: 960px 48px; }
.job-card[data-job="alc"] { border-left-color: #1e7a5a; }
.job-card[data-job="alc"] .job-thumb { background-color: #1e7a5a; background-image: url("../img/icon_alc.png"); background-size: 768px 48px; background-position: -96px 0; }

.site-foot {
  margin: 18px 12px 16px;
  padding: 0 8px 12px;
  color: #4a4a5c;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.site-foot p { margin: 0; }

.site-foot p + p { margin-top: 0.45em; }

.site-foot .copy {
  color: #3a3a48;
}

body.sim .site-foot {
  margin-top: 18px;
}

body.lang-ar .site-foot { direction: rtl; }

@media (max-width: 640px) {
  .menu-hero { padding: 18px 20px 16px; }
  .lead-warn { margin-right: 0; }
  .menu-hero .lang-switch {
    position: static;
    display: inline-flex;
    margin: 0 0 10px auto;
  }
  .job-card {
    grid-template-columns: 48px 1fr;
  }
  .job-go { display: none; }
}
