/* account.castle-lanes.com: the website's war-ledger look (castle-lanes.com),
   the game's own HUD frame round the panel, no scripts. */
@font-face { font-family: "Cinzel"; src: url("/static/fonts/Cinzel.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/static/fonts/AlegreyaSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/static/fonts/AlegreyaSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --ground: #120d09; --ground-2: #1a130d; --ground-3: #231a12; --well: rgba(10, 7, 5, 0.72);
  --ink: #f1e7d6; --ink-2: #cdbca2; --ink-3: #a8967c;
  --rule: rgba(214, 168, 100, 0.2); --rule-strong: rgba(214, 168, 100, 0.42);
  --bronze: #b0884f; --gold: #eab85c; --gold-hi: #f6d48c; --ember: #e0702a; --cherry: #a33a1a; --ok: #8fbf6a;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --text: "Alegreya Sans", "Gill Sans", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --panel-w: 30rem;
  --frame: 18px;
  --pad: clamp(1.25rem, 4vw, 2rem);
  color-scheme: dark;
}
/* The signed-in pages: a side menu beside the page, so a wider panel. */
body:has(.app) { --panel-w: 54rem; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #5a442b var(--ground); background: var(--ground); }
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  color: var(--ink); font: 400 1.0625rem/1.55 var(--text); font-variant-numeric: lining-nums;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(1.25rem, 5vw, 3.5rem) 1rem 2.5rem;
}
/* The battlefield from the website's hero, sunk deep behind the panel. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(18, 13, 9, 0.6), rgba(18, 13, 9, 0.9) 75%),
    linear-gradient(180deg, rgba(18, 13, 9, 0.2), var(--ground) 95%),
    url("/static/backdrop-1280.webp") center 35% / cover no-repeat;
}
@media (max-width: 40rem) {
  body::before {
    background:
      radial-gradient(ellipse 90% 55% at 50% 30%, rgba(18, 13, 9, 0.74), rgba(18, 13, 9, 0.95) 75%),
      linear-gradient(180deg, rgba(18, 13, 9, 0.35), var(--ground) 92%),
      url("/static/backdrop-760.webp") center top / cover no-repeat;
  }
}

::selection { background: var(--ember); color: #160e08; }
a { color: var(--gold); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { color: var(--gold-hi); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 4px; }

/* Header: the website's brand, plus where you are. */
.top { width: min(100%, var(--panel-w)); display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--gold); font: 700 1.125rem/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
}
.brand:hover { color: var(--gold-hi); }
.brand img { width: 2.75rem; height: auto; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55)); }
.realm { color: var(--ink-3); font: 700 0.8125rem/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase; }

/* The panel, in the game's HUD frame. */
.panel {
  width: min(100%, var(--panel-w)); position: relative;
  padding: var(--pad);
  background: linear-gradient(180deg, #1e160f 0%, #160f0a 100%) padding-box;
  border: var(--frame) solid #3a2a16;
  border-image: url("/static/hud-frame.webp") 46 round;
  box-shadow: 0 36px 80px -28px rgba(0, 0, 0, 0.95), 0 12px 30px -12px rgba(0, 0, 0, 0.8);
}

h1, h2 { font-family: var(--display); font-weight: 700; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.625rem, 5vw, 2rem); line-height: 1.15; letter-spacing: 0.02em; color: var(--gold-hi); margin-bottom: 1rem; }
h1::after {
  /* the website's bronze rule with a gold stud */
  content: ""; display: block; width: 6.5rem; height: 9px; margin-top: 0.85rem;
  background:
    radial-gradient(circle at 50% 50%, var(--gold) 0 3px, transparent 3.5px) 0 0 / 9px 9px no-repeat,
    linear-gradient(90deg, var(--bronze), rgba(176, 136, 79, 0)) 14px 4px / calc(100% - 14px) 1px no-repeat;
}
h2 { font-size: 1.1875rem; line-height: 1.3; letter-spacing: 0.03em; color: var(--gold); margin-bottom: 0.6rem; }
p { margin: 0 0 0.9rem; color: var(--ink-2); text-wrap: pretty; }
.lede { font-size: 1.125rem; margin-bottom: 0.4rem; }

/* Forms */
label { display: block; margin: 1.1rem 0 0.4rem; font-weight: 700; color: var(--ink); }
.hint { font-weight: 400; color: var(--ink-3); }
.hint::before { content: "· "; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.1rem 0 0.4rem; }
.field-head label { margin: 0; }
.field-head a { font-size: 0.9375rem; }
input[type=email], input[type=password], input[type=text] {
  display: block; width: 100%; min-height: 3rem; padding: 0.7rem 0.9rem;
  font: inherit; color: var(--ink); caret-color: var(--gold-hi);
  background: var(--well); border: 1px solid var(--rule-strong); border-radius: 8px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: border-color 180ms var(--ease-out), background-color 180ms var(--ease-out);
}
input:hover { border-color: rgba(214, 168, 100, 0.62); }
input:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; border-color: var(--gold); background: rgba(10, 7, 5, 0.9); }
input:user-invalid { border-color: var(--ember); }
.code-input { font-family: var(--mono); letter-spacing: 0.08em; }
/* A checkbox beside its words (the launch news form). */
label.check { display: flex; align-items: flex-start; gap: 0.6rem; font-weight: 400; color: var(--ink-2); cursor: pointer; }
label.check input { flex: none; width: 1.15rem; height: 1.15rem; margin: 0.2rem 0 0; accent-color: var(--gold); }
/* What the launch news list sends: the website's gold studs. */
ul.news-list { list-style: none; padding: 0; margin: 0.4rem 0 1rem; }
ul.news-list li { position: relative; padding: 0.3rem 0 0.3rem 1.3rem; color: var(--ink); }
ul.news-list li::before { content: ""; position: absolute; left: 0.2rem; top: 0.82rem; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

button, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 3rem; margin-top: 1.4rem; padding: 0.8rem 1.4rem;
  font: 700 1.0625rem/1.1 var(--text); letter-spacing: 0.01em; cursor: pointer;
  color: #1d1208; border: 0; border-radius: 8px;
  background: linear-gradient(180deg, #f3cd7f 0%, var(--gold) 55%, #cf9a43 100%);
  box-shadow: inset 0 1px 0 rgba(255, 244, 214, 0.65), inset 0 -2px 0 rgba(120, 70, 20, 0.45), 0 10px 24px -10px rgba(0, 0, 0, 0.7);
  transition: background-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out), transform 180ms var(--ease-out), color 180ms;
}
a.button { text-decoration: none; }
button:hover, a.button:hover {
  color: #1d1208;
  background: linear-gradient(180deg, #f8daa0 0%, #f0c46e 55%, #d9a54c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 244, 214, 0.75), inset 0 -2px 0 rgba(120, 70, 20, 0.45), 0 14px 30px -10px rgba(0, 0, 0, 0.8);
  transform: translateY(-1px);
}
button:active, a.button:active { transform: translateY(0); }
button.quiet, a.button.quiet { color: var(--ink); background: rgba(234, 184, 92, 0.08); box-shadow: inset 0 0 0 1px var(--rule-strong); }
button.quiet:hover, a.button.quiet:hover { color: var(--ink); background: rgba(234, 184, 92, 0.16); box-shadow: inset 0 0 0 1px rgba(214, 168, 100, 0.62); }
button.danger {
  color: #fbe9df;
  background: linear-gradient(180deg, #c4532b 0%, var(--cherry) 60%, #7e2a10 100%);
  box-shadow: inset 0 1px 0 rgba(255, 210, 190, 0.35), inset 0 -2px 0 rgba(60, 15, 5, 0.5), 0 10px 24px -10px rgba(0, 0, 0, 0.7);
}
button.danger:hover { background: linear-gradient(180deg, #d0623a 0%, #b5431f 60%, #8a3013 100%); }
/* On the form pages every action spans the panel. */
body:not(:has(.app)) .panel form > button { width: 100%; }
form + form button, button + button { margin-top: 0.75rem; }

.g-chip { display: inline-grid; place-items: center; flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.g-chip svg { width: 1rem; height: 1rem; }

.or {
  display: flex; align-items: center; gap: 0.9rem; margin: 1.5rem 0 0;
  color: var(--ink-3); font: 700 0.8125rem/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase;
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.or + form button { margin-top: 1.1rem; }

.links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 1.25rem 0 0; font-size: 0.9375rem; }
.small { font-size: 0.9375rem; line-height: 1.5; color: var(--ink-3); margin-top: 1.25rem; }
.small a { color: var(--ink-2); }
.small a:hover { color: var(--gold-hi); }
.panel-foot {
  margin: 1.75rem calc(-1 * var(--pad)) calc(-1 * var(--pad)); padding: 1.1rem var(--pad);
  text-align: center; color: var(--ink-2);
  background: rgba(10, 7, 5, 0.45); border-top: 1px solid var(--rule);
}

.notice { padding: 0.75rem 1rem; margin: 0 0 1.25rem; border-radius: 8px; border: 1px solid; line-height: 1.45; }
.notice.error { color: #f7cdb9; background: rgba(163, 58, 26, 0.2); border-color: rgba(224, 112, 42, 0.55); }
.notice.ok { color: #d8ecc8; background: rgba(143, 191, 106, 0.12); border-color: rgba(143, 191, 106, 0.45); }

/* The account page */
h1 { overflow-wrap: anywhere; }
h1 .tag { font: 400 0.7em/1 var(--text); color: var(--ink-3); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; vertical-align: 0.08em;
  font: 700 0.8125rem/1.4 var(--text); letter-spacing: 0.02em; color: var(--gold-hi);
  background: rgba(234, 184, 92, 0.12); box-shadow: inset 0 0 0 1px rgba(234, 184, 92, 0.4);
}
.ledger { margin: 0.25rem 0 0; }
.ledger div { display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr); gap: 0.25rem 1.5rem; padding: 0.7rem 0; border-top: 1px solid var(--rule); align-items: baseline; }
.ledger dt { font: 700 0.9375rem/1.4 var(--display); letter-spacing: 0.03em; color: var(--ink-3); }
.ledger dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.app section { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--rule-strong); }
.invite {
  padding: 1.1rem 1.25rem 0.35rem; border-radius: 10px;
  background: var(--well); border: 1px dashed var(--rule-strong);
}
.code { margin: 0 0 0.6rem; font: 700 clamp(1.375rem, 4.5vw, 1.75rem)/1.2 var(--mono); letter-spacing: 0.12em; color: var(--gold-hi); user-select: all; overflow-wrap: anywhere; }
.invite .small { margin-top: 0; }
.link { user-select: all; overflow-wrap: anywhere; color: var(--ink-2); font-family: var(--mono); font-size: 0.875rem; }
form.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 0.75rem; align-items: end; }
form.row label { grid-column: 1 / -1; margin-top: 0; }
.app form.row button { margin-top: 0; min-height: 3rem; }
ul.devices { list-style: none; padding: 0; margin: 0; }
ul.devices li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 1rem; align-items: center; padding: 0.85rem 0; border-top: 1px solid var(--rule); }
ul.devices li:first-child { border-top: 0; padding-top: 0.25rem; }
.device { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
ul.devices small { grid-column: 1; color: var(--ink-3); font-size: 0.875rem; }
form.inline { grid-column: 2; grid-row: 1 / span 2; }
form.inline button, .app section > form > button, .app section > form.stack > button { min-height: 2.5rem; padding: 0.5rem 1rem; font-size: 0.9875rem; }
form.inline button { margin: 0; }
ul.devices + form button { margin-top: 1rem; }
/* The side menu */
.panel.app { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0 clamp(1.5rem, 4vw, 2.5rem); }
.side { display: flex; flex-direction: column; gap: 0.15rem; padding-right: clamp(1rem, 3vw, 1.75rem); border-right: 1px solid var(--rule); align-self: start; }
.side a {
  position: relative; display: block; padding: 0.7rem 0.4rem 0.7rem 1.35rem;
  color: var(--ink-3); font: 700 0.9375rem/1.2 var(--display); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  border-radius: 6px; transition: color 180ms var(--ease-out), background-color 180ms var(--ease-out);
}
.side a::before {
  content: ""; position: absolute; left: 0.35rem; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 1px var(--rule-strong);
}
.side a:hover { color: var(--ink); background: rgba(234, 184, 92, 0.06); }
.side a[aria-current="page"] { color: var(--gold-hi); background: rgba(234, 184, 92, 0.09); }
.side a[aria-current="page"]::before { background: var(--gold); box-shadow: 0 0 0 2px rgba(234, 184, 92, 0.25); }
.content { min-width: 0; }

/* Profile: play, invite */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }
.actions .button { margin-top: 0.2rem; }
.actions.choice { margin-top: 1.4rem; }
.actions.choice button { margin: 0; }
.invite .link { margin: 0 0 0.9rem; font-size: 0.875rem; }
.invite button.copy { margin: 0 0 0.9rem; min-height: 2.5rem; padding: 0.5rem 1rem; font-size: 0.9875rem; }

/* Download */
.primary-dl { margin: 1.4rem 0 0; padding: 1.25rem 1.4rem 0.4rem; border-radius: 10px; background: var(--well); border: 1px solid var(--rule-strong); }
.primary-dl .for { margin: 0; font: 700 0.875rem/1.2 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.primary-dl .button { margin-top: 0.9rem; }
.primary-dl .small { margin-top: 0.8rem; overflow-wrap: anywhere; }
ul.platforms { list-style: none; padding: 0; margin: 0; }
ul.platforms li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 1rem; align-items: center; padding: 0.85rem 0; border-top: 1px solid var(--rule); }
ul.platforms li:first-child { border-top: 0; padding-top: 0.25rem; }
ul.platforms small { grid-column: 1; color: var(--ink-3); font-size: 0.875rem; }
ul.platforms .button { grid-column: 2; grid-row: 1 / span 2; margin: 0; min-height: 2.5rem; padding: 0.5rem 1rem; font-size: 0.9875rem; }
form.stack + .small { margin-top: 0.9rem; }

.leave { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; }
.leave h2 { flex-basis: 100%; }
.leave button { margin-top: 0; }
.delete-link { color: #ef9f7c; font-size: 0.9875rem; }
.delete-link:hover { color: #f7c0a6; }

footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 1.25rem; margin-top: 1.75rem; font-size: 0.875rem; }
footer a { color: var(--ink-3); }
footer a:hover { color: var(--gold-hi); }

@media (max-width: 44rem) {
  .panel.app { grid-template-columns: minmax(0, 1fr); }
  .side { flex-direction: row; gap: 0.25rem; padding: 0 0 0.9rem; margin-bottom: 1.25rem; border-right: 0; border-bottom: 1px solid var(--rule); }
  .side a { flex: 1 1 0; min-width: 0; text-align: center; padding: 0.65rem 0.25rem; font-size: 0.75rem; letter-spacing: 0.05em; }
  .side a::before { display: none; }
  .side a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--gold); }
}
@media (max-width: 30rem) {
  :root { --frame: 12px; --pad: 1.15rem; }
  body { padding: 1rem 1rem 2rem; }
  .brand { font-size: 1rem; }
  .brand img { width: 2.25rem; }
  .ledger div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  ul.devices li { grid-template-columns: minmax(0, 1fr); }
  form.inline { grid-column: 1; grid-row: auto; margin-top: 0.5rem; }
  ul.platforms li { grid-template-columns: minmax(0, 1fr); }
  ul.platforms .button { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 0.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  button:hover { transform: none; }
}
