/* Tianlu website v3: the design of the canvas ("Website" page), same family as the in-game windows.
   Earth tones, bronze gold, Sora, no red, no neon. Everything is nested in .v3 so it never touches the pages that are not redesigned yet
   (those sit in .legacy and use css/*.legacy.css, made from the old files by tools/scope-legacy-css.js). */

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 130px; }
body { margin: 0; background: #0d0b08; color: #f1e9d8; font-family: Sora, system-ui, sans-serif; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: #c9a96a; color: #1b140b; font: 600 14px Sora, sans-serif; text-decoration: none; }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.v3 {
  --bg0: #0a0806; --bg1: #0f0d0a; --bg2: #16120d; --bg3: #1d1811; --bg4: #2a2117; --line: #2a2218; --line2: #4a3b29;
  --gold: #c9a96a; --gold2: #e6cb92; --tx: #f1e9d8; --tx2: #cbbd9f; --tx3: #9d8d6f;
  --ok: #a8c99a; --okbg: #1c2919; --okln: #46633c; --run: #e0bb72; --runbg: #2a2113; --runln: #6e5630; --miss: #d9a173; --missbg: #2c1e13;
  --pad: 40px; --wrap: 1200px;
  font-family: Sora, system-ui, sans-serif; color: var(--tx); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;

  *, *::before, *::after { box-sizing: border-box; }
  a { color: inherit; text-decoration: none; }
  button { font-family: inherit; cursor: pointer; color: inherit; }
  img { display: block; max-width: none; }
  :focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }

  /* ---------- layout ---------- */
  .wrap { width: min(var(--wrap), 100% - 2 * var(--pad)); margin: 0 auto; position: relative; }
  .row { display: flex; align-items: center; gap: 12px; }
  .col { display: flex; flex-direction: column; gap: 10px; }
  .grow { flex: 1 1 0; min-width: 0; }
  .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .sec { padding: 72px 0 0; }
  .kick { font-size: 12.5px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); word-spacing: 3px; }
  .h1 { font-size: 52px; font-weight: 600; line-height: 1.08; letter-spacing: -1px; margin: 0; }
  .h2 { font-size: 32px; font-weight: 600; line-height: 1.15; letter-spacing: -.5px; margin: 0; }
  .h3 { font-size: 19px; font-weight: 600; line-height: 1.3; margin: 0; }
  .lead { font-size: 18px; color: var(--tx2); margin: 0; max-width: 640px; }
  .p { font-size: 15.5px; color: var(--tx2); margin: 0; }
  .sm { font-size: 13.5px; color: var(--tx3); }
  .gold { color: var(--gold2); }
  .muted { color: var(--tx3); }
  .sh { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
  .sh .col { gap: 8px; }
  .sh .more { margin-left: auto; font-size: 15px; font-weight: 600; color: var(--gold2); white-space: nowrap; }

  /* ---------- buttons, chips ---------- */
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 46px; padding: 0 24px; border-radius: 999px; font-size: 15.5px; font-weight: 600; border: 1px solid var(--line2); background: transparent; color: var(--tx); white-space: nowrap; transition: filter .15s, background .15s, border-color .15s; }
  .btn:hover { border-color: #8a6d3b; }
  .btn.p { background: linear-gradient(#dcbf86, #c4a160); border-color: #e6cb92; color: #1b140b; box-shadow: 0 6px 24px rgba(201, 169, 106, .22); }
  .btn.p:hover { filter: brightness(1.07); }
  .btn.big { height: 58px; padding: 0 34px; font-size: 17px; }
  .btn.s { height: 38px; padding: 0 17px; font-size: 14px; }
  .btn.xs { height: 32px; padding: 0 13px; font-size: 13px; }
  .btn.g { background: rgba(20, 16, 11, .6); border-color: #6b5636; color: var(--gold2); }
  .btn.g:hover { background: rgba(42, 33, 23, .8); }
  .chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--bg4); color: var(--tx2); border: 1px solid var(--line2); white-space: nowrap; }
  .chip.ok { background: var(--okbg); color: var(--ok); border-color: var(--okln); }
  .chip.run { background: var(--runbg); color: var(--run); border-color: var(--runln); }
  .chip.miss { background: var(--missbg); color: var(--miss); border-color: #7a5232; }
  .chip.gold { background: #3a2d17; color: var(--gold2); border-color: #8a6d3b; }
  .chip .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

  /* ---------- surfaces ---------- */
  .card { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
  .fr { position: relative; }
  .fr > .c { position: absolute; width: 14px; height: 14px; border-color: var(--gold); border-style: solid; pointer-events: none; z-index: 3; }
  .fr > .c.a { left: 7px; top: 7px; border-width: 1px 0 0 1px; }
  .fr > .c.f { right: 7px; bottom: 7px; border-width: 0 1px 1px 0; }
  .num { width: 36px; height: 36px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: #1b140b; background: linear-gradient(#e6cb92, #c4a160); }
  .sq { display: block; border-radius: 10px; overflow: hidden; flex: none; background: #0a0806; box-shadow: 0 0 0 1px #4a3b29; }
  .sq img { width: 100%; height: 100%; object-fit: cover; }
  .sq img.mob { transform: scale(1.45); object-position: center 45%; }
  .rd { display: flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; flex: none; box-shadow: 0 0 0 2px #6b5636; background: #2a2117; color: var(--gold2); font-weight: 700; }
  .rd img { width: 100%; height: 100%; object-fit: cover; }
  .barp { height: 8px; border-radius: 999px; background: #2a2218; overflow: hidden; }
  .barp i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #8a6d3b, #e6cb92); }
  .barp.ok i { background: linear-gradient(90deg, #46633c, #a8c99a); }
  .skel { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, #1d1811, #2a2117, #1d1811); background-size: 200% 100%; animation: v3-shimmer 1.4s linear infinite; }
  .empty { padding: 18px 0 6px; font-size: 14px; color: var(--tx3); }

  /* ---------- live strip ---------- */
  .live { height: 38px; display: flex; align-items: center; gap: 22px; padding: 0 var(--pad); background: var(--bg0); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--tx2); overflow: hidden; }
  .live b { color: var(--tx); font-weight: 600; }
  .live .sp { flex: 1; }
  .live .it { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
  .live .dot { width: 8px; height: 8px; border-radius: 50%; background: #8fbf7c; box-shadow: 0 0 0 3px rgba(143, 191, 124, .18); }
  .live .dot.off { background: #9d8d6f; box-shadow: none; }
  .live .sep { width: 1px; height: 14px; background: var(--line2); flex: none; }
  .live .warn { color: var(--run); }
  .live svg { color: var(--gold); flex: none; }

  /* ---------- header ---------- */
  .hdr { height: 76px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; padding: 0 min(var(--pad), 28px); background: rgba(13, 11, 8, .94); border-bottom: 1px solid var(--line); position: relative; z-index: 5; backdrop-filter: blur(8px); }
  .hdr .logo { height: 44px; width: auto; margin-right: 22px; }
  .hdr > a:first-child { justify-self: start; }
  .hdr .nav { display: flex; align-items: center; justify-content: center; gap: 16px; min-width: 0; }
  #v3-pop { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
  #v3-pop > * { pointer-events: auto; }
  .nb { display: flex; align-items: center; gap: 7px; padding: 9px 10px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--tx2); white-space: nowrap; background: none; border: 0; }
  .nb svg { color: var(--gold); flex: none; }
  .nb:hover { color: var(--tx); }
  .nb.on, .nb[aria-expanded="true"] { background: var(--bg4); color: var(--gold2); }
  .nb.start { color: var(--gold2); }
  .nb .cv { opacity: .6; font-size: 11px; transition: transform .15s; }
  .nb[aria-expanded="true"] .cv { transform: rotate(180deg); opacity: 1; }
  .ib { width: 40px; height: 40px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--tx2); border: 1px solid var(--line); background: none; }
  .ib:hover, .ib[aria-expanded="true"] { border-color: #c9a96a; color: var(--gold2); background: var(--bg4); }
  .lg { position: relative; font-size: 13px; font-weight: 600; color: var(--tx2); padding: 0 12px; height: 40px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; background: none; flex: none; }
  .lg:hover, .lg[aria-expanded="true"] { border-color: #c9a96a; color: var(--gold2); background: var(--bg4); }
  .hdr .acts { display: flex; align-items: center; gap: 6px; justify-self: end; }
  .hdr .signin { padding: 0 14px; }
  .hdr .dl { padding: 0 15px; }
  .hdr .acct { display: flex; align-items: center; gap: 8px; padding: 3px; border-radius: 999px; border: 1px solid var(--line2); background: none; font-size: 14px; font-weight: 600; max-width: 200px; }
  .hdr .acct span:last-child { display: none; }
  .hdr .acct[aria-expanded="true"] { border-color: #c9a96a; background: var(--bg4); color: var(--gold2); }
  .hdr .burger { display: none; }

  /* ---------- menus that open from the header ---------- */
  .mega, .pop { position: absolute; top: calc(100% - 6px); z-index: 30; border-radius: 16px; overflow: hidden; background: #16120d; border: 1px solid #6b5636; box-shadow: 0 30px 70px rgba(0, 0, 0, .65); text-align: left; animation: v3-drop .16s ease-out; }
  .mega { width: 720px; display: grid; grid-template-columns: 430px 1fr; }
  .mega .links, .pop .links { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
  .mh { font-size: 10.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold); padding: 10px 12px 4px; display: flex; align-items: center; gap: 10px; }
  .mh::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, #4a3b29, transparent); }
  .lk { display: flex; gap: 12px; align-items: center; padding: 7px 10px; border-radius: 10px; min-height: 52px; color: var(--tx); }
  .lk:hover, .lk:focus-visible { background: #2a2117; box-shadow: inset 0 0 0 1px #6b5636; outline: none; }
  .lk[aria-current="page"] { box-shadow: inset 3px 0 0 #c9a96a; background: #1d1811; }
  .lk .sq { width: 36px; height: 36px; border-radius: 8px; }
  .lk b { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; }
  .lk .sm { display: block; font-size: 12.5px; white-space: nowrap; }
  .lk svg { color: var(--gold); flex: none; }
  .side { padding: 20px; background: linear-gradient(180deg, #221b12, #17130d); border-left: 1px solid #4a3b29; display: flex; flex-direction: column; gap: 12px; }
  .side .pic { height: 140px; border-radius: 12px; overflow: hidden; }
  .side .pic img { width: 100%; height: 100%; object-fit: cover; }
  .mfoot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 11px 16px; border-top: 1px solid #2a2218; background: #120f0b; font-size: 13.5px; color: var(--tx3); }
  .mfoot a, .mfoot button { color: var(--gold2); font-weight: 600; background: none; border: 0; font-size: 13.5px; padding: 0; }
  .pop.lang { width: 460px; }
  .lgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; padding: 6px 8px 10px; }
  .lgrid .lk { min-height: 0; padding: 7px 8px; background: none; border: 0; text-align: left; width: 100%; }
  .lgrid .lk.on { background: #2a2117; }
  .lcode { width: 36px; height: 36px; border-radius: 8px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #e6cb92; background: #2a2117; box-shadow: 0 0 0 1px #4a3b29; }
  .lgrid .tick { margin-left: auto; color: var(--gold2); font-weight: 700; }
  .pop.acctm { width: 340px; }
  .acctm .h { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-bottom: 1px solid #2a2218; background: linear-gradient(180deg, #2a2117, #16120d); }
  .acctm .lk { padding: 11px 20px; border-radius: 0; min-height: 0; }
  .pop.srch { width: 520px; }
  .srch .box { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; border-bottom: 1px solid #2a2218; background: #0a0806; }
  .srch input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; color: var(--tx); font: inherit; font-size: 16px; outline: none; }
  .srch .res { max-height: 420px; overflow: auto; padding: 8px; }
  .srch .lk[aria-selected="true"] { background: #2a2117; box-shadow: inset 0 0 0 1px #6b5636; }
  .srch .none { padding: 14px 12px; font-size: 14px; color: var(--tx3); margin: 0; }

  /* ---------- page head on top of art (used by the redesigned inner pages) ---------- */
  .phero { position: relative; height: 440px; overflow: hidden; border-bottom: 1px solid var(--line2); }
  .phero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .phero .sh1 { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13, 11, 8, .97) 0%, rgba(13, 11, 8, .88) 34%, rgba(13, 11, 8, .35) 68%, rgba(13, 11, 8, .15) 100%); }
  .phero .sh2 { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(15, 13, 10, 1) 0%, rgba(15, 13, 10, 0) 45%); }
  .phero .in { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
  .crumb { font-size: 13.5px; color: var(--tx3); display: flex; gap: 8px; align-items: center; }
  .crumb b { color: var(--gold2); font-weight: 500; }

  /* ---------- footer ---------- */
  .foot { margin-top: 96px; border-top: 1px solid var(--line); background: var(--bg0); padding: 40px 0 28px; }
  .foot .fband { display: flex; align-items: center; gap: 14px; padding: 24px 30px; margin-bottom: 44px; border-radius: 18px; border: 1px solid #6b5636; background: linear-gradient(100deg, #2c2318 0%, #16120d 70%); }
  .foot .fdisc { background: #5865F2; border-color: #5865F2; color: #fff; }
  .btn.hdisc { background: #5865F2; border-color: #5865F2; color: #fff; }
  .btn.hdisc:hover { background: #4752C4; border-color: #4752C4; color: #fff; }
  .foot .fcols { display: grid; grid-template-columns: 1.5fr repeat(5, minmax(0, 1fr)); gap: 28px; }
  .foot h4 { margin: 0 0 14px; font-size: 12.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold); font-weight: 600; }
  .foot .fcols a { display: block; font-size: 14px; color: var(--tx2); padding: 4px 0; }
  .foot .fcols a:hover { color: var(--gold2); }
  .foot .fstat { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--tx3); }
  .foot .fstat > span { display: flex; align-items: center; gap: 8px; }
  .foot .fstat i { width: 7px; height: 7px; border-radius: 50%; background: #6b5636; flex: none; }
  .foot .fstat i.on { background: #8fbf7c; }
  .foot .fstat b { color: var(--tx); font-weight: 600; }
  .foot .base { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 24px; font-size: 13px; color: var(--tx3); flex-wrap: wrap; }
  .foot .base a:hover { color: var(--gold2); }
  .foot .flang { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid #4a3b29; color: var(--tx2); background: none; font-size: 13px; }

  /* ---------- toast ---------- */
  .toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; padding: 12px 20px; border-radius: 12px; background: #2a2117; border: 1px solid #6b5636; color: var(--tx); font-size: 14.5px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
}

/* the header sticks to the top; the strip above it scrolls away */
#v3-top { position: sticky; top: 0; z-index: 40; }
.v3-strip { position: relative; z-index: 41; }

@keyframes v3-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes v3-shimmer { to { background-position: -200% 0; } }

/* ---------- smaller screens ---------- */
@media (min-width: 1401px) and (max-width: 1520px) {
  .v3 .hdr .nav { gap: 10px; }
  .v3 .hdr .lg svg { display: none; }
}
@media (max-width: 1400px) {
  .v3 { --pad: 28px;
    .hdr .logo { margin-right: 10px; }
    .nb { padding: 9px 10px; gap: 6px; }
    .hdr .nav .nb svg { display: none; }
  }
}
@media (max-width: 1340px) {
  .v3 .hdr .dl { width: 40px; padding: 0; }
  .v3 .hdr .dl span { display: none; }
}
@media (max-width: 1180px) {
  .v3 {
    .live .hide-m { display: none; }
    .hdr .nav { display: none; }
    .hdr .burger { display: flex; }
    .hdr .acts { margin-left: auto; }
    .hdr .nav.open { display: flex; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 12px 16px; background: #120f0b; border-bottom: 1px solid #4a3b29; max-height: calc(100vh - 114px); overflow: auto; box-shadow: 0 30px 60px rgba(0, 0, 0, .6); }
    .hdr .nav.open .nb { justify-content: flex-start; padding: 14px 12px; font-size: 16px; border-radius: 10px; }
    .hdr .nav.open .nb svg { display: block; }
    .hdr .nav.open .nb .cv { margin-left: auto; }
    .hdr .nav.open .mega { position: static; width: auto; display: block; border-radius: 12px; margin: 0 0 8px; box-shadow: none; animation: none; }
    .hdr .nav.open .mega .side, .hdr .nav.open .mega .mfoot { display: none; }
    .mega { left: 12px !important; right: 12px; width: auto; grid-template-columns: minmax(0, 1fr); }
    .mega .side { display: none; }
    .foot .fcols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .foot .fcols > :first-child { grid-column: 1 / -1; }
  }
}
@media (max-width: 720px) {
  .v3 { --pad: 16px;
    .live { gap: 14px; font-size: 12px; }
    .live .hide-s { display: none; }
    .hdr { height: 64px; }
    .hdr .logo { height: 36px; }
    .hdr .signin, .hdr .dl span, .hdr .lg .lname { display: none; }
    .hdr .dl { width: 40px; padding: 0; }
    .hdr .acct { padding: 4px; }
    .hdr .acct span:last-child { display: none; }
    .pop { left: 8px !important; right: 8px !important; width: auto !important; }
    .lgrid { grid-template-columns: minmax(0, 1fr); }
    .h1 { font-size: 36px; }
    .h2 { font-size: 26px; }
    .lead { font-size: 16px; }
    .sec { padding-top: 52px; }
    .sh { flex-direction: column; align-items: flex-start; gap: 10px; }
    .sh .more { margin-left: 0; }
    .grid2, .grid3, .grid4 { grid-template-columns: minmax(0, 1fr); }
    .foot { margin-top: 64px; }
    .foot .fband { flex-direction: column; align-items: flex-start; padding: 22px; }
    .foot .fband > span { display: none; }
    .foot .fcols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
    .foot .base { gap: 12px 18px; }
    .foot .base > span:first-child { flex-basis: 100%; }
    .foot .base .grow { display: none; }
  }
}
