/*
 * Gloomy Tibia - Tibia.com 2007 theme.
 *
 * Curated on top of design-system/tokens.css, which the
 * arvindrk/extract-design-system CLI generated from the Wayback Machine
 * snapshot 20070207233516 of https://www.tibia.com/ (fonts, spacing scale).
 *
 * The extractor reported no palette because the 2007 site paints its
 * surfaces with bitmap images. Color values come from that snapshot's own
 * stylesheets (static.tibia.com/styles/basic.css and news.css), and the
 * decorative bitmaps in assets/tibia-2007/ were fetched from the same
 * snapshot: title and headline bar patterns, menu button and chain skins,
 * parchment scroll texture, edge strips, and corner inlays.
 */

/* Title-bar lettering. Martel (Scriptorium Fonts, 1998) matches the bitmap
   headlines of the original site. */
@font-face {
  font-family: "Martel";
  src: url(assets/fonts/martel.ttf) format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surfaces */
  --color-page: #384f5d;
  --color-page-edge: #3a3738;
  --color-parchment: #fff2db;
  --color-parchment-edge: #debb9d;
  --color-row-odd: #d4c0a1;
  --color-row-even: #f1e0c6;
  --color-menu: #0d2e2b;
  --color-menu-line: #4b7874;
  --color-menu-text: #d7d7d7;
  --color-table-head: #505050;

  /* Ink and accents */
  --color-ink: #5a2800;
  --color-ink-muted: #808080;
  --color-gold: #cfa600;
  --color-gold-bright: #ffbb05;
  --color-bar: #793d03;
  --color-link: #004294;
  --color-link-hover: #0063dc;
  --color-online: #00bf00;
  --color-danger: #ef0000;
  --color-light: #efefef;

  /* Typography. The archived stylesheets put Verdana first for content;
     the extractor detected only Arial. */
  --font-content: Verdana, Arial, "Times New Roman", sans-serif;
  --font-ui: Arial, sans-serif;
  --text-xs: 7pt;
  --text-sm: 8pt;
  --text-base: 9pt;
  --text-md: 10pt;
  --text-lg: 12pt;

  /* Structure */
  --radius: 0;
  --box-border: 2px solid var(--color-page-edge);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--color-page);
  color: var(--color-light);
  font-family: var(--font-content);
  font-size: var(--text-base);
  line-height: 1.45;
}

/* Header band, like the dark artwork bar of the original site. */
.site-header {
  background: linear-gradient(#41545f, #26333c 60%, #1a242c);
  border-bottom: 3px solid #0a1a18;
  box-shadow: inset 0 1px 0 #5a6d79;
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  color: var(--color-gold);
  font-family: var(--font-ui);
  font-size: 30px;
  font-weight: bold;
  letter-spacing: 2px;
  line-height: 1;
  text-shadow: 1px 2px 0 #000, 0 0 14px rgba(0, 0, 0, 0.75);
}

.brand small {
  display: block;
  margin-top: 7px;
  color: var(--color-menu-text);
  font-family: var(--font-content);
  font-size: var(--text-sm);
  font-weight: normal;
  letter-spacing: 0;
}

.host {
  color: var(--color-light);
  font-family: Consolas, "Courier New", monospace;
  font-size: var(--text-sm);
  white-space: nowrap;
  padding-bottom: 2px;
}

/* Three-column body like #MenuColumn, #ContentColumn, #ThemeboxesColumn. */
.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 16px 0;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 190px;
  gap: 0 18px;
  align-items: start;
}

/* Menu column: #0D2E2B panel with the original riveted caps, chain edges,
   and stone menu button skins. */
.menu-panel {
  width: 180px;
  padding: 12px 5px;
  background-color: var(--color-menu);
  background-image:
    url(assets/tibia-2007/global_general_box-top.gif),
    url(assets/tibia-2007/global_general_box-bottom.gif),
    url(assets/tibia-2007/global_general_chain.gif),
    url(assets/tibia-2007/global_general_chain.gif);
  background-repeat: no-repeat, no-repeat, repeat-y, repeat-y;
  background-position: left top, left bottom, left top, right top;
}

.menu-btn {
  position: relative;
  display: block;
  width: 170px;
  height: 32px;
  padding: 0;
  background: url(assets/tibia-2007/global_menu_button-background.gif) no-repeat left top;
  color: var(--color-menu-text);
  font-family: var(--font-ui);
  font-size: var(--text-md);
  font-weight: bold;
  line-height: 32px;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 1px 0 #000, 0 0 4px rgba(0, 0, 0, 0.9);
}

.menu-btn + .menu-btn {
  margin-top: 2px;
}

.menu-btn:hover,
.menu-btn:focus {
  background-image: url(assets/tibia-2007/global_menu_button-background-over.gif);
  color: #fff;
}

.menu-btn[aria-current="page"] {
  color: var(--color-gold-bright);
}

/* Green corner lamps on the active item, like .Light_lu/.Light_ru/.Light_ld. */
.menu-btn[aria-current="page"]::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 3px;
  bottom: 2px;
  left: 3px;
  background-image:
    url(assets/tibia-2007/global_menu_green-light.gif),
    url(assets/tibia-2007/global_menu_green-light.gif),
    url(assets/tibia-2007/global_menu_green-light.gif);
  background-repeat: no-repeat;
  background-position: left top, right top, left bottom;
  pointer-events: none;
}

/* Parchment content boxes: 6px gold/black edge strips, corner inlays, the
   green leaf title bar, and the scroll parchment texture. */
.box {
  position: relative;
  margin: 0 0 18px;
  padding: 6px 0;
  background-color: var(--color-parchment-edge);
  background-image:
    url(assets/tibia-2007/global_content_border-1.gif),
    url(assets/tibia-2007/global_content_border-1.gif);
  background-repeat: repeat-x, repeat-x;
  background-position: left top, left bottom;
  border-left: var(--box-border);
  border-right: var(--box-border);
}

.box::before,
.box::after {
  content: "";
  position: absolute;
  left: -5px;
  right: -5px;
  height: 17px;
  background-repeat: no-repeat;
  pointer-events: none;
}

.box::before {
  top: -4px;
  background-image:
    url(assets/tibia-2007/global_content_corner-tl.gif),
    url(assets/tibia-2007/global_content_corner-tr.gif);
  background-position: left top, right top;
}

.box::after {
  bottom: -4px;
  background-image:
    url(assets/tibia-2007/global_content_corner-bl.gif),
    url(assets/tibia-2007/global_content_corner-br.gif);
  background-position: left bottom, right bottom;
}

.box-title {
  margin: 0;
  height: 24px;
  padding: 2px 10px 0;
  background: url(assets/tibia-2007/global_content_title-background-green.gif) repeat-x left top;
  color: #e4e39a;
  font-family: "Martel", var(--font-content);
  font-size: 13pt;
  font-weight: 400;
  line-height: 22px;
  text-shadow: 1px 1px 0 #16210a, 0 0 3px rgba(0, 0, 0, 0.9);
}

.box-body {
  margin: 4px;
  padding: 10px;
  background: var(--color-parchment) url(assets/tibia-2007/global_content_scroll.gif) repeat left top;
  border: 1px solid var(--color-bar);
  color: var(--color-ink);
}

.box-body p {
  margin: 0 0 10px;
}

.box-body p:last-child {
  margin-bottom: 0;
}

.box-body a {
  color: var(--color-link);
  font-weight: bold;
  text-decoration: none;
}

.box-body a:hover,
.box-body a:focus {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.box-body ul {
  margin: 0;
  padding-left: 20px;
}

/* News-style headline bar (red rune pattern from the original site). */
.headline {
  height: 28px;
  margin: 0 0 10px;
  padding: 0 10px;
  background: url(assets/tibia-2007/news_newsheadline_background.gif) repeat-x left top;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  color: #f2cf6b;
  font-size: var(--text-md);
  font-weight: bold;
  line-height: 28px;
  text-shadow: 1px 1px 0 #2a0400, 0 0 3px rgba(0, 0, 0, 0.8);
}

/* Two-tone data rows, like the news ticker. */
.data {
  width: 100%;
  border-collapse: collapse;
}

.data th,
.data td {
  padding: 4px 8px;
  text-align: left;
  vertical-align: top;
  font-size: var(--text-base);
}

.data th {
  width: 34%;
  background: var(--color-table-head);
  color: #fff;
  font-family: var(--font-ui);
  font-size: var(--text-md);
}

.data tr:nth-child(odd) td {
  background: var(--color-row-odd);
}

.data tr:nth-child(even) td {
  background: var(--color-row-even);
}

.data tr + tr td {
  border-top: 1px solid rgba(90, 40, 0, 0.3);
}

/* Steel button, CSS recreation of button-standard-blue.gif. */
.btn {
  display: inline-block;
  padding: 8px 18px;
  background: linear-gradient(#b3bec9, #76838f 48%, #4c5967);
  border: 1px solid #212b35;
  box-shadow: inset 0 1px 0 #c6d0da;
  color: #fff;
  font-family: var(--font-ui);
  font-size: var(--text-md);
  font-weight: bold;
  text-decoration: none;
  text-shadow: 0 1px 0 #000;
}

.btn:hover,
.btn:focus {
  background: linear-gradient(#c4cfda, #8794a1 48%, #5b6876);
  color: #fff;
  text-decoration: none;
}

/* Keep button labels white inside parchment boxes, where generic link
   styling would otherwise win. */
.box-body a.btn,
.box-body a.btn:hover,
.box-body a.btn:focus {
  color: #fff;
  text-decoration: none;
}

.meta {
  margin-top: 8px;
  color: #6b4a2f;
  font-size: var(--text-sm);
}

code {
  padding: 1px 5px;
  background: rgba(90, 40, 0, 0.12);
  font-family: Consolas, "Courier New", monospace;
}

.rail .online-count {
  color: var(--color-online);
  font-weight: bold;
}

/* Footer, like the white 7pt copyright line. */
.site-footer {
  padding: 4px 16px 28px;
  color: #fff;
  font-family: var(--font-content);
  font-size: var(--text-xs);
  text-align: center;
}

.site-footer a {
  color: #fff;
  font-weight: bold;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus {
  text-decoration: underline;
}

@media (max-width: 860px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .host {
    padding-bottom: 0;
  }

  .page {
    grid-template-columns: 1fr;
  }

  .menu {
    order: -1;
  }

  .menu-panel {
    margin: 0 auto 18px;
  }
}
