:root {
  --bg: #0c0805;
  --panel: rgba(14, 10, 7, 0.88);
  --gold: #e4c078;
  --gold-bright: #ffe9b4;
  --gold-dim: #9a7440;
  --blood: #9a1c1c;
  --ice: #6ec4ff;
  --text: #f3e6c8;
  --muted: #b89a70;
  --frame: #4a3418;
  --ink: #120c08;
  --parchment: #c4aa7a;
  --ui-font: "Cormorant Garamond", Palatino Linotype, Palatino, Georgia, serif;
  --ui-display: "Cinzel Decorative", "Cinzel", Palatino, serif;
  --ui-label: "Cinzel", Palatino, serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--ui-font);
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
html.login-open,
html.login-open body,
html.login-open #app,
html.login-open #screen-login {
  overflow: visible;
}
html.looking, html.looking * { cursor: none !important; }
#app, .screen { position: absolute; inset: 0; }
.hidden { display: none !important; }
.screen { display: flex; }

#screen-login, #screen-post {
  align-items: center; justify-content: center;
  z-index: 30;
  background:
    radial-gradient(ellipse at 50% 12%, rgba(120, 70, 24, 0.32), transparent 46%),
    radial-gradient(ellipse at 50% 100%, rgba(40, 16, 8, 0.55), transparent 50%),
    linear-gradient(180deg, rgba(10,6,4,0.22), rgba(6,4,3,0.78)),
    url("../textures/sky.jpg") center/cover no-repeat,
    #100804;
}
.login-card {
  width: min(540px, 92vw);
  padding: 8px 18px 22px;
  background-color: #3a2818;
  border: 72px solid transparent;
  border-image-source: url("../textures/ui/login_panel.jpg");
  border-image-slice: 168 fill;
  border-image-repeat: stretch;
  box-shadow: 0 28px 56px rgba(0,0,0,0.72);
}
.crest {
  width: 96px; height: 96px; margin: 2px auto 6px;
  border-radius: 50%;
  background: url("../textures/ui/crest.jpg") center/128% no-repeat;
  box-shadow:
    0 0 0 2px #1a1208,
    0 0 0 4px #d4b46a,
    0 0 0 6px #3a2810,
    0 0 28px rgba(180, 36, 18, 0.45),
    0 10px 22px rgba(0,0,0,0.5);
}
h1 {
  text-align: center; letter-spacing: 0.14em; font-weight: 700;
  margin: 6px 0 2px; text-transform: uppercase; font-size: 26px;
  font-family: var(--ui-display);
  color: var(--gold-bright);
  text-shadow: 0 2px 0 #3a2a10, 0 0 22px rgba(224, 180, 80, 0.4);
}
.login-card h1::after {
  content: "";
  display: block;
  width: 92px; height: 1px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, transparent, #e0c070, transparent);
}
.captcha-row {
  display: flex;
  justify-content: center;
  margin: 10px 0 4px;
  min-height: 78px;
  position: relative;
  z-index: 40;
  overflow: visible;
}
.captcha-row.hidden { display: none !important; }
#login-recaptcha { min-height: 78px; }
iframe[src*="recaptcha"] { z-index: 2147483647; }
.tagline, .hint { text-align: center; color: var(--muted); }
.tagline { font-size: 16px; font-style: italic; font-weight: 500; margin: 8px 0 4px; }
.hint { font-size: 13px; line-height: 1.45; margin-top: 14px; opacity: 0.9; }
label {
  display: block; margin: 12px 0 6px; color: var(--gold);
  font-family: var(--ui-label);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
}
input, select {
  width: 100%; padding: 10px 12px;
  background: linear-gradient(#16100a, #100c08);
  color: var(--text);
  border: 1px solid #5a4024;
  border-radius: 3px;
  box-shadow: inset 0 2px 7px rgba(0,0,0,0.5);
  font: inherit;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: inset 0 2px 7px rgba(0,0,0,0.5), 0 0 0 1px rgba(224,180,80,0.28);
}
button {
  cursor: pointer; font: inherit;
  background: linear-gradient(#4a341c, #24180e);
  color: var(--text);
  border: 1px solid #7a5a30;
  border-radius: 3px;
  padding: 8px 14px;
  box-shadow: inset 0 1px 0 rgba(255,220,150,0.16), 0 2px 0 #140e08;
  transition: filter 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}
button.gold {
  background: linear-gradient(180deg, #d4b060 0%, #a07830 42%, #6a4a16 56%, #3e2a0c 100%);
  color: #fff6d8; border-color: #f0d48a; width: 100%;
  margin-top: 16px; letter-spacing: 0.12em; text-transform: uppercase;
  font-family: var(--ui-label);
  font-size: 13px;
  text-shadow: 0 1px 0 #3a2a10;
  box-shadow:
    0 2px 0 #1a1208,
    inset 0 1px 0 rgba(255,240,200,0.5),
    inset 0 -3px 6px rgba(0,0,0,0.35),
    0 0 18px rgba(224,180,80,0.18);
}
button.gold.large { padding: 13px 16px; font-size: 15px; }
button.ghost {
  background: transparent; width: 100%; margin-top: 8px;
  color: var(--muted); border-color: transparent; box-shadow: none;
}
#btn-new-account {
  margin-top: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--ui-label);
  font-size: 12px;
}
button:hover { filter: brightness(1.1); }
button.gold:hover {
  filter: none;
  color: #fffdf0;
  box-shadow:
    0 2px 0 #1a1208,
    inset 0 1px 0 rgba(255,240,200,0.65),
    0 0 26px rgba(255,210,100,0.42);
}
button.ghost:hover { color: var(--gold-bright); filter: none; }
.class-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.class-pick {
  min-width: 0; text-align: center; padding: 12px 6px 10px;
  border: 1px solid rgba(180,140,70,0.35);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(42,28,14,0.72), rgba(12,8,6,0.72));
  cursor: pointer; font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255,230,180,0.1), 0 4px 12px rgba(0,0,0,0.28);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.class-pick::before {
  content: "";
  display: block;
  width: 9px; height: 9px;
  margin: 0 auto 7px;
  border-radius: 50%;
  background: var(--gem, #c4a050);
  box-shadow: 0 0 8px var(--gem, #c4a050), inset 0 1px 0 rgba(255,255,255,0.5);
}
.class-pick.cls-blade { --gem: #d05048; }
.class-pick.cls-arcanist { --gem: #5a88e0; }
.class-pick.cls-aegis { --gem: #e0c060; }
.class-pick.cls-warrior { --gem: #e07030; }
.class-pick.sel {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(212,180,106,0.32), rgba(40,28,10,0.55));
  box-shadow: 0 0 18px rgba(224,180,80,0.38), inset 0 1px 0 rgba(255,230,180,0.28);
}
.class-pick .role { display: block; color: var(--muted); font-size: 12px; font-weight: 500; margin-top: 2px; }

.topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 54px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 220px 0 22px;
  border-bottom: 1px solid #e0c070;
  background:
    linear-gradient(180deg, rgba(255,220,150,0.08), transparent 40%),
    linear-gradient(180deg, rgba(42,28,14,0.96), rgba(12,8,5,0.94));
  box-shadow: 0 10px 26px rgba(0,0,0,0.48), inset 0 -1px 0 rgba(255,220,150,0.22);
  z-index: 4;
}
.brand {
  color: var(--gold); letter-spacing: 0.2em; text-transform: uppercase;
  font-size: 13px; font-family: var(--ui-display);
  text-shadow: 0 0 14px rgba(224,180,80,0.4);
}
.who-wrap {
  position: relative;
  z-index: 6;
  max-width: min(240px, 36vw);
  flex-shrink: 1;
  pointer-events: auto;
}
#hub-who.who {
  display: block;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 6px 12px;
  color: var(--gold-bright);
  font-size: 15px;
  font-family: var(--ui-font);
  letter-spacing: 0.02em;
  text-transform: none;
  text-shadow: 0 1px 2px #000;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#hub-who.who::after {
  content: "▾";
  display: inline-block;
  margin-left: 7px;
  font-size: 11px;
  opacity: 0.72;
}
#hub-who.who:hover,
#hub-who.who[aria-expanded="true"] {
  color: #fff6d8;
  filter: none;
  border-color: rgba(196, 160, 80, 0.55);
  background: linear-gradient(180deg, rgba(42, 28, 14, 0.55), rgba(12, 8, 5, 0.45));
}
