:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

html {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background: #0b0820;
}

body {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y pinch-zoom;
  background:
    linear-gradient(180deg, rgba(11, 8, 32, 0.42), rgba(11, 8, 32, 0.88)),
    url(../../images/bg.jpg) center top / cover fixed no-repeat;
  color: #f8f6ff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

button,
input,
select {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[role="tab"]:focus-visible,
a:focus-visible {
  outline: 3px solid #ffe45c;
  outline-offset: 2px;
}

a {
  color: #d7c1ff;
  text-decoration: none;
}

a:hover {
  color: #ffffff;
}

.main {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  padding: 28px 16px 48px;
  overflow-x: hidden;
}

.bobina {
  width: min(100%, 1180px);
  max-width: 100%;
  margin: 0 auto;
  overflow-x: clip;
}

.fullwrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  visibility: hidden;
}

.sim-card,
.sim-header,
.sim-notice {
  border: 1px solid rgba(255, 222, 92, 0.22);
  background: rgba(16, 12, 34, 0.9);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.38);
}

.sim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 116px;
  padding: 18px 22px;
  border-radius: 12px 12px 0 0;
  background:
    linear-gradient(90deg, rgba(12, 8, 30, 0.74), rgba(12, 8, 30, 0.46)),
    url(../img/vrZeRjn9YmqXyi5OsKoPp324bz.png) center 31% / cover no-repeat;
}

.sim-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.sim-brand img {
  display: block;
  width: 120px;
  max-width: 34vw;
  height: auto;
}

.sim-title {
  min-width: 0;
}

.sim-kicker {
  margin: 0 0 4px;
  color: #ffe45c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.sim-title h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1;
  text-shadow: 0 3px 0 rgba(73, 39, 117, 0.8);
}

.sim-home {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 228, 92, 0.48);
  border-radius: 6px;
  background: rgba(255, 228, 92, 0.12);
  color: #fff6b1;
  font-weight: 800;
}

.sim-home:hover {
  background: #ffe45c;
  color: #171026;
  box-shadow: 0 0 22px rgba(255, 228, 92, 0.38);
}

.sim-card {
  padding: 18px;
  border-top: 0;
  border-radius: 0 0 12px 12px;
}

.sim-status {
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 1px solid rgba(145, 210, 255, 0.55);
  border-radius: 7px;
  background: rgba(58, 148, 211, 0.2);
  color: #e8f7ff;
  font-size: 13px;
  line-height: 1.45;
}

.sim-status[hidden] {
  display: none;
}

.sim-status.is-warning {
  border-color: rgba(255, 210, 31, 0.7);
  background: rgba(165, 115, 0, 0.25);
  color: #fff5b3;
}

.sim-status.is-error {
  border-color: rgba(255, 101, 101, 0.75);
  background: rgba(152, 22, 22, 0.3);
  color: #ffe2e2;
}

div.header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 64px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

h3.caption {
  display: none;
}

form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  color: #ffffff;
  font-size: 14px;
}

#jobselect,
input.num {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  color: #171026;
}

#jobselect {
  width: min(100%, 390px);
  padding: 0 10px;
}

input.num {
  width: 68px;
  padding: 0 7px;
  text-align: center;
}

.bonus-hint {
  color: #ffe45c;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.sp-readout {
  justify-self: end;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 7px;
  background: #ffe45c;
  color: #171026;
  font-weight: 900;
  white-space: nowrap;
}

.sp-readout.is-over-budget {
  background: #ff6a6a;
  color: #270000;
}

.spDisp {
  font-size: 22px;
}

div.contents {
  min-height: 0;
  margin: 0;
  padding: 0;
}

#tab_list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

#tab_list li {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  user-select: none;
}

#tab_list li:hover,
#tab_list li.is-active {
  border-color: rgba(255, 228, 92, 0.65);
  background: #ffe45c;
  color: #171026;
}

.simulator-grid {
  display: grid;
  grid-template-columns: 422px minmax(310px, 390px);
  gap: 18px;
  align-items: start;
  justify-content: center;
}

.skill-panel,
div.tips {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(248, 246, 255, 0.96);
  color: #171026;
}

.skill-panel {
  justify-self: center;
  width: min(100%, 422px);
  min-width: 0;
  padding: 10px;
}

.skill-board-shell {
  --skill-board-scale: 1;
  position: relative;
  width: min(100%, 400px);
  height: 484px;
  margin: 0 auto;
  overflow: hidden;
}

div.skilltable {
  position: absolute;
  top: 0;
  left: 50%;
  width: 400px;
  height: 484px;
  margin-left: -200px;
  overflow: hidden;
  background-color: #e7e4dc;
  background-position: 10px 0;
  background-repeat: no-repeat;
  background-size: 380px 453px;
  color: #171026;
  transform: scale(var(--skill-board-scale));
  transform-origin: top center;
}

div.skilltable[hidden] {
  display: none !important;
}

div.skilltable.is-missing-class {
  background:
    repeating-linear-gradient(135deg, rgba(96, 78, 116, 0.08) 0 10px, transparent 10px 20px),
    #efedf2;
}

.board-heading {
  position: absolute;
  z-index: 4;
  top: 7px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
  color: #18101f;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 4px rgba(255, 255, 255, 0.75);
}

.jobname {
  min-width: 0;
  overflow: hidden;
  color: #18101f;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usesp {
  flex: 0 0 auto;
  color: #18101f;
  font-size: 15px;
  font-weight: 900;
}

.skilltree,
.skill-arrow-layer,
.skill-node-layer {
  position: absolute;
  inset: 0;
  display: block;
}

.skill-arrow-layer {
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.skill-arrow-mask {
  position: absolute;
  display: block;
  overflow: hidden;
  transition: filter 120ms ease, opacity 120ms ease;
}

.skill-arrow-mask.is-inactive {
  filter: grayscale(1) brightness(0.7);
  opacity: 0.62;
}

.skill-arrow-mask.is-satisfied {
  filter:
    brightness(0)
    saturate(100%)
    invert(50%)
    sepia(98%)
    saturate(3261%)
    hue-rotate(2deg)
    brightness(101%)
    contrast(105%)
    drop-shadow(0 0 1px rgba(255, 122, 0, 0.78));
  opacity: 1;
}

.skill-arrow {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.skill-node-layer {
  z-index: 2;
}

.skill-node {
  position: absolute;
  width: 46px;
  height: 62px;
  color: #ffffff;
  font-size: 10px;
}

.skill-icon-button {
  position: absolute;
  top: 3px;
  left: 3px;
  display: block;
  width: 42px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(24, 13, 35, 0.82);
  border-radius: 5px;
  background: linear-gradient(135deg, #40324f, #17101e);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.72);
  transition: filter 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.skill-icon {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.skill-icon.is-missing {
  background:
    linear-gradient(45deg, transparent 46%, #ff7171 47% 53%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, #ff7171 47% 53%, transparent 54%),
    #24192d;
}

.skill-node.is-locked .skill-icon-button {
  filter: grayscale(0.92) brightness(0.65);
}

.skill-node.is-learned .skill-icon-button {
  border-color: #ffe45c;
  box-shadow:
    0 0 0 1px rgba(60, 34, 0, 0.9),
    0 0 8px rgba(255, 228, 92, 0.78);
}

.skill-node.is-selected {
  z-index: 5;
}

.skill-node.is-selected .skill-icon-button {
  transform: scale(1.07);
  box-shadow:
    0 0 0 2px #2a1c44,
    0 0 0 4px #ffd21f,
    0 0 13px 4px rgba(255, 210, 31, 0.82);
}

.skill-rank-controls {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.skill-rank-button {
  position: absolute;
  display: grid;
  place-items: center;
  top: 29px;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.62);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.96);
  color: #171026;
  font-size: 13px;
  font-weight: 1000;
  line-height: 1;
  pointer-events: auto;
}

.skill-add {
  left: 30px;
}

.skill-remove {
  left: 2px;
}

.skill-rank-button:not(:disabled):hover {
  background: #ffe45c;
}

.skill-rank-button:disabled {
  opacity: 0.26;
}

.skill-rank {
  position: absolute;
  top: 44px;
  left: 3px;
  width: 40px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 13px;
  text-align: center;
  text-shadow:
    -1px -1px 1px #000,
    1px -1px 1px #000,
    -1px 1px 1px #000,
    1px 1px 1px #000;
}

.skill-rank strong {
  color: #ffe45c;
}

div.tips {
  min-height: 484px;
  max-height: 650px;
  padding: 18px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.5;
}

.tips-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(66, 40, 82, 0.16);
}

.tips-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 1px solid #2c2033;
  border-radius: 6px;
  background: #24192d;
  object-fit: contain;
}

.tips-icon.is-missing {
  background:
    linear-gradient(45deg, transparent 46%, #ff7171 47% 53%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, #ff7171 47% 53%, transparent 54%),
    #24192d;
}

.tips-title-group {
  min-width: 0;
}

.tips-type {
  margin: 0 0 3px;
  color: #76558d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

div.tips h2 {
  margin: 0;
  color: #553568;
  font-size: 22px;
  line-height: 1.08;
}

.tips-id {
  margin: 5px 0 0;
  color: #766c7c;
  font-size: 10px;
}

.rank-browser {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  gap: 8px;
  align-items: center;
  margin: 14px 0;
  padding: 8px;
  border-radius: 6px;
  background: #ece7f0;
}

.rank-browser-button {
  width: 34px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(55, 35, 65, 0.28);
  border-radius: 5px;
  background: #ffffff;
  color: #382344;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.rank-browser-button:not(:disabled):hover {
  background: #ffe45c;
}

.rank-browser-button:disabled {
  opacity: 0.32;
}

.rank-browser-value {
  color: #34253c;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.skill-details {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.skill-detail-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.skill-details dt {
  color: #75697b;
  font-weight: 700;
}

.skill-details dt::after {
  content: ":";
}

.skill-details dd {
  margin: 0;
  color: #241a29;
  font-weight: 800;
}

.skill-details .skill-effect-blue {
  color: #6559dd;
}

.skill-details .skill-effect-orange {
  color: #d05f18;
}

.skill-details .skill-gauge {
  color: #8a7000;
}

.skill-description-label {
  margin: 15px 0 0;
  color: #7a6500;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.skill-description {
  margin: 5px 0 0;
  padding: 13px;
  border-left: 4px solid #8c63a5;
  border-radius: 0 5px 5px 0;
  background: #f0edf2;
  color: #291e2f;
  line-height: 1.58;
  white-space: pre-line;
}

.skill-pvp-notice {
  margin: 15px 0 0;
  padding: 9px 11px;
  border: 1px solid #bd2f3d;
  border-radius: 5px;
  background: #ffe8eb;
  color: #a11626;
  font-weight: 900;
}

.skill-cannot-block {
  margin: 13px 0 0;
  padding: 9px 11px;
  border-left: 4px solid #d3a800;
  border-radius: 0 5px 5px 0;
  background: #fff7cf;
  color: #725900;
  font-weight: 900;
}

@media (max-width: 430px) {
  .skill-detail-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
  }

  .skill-details dd {
    padding-left: 8px;
  }
}

.tips-lock-reason,
.tips-warning {
  margin: 12px 0 0;
  padding: 9px 11px;
  border: 1px solid #d8a826;
  border-radius: 5px;
  background: #fff4c7;
  color: #614700;
  font-weight: 800;
}

.sim-notice {
  margin-top: 18px;
  padding: 18px 22px;
  border-radius: 10px;
  color: #f8f6ff;
  font-size: 13px;
  line-height: 1.65;
}

.sim-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.sim-play {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 6px;
  background: #ffe45c;
  color: #171026;
  font-weight: 900;
}

.sim-play:hover {
  background: #ffffff;
  color: #171026;
}

.sim-play img {
  width: auto;
  height: 36px;
}

.sim-share-label {
  display: block;
  margin: 14px 0 6px;
  color: #fff4c2;
  font-size: 13px;
  font-weight: 700;
}

.sim-share-url {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 228, 92, 0.55);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff8d8;
  font-size: 13px;
}

.sim-share-url:focus {
  outline: 2px solid #ffe45c;
  outline-offset: 1px;
}

@media (max-width: 900px) {
  .simulator-grid {
    grid-template-columns: 1fr;
  }

  div.tips {
    width: min(100%, 422px);
    min-height: 260px;
    max-height: none;
    justify-self: center;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 12px 8px 32px;
  }

  .sim-header {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 16px;
  }

  .sim-home {
    width: 100%;
  }

  .sim-card {
    padding: 12px;
  }

  div.header {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  form {
    align-items: stretch;
  }

  #jobselect {
    width: 100%;
  }

  .sp-readout {
    justify-self: stretch;
    justify-content: center;
  }

  #tab_list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #tab_list li {
    padding: 6px 9px;
  }

  .skill-panel {
    padding: 8px;
  }

  .sim-notice {
    padding: 14px;
  }
}

@media (max-width: 390px) {
  .sim-title h1 {
    font-size: 24px;
  }

  input.num {
    width: 58px;
  }

  .skill-details {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .skill-details dd {
    margin-bottom: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
