/* Forgewell Factions website. Built from the server's own form textures (img/, copied from the resource pack's
   forgewell_ui) drawn at 4x with pixelated scaling, so the site looks like the in-game menus. The 9-slice textures use
   border-image with the same slice sizes as their .json files in the pack. */
@font-face {
  font-family: "Minecraft Ten";
  src: url("fonts/minecraft-ten.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #140B0A;
  --bg-deep: #0C0606;
  --text: #F3EBE3;
  --text-2: #DACDC3;
  --text-3: #B6A498;
  --gold: #F2C14E;
  --gold-hi: #FFE08A;
  --title: "Minecraft Ten", "Inter", sans-serif;
  --body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--body); }
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }
code { font-family: ui-monospace, Consolas, monospace; color: var(--gold); }
strong { color: var(--text); }
h1, h2, h3, p { margin: 0; }
h2, h3 { font-family: var(--title); font-weight: 400; letter-spacing: .02em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.px { image-rendering: pixelated; }
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: 24px; }
.gold { color: var(--gold); }
.muted { color: var(--text-3); }
.small { font-size: 13px; color: var(--text-3); margin-top: 10px; }

/* Backgrounds and frames (all the pack's textures) */
.wall {
  background: #2A1712 url("img/wall.png") center top / cover no-repeat;
  image-rendering: pixelated;
}
.panel {
  border: 8px solid transparent;
  border-image: url("img/g_body.png") 2 fill / 8px stretch;
  image-rendering: pixelated;
}
.card {
  position: relative;
  border: 8px solid transparent;
  border-image: url("img/g_card_frame.png") 2 / 8px stretch;
  background: url("img/g_display.png") center / 100% 100%;
  image-rendering: pixelated;
  padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.card h3 { font-size: 22px; text-shadow: 2px 2px 0 #000; }
.card p { color: #CDBDB1; }
.card-title { display: flex; align-items: center; gap: 14px; }
.card-title h3 { padding-top: .1em; }
.plaque {
  align-self: flex-start;
  border: 8px solid transparent;
  border-image: url("img/g_plaque.png") 2 fill / 8px stretch;
  image-rendering: pixelated;
  padding: .3em .55em .4em;
  color: #3A1C08;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1;
  text-shadow: 2px 2px 0 rgba(255, 236, 170, .55);
}
.icon-card {
  width: 64px; height: 64px; flex: none;
  display: grid; place-items: center;
  border: 8px solid transparent;
  border-image: url("img/g_icon_card.png") 2 fill / 8px stretch;
  image-rendering: pixelated;
}
.icon-card img { width: 32px; height: 32px; }
.icon-card.small { width: 52px; height: 52px; }
.icon-card.small img { width: 24px; height: 24px; }

/* Buttons: the form button faces (red = the Support button, gold, and the plain stone face) */
/* Minecraft Ten's capitals sit 0.05em below the middle of a line-height: 1 box, so every texture with title text
   inside (buttons, the badge, the plaques) gets 0.1em more padding at the bottom than the top, which centres the letters */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px .1em;
  font: 20px/1 var(--title); letter-spacing: .03em; text-decoration: none;
  color: #fff; text-shadow: 2px 2px 0 rgba(0, 0, 0, .7);
  border: 4px solid transparent;
  border-image: url("img/g_button_face.png") 1 fill / 4px stretch;
  image-rendering: pixelated;
  /* The black outline the server's buttons have */
  box-shadow: 0 0 0 4px #000;
  background: none; cursor: pointer;
}
.btn:hover { color: #fff; border-image-source: url("img/g_button_face_hover.png"); }
.btn:active { transform: translateY(2px); }
.btn-red { border-image-source: url("img/g_support.png"); }
.btn-red:hover { border-image-source: url("img/g_support_hover.png"); }
.btn-gold { border-image-source: url("img/g_button_face_gold.png"); color: #3A1C08; text-shadow: 1px 1px 0 rgba(255, 236, 170, .6); }
.btn-gold:hover { border-image-source: url("img/g_button_face_gold_hover.png"); color: #3A1C08; }
.btn-sm { min-height: 44px; padding: 0 18px .1em; font-size: 18px; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--bg-deep); border-bottom: 4px solid #8E2A1C; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { display: flex; }
.brand img { height: 38px; width: auto; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a:not(.btn) { color: var(--text-2); text-decoration: none; font: 19px var(--title); padding: 12px 4px 8px; text-shadow: 2px 2px 0 #000; }
.nav a:not(.btn):hover { color: var(--gold); }
.menu-toggle { display: none; min-height: 44px; width: 52px; padding: 0; }

/* Hero */
.hero { border-bottom: 4px solid #8E2A1C; }
.hero-inner { padding-block: 96px 104px; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.badge {
  font: 18px/1 var(--title); color: #fff; text-shadow: 2px 2px 0 rgba(0, 0, 0, .7);
  border: 4px solid transparent; border-image: url("img/g_support.png") 1 fill / 4px stretch; image-rendering: pixelated;
  box-shadow: 0 0 0 4px #000;
  padding: 8px 14px calc(8px + .1em);
}
.hero-logo { width: 100%; }
.hero-logo img { display: block; width: min(555px, 100%); height: auto; filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, .55)); }
.tagline { font: clamp(30px, 4.5vw, 46px)/1.1 var(--title); text-shadow: 3px 3px 0 #000; }
.lead { max-width: 620px; font-size: 19px; color: var(--text-2); text-shadow: 1px 1px 0 #000; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.ip-box { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 10px 10px 10px 16px; margin-top: 8px; }
.ip-text { display: flex; flex-direction: column; gap: 2px; }
.ip-text .label { font: 15px var(--title); color: var(--gold); letter-spacing: .04em; }
.ip-text code { font-size: 18px; color: var(--text); }
.copy { min-height: 46px; font-size: 18px; }

/* Sections */
.section { padding-block: 96px; display: flex; flex-direction: column; gap: 40px; }
.band { border-block: 4px solid #8E2A1C; }
.section-head { display: flex; flex-direction: column; gap: 16px; max-width: 700px; }
.section-head p { font-size: 17px; color: var(--text-2); text-shadow: 1px 1px 0 #000; }

.grid { display: grid; gap: 20px; }
.features { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.join { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.ranks { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: stretch; }
.notes { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.fair, .note { display: flex; align-items: center; gap: 18px; padding: 14px 18px; }
.fair p { flex: 1 1 300px; font-size: 17px; }
.note p { color: var(--text-2); }

/* Join steps: numbered in gold, like the form's pixel numbers */
.steps, .cmds { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; color: var(--text-2); }
.steps { counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-left: 32px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; font: 22px/1.2 var(--title); color: var(--gold); text-shadow: 2px 2px 0 #000; }
.cmds li { padding-left: 18px; position: relative; }
.cmds li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; background: var(--gold); box-shadow: 2px 2px 0 #000; }

/* Ranks */
.rank { gap: 14px; }
/* The rank banners (the chat rank textures, 24x upscaled, 9 pixels tall) drawn at 4x */
.rank-name img { display: block; height: 36px; width: auto; filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, .6)); }
.rank .muted { margin-top: -4px; }
.rank.featured { border-image-source: url("img/g_card_frame_hover.png"); }
.price { font: 38px/1 var(--title); text-shadow: 3px 3px 0 #000; display: flex; align-items: flex-end; gap: .12em; }
/* Minecraft Ten has no £, so it's drawn as pixels (index.html), the height of the font's capitals */
.pound { width: 1em; height: 1em; fill: currentColor; filter: drop-shadow(3px 3px 0 #000); flex: none; margin-bottom: -.03em; }
.price .per { font: 16px var(--body); color: var(--text-3); text-shadow: none; margin-left: .3em; align-self: flex-end; padding-bottom: .1em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.perks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; color: var(--text-2); flex: 1; }
.perks li { padding-left: 18px; position: relative; }
.perks li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; background: var(--rank); box-shadow: 2px 2px 0 #000; }
.rank .btn { width: 100%; }

/* Footer */
.footer { background: var(--bg-deep); border-top: 4px solid #8E2A1C; }
.footer-inner { padding-block: 36px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer img { height: 38px; width: auto; display: block; }
.nav-footer { display: flex; flex-wrap: wrap; gap: 20px; }
.nav-footer a { color: var(--text-2); text-decoration: none; font: 18px var(--title); padding: 10px 0 6px; }
.nav-footer a:hover { color: var(--gold); }

/* Checkout box (store.js) and the message that pops up after paying */
.buy { width: min(440px, calc(100% - 32px)); padding: 24px; color: var(--text); }
.buy::backdrop { background: rgba(8, 4, 4, .75); }
.buy-form { display: flex; flex-direction: column; gap: 12px; }
.buy-form .plaque { font-size: 28px; margin-bottom: 8px; }
.buy-form label { font: 18px var(--title); color: var(--gold); text-shadow: 2px 2px 0 #000; }
.buy-form input {
  min-height: 48px; padding: 0 14px; font: 17px var(--body); color: var(--text);
  background: #0C0606; border: 4px solid #000; box-shadow: inset 0 0 0 2px #4A3631;
}
.buy-form input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--gold); }
.buy-hint { font-size: 14px; color: var(--text-3); }
.buy-error { font-size: 14px; color: #FF8A7A; }
.buy-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px; margin-top: 8px; }
.btn:disabled { opacity: .6; cursor: progress; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; }

/* Phones */
@media (max-width: 760px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-deep); border-bottom: 4px solid #8E2A1C; padding: 8px 16px 16px;
  }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: 14px 4px 10px; border-bottom: 2px solid #2A1712; }
  .nav .btn { margin-top: 12px; }
  .wrap { padding-inline: 16px; }
  .hero-inner { padding-block: 56px 72px; }
  .section { padding-block: 64px; gap: 32px; }
  .features, .join, .ranks, .notes { grid-template-columns: 1fr; }
  .ip-box { width: 100%; }
  .ip-text { flex: 1; }
  .ip-text code { font-size: 15px; white-space: nowrap; }
}
