:root {
  --gold: #e8c26a; --gold-d: #9a7430; --ink: #f4ead2; --panel: rgba(18, 14, 10, 0.86);
  --font-head: 'Cinzel', Georgia, serif; --font-body: 'Alegreya Sans', 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1a1612; color: var(--ink); font-family: var(--font-body); }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
/* full-screen layers must let clicks through to the game view (the id rule above would otherwise win) */
#ui > .hud, #ui > .login { pointer-events: none; }
#loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(ellipse at center, #3a2e1e 0%, #120e0a 75%); z-index: 50; transition: opacity .6s; }
#loading.done { opacity: 0; pointer-events: none; }
#loading .title { font-family: var(--font-head); font-weight: 800; font-size: 64px; letter-spacing: 6px; color: var(--gold);
  text-shadow: 0 2px 0 #5a3e14, 0 0 30px rgba(232, 194, 106, .35); }
#loading .bar { width: 340px; height: 10px; border: 1px solid var(--gold-d); border-radius: 6px; overflow: hidden; background: #0c0906; }
#loading .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #9a7430, #f3d48a); transition: width .2s; }
#loading .msg { font-size: 15px; opacity: .8; letter-spacing: 1px; }

#loading { background-size: cover !important; background-position: center !important; justify-content: flex-end !important; padding-bottom: 7vh; }
#loading .title { position: absolute; top: 9vh; left: 0; right: 0; text-align: center; text-shadow: 0 2px 4px #000, 0 0 24px rgba(0,0,0,.8); }
#loading .bar { width: min(560px, 70vw); height: 12px; box-shadow: 0 0 10px rgba(0,0,0,.8); }
#loading .msg { text-shadow: 0 1px 3px #000; }
#loading .tip { max-width: min(720px, 86vw); text-align: center; font-size: 14.5px; color: #f0e2c0; text-shadow: 0 1px 3px #000; opacity: .92; margin-top: 4px; }
#loading .tip::before { content: 'Tip: '; color: #f3d48a; font-weight: 700; }

/* Loading instruments share the HUD material palette. Existing art stays in place. */
#loading::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, #08121b99, transparent 35% 58%, #08121bf2);
  box-shadow: inset 0 0 0 6px #101920, inset 0 0 0 7px #91784970;
}
#loading .title {
  color: var(--brass-light, #f6df9f);
  text-shadow: 0 1px 0 #fff8, 0 3px 0 #685637, 0 6px 18px #000;
}
#loading .title::after {
  content: ''; display: block; width: min(420px, 65vw); height: 2px; margin: 12px auto 0;
  background: linear-gradient(90deg, transparent, #917849 15%, #5fe0d0 50%, #917849 85%, transparent);
}
#loading .bar {
  position: relative; border-radius: 1px; border-color: #917849;
  background: linear-gradient(#050b10, #15232b);
  box-shadow: inset 0 2px 4px #000, 0 0 0 3px #101920, 0 0 0 4px #59665d, 0 5px 15px #000a;
}
#loading .bar i { background: linear-gradient(#b5f4e5, #5abeb5 45%, #2b7279); box-shadow: inset 0 1px 0 #fff8; }
#loading .bar::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), #07101899 calc(10% - 1px) 10%) top / 100% 4px no-repeat;
  box-shadow: inset 0 1px 2px #0009;
}
#loading .msg, #loading .tip { position: relative; color: #d0dedf; opacity: 1; }
#loading .msg { color: #f6df9f; }
@media (prefers-reduced-motion: reduce) {
  #loading, #loading .bar i { transition: none; }
}
