/* Shared Vibeheim carved-wood theme. Linked by index.html and player.html. */
  /* Valheim's UI is carved wood and firelight: warm browns, gold lettering,
     heavy borders, no flat modern cards. Display type is Cinzel (carved
     Roman), but body copy stays a plain sans at a large size because
     decorative faces are what make small text unreadable. */
  :root {
    /* Mahogany and brass. The previous palette was a single flat mid-brown,
       which is what made it read as cheap: real wood has depth, a red
       undertone and a sheen, and the metal has to look cast, not printed. */
    --ink:       #0b0605;
    --ink-2:     #140b08;
    --wood-dark: #1d0e09;
    --wood:      #4a2116;
    --wood-lit:  #632c1d;
    --wood-hi:   #7a3925;
    --edge:      #6b3a24;
    --edge-hi:   #9a5734;
    --brass:     #e2b75f;
    --brass-dim: #a87f38;
    --brass-hi:  #f7e0a2;
    --parchment: #f4e9d6;
    --muted:     #bca68c;
    --ember:     #e8834a;
    --ash:       #9a8a78;
    --focus:     #a8d4ff;
    --lit:       #e8a23c;
    --out:       #7d6a58;
  }

  * { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    margin: 0;
    color: var(--parchment);
    font: 500 22px/1.62 "Cormorant Garamond", Georgia, serif;
    padding: 0 16px 72px;
    background:
      radial-gradient(1200px 680px at 50% -16%, #45201a 0%, transparent 64%),
      radial-gradient(900px 500px at 50% 108%, #2a1410 0%, transparent 60%),
      var(--ink);
    background-attachment: fixed;
  }
  .wrap { max-width: 880px; margin: 0 auto; }

  /* Carved posts down both edges. Decorative only, and dropped entirely on
     narrow screens where they would eat the reading width. */
  .post {
    position: fixed; top: 0; bottom: 0; width: 74px; z-index: 0;
    pointer-events: none; color: var(--edge-hi);
    background:
      repeating-linear-gradient(0deg,
        rgba(0,0,0,.09) 0 3px, rgba(255,214,170,.025) 3px 7px, transparent 7px 14px),
      linear-gradient(90deg,
        var(--wood-dark) 0%, var(--wood) 42%, var(--wood-lit) 52%,
        var(--wood) 62%, var(--wood-dark) 100%);
    box-shadow:
      inset 0 0 0 1px rgba(0,0,0,.5),
      inset 0 0 40px rgba(0,0,0,.4);
  }
  .post.left  { left: 0;  border-right: 1px solid var(--wood-dark); }
  .post.right { right: 0; border-left: 1px solid var(--wood-dark); }
  .post svg { width: 100%; height: 100%; opacity: .55; }
  .wrap { position: relative; z-index: 1; }
  @media (max-width: 1180px) { .post { display: none; } }

  /* Carved wood plank: warm base, faint vertical grain, hard dark rim and a
     lit top edge so it reads as a physical panel rather than a div. */
  .plank {
    position: relative;
    background:
      linear-gradient(180deg, rgba(255,226,186,.10) 0%, transparent 42%),
      repeating-linear-gradient(90deg,
        rgba(0,0,0,.07) 0 3px, rgba(255,214,170,.028) 3px 7px,
        rgba(0,0,0,.035) 7px 12px, transparent 12px 23px),
      linear-gradient(180deg, var(--wood-hi) 0%, var(--wood-lit) 26%,
                              var(--wood) 64%, var(--wood-dark) 100%);
    border: 1px solid var(--wood-dark);
    border-radius: 6px;
    box-shadow:
      inset 0 1px 0 rgba(255,214,170,.22),
      inset 0 -1px 0 rgba(0,0,0,.5),
      inset 0 0 44px rgba(0,0,0,.34),
      0 1px 0 rgba(255,214,170,.06),
      0 18px 40px rgba(0,0,0,.55);
  }

  header { padding: 60px 0 8px; text-align: center; }
  h1 {
    margin: 0;
    font-family: Cinzel, "Trajan Pro", Georgia, serif;
    font-weight: 900;
    font-size: clamp(44px, 10vw, 82px);
    line-height: 1;
    letter-spacing: .14em;
    background: linear-gradient(176deg,
      var(--brass-hi) 6%, var(--brass) 38%,
      var(--brass-dim) 62%, var(--brass-hi) 96%);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 0 rgba(0,0,0,.55))
            drop-shadow(0 10px 26px rgba(0,0,0,.6));
  }
  .tagline {
    margin: 14px 0 0; color: var(--muted); font-size: 18px; letter-spacing: .03em;
  }

  /* Runic divider, drawn not imported. */
  /* Iron fittings pinned to each plank corner, mirrored into all four. */
  .plank > .fitting {
    position: absolute; width: 26px; height: 26px; color: var(--edge-hi);
    pointer-events: none;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.8));
  }
  .plank > .fitting.tl { top: -1px; left: -1px; }
  .plank > .fitting.tr { top: -1px; right: -1px; transform: scaleX(-1); }
  .plank > .fitting.bl { bottom: -1px; left: -1px; transform: scaleY(-1); }
  .plank > .fitting.br { bottom: -1px; right: -1px; transform: scale(-1,-1); }

  .axeMark { width: 26px; height: 26px; color: var(--brass-dim); flex: none; }
  h2 { display: flex; align-items: center; gap: 11px; }

  .crest {
    display: flex; align-items: center; justify-content: center; gap: 20px;
    margin-bottom: 6px; color: var(--brass-dim);
  }
  .crest { gap: 0; }
  .crest .axe { width: 66px; height: 66px; }
  .crest .axe.left  { transform: rotate(-26deg); margin-right: -14px; }
  .crest .axe.right { transform: scaleX(-1) rotate(-26deg); margin-left: -14px; }

  .knotband {
    display: block; width: 100%; height: 22px; color: var(--edge-hi);
    margin: 26px 0 30px; opacity: .85;
  }

  .divider {
    display: flex; align-items: center; gap: 14px;
    margin: 30px 0 34px; color: var(--edge-hi);
  }
  .divider::before, .divider::after {
    content: ""; flex: 1; height: 2px;
    background: linear-gradient(90deg, transparent, var(--edge), transparent);
  }
  .divider span { font-size: 19px; letter-spacing: .5em; color: var(--brass-dim); }

  .status {
    display: flex; align-items: center; gap: 13px;
    padding: 16px 22px; font-size: 20px; font-weight: 700;
  }
  .fire { width: 34px; height: 34px; flex: none; }
  .fire.sm { width: 24px; height: 24px; }
  .up   { color: var(--brass); }
  .down { color: var(--muted); }
  /* Flame breathes; the logs never move. */
  .fire .flame { transform-origin: 32px 40px; animation: flicker 2.6s ease-in-out infinite; }
  @keyframes flicker {
    0%,100% { transform: scaleY(1)   scaleX(1);    opacity: 1; }
    45%     { transform: scaleY(.92) scaleX(1.05); opacity: .9; }
  }
  @media (prefers-reduced-motion: reduce) { .fire .flame { animation: none; } }
  .status .sub {
    margin-left: auto; color: var(--muted); font-weight: 600; font-size: 17px;
  }

  h2 {
    font-family: Cinzel, "Trajan Pro", Georgia, serif;
    font-size: 16px; letter-spacing: .34em; text-transform: uppercase;
    color: var(--brass-dim); margin: 56px 0 18px; font-weight: 700;
  }

  .join { padding: 28px; text-align: center; }
  .codeRow {
    display: flex; gap: 16px; align-items: center; justify-content: center;
    flex-wrap: wrap;
  }
  code#joinCode {
    font-family: Cinzel, "Trajan Pro", Georgia, serif;
    font-weight: 900;
    font-size: clamp(52px, 13vw, 92px); line-height: 1;
    letter-spacing: .12em;
    color: var(--brass);
    text-shadow: 0 3px 0 #5a2410, 0 6px 18px rgba(0,0,0,.6);
  }
  code#addr {
    font: 700 clamp(19px, 4vw, 26px)/1.3 Cinzel, "Trajan Pro", Georgia, serif;
    color: var(--parchment); letter-spacing: .02em; word-break: break-all;
  }
  button {
    font: 700 13px/1 Cinzel, Georgia, serif;
    letter-spacing: .2em; text-transform: uppercase;
    color: var(--brass-hi);
    background: linear-gradient(180deg, var(--wood-hi), var(--wood-dark));
    border: 1px solid var(--edge);
    border-radius: 4px; padding: 15px 24px; cursor: pointer;
    box-shadow:
      inset 0 1px 0 rgba(255,214,170,.28),
      inset 0 -1px 0 rgba(0,0,0,.55),
      0 4px 14px rgba(0,0,0,.5);
    transition: color .18s ease, border-color .18s ease;
  }
  button:hover { color: #fff3d6; border-color: var(--edge-hi); }
  button:active { transform: translateY(1px); }
  button:focus-visible, a:focus-visible {
    outline: 3px solid var(--focus); outline-offset: 3px;
  }
  .note { margin: 18px 0 0; color: var(--muted); font-size: 16px; }
  .tabs { display: flex; gap: 8px; margin-bottom: 22px; justify-content: center; }
  .tab {
    font-family: Cinzel, "Trajan Pro", Georgia, serif; font-size: 15px;
    letter-spacing: .06em; text-transform: none; padding: 10px 18px;
    color: var(--muted); background: rgba(0,0,0,.3);
    border: 2px solid rgba(0,0,0,.4); box-shadow: none;
  }
  .tab.on {
    color: var(--brass); background: linear-gradient(180deg, var(--wood-lit), var(--wood-dark));
    border-color: var(--edge); box-shadow: inset 0 1px 0 var(--edge-hi);
  }
  .steps {
    margin: 0; padding-left: 26px; text-align: left;
    color: var(--muted); font-size: 18px;
  }
  .steps li { margin: 8px 0; }
  .steps b { color: var(--parchment); }
  .sep { border: 0; border-top: 2px solid var(--wood-dark);
         box-shadow: 0 1px 0 var(--edge); margin: 26px 0; }

  ul.online { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
  ul.online li {
    display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
    padding: 15px 20px;
  }
  .pname { font-size: 21px; font-weight: 700; }
  .psince { color: var(--muted); font-size: 17px; margin-left: auto; }

  .tableWrap { padding: 8px 20px 12px; }
  .tableScroll { overflow-x: auto; }
  .tableScroll::-webkit-scrollbar { height: 10px; }
  .tableScroll::-webkit-scrollbar-track {
    background: rgba(0,0,0,.35); border-radius: 5px;
  }
  .tableScroll::-webkit-scrollbar-thumb {
    background: var(--edge); border-radius: 5px;
  }
  .tableScroll { scrollbar-color: var(--edge) rgba(0,0,0,.35); scrollbar-width: thin; }
  table { width: 100%; border-collapse: collapse; min-width: 520px; }
  th, td { text-align: left; padding: 14px 10px; }
  th {
    font-family: Cinzel, "Trajan Pro", Georgia, serif;
    font-size: 14px; letter-spacing: .12em; text-transform: uppercase;
    color: var(--brass-dim); border-bottom: 2px solid var(--wood-dark);
  }
  td { font-size: 18px; border-bottom: 1px solid rgba(0,0,0,.28); }
  tbody tr:last-child td { border-bottom: 0; }
  td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
  tbody tr:hover td { background: rgba(255,255,255,.045); }
  .rank { color: var(--brass-dim); font-weight: 700; }

  .empty { padding: 26px; color: var(--muted); text-align: center; font-size: 18px; }
  footer { margin-top: 48px; text-align: center; color: var(--muted); font-size: 15px; }
  @media (prefers-reduced-motion: reduce) {
    *, *::before { animation: none !important; transition: none !important; }
  }

/* Per-character links out of the roster. */
.vlink { color: var(--parchment); text-decoration: none; border-bottom: 1px solid var(--edge); }
.vlink:hover { color: var(--brass); border-bottom-color: var(--brass); }

/* Profile page. */
.bigname {
  font-family: Cinzel, "Trajan Pro", Georgia, serif;
  font-size: clamp(34px, 7vw, 56px); line-height: 1.1; color: var(--brass);
  margin: 0; text-shadow: 0 3px 0 #5a2410, 0 5px 14px rgba(0,0,0,.7);
}
.statGrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; padding: 22px;
}
.statCell { text-align: center; padding: 14px 8px; }
.statCell .v {
  font-family: Cinzel, "Trajan Pro", Georgia, serif; font-size: 28px; line-height: 1.1;
  color: var(--parchment); font-variant-numeric: tabular-nums;
  /* "34m ago" must not break across lines under its own label. */
  white-space: nowrap;
}
.statCell .v.blood { color: var(--out); }
.statCell .k {
  margin-top: 8px; font-size: 13px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.urlRow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 22px; }
.urlRow code {
  flex: 1; min-width: 240px; font: 600 15px/1.5 ui-monospace, Menlo, monospace;
  color: var(--parchment); background: rgba(0,0,0,.32); padding: 12px 14px;
  border: 2px solid rgba(0,0,0,.4); border-radius: 7px; word-break: break-all;
}
.back { display: inline-block; margin-bottom: 8px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--brass); }

/* The profile header fire sits beside 56px type, so it needs the scale to
   read as a bonfire rather than a smudge. */
.profileFire { width: 52px; height: 52px; flex: none; }
.profileFire.out { opacity: .85; }

/* Overlay customisation controls. */
.opts {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 4px 22px 18px;
}
.opts .tabs { margin: 0; justify-content: flex-start; }
.check {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  color: var(--muted); font-size: 17px; user-select: none;
}
.check input {
  appearance: none; width: 24px; height: 24px; margin: 0; flex: none;
  background: rgba(0,0,0,.34);
  border: 2px solid var(--edge); border-radius: 5px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.check input:checked {
  background: linear-gradient(180deg, var(--wood-lit), var(--wood-dark));
  border-color: var(--brass-dim);
}
/* Checkmark drawn in CSS so state never depends on colour alone. */
.check input:checked::after {
  content: ""; display: block;
  width: 6px; height: 12px; margin: 1px 0 0 6px;
  border: solid var(--brass); border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.check input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.check:hover { color: var(--parchment); }
