/* The ShopHaven Idle wiki, on top of site.css.
   Same frames, font and colours as the game: dark panels, gold for links and headings, the rarity colours
   from Theme.rarity, and the game's own art drawn at whole multiples with image-rendering: pixelated. */

:root {
  --r-mythic: #e14257;
  --q0: #8f8782; --q1: #ecdcb8; --q2: #5dba74; --q3: #4f8fe6; --q4: #b15fe0; --q5: #eba539; --q6: #e14257;
  --row: rgba(255, 255, 255, .025);
  --wbar-h: 64px;
}

body.shwiki { background: radial-gradient(900px 500px at 50% -10%, rgba(236, 193, 105, .07), transparent 70%), var(--ink); }
.shwiki img.ic, .shwiki .wsprite, .shwiki img.big, .shwiki img.wide, .shwiki .scenebox, .shwiki .decorart img { image-rendering: pixelated; }

/* ---------------------------------------------------------------- search bar */

.wbar { position: relative; z-index: 30; background: var(--ink-2); box-shadow: 0 var(--px) 0 var(--line); }
.wbar .wrap { display: flex; gap: 10px; align-items: center; padding-block: 10px; }
.wsearch { position: relative; flex: 1; margin: 0; }
.wsearch input {
  width: 100%; box-sizing: border-box; height: 44px; padding: 0 14px 0 40px;
  font: 18px/1 var(--display); color: var(--text); background: #050408 url("/assets/icons/guide.png") 12px 50% / 18px no-repeat;
  border: var(--px) solid var(--line-2); box-shadow: inset 0 0 0 var(--px) #050408; border-radius: 0; -webkit-appearance: none; appearance: none;
}
.wsearch input::placeholder { color: var(--faint); }
.wsearch input:focus { outline: none; border-color: var(--gold); }
.wsearch.big input { height: 54px; font-size: 20px; }
.wresults {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; max-height: min(70vh, 560px); overflow-y: auto;
  border-style: solid; border-width: 16px; border-image: url("/assets/gh/ui/tooltip.png") 32 fill stretch; image-rendering: pixelated;
}
.wresults a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; color: var(--text); text-decoration: none; }
.wresults a:hover, .wresults a.on { background: var(--ink-3); color: var(--gold-hi); }
.wresults a span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.wresults small, .tile small { color: var(--text-dim); font-size: 14px; }
.wresults .empty { padding: 8px; color: var(--text-dim); }
.wresults mark, .searchpage mark { background: none; color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; }
.wmenu {
  display: none; height: 44px; padding: 0 12px; font: 16px/1 var(--display); color: var(--gold-hi); cursor: pointer;
  border-style: solid; border-width: 10px 14px; border-image: url("/assets/gh/ui/tab.png") 32 fill stretch; background: none;
}

/* ---------------------------------------------------------------- layout */

.wmain { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 22px; padding-block: 24px 60px; align-items: start; }
.wside { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; position: sticky; top: 140px; display: flex; flex-direction: column; max-height: calc(100vh - 160px); overflow-y: auto; }
.wside a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 10px; color: var(--text-dim); font-size: 16px; border-left: var(--px) solid var(--line); }
.wside a span { color: var(--faint); font-size: 14px; }
.wside a:hover { color: var(--gold-hi); border-left-color: var(--gold); text-decoration: none; background: var(--ink-3); }
.wside a.home { color: var(--gold); margin-bottom: 6px; }

.wart {
  min-width: 0; padding: 6px 10px 18px;
  border-style: solid; border-width: 24px; border-image: url("/assets/gh/ui/panel.png") 48 fill stretch; image-rendering: pixelated;
}
.wart > * { image-rendering: auto; }
.wart h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.1; color: var(--gold-hi); margin: 4px 0 14px; }
.wart h2 { font-size: 26px; color: var(--gold); margin: 30px 0 10px; padding-bottom: 4px; border-bottom: var(--px) solid var(--line-2); clear: none; }
.wart h3 { font-size: 20px; margin: 18px 0 6px; }
.wart p, .wart li { color: var(--text-dim); }
.wart section { scroll-margin-top: 140px; }
.wart .lead { font-size: 19px; color: var(--text); }
.wart .flavour { font-size: 18px; color: var(--text); font-style: italic; }
.wart .dim, .dim { color: var(--faint); }
.wart .wnote { font-size: 15px; color: var(--faint); border-left: var(--px) solid var(--line-2); padding-left: 10px; }
.wart ul { padding-left: 20px; }
.crumbs { font-size: 15px; color: var(--faint); margin: 0 0 6px; }
.jump { font-size: 15px; }

/* ---------------------------------------------------------------- links and icons */

a.wl { white-space: normal; }
a.wl img.ic { margin-right: 4px; }
img.ic { width: 32px; height: 32px; vertical-align: middle; object-fit: contain; }
.wt img.ic, p img.ic, li img.ic { width: 28px; height: 28px; }
img.big { width: 128px; height: 128px; object-fit: contain; }
.qty { color: var(--text); white-space: nowrap; }
.rar { font-size: 15px; }
.rar-common { color: var(--r-common); } .rar-uncommon { color: var(--r-uncommon); } .rar-rare { color: var(--r-rare); }
.rar-epic { color: var(--r-epic); } .rar-legendary { color: var(--r-legendary); } .rar-mythic { color: var(--r-mythic); }
a.wl.rar-common { color: var(--gold); }
.q { white-space: nowrap; }
.q0 { color: var(--q0); } .q1 { color: var(--q1); } .q2 { color: var(--q2); } .q3 { color: var(--q3); } .q4 { color: var(--q4); } .q5 { color: var(--q5); } .q6 { color: var(--q6); }

/* ---------------------------------------------------------------- infobox */

.infobox {
  float: right; width: 300px; margin: 0 0 16px 22px; padding: 0;
  border-style: solid; border-width: 16px; border-image: url("/assets/gh/ui/tooltip.png") 32 fill stretch; image-rendering: pixelated;
}
.infobox > * { image-rendering: auto; }
.infobox h2 { font-size: 22px; margin: 0 0 8px; text-align: center; color: var(--gold-hi); border: 0; padding: 0; }
.infobox .art { display: flex; justify-content: center; align-items: flex-end; min-height: 40px; padding: 8px 0 12px; background: radial-gradient(closest-side, rgba(236, 193, 105, .12), transparent); }
.infobox .art img.wide { width: 100%; height: auto; }
.infobox .pair { display: flex; gap: 12px; align-items: flex-end; }
.infobox .cap { text-align: center; font-size: 14px; color: var(--faint); margin: -6px 0 8px; }
.infobox table { width: 100%; border-collapse: collapse; font-size: 15px; }
.infobox th { text-align: left; vertical-align: top; color: var(--gold-dim); font-weight: 400; padding: 5px 8px 5px 0; width: 38%; }
.infobox td { color: var(--text); padding: 5px 0; vertical-align: top; }
.infobox tr + tr th, .infobox tr + tr td { border-top: var(--px) solid rgba(102, 68, 33, .45); }

/* ---------------------------------------------------------------- tables */

.tw { overflow-x: auto; margin: 10px 0 16px; -webkit-overflow-scrolling: touch; clear: none; }
table.wt { border-collapse: collapse; width: 100%; font-size: 16px; }
.wt th { text-align: left; font-weight: 400; color: var(--gold); padding: 8px 10px; background: var(--ink-3); border-bottom: var(--px) solid var(--line-2); white-space: nowrap; }
.wt td { padding: 6px 10px; color: var(--text); border-bottom: var(--px) solid rgba(58, 42, 24, .6); vertical-align: middle; }
.wt tbody tr:nth-child(even) td { background: var(--row); }
.wt tbody tr:hover td { background: rgba(236, 193, 105, .06); }
table[data-sort] th { cursor: pointer; user-select: none; }
/* Pixellari has no arrow glyphs: the sort marks are drawn. */
table[data-sort] th::after { content: ""; display: inline-block; margin-left: 6px; vertical-align: 2px; border: 4px solid transparent; border-top-color: var(--faint); border-bottom-width: 0; }
table[data-sort] th[aria-sort="ascending"]::after { border-top-width: 0; border-bottom: 5px solid var(--gold); border-top-color: transparent; }
table[data-sort] th[aria-sort="descending"]::after { border-top-color: var(--gold); }

/* ---------------------------------------------------------------- recipes */

.recipe { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px 12px; align-items: center; margin: 8px 0 12px; padding: 10px 12px; background: rgba(5, 4, 8, .55); border: var(--px) solid var(--line); }
.recipe .arrow { color: var(--gold); font-size: 22px; }
.recipe .rm { grid-column: 1 / -1; font-size: 15px; color: var(--text-dim); }
.recipe .rm a.wl { color: var(--gold); }
.recipe > p { grid-column: 1 / -1; margin: 0; font-size: 14px; }

/* ---------------------------------------------------------------- tiles and categories */

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 10px 0 20px; }
.tile { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: rgba(5, 4, 8, .5); border: var(--px) solid var(--line); color: var(--text); }
.tile:hover { border-color: var(--gold-dim); background: var(--ink-3); text-decoration: none; color: var(--gold-hi); }
.tile span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tile b { font-weight: 400; }
.tile .ic { flex: none; width: 40px; height: 40px; }
.tile.rar-uncommon b { color: var(--r-uncommon); } .tile.rar-rare b { color: var(--r-rare); } .tile.rar-epic b { color: var(--r-epic); }
.tile.rar-legendary b { color: var(--r-legendary); } .tile.rar-mythic b { color: var(--r-mythic); }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; text-align: center; color: var(--text);
  border-style: solid; border-width: 16px; border-image: url("/assets/gh/ui/slot.png") 32 fill stretch; image-rendering: pixelated;
}
.cat > * { image-rendering: auto; }
.cat img.ic { width: 48px; height: 48px; image-rendering: pixelated; }
.cat small { color: var(--faint); }
.cat:hover { filter: brightness(1.25); text-decoration: none; color: var(--gold-hi); }
.whero { text-align: center; padding: 10px 0 6px; }
.whero .lead { max-width: 720px; margin: 0 auto 18px; }
.whero .wsearch { max-width: 640px; margin: 0 auto; text-align: left; }

/* ---------------------------------------------------------------- art */

.wsprite { display: inline-block; width: var(--w); height: var(--h); background: var(--sheet) 0 0 / calc(var(--w) * var(--n)) 100% no-repeat; animation: wspr var(--speed) steps(var(--n)) infinite; }
@keyframes wspr { to { background-position-x: calc(var(--w) * var(--n) * -1); } }
@media (prefers-reduced-motion: reduce) { .wsprite { animation: none; } }
.scenebox { position: relative; height: 220px; margin: 0 0 16px; background: center / cover no-repeat; border: var(--px) solid var(--line-2); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.scenebox img.scenespr { width: 128px; height: 128px; margin-bottom: 12px; image-rendering: pixelated; }
.scenebox .wsprite { margin-bottom: 12px; }
.decorart { display: inline-block; margin: 12px 0; border: var(--px) solid var(--line-2); background: #050408; max-width: 100%; }
.decorart img { display: block; max-width: 100%; height: auto; }   /* drawn at the game's own 3× */
.decorart figcaption { padding: 4px 8px; font-size: 14px; color: var(--faint); }
.collars { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.collar { display: inline-block; width: 16px; height: 16px; background: var(--c); border: var(--px) solid #050408; box-shadow: 0 0 0 var(--px) var(--line-2); margin-right: 6px; vertical-align: -2px; }

/* ---------------------------------------------------------------- story and backlinks */

.letter { margin: 14px 0; }
.letter h3 { margin-bottom: 2px; }
.letter blockquote { margin: 6px 0 0; padding: 10px 14px; color: var(--text); background: rgba(5, 4, 8, .5); border-left: var(--px) solid var(--gold-dim); font-style: italic; }
details.links { clear: both; margin-top: 34px; padding: 10px 12px; border: var(--px) solid var(--line); background: rgba(5, 4, 8, .4); }
details.links summary { cursor: pointer; color: var(--gold); font-size: 18px; }
details.links p { font-size: 15px; margin: 8px 0 0; }
.searchpage .tile { margin-bottom: 6px; }

/* ---------------------------------------------------------------- tablets and phones
   Under laptop width a floated infobox squeezes the tables beside it, so it sits across the top instead. */

@media (max-width: 1180px) {
  .infobox { float: none; width: auto; margin: 0 0 18px; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 0 16px; align-items: center; }
  .infobox h2, .infobox .cap { grid-column: 1 / -1; }
  .infobox .art { padding: 4px 0; }
}

@media (max-width: 900px) {
  .wmain { grid-template-columns: minmax(0, 1fr); padding-block: 14px 40px; }
  .wmenu { display: block; }
  .wside {
    display: none; position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: min(300px, 86vw); max-height: none; padding: 16px;
    background: var(--ink-2); box-shadow: -10px 0 30px rgba(0, 0, 0, .6);
  }
  .wside.open { display: flex; }
}
@media (max-width: 640px) {
  .wart { border-width: 16px; padding: 4px 4px 14px; border-image-slice: 48; }
  .infobox { grid-template-columns: minmax(0, 1fr); }
  .wart h2 { font-size: 22px; }
  .recipe { grid-template-columns: 1fr; }
  .recipe .arrow { transform: rotate(90deg); justify-self: start; }
  .tiles { grid-template-columns: 1fr; }
  .cats { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .scenebox { height: 160px; }
  table.wt { font-size: 15px; }
  .wt th, .wt td { padding: 6px 7px; }
}
