/* Soul Ruin website: a blood moon over a ruined kingdom. No external fonts or images; the art is bg.svg and frame.svg.
   If a bg.jpg is put next to bg.svg it is drawn instead (the SVG stays as the fallback). */

:root {
  --bg: #090607;
  --panel: rgba(14, 10, 11, 0.9);
  --panel-2: rgba(30, 20, 20, 0.85);
  --border: #5d4630;
  --gold: #f0d7a1;
  --gold-dim: #b79a68;
  --text: #e8dcc6;
  --muted: #a89a84;
  --good: #8bdc8b;
  --bad: #ff7e72;
  --red: #b3261e;
  --red-2: #7e1712;
  --display: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background-color: var(--bg);
  background-image: url("/bg.jpg"), url("/bg.svg");
  background-size: cover, cover;
  background-position: center top, center top;
  background-attachment: fixed, fixed;
  color: var(--text);
  font: 17px/1.55 var(--display);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* darkens the edges and the bottom so the art never fights with the text */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0.6));
  pointer-events: none;
  z-index: 0;
}

#embers { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

a { color: var(--gold); }

/* ------------------------------------------------------------ header */

.top {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 10px 40px;
  background: linear-gradient(rgba(5, 3, 4, 0.92), rgba(5, 3, 4, 0.7));
  border-bottom: 1px solid #3a2b20;
}

.brand {
  justify-self: start;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: 1px;
  color: #f6e2b6;
  text-decoration: none;
  text-shadow: 0 0 18px rgba(179, 38, 30, 0.7), 0 2px 0 #000;
}

nav.main { display: flex; gap: 4px; }
nav.main a {
  position: relative;
  padding: 10px 24px;
  color: var(--gold-dim);
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 15px;
}
nav.main a:hover { color: var(--gold); }
nav.main a.on { color: var(--gold); }
nav.main a.on::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 2px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d9a45a, transparent);
}

.user { justify-self: end; display: flex; align-items: center; gap: 14px; }
.who { display: flex; align-items: center; gap: 8px; color: var(--gold); font-size: 16px; }
.who::before {
  content: "";
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f0d7a1'%3E%3Ccircle cx='12' cy='7' r='5'/%3E%3Cpath d='M2 22c0-6 4-9 10-9s10 3 10 9z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.logout {
  padding: 7px 16px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--gold);
  border: 1px solid #8a6b45;
  border-radius: 3px;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.logout:hover { background: rgba(120, 30, 24, 0.4); }

/* ------------------------------------------------------------ page */

main {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 44px 20px 48px;
}

.foot {
  position: relative;
  z-index: 3;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 12px;
  background: rgba(4, 2, 3, 0.85);
  border-top: 1px solid #2c2018;
  letter-spacing: 0.5px;
}
.foot::before, .foot::after { content: "\25C6"; color: #6a5238; margin: 0 14px; font-size: 9px; vertical-align: middle; }

h1 { font-size: 40px; line-height: 1.15; margin: 0 0 10px; color: #f6e2b6; font-weight: normal; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); }
h2 { font-size: 24px; margin: 0 0 12px; color: #f6e2b6; font-weight: normal; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.small { font-size: 14px; }

/* ------------------------------------------------------------ framed panels */

.card {
  position: relative;
  background: linear-gradient(rgba(20, 14, 15, 0.92), rgba(9, 6, 7, 0.94));
  border: 18px solid transparent;
  border-image: url("/frame.svg") 34 / 18px stretch;
  padding: 18px 26px 22px;
  margin: 0 auto 26px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.card.hero::before {
  content: "";
  position: absolute;
  top: -34px;
  left: 50%;
  width: 70px;
  height: 22px;
  transform: translateX(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 22'%3E%3Cpath d='M2 11H24M46 11H68' stroke='%23cfa56a' stroke-width='1.5'/%3E%3Cpath d='M35 1 L47 11 L35 21 L23 11Z' fill='%230d0707' stroke='%23cfa56a' stroke-width='2'/%3E%3Cpath d='M35 6 L41 11 L35 16 L29 11Z' fill='%23c0281e'/%3E%3C/svg%3E") center / contain no-repeat;
}

.narrow { max-width: 460px; margin-top: 30px; }
.wide { max-width: 760px; }

/* ------------------------------------------------------------ forms */

.tabs { display: flex; gap: 6px; margin: 4px 0 14px; }
.tabs button {
  flex: 1;
  padding: 9px;
  background: rgba(40, 28, 24, 0.7);
  color: var(--muted);
  border: 1px solid #4a3828;
  font: inherit;
  letter-spacing: 1px;
  cursor: pointer;
}
.tabs button.on { color: var(--gold); background: rgba(100, 30, 24, 0.55); border-color: #9a7a4e; }

label { display: block; margin: 12px 0 4px; color: var(--gold-dim); font-size: 14px; letter-spacing: 1px; text-transform: uppercase; }

input[type=text], input[type=password], input[type=number], input[type=search], textarea, input[type=file] {
  width: 100%;
  padding: 10px 12px;
  background: rgba(5, 3, 4, 0.85);
  color: var(--text);
  border: 1px solid #4d3a28;
  border-radius: 3px;
  font: inherit;
  font-size: 16px;
}
input:focus, textarea:focus { outline: 1px solid #b08a58; }
textarea { min-height: 84px; resize: vertical; }

.btn {
  display: inline-block;
  padding: 10px 22px;
  background: linear-gradient(#5a2019, #36120f);
  color: var(--gold);
  border: 1px solid #9a7a4e;
  border-radius: 3px;
  font: inherit;
  font-size: 16px;
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.15);
}
.btn:hover { filter: brightness(1.25); }
.btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.btn.danger { color: var(--bad); border-color: #7a3a33; background: linear-gradient(#3c1512, #240c0b); }
.btn.small { padding: 4px 11px; font-size: 14px; }

.btn.big {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 520px;
  margin: 8px auto 0;
  padding: 16px 26px;
  font-size: 22px;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(#a02a1f, #6d1812 55%, #561009);
  border: 3px double #d09a5c;
  border-radius: 6px;
  box-shadow: 0 0 22px rgba(179, 38, 30, 0.45), inset 0 1px 0 rgba(255, 190, 140, 0.3);
  color: #fbe6bd;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
}
.btn.big::before {
  content: "";
  width: 34px;
  height: 34px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fbe6bd'%3E%3Cpath d='M10 2h4v9h4l-6 7-6-7h4z'/%3E%3Cpath d='M3 20h18v2H3z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 140px; }

.msg { margin: 12px 0 0; min-height: 22px; }

/* ------------------------------------------------------------ the welcome steps */

ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 14px 0 18px; }
ol.steps li {
  position: relative;
  counter-increment: step;
  padding: 4px 0 4px 62px;
  min-height: 48px;
  margin-bottom: 8px;
}
ol.steps li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  width: 30px;
  height: 30px;
  transform: rotate(45deg);
  border: 2px solid #c9a26a;
  background: #120b0b;
}
ol.steps li::after {
  content: counter(step);
  position: absolute;
  left: 8px;
  top: 6px;
  width: 30px;
  line-height: 30px;
  text-align: center;
  color: #f6e2b6;
  font-size: 18px;
}

.notice {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 20px auto 0;
  padding: 14px 18px;
  background: rgba(10, 12, 16, 0.65);
  border: 1px solid #3b3a3a;
  border-radius: 3px;
  color: var(--muted);
  font-size: 14.5px;
}
.notice::before {
  content: "";
  flex: none;
  width: 34px;
  height: 34px;
  margin-top: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23c9c2b4'%3E%3Cpath d='M2 4.5 10.5 3.3v8H2zM11.7 3.1 22 1.6v9.8H11.7zM2 12.6h8.5v8.1L2 19.5zM11.7 12.6H22v9.8l-10.3-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.notice p { margin: 0; }

/* ------------------------------------------------------------ tables and bits */

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid #2b2019; vertical-align: top; }
th { color: var(--gold-dim); font-weight: normal; font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; }
td.num { text-align: right; }
.scroll { overflow-x: auto; }

.tag { display: inline-block; padding: 1px 10px; border-radius: 10px; font-size: 13px; border: 1px solid #5a4630; margin-right: 4px; }
.tag.on { color: var(--good); border-color: #3b6a3b; }
.tag.bad { color: var(--bad); border-color: #7a3a33; }
.tag.gold { color: var(--gold); border-color: #8a6b45; }
.tag.red { color: #ffd9b8; background: #6d1812; border-color: #b0543f; }

.stats { display: flex; gap: 14px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 140px; background: rgba(32, 22, 20, 0.8); border: 1px solid #4a3828; border-radius: 3px; padding: 12px 14px; }
.stat b { display: block; font-size: 26px; color: var(--gold); font-weight: normal; }

.progress { height: 14px; background: #060304; border: 1px solid #4d3a28; border-radius: 7px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, #7e1712, #d14a36); transition: width 0.15s; }

code, .code { font-family: Consolas, "Courier New", monospace; color: var(--gold); letter-spacing: 1px; }
pre.notes { white-space: pre-wrap; font: inherit; margin: 0; color: var(--text); }
.codes { background: rgba(5, 3, 4, 0.85); border: 1px dashed #8a6b45; border-radius: 3px; padding: 10px 12px; margin-top: 10px; font-family: Consolas, "Courier New", monospace; color: var(--gold); white-space: pre-line; }

.subnav { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 20px; }
.subnav a {
  padding: 7px 18px;
  background: rgba(14, 10, 11, 0.85);
  border: 1px solid #4a3828;
  color: var(--gold-dim);
  text-decoration: none;
  letter-spacing: 1px;
  font-size: 15px;
}
.subnav a.on { color: var(--gold); border-color: #9a7a4e; background: rgba(100, 30, 24, 0.5); }

.admin-title { text-shadow: 0 2px 0 #000, 0 0 14px rgba(0, 0, 0, 0.9); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.gallery figure { margin: 0; background: rgba(5, 3, 4, 0.7); border: 1px solid #4a3828; padding: 8px; }
.gallery img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.gallery figcaption { padding: 8px 4px 2px; color: var(--muted); font-size: 14px; }
.lightbox { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, 0.88); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 92vh; border: 2px solid #8a6b45; }

@media (max-width: 760px) {
  .top { grid-template-columns: 1fr; justify-items: center; padding: 10px 14px; }
  .brand, .user { justify-self: center; }
  nav.main a { padding: 8px 12px; }
  .card { padding: 14px 14px 18px; }
  h1 { font-size: 32px; }
  .btn.big { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) { #embers { display: none; } }

input[type=file]::file-selector-button {
  margin-right: 12px;
  padding: 5px 14px;
  background: linear-gradient(#5a2019, #36120f);
  color: var(--gold);
  border: 1px solid #9a7a4e;
  border-radius: 3px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
