/* Mythwake website: a classic framed MMO portal in Mythwake's colours.
   Chunky like the game: thick dark outlines, flat fills, hard drop shadows. */

@font-face {
  font-family: "Mythwake";
  src: url("../fonts/MythwakeBold.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #1a120c;
  --night: #0e2226;
  --night2: #15343a;
  --parch: #f7eed6;
  --parch2: #eadbb3;
  --parch3: #dcc796;
  --teal: #1d5559;
  --teal2: #27727a;
  --gold: #f4b93a;
  --gold2: #d08f16;
  --text: #2a1f15;
  --muted: #6e5c46;
  --link: #145b7d;
  --todo-bg: #fff0a8;
  --todo-ink: #6a4600;
  --title: "Mythwake", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  background-image:
    radial-gradient(ellipse at 50% 0, #24525a 0, rgba(36, 82, 90, 0) 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .025) 0 12px, rgba(0, 0, 0, 0) 12px 24px);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); font-weight: 600; }
a:hover { color: var(--gold2); }
h1, h2, h3 { font-family: var(--title); font-weight: normal; letter-spacing: .02em; line-height: 1.2; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 9; background: var(--gold); color: var(--ink); padding: 8px 12px; }

/* ---------- The frame ---------- */
.frame {
  max-width: 1000px;
  margin: 20px auto 28px;
  background: var(--parch2);
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 8px 0 var(--ink), 0 18px 40px rgba(0, 0, 0, .5);
  overflow: hidden;
}

/* ---------- Banner ---------- */
.banner {
  position: relative;
  display: block;
  height: 240px;
  background: #3d6e5c;
  overflow: hidden;
  border-bottom: 4px solid var(--ink);
}
.banner picture, .banner .bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.banner .bg { object-fit: cover; object-position: 50% 35%; }
.banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(14, 34, 38, .05), rgba(14, 34, 38, .15) 55%, rgba(14, 34, 38, .55));
}
.banner .logo {
  position: absolute; z-index: 1;
  left: 50%; top: 50%;
  width: min(600px, 84%);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 0 rgba(26, 18, 12, .85)) drop-shadow(0 0 18px rgba(0, 0, 0, .45));
}
.page-banner { height: 150px; }
.page-banner .logo { width: min(420px, 74%); }

/* ---------- Tab navigation ---------- */
.topnav {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--teal);
  border-bottom: 4px solid var(--ink);
}
.topnav a {
  display: block;
  padding: 11px 6px 9px;
  text-align: center;
  font-family: var(--title);
  font-weight: normal;
  font-size: 1.1rem;
  color: var(--parch);
  text-decoration: none;
  text-shadow: 0 2px 0 var(--ink);
  border-right: 3px solid var(--ink);
}
.topnav a:last-child { border-right: 0; }
.topnav a:hover { background: var(--teal2); color: var(--gold); }
.topnav a[aria-current="page"] { background: var(--gold); color: var(--ink); text-shadow: none; }

/* ---------- Columns ---------- */
.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 18px;
  padding: 18px;
}
.single { padding: 18px; }

/* ---------- Boxes ---------- */
.box {
  background: var(--parch);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 5px 0 var(--ink);
  margin: 0 0 20px;
  overflow: hidden;
}
.box:last-child { margin-bottom: 0; }
.box-title {
  margin: 0;
  padding: 9px 16px 7px;
  background: var(--teal);
  color: var(--gold);
  font-size: 1.35rem;
  text-shadow: 0 2px 0 var(--ink);
  border-bottom: 3px solid var(--ink);
}
.box-body { padding: 14px 18px 16px; }
.box-body > :first-child { margin-top: 0; }
.box-body > :last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 10px 22px 8px;
  font-family: var(--title);
  font-weight: normal;
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--ink);
  background: var(--gold);
  background-image: linear-gradient(#ffd56a, var(--gold) 55%);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 5px 0 var(--ink);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.btn:hover { color: var(--ink); background-image: linear-gradient(#ffe08a, #ffc64d 55%); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn-big { font-size: 1.9rem; padding: 14px 34px 11px; }
.btn-block { display: block; width: 100%; }
.btn-teal { background: var(--teal2); background-image: none; color: var(--parch); text-shadow: 0 2px 0 var(--ink); }
.btn-teal:hover { background: #2f8790; color: var(--gold); background-image: none; }
.btn-small { font-size: 1rem; padding: 7px 14px 5px; }
.btn.is-off, .btn.is-off:hover {
  background: #b9ab8c; background-image: none; color: #4c4232;
  cursor: not-allowed; transform: none; box-shadow: 0 5px 0 var(--ink); text-shadow: none;
}
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* Placeholders Bay must fill: deliberately loud. */
.todo {
  background: var(--todo-bg);
  color: var(--todo-ink);
  border: 2px dashed #c08a00;
  border-radius: 5px;
  padding: 0 5px;
  font-weight: 700;
  font-size: .92em;
}
.note { margin: 10px 0 0; font-size: .9rem; }

/* ---------- Home: play box ---------- */
.playbox {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}
.playbox h2 { margin: 0 0 6px; font-size: 1.7rem; color: var(--teal); }
.playbox p { margin: 0; }
.playbox .cta { text-align: center; }

.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.features li { position: relative; padding-left: 26px; }
.features li::before {
  content: ""; position: absolute; left: 0; top: .35em;
  width: 14px; height: 14px;
  background: var(--gold);
  border: 2px solid var(--ink);
  transform: rotate(45deg);
}
.features b { display: block; font-family: var(--title); font-weight: normal; font-size: 1.1rem; color: var(--teal); }

/* ---------- News ---------- */
.post { padding: 0 0 14px; margin: 0 0 14px; border-bottom: 2px dashed var(--parch3); }
.post:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.post h3 { margin: 0; font-size: 1.35rem; color: var(--teal); }
.post h3 a { color: inherit; text-decoration: none; font-weight: normal; }
.post h3 a:hover { color: var(--gold2); }
.post-meta { margin: 2px 0 8px; font-size: .85rem; color: var(--muted); }
.post-cat {
  display: inline-block; margin-left: 8px; padding: 0 8px;
  background: var(--parch2); border: 2px solid var(--ink); border-radius: 20px;
  font-size: .78rem; font-weight: 700; color: var(--ink);
}
.post-body p { margin: 0 0 10px; }
.post-body > :last-child { margin-bottom: 0; }
.more { display: inline-block; margin-top: 2px; }

/* ---------- Screenshots ---------- */
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shot {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 9;
  padding: 10px;
  text-align: center;
  background: repeating-linear-gradient(45deg, var(--parch2) 0 10px, var(--parch) 10px 20px);
  border: 3px dashed var(--muted);
  border-radius: 10px;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
}
.shot.has-shot { padding: 0; border: 3px solid var(--ink); overflow: hidden; background: var(--ink); }
.shot.has-shot a, .shot.has-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Sidebar ---------- */
.side .box-body { padding: 12px 14px 14px; }
.side form { display: flex; gap: 8px; }
.side input { flex: 1; min-width: 0; }
input[type="text"], input[type="search"], input[type="number"] {
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  background: #fffaf0;
  border: 3px solid var(--ink);
  border-radius: 8px;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--gold2); outline-offset: 2px; }
.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li { border-bottom: 2px dashed var(--parch3); }
.linklist li:last-child { border-bottom: 0; }
.linklist a { display: block; padding: 7px 2px; text-decoration: none; }
.linklist a::before { content: "\25B8\00a0"; color: var(--gold2); }

/* ---------- Download ---------- */
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 12px 46px; min-height: 34px; }
.steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px; line-height: 28px;
  text-align: center;
  font-family: var(--title);
  font-size: 1.15rem;
  background: var(--gold);
  border: 3px solid var(--ink);
  border-radius: 50%;
}
.reqs { width: 100%; border-collapse: collapse; }
.reqs th, .reqs td { text-align: left; padding: 6px 8px; border-bottom: 2px dashed var(--parch3); vertical-align: top; }
.reqs th { width: 34%; color: var(--teal); }

/* ---------- Hiscores ---------- */
.hs { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; }
.hs-skills { display: flex; flex-direction: column; gap: 4px; }
.hs-skill {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 6px 10px;
  font: inherit; font-weight: 600; text-align: left;
  color: var(--text);
  background: var(--parch);
  border: 2px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
}
.hs-skill:hover { background: #fff7df; }
.hs-skill.on { background: var(--gold); }
.hs-dot { display: inline-block; flex: none; width: 14px; height: 14px; margin-right: 6px; border: 2px solid var(--ink); border-radius: 3px; vertical-align: -2px; }
.hs-skill .hs-dot { margin-right: 0; }
.hs-table { width: 100%; border-collapse: collapse; border: 3px solid var(--ink); background: var(--parch); }
.hs-table th {
  padding: 8px 10px 6px;
  text-align: left;
  font-family: var(--title); font-weight: normal; font-size: 1.05rem;
  color: var(--gold); background: var(--teal);
  border-bottom: 3px solid var(--ink);
}
.hs-table td { padding: 6px 10px; border-bottom: 1px solid var(--parch3); }
.hs-table tbody tr:nth-child(even) td { background: #f0e4c4; }
.hs-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.hs-table th:not(:nth-child(2)) { text-align: right; }
.hs-empty { padding: 22px 12px !important; text-align: center; color: var(--muted); font-weight: 600; }
.hs-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 12px 0 0; }
.hs-forms { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.hs-forms form { display: flex; gap: 6px; flex: 1 1 220px; }
.hs-forms input { flex: 1; min-width: 0; }
#hs-player .btn { margin-top: 14px; }
#hs-player .hs-table th:first-child { text-align: left; }

/* ---------- Policies ---------- */
.doc h2 { color: var(--teal); font-size: 1.4rem; margin: 22px 0 6px; }
.doc h3 { color: var(--teal); font-size: 1.1rem; margin: 16px 0 4px; }
.doc ul { padding-left: 22px; }
.doc li { margin: 0 0 5px; }
.draft {
  margin: 0 0 16px; padding: 10px 14px;
  background: var(--todo-bg); color: var(--todo-ink);
  border: 3px dashed #c08a00; border-radius: 10px;
  font-weight: 600;
}

/* ---------- Footer ---------- */
.foot {
  padding: 14px 18px 16px;
  background: var(--teal);
  color: var(--parch);
  border-top: 4px solid var(--ink);
  font-size: .88rem;
  text-align: center;
}
.foot nav { margin-bottom: 6px; }
.foot a { color: var(--gold); margin: 0 6px; font-weight: 600; }
.foot a:hover { color: #fff; }
.foot p { margin: 4px 0 0; }
.foot .todo { font-size: .85rem; }

/* ---------- Phones and small tablets ---------- */
@media (max-width: 820px) {
  .cols { grid-template-columns: 1fr; }
  .hs { grid-template-columns: 1fr; }
  .hs-skills { flex-direction: row; flex-wrap: wrap; }
  .hs-skill { width: auto; flex: 1 1 140px; }
}
@media (max-width: 640px) {
  .frame { margin: 0; border-width: 0 0 4px; border-radius: 0; box-shadow: none; }
  .banner { height: 170px; }
  .page-banner { height: 110px; }
  .topnav { grid-template-columns: repeat(4, 1fr); }
  .topnav a { font-size: 1rem; padding: 10px 2px 8px; border-bottom: 3px solid var(--ink); }
  .topnav a:nth-child(4n) { border-right: 0; }
  .topnav a:nth-child(n+5) { border-bottom: 0; }
  .cols, .single { padding: 14px 12px; gap: 14px; }
  .box-body { padding: 12px 14px 14px; }
  .playbox { grid-template-columns: 1fr; text-align: center; }
  .features { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; }
  .btn-big { font-size: 1.6rem; width: 100%; }
  .hs-table th, .hs-table td { padding: 6px; font-size: .92rem; }
  .reqs th { width: 40%; }
}
