/* Thương Cảng 1800 — v2 (nháp): composition taken from the concept mockups. Tokens over ../../css/palette.css. */
:root {
  color-scheme: light;
  --text: var(--muc-900);
  --text-2: var(--muc-700);
  --text-muted: var(--muc-600);
  --title: var(--chu-500);
  --good: var(--la-text);
  --good-ui: var(--la-ui);
  --warn: var(--nghe-text);
  --warn-ui: var(--nghe-ui);
  --bad: var(--chusa-bad);
  --lux: var(--hoaca-text);
  --lux-ui: var(--hoaca-500);
  --info: var(--song-700);
  --tier-nong-dan: #5d7425;
  --tier-tho: #2c5868;
  --tier-thi-dan: #8a4b22;
  --tier-bac-vat: #44505c;
  --tier-phu-thuong: #8a6420;
  --font-display: 'Water Brush', 'Brygada 1918', Georgia, serif;
  --font-title: 'Brygada 1918', Georgia, serif;
  --font-ui: 'Be Vietnam Pro', system-ui, sans-serif;
  --font-num: 'Brygada 1918', Georgia, serif;
  --font-head: var(--font-title); /* tiêu đề bảng ≥ 16 px (bộ C: bút lông) */
  --font-label: var(--font-title); /* nhãn mục, đường kẻ có chữ (bộ B: Vina Sans) */
  --gap: 12px;
  --tap: 30px;
  --shadow: 0 10px 26px rgba(9, 8, 6, 0.4), 0 2px 6px rgba(9, 8, 6, 0.3);
  --paper-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .32 0 0 0 0 .16 0 0 0 .55 -.18'/%3E%3C/filter%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .32' numOctaves='3' seed='9'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .36 0 0 0 0 .18 0 0 0 .9 -.42'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23a)'/%3E%3Crect width='240' height='240' filter='url(%23b)' transform='rotate(28 120 120)'/%3E%3C/svg%3E");
  --red: linear-gradient(180deg, #8a200c 0%, #6a1407 45%, #520902 100%);
  --red-btn: radial-gradient(circle at 50% 30%, #9a2a10 0%, #6a1407 60%, #4a0904 100%);
  --black: linear-gradient(180deg, #24211c 0%, #15130f 55%, #0b0a07 100%);
}
:root[data-input='touch'],
[data-form='phone'] {
  --tap: 44px;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}
body {
  font: 14px/1.35 var(--font-ui);
  color: var(--text);
  background: #7d8a88;
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
}
.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.num {
  font-family: var(--font-num);
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: 600;
}
.pos {
  color: var(--good);
}
.neg {
  color: var(--bad);
}
.wt {
  color: var(--warn);
}
.glyph {
  display: block;
  flex: none;
}
.gicon {
  flex: none;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(36, 27, 18, 0.35));
}
.portrait {
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 20%;
  background: radial-gradient(circle at 50% 35%, var(--paper-50), var(--paper-300));
  box-shadow: 0 0 0 2px var(--tone, var(--vang-400)), 0 0 0 3px var(--then-900);
}

/* ---------------------------------------------------------------- the 3D placeholder */
.world {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    repeating-linear-gradient(30deg, transparent 0 39px, rgba(255, 255, 255, 0.15) 39px 40px),
    repeating-linear-gradient(150deg, transparent 0 39px, rgba(255, 255, 255, 0.15) 39px 40px),
    radial-gradient(120% 90% at 40% 35%, #a9b4a3 0%, #94a3a0 55%, #7f9196 100%);
}
.world__label {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  padding: 6px 12px;
  border: 1px dashed rgba(36, 27, 18, 0.35);
  border-radius: 6px;
  color: rgba(36, 27, 18, 0.62);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.world__label small {
  font-weight: 500;
}
.world__pick {
  position: absolute;
  width: 92px;
  height: 52px;
  transform: translate(-50%, -50%);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: rgba(239, 200, 112, 0.4);
  pointer-events: none;
}

/* ---------------------------------------------------------------- surfaces */
.paper {
  background-color: var(--paper-100);
  background-image: var(--paper-tex), radial-gradient(130% 100% at 50% 0%, rgba(255, 250, 235, 0.55), transparent 60%);
  color: var(--text);
}
.frame {
  position: relative;
  border: 4px solid var(--son-frame);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--vang-400), inset 0 0 0 2px rgba(60, 8, 2, 0.35), 0 0 0 1px var(--then-900), var(--shadow);
}
.frame--dark {
  border-color: var(--then-700);
}
.corner {
  position: absolute;
  width: 26px;
  height: 26px;
  color: var(--vang-500);
  pointer-events: none;
  z-index: 1;
}
.corner svg {
  width: 100%;
  height: 100%;
}
.corner--tl {
  top: 2px;
  left: 2px;
}
.corner--tr {
  top: 2px;
  right: 2px;
  transform: scaleX(-1);
}
.corner--bl {
  bottom: 2px;
  left: 2px;
  transform: scaleY(-1);
}
.corner--br {
  bottom: 2px;
  right: 2px;
  transform: scale(-1, -1);
}
.watermark {
  position: absolute;
  right: -50px;
  bottom: -50px;
  width: 230px;
  height: 230px;
  color: var(--chu-500);
  opacity: 0.07;
  pointer-events: none;
}
.watermark svg {
  width: 100%;
  height: 100%;
}
.rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 8px;
  color: var(--title);
  font: 700 14px var(--font-label);
  letter-spacing: 0.02em;
}
.rule::before,
.rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--muc-500));
}
.rule::after {
  background: linear-gradient(90deg, var(--muc-500), transparent);
}
.rule--left::before {
  display: none;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: max(34px, var(--tap));
  padding: 0 14px;
  border: 1px solid var(--paper-400);
  border-radius: 7px;
  background: linear-gradient(180deg, var(--paper-50), var(--paper-200));
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 2px rgba(36, 27, 18, 0.2);
}
.btn--red {
  border-color: var(--then-900);
  background: var(--red);
  color: var(--paper-50);
  box-shadow: inset 0 0 0 1px var(--vang-500), 0 2px 4px rgba(9, 8, 6, 0.35);
}
.btn--red .glyph {
  color: var(--vang-200);
}
.btn--ghost {
  background: transparent;
  box-shadow: none;
}
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn:focus-visible,
.orb:focus-visible {
  outline: 2px solid var(--ngoc-500);
  outline-offset: 2px;
}
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--paper-400);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--paper-50);
  color: var(--text-2);
  font: 600 10.5px/1 var(--font-ui);
}
:root[data-input='touch'] kbd,
[data-form='phone'] kbd {
  display: none;
}
/* round lacquer button with a gold ring (the concept's icon buttons) */
.orb {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: var(--orb, 36px);
  height: var(--orb, 36px);
  padding: 0;
  border: 1px solid var(--then-900);
  border-radius: 50%;
  background: var(--red-btn);
  color: var(--vang-200);
  box-shadow: inset 0 0 0 1.5px var(--vang-500), inset 0 2px 3px rgba(255, 220, 160, 0.18), 0 2px 4px rgba(9, 8, 6, 0.4);
}
.orb--dark {
  background: radial-gradient(circle at 50% 30%, #3a332a, #17140f);
}
.orb--paper {
  border-color: var(--paper-400);
  background: radial-gradient(circle at 50% 30%, var(--paper-50), var(--paper-200));
  color: var(--text-2);
  box-shadow: 0 1px 3px rgba(36, 27, 18, 0.25);
}
.orb.is-on {
  box-shadow: inset 0 0 0 2px var(--vang-200), 0 0 0 2px rgba(239, 200, 112, 0.45), 0 2px 4px rgba(9, 8, 6, 0.4);
}
.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--son-300);
  color: var(--paper-50);
  font: 700 11px/1 var(--font-ui);
  box-shadow: 0 0 0 1.5px var(--paper-50);
}
.dot-alert {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--nghe-500);
  box-shadow: 0 0 0 1.5px var(--then-900);
}
.draft-tag {
  display: inline-block;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}
.bar {
  position: relative;
  height: 5px;
  border-radius: 3px;
  background: rgba(36, 27, 18, 0.16);
  overflow: hidden;
}
.bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  background: var(--good-ui);
}
.bar.is-warn > i {
  background: var(--warn-ui);
}
.bar.is-bad > i {
  background: var(--bad);
}

/* ---------------------------------------------------------------- tooltips (hover / focus; data-show forces one) */
.tipped {
  position: relative;
}
.tip {
  position: absolute;
  z-index: 60;
  left: 50%;
  top: calc(100% + 8px);
  width: max-content;
  max-width: 250px;
  padding: 7px 10px;
  border: 1px solid var(--vang-600);
  border-radius: 6px;
  background: var(--then-800);
  color: var(--paper-50);
  font: 500 12.5px/1.35 var(--font-ui);
  text-align: left;
  white-space: normal;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.tip b {
  color: var(--vang-200);
}
.tip--up {
  top: auto;
  bottom: calc(100% + 8px);
}
.tip--right {
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
}
.tip--end {
  left: auto;
  right: 0;
  transform: none;
}
.tipped:hover > .tip,
.tipped:focus-visible > .tip,
.tipped[data-show] > .tip {
  opacity: 1;
  visibility: visible;
}
[data-form='phone'] .tip {
  display: none;
}

/* ---------------------------------------------------------------- need rings */
.need {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  text-align: center;
}
.need__ring {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--ring, 64px);
  height: var(--ring, 64px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.need__ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.need__ring .trk {
  fill: var(--paper-50);
  stroke: rgba(36, 27, 18, 0.14);
}
.need__ring .fil {
  fill: none;
  stroke: var(--good-ui);
  stroke-linecap: round;
}
.need.is-warn .fil {
  stroke: var(--nghe-500);
}
.need.is-bad .fil {
  stroke: var(--bad);
}
.need.is-lux .fil {
  stroke: var(--lux-ui);
}
.need.is-locked .trk {
  stroke: var(--muc-400);
  stroke-dasharray: 3 3;
}
.need__img {
  position: relative;
  width: 70%;
  height: 70%;
  object-fit: contain;
}
.need.is-locked .need__img {
  filter: grayscale(1) opacity(0.45);
}
.need__flag,
.need__lock {
  position: absolute;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--paper-50);
  font: 800 12px/1 var(--font-ui);
}
.need__flag {
  top: -1px;
  right: -1px;
  background: var(--nghe-500);
  color: var(--then-900);
}
.need.is-bad .need__flag {
  background: var(--bad);
  color: var(--paper-50);
}
.need__lock {
  right: -1px;
  bottom: -1px;
  background: var(--then-700);
  color: var(--paper-50);
}
.need__name {
  max-width: 100%;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.need__sub {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.1;
}
.need.is-warn .need__sub {
  color: var(--warn);
}
.need.is-bad .need__sub {
  color: var(--bad);
}
.need.is-lux .need__sub {
  color: var(--lux);
}
.world__label--corner {
  left: 12px;
  top: 12px;
  transform: none;
}
