/* wiki: side menus, tab and search, content panel, main page, article.
   Values are from the "Yumuşak gece" mockups (G-wiki-ana, G-wiki-madde,
   G-wiki-mobil). Colours, fonts and buttons come from base.css. */

/* The Minecraft font is used for one thing only: in-game tooltip blocks. */
@font-face {
  font-family: "Minecraft";
  src: url("../fonts/MinecraftVanilla.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --tooltip-background: #1B0C1B;
  --tooltip-border: #2C0863;
  --world-card-backdrop: #1C2028;
  /* Minecraft chat colours, tuned to the tooltip background. */
  --mc-0: #7A7A86;
  --mc-1: #6E7BFF;
  --mc-2: #4FC46A;
  --mc-3: #3FC8C8;
  --mc-4: #E0564A;
  --mc-5: #C77BE6;
  --mc-6: #FFB24D;
  --mc-7: #C9C9D4;
  --mc-8: #8E8E9C;
  --mc-9: #8C9BFF;
  --mc-a: #8FE35A;
  --mc-b: #6FE0F0;
  --mc-c: #FF6A5C;
  --mc-d: #FF8AE0;
  --mc-e: #FFE85C;
  --mc-f: #FFFFFF;
}

.wiki-body {
  min-height: 100vh;
  background: var(--page-glow);
  background-repeat: no-repeat;
  background-color: var(--color-page);
  font-size: 16px;
}

.wiki-body a {
  color: var(--link);
}

.wiki-body a:hover {
  color: var(--accent);
}

.wiki-body a.btn,
.wiki-body a.btn:hover {
  color: var(--text-strong);
}

.wiki-body a.btn-gold,
.wiki-body a.btn-gold:hover {
  color: var(--gold-text);
}

/* ---------- Frame ---------- */

.wiki {
  display: flex;
  gap: 18px;
  padding: 0 24px 0 16px;
}

.wiki-top {
  display: none;
}

.wiki-side {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 180px;
  padding-top: 14px;
  font-size: 15px;
}

.wiki-logo {
  display: block;
  text-align: center;
}

.wiki-logo img {
  width: 124px;
}

.wiki-menus {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-box {
  padding: 12px 14px 14px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
  line-height: 1.9;
}

.side-box-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  line-height: inherit;
  color: var(--accent);
}

.side-box ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-box a {
  display: block;
}

.wiki-main {
  flex: 1;
  min-width: 0;
}

.wiki-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 68px;
}

.wiki-tab {
  padding: 10px 20px 9px;
  background: var(--surface-panel);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
}

.wiki-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--tap);
  margin-bottom: 10px;
  padding: 0 6px 0 14px;
  background: var(--surface-well);
  border: 2px solid var(--line-input);
  border-radius: var(--radius-control);
}

.wiki-search input {
  width: 220px;
  min-width: 0;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
}

.wiki-search input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.wiki-search input:focus-visible {
  outline: 0;
}

.wiki-search:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.wiki-search button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
}

.wiki-search button:hover {
  color: var(--accent);
}

.wiki-panel {
  padding: 22px 24px 28px;
  background: var(--surface-panel);
  border: 1px solid var(--line);
  border-radius: 0 var(--radius-panel) var(--radius-panel) var(--radius-panel);
}

.wiki-footer {
  padding: 14px 4px 22px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- Main page ---------- */

.home {
  display: flex;
  gap: 20px;
  margin: -2px -4px -8px;
  font-size: 15px;
}

.home-main {
  flex: 1;
  min-width: 0;
}

.home-title,
.home-band {
  margin: 0;
  border-radius: var(--radius-control);
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 600;
}

.home-title {
  padding: 11px 12px;
  background: var(--surface-button);
  font-size: 25px;
  color: var(--accent);
}

.home-band {
  padding: 9px 12px;
  background: var(--surface-band);
  font-size: 21px;
  color: var(--text-strong);
}

.home-intro {
  margin: 14px 4px 18px;
  line-height: 1.7;
  color: var(--text-soft);
}

.home-intro p {
  margin: 0;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 10px 22px;
  padding: 0;
  list-style: none;
  font-family: var(--font-heading);
  font-size: 16px;
}

.wiki-body a.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 14px 4px 10px;
  background: var(--surface-band);
  border-radius: var(--radius-box);
  box-shadow: 0 4px 0 var(--surface-well);
  text-align: center;
  color: var(--text-strong);
}

.wiki-body a.tile:hover {
  color: var(--accent);
}

.tile-icon {
  flex: none;
  width: auto;
  height: 44px;
}

svg.tile-icon {
  width: 44px;
}

.tile-glyph {
  display: grid;
  place-items: center;
  font-size: 36px;
  line-height: 1;
}

.world-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.wiki-body a.world-card {
  display: block;
  height: 100%;
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  color: var(--text-strong);
}

.world-card img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: var(--world-card-backdrop);
}

.world-card-name {
  display: block;
  padding: 10px 14px 0;
  font-family: var(--font-heading);
  font-size: 21px;
}

.world-card:hover .world-card-name {
  color: var(--accent);
}

.world-card-note {
  display: block;
  padding: 0 14px 12px;
}

.home-side {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 300px;
}

.home-box {
  padding: 16px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.home-box-center {
  text-align: center;
}

.home-box h2 {
  margin: 0;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 600;
  color: var(--accent);
}

.home-box p {
  margin: 8px 0 12px;
  line-height: 1.6;
  color: var(--text-soft);
}

.home-box .home-box-note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

.home-address {
  display: block;
  margin-top: 10px;
  padding: 11px;
  overflow: hidden;
  background: var(--surface-well);
  border: 2px solid var(--line-input);
  border-radius: var(--radius-control);
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-strong);
}

.wiki-body a.home-store {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  color: var(--text-strong);
}

.home-store img {
  flex: none;
  width: 74px;
}

.home-store-title,
.home-store-go {
  display: block;
}

.home-store-go {
  font-size: 14px;
  color: var(--link);
}

.home-store:hover .home-store-go {
  color: var(--accent);
}

/* ---------- Article ---------- */

.article-title {
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 600;
  color: var(--text-strong);
}

.article-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.article-text {
  flex: 1;
  min-width: 0;
}

.article-body {
  line-height: 1.7;
  color: var(--text-soft);
}

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

.article-body strong,
.article-body b {
  color: var(--text-strong);
}

.article-body ul,
.article-body ol {
  margin: 0 0 10px;
  padding-left: 22px;
}

.article-body h2 {
  margin: 24px 0 10px;
  padding: 7px 14px;
  background: var(--surface-band);
  border-radius: var(--radius-band);
  font-family: var(--font-heading);
  font-size: 23px;
  font-weight: 600;
  color: var(--text-strong);
}

.article-body h3 {
  margin: 18px 0 8px;
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-strong);
}

.article-body code {
  padding: 1px 7px;
  background: var(--surface-well);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: var(--text-strong);
}

.article-body img {
  border-radius: var(--radius-box);
}

.table-scroll {
  display: inline-block;
  max-width: 100%;
  margin: 0 0 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
  vertical-align: top;
}

.article-body table {
  border-collapse: collapse;
  background: var(--surface-card);
  font-size: 15px;
}

.article-body th {
  padding: 10px 18px;
  background: var(--surface-band);
  text-align: left;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
}

.article-body td {
  padding: 10px 18px;
  border-top: 1px solid var(--line);
}

.article-body td code {
  white-space: nowrap;
}

/* In-game tooltip: ```tooltip block in Markdown. */
.mc-tooltip {
  display: inline-block;
  max-width: 100%;
  margin: 0 0 10px;
  padding: 10px 14px 9px;
  background: var(--tooltip-background);
  border: 3px solid var(--tooltip-border);
  border-radius: 6px;
  font-family: "Minecraft", monospace;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--mc-f);
}

.mc-0 { color: var(--mc-0); }
.mc-1 { color: var(--mc-1); }
.mc-2 { color: var(--mc-2); }
.mc-3 { color: var(--mc-3); }
.mc-4 { color: var(--mc-4); }
.mc-5 { color: var(--mc-5); }
.mc-6 { color: var(--mc-6); }
.mc-7 { color: var(--mc-7); }
.mc-8 { color: var(--mc-8); }
.mc-9 { color: var(--mc-9); }
.mc-a { color: var(--mc-a); }
.mc-b { color: var(--mc-b); }
.mc-c { color: var(--mc-c); }
.mc-d { color: var(--mc-d); }
.mc-e { color: var(--mc-e); }
.mc-f { color: var(--mc-f); }

.toc {
  display: inline-block;
  min-width: 220px;
  margin-top: 6px;
  padding: 12px 18px 14px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
  font-size: 15px;
  line-height: 1.9;
}

.toc-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  line-height: inherit;
  color: var(--text-strong);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
}

.toc-level-3 {
  padding-left: 16px;
}

.infobox {
  flex: none;
  order: 2;
  width: 304px;
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}

.infobox-title {
  padding: 10px;
  background: var(--surface-button);
  text-align: center;
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 600;
  color: var(--accent);
}

.infobox-image {
  padding: 16px;
  background: var(--surface-well);
  text-align: center;
}

.infobox-image img {
  display: block;
  width: 240px;
  max-height: 260px;
  margin: 0 auto;
  object-fit: contain;
}

.infobox-section {
  padding: 8px;
  background: var(--surface-band);
  text-align: center;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-strong);
}

.infobox dl,
.infobox dd {
  margin: 0;
}

.infobox dt {
  font-weight: 800;
  color: var(--text-strong);
}

.infobox-rows > div {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.infobox-rows dt,
.infobox-rows dd {
  padding: 9px 14px;
}

.infobox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* The 1px gaps show the grid's own background as the lines between cells. */
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  text-align: center;
}

.infobox-section + .infobox-grid {
  border-top: 0;
}

.infobox-grid > div {
  padding: 10px;
  background: var(--surface-card);
}

.infobox-grid > div:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.navbox {
  margin-top: 28px;
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.navbox-title {
  margin: 0;
  padding: 8px;
  background: var(--surface-band);
  text-align: center;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-strong);
}

.navbox ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 32px;
  margin: 0;
  padding: 12px;
  list-style: none;
}

.navbox strong {
  font-weight: 700;
  color: var(--text-strong);
}

/* ---------- Search results, message pages ---------- */

.hits {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.hit {
  margin-top: 12px;
  padding: 12px 16px 14px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
  line-height: 1.6;
}

.hit-title {
  font-family: var(--font-heading);
  font-size: 20px;
}

.hit-category,
.hit-snippet {
  margin: 0;
}

.hit-category {
  font-size: 14px;
  color: var(--text-muted);
}

.hit-snippet {
  color: var(--text-soft);
}

.wiki-panel .button-row {
  margin-top: 16px;
}

/* ---------- Medium screens: the main page's side column moves down ---------- */

@media (max-width: 1179.98px) {
  .home {
    flex-direction: column;
  }

  .home-side {
    flex-direction: row;
    flex-wrap: wrap;
    width: auto;
  }

  .home-box {
    flex: 1 1 240px;
  }

  .tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- Phone ---------- */

@media (max-width: 899.98px) {
  .wiki-body {
    background-image: var(--page-glow-narrow);
  }

  .wiki {
    display: block;
    padding: 0;
  }

  .wiki-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 64px;
    padding: 0 10px 0 12px;
  }

  .wiki-body a.wiki-top-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 21px;
    color: var(--text-strong);
  }

  .wiki-top-brand img {
    display: block;
    width: 44px;
  }

  .wiki-top-buttons {
    display: flex;
    gap: 8px;
  }

  .wiki-top .btn {
    height: 46px;
    padding: 0 16px;
    font-size: 17px;
  }

  .wiki-top .wiki-top-search {
    width: 46px;
    padding: 0;
  }

  /* Without scripts the buttons do nothing, so they are not shown and the
     menus and the search box stay open. */
  html:not(.js) .wiki-top-buttons {
    display: none;
  }

  .wiki-side {
    width: auto;
    padding: 0 8px;
  }

  .wiki-logo {
    display: none;
  }

  .wiki-menus {
    padding-bottom: 12px;
  }

  .js .wiki-menus:not(.is-open),
  .js .wiki-search:not(.is-open) {
    display: none;
  }

  .side-box a {
    display: flex;
    align-items: center;
    min-height: 40px;
  }

  .wiki-main {
    margin: 4px 8px 0;
  }

  .wiki-bar {
    display: block;
    height: auto;
  }

  .wiki-tab {
    display: none;
  }

  .wiki-search {
    height: 48px;
    margin-bottom: 10px;
  }

  .wiki-search input {
    flex: 1;
    width: auto;
    height: 40px;
    font-size: 16px;
  }

  .wiki-search button {
    width: 40px;
    height: 40px;
  }

  .wiki-panel {
    padding: 16px 14px 22px;
    border-radius: var(--radius-panel);
  }

  .wiki-footer {
    padding: 14px 8px 24px;
  }

  .home {
    margin: 0;
  }

  .tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 20px;
  }

  .world-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-title {
    margin-bottom: 14px;
    padding-bottom: 6px;
    font-size: 34px;
    line-height: 1.2;
  }

  .article-layout {
    display: block;
  }

  .infobox {
    width: auto;
    margin-bottom: 16px;
  }

  .infobox-image {
    padding: 14px;
  }

  .infobox-rows > div {
    grid-template-columns: 128px minmax(0, 1fr);
  }

  .toc {
    display: block;
    padding: 10px 16px 12px;
    line-height: 1.7;
  }

  .toc-title {
    font-size: 18px;
  }

  .toc a {
    display: flex;
    align-items: center;
    min-height: 40px;
  }

  .article-body h2 {
    margin: 22px 0 8px;
    font-size: 22px;
    line-height: 1.3;
  }

  .table-scroll {
    display: block;
  }

  .article-body table {
    width: 100%;
    white-space: nowrap;
  }

  .article-body th,
  .article-body td {
    padding: 10px 14px;
  }

  .navbox {
    margin-top: 24px;
  }

  .navbox ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    text-align: center;
  }

  .navbox li > * {
    display: grid;
    place-items: center;
    min-height: 46px;
  }
}
