:root {
  --world-brightness: 1;
  --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.login-open .status-wrap { display: none !important; }
html.login-open .who-wrap { display: none !important; }
html.looking, html.looking * { cursor: none !important; }
html.ground-aim, html.ground-aim * { cursor: default !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;
  isolation: isolate;
  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/ui/login_courtyard.jpg") center/cover no-repeat,
    #100804;
}
#screen-login::before,
#screen-post::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 48% 40% at 74% 12%, rgba(196, 220, 255, 0.36), transparent 64%),
    radial-gradient(ellipse 32% 46% at 16% 60%, rgba(255, 148, 52, 0.24), transparent 70%),
    radial-gradient(ellipse 38% 28% at 52% 76%, rgba(232, 196, 90, 0.14), transparent 72%);
  mix-blend-mode: soft-light;
  animation: courtyard-light 8s ease-in-out infinite alternate;
}
#screen-login::after,
#screen-post::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 18% 30%, rgba(255, 214, 140, 0.7), transparent),
    radial-gradient(1px 1px at 42% 58%, rgba(255, 236, 200, 0.55), transparent),
    radial-gradient(1.6px 1.6px at 71% 44%, rgba(180, 210, 255, 0.5), transparent),
    radial-gradient(1px 1px at 8% 72%, rgba(255, 160, 70, 0.45), transparent),
    radial-gradient(1.2px 1.2px at 88% 68%, rgba(255, 220, 160, 0.4), transparent),
    radial-gradient(1px 1px at 55% 18%, rgba(210, 230, 255, 0.45), transparent),
    radial-gradient(1.4px 1.4px at 33% 82%, rgba(255, 190, 90, 0.35), transparent);
  mix-blend-mode: screen;
  opacity: 0.5;
  animation: courtyard-motes 18s linear infinite;
}
@keyframes courtyard-light {
  from { opacity: 0.58; }
  to { opacity: 1; }
}
@keyframes courtyard-motes {
  from {
    background-position: 0 10px, 8px 18px, -6px 4px, 4px 14px, 0 8px, 10px 6px, -8px 20px;
  }
  to {
    background-position: 10px -36px, -8px -26px, 12px -32px, -4px -20px, 8px -40px, -10px -16px, 6px -28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #screen-login::before, #screen-post::before,
  #screen-login::after, #screen-post::after {
    animation: none;
  }
}
.login-card {
  position: relative;
  z-index: 1;
  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; }
#login-sub:empty { display: none; }
.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;
}
.login-card button.ghost,
#btn-new-account {
  margin-top: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--ui-label);
  font-size: 12px;
}
.login-card input {
  font-family: var(--ui-font);
}
.login-card .err {
  font-family: var(--ui-font);
  font-size: 15px;
  font-weight: 500;
}
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 1fr; gap: 8px; }
.class-pick {
  min-width: 0; text-align: center; padding: 10px 6px 8px;
  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: 14px;
  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: 44px; height: 44px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background-color: var(--gem, #c4a050);
  background-size: cover;
  background-position: center 14%;
  background-repeat: no-repeat;
  box-shadow:
    0 0 0 2px #1a1208,
    0 0 0 3px #c4a050,
    0 0 10px var(--gem, #c4a050);
}
.class-pick.cls-blade { --gem: #d05048; }
.class-pick.cls-blade::before { background-image: url("../textures/ui/port_blade.jpg"); }
.class-pick.cls-arcanist { --gem: #5a88e0; }
.class-pick.cls-arcanist::before { background-image: url("../textures/ui/port_arcanist.jpg"); }
.class-pick.cls-aegis { --gem: #e0c060; }
.class-pick.cls-aegis::before { background-image: url("../textures/ui/port_aegis.jpg"); }
.class-pick.cls-warrior { --gem: #e07030; }
.class-pick.cls-warrior::before { background-image: url("../textures/ui/port_warrior.jpg"); }
.class-pick.cls-justicar { --gem: #e8c060; }
.class-pick.cls-justicar::before { background-image: url("../textures/ui/port_justicar.jpg"); }
.class-pick.cls-graveborn { --gem: #5a88aa; }
.class-pick.cls-graveborn::before { background-image: url("../textures/ui/port_graveborn.jpg"); }
.class-pick.cls-binder { --gem: #9a58e0; }
.class-pick.cls-binder::before { background-image: url("../textures/ui/port_binder.jpg"); }
.class-pick.cls-grove { --gem: #3dcc6a; }
.class-pick.cls-grove::before { background-image: url("../textures/ui/port_grove.jpg"); }
.class-pick.cls-random { --gem: #d8c898; }
.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;
  line-height: 1.25;
  min-height: 2.5em;
}

html[lang="ko"] {
  --ui-font: "Noto Serif KR", "Cormorant Garamond", Palatino, Georgia, serif;
  --ui-display: "Noto Serif KR", "Cinzel Decorative", "Cinzel", Palatino, serif;
  --ui-label: "Noto Serif KR", "Cinzel", Palatino, serif;
}
html[lang="ko"] .chrome-btn,
html[lang="ko"] button,
html[lang="ko"] .hub-dock-btn,
html[lang="ko"] .class-pick {
  text-transform: none;
  letter-spacing: 0.02em;
}
.topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 54px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px 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;
}
.chrome-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 32px;
  margin: 0;
  padding: 0 12px;
  color: var(--gold-bright);
  font-family: var(--ui-label);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px #000;
  background: linear-gradient(180deg, rgba(42, 28, 14, 0.96), rgba(12, 8, 5, 0.94));
  border: 1px solid #c4a050;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.16), 0 2px 0 #140e08;
}
.chrome-btn:hover,
.chrome-btn[aria-expanded="true"] {
  color: #fff6d8;
  filter: none;
  border-color: var(--gold-bright);
}
#hub-who.who {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#hub-who.who::after {
  content: "▾";
  display: inline-block;
  margin-left: 7px;
  font-size: 10px;
  letter-spacing: 0;
  opacity: 0.72;
}
