/* Retro Arcade look for Empires & Allies Revival */
@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Chakra+Petch:wght@400;500;600;700&display=swap");
:root {
  --bg: #07051a; --bg2: #0e0a2b; --panel: #130f35; --panel2: #1b1646; --line: #2d2670;
  --text: #f1efff; --muted: #a9a3e0; --pink: #ff2bd6; --cyan: #22e4ff; --gold: #ffd23f;
  --ok: #3ef0a0; --bad: #ff5c7a; --r: 16px;
  --px: "Press Start 2P", ui-monospace, monospace;
  --ui: "Chakra Petch", system-ui, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--ui); }
body.ra-page {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255, 43, 214, .18), transparent 60%),
    radial-gradient(900px 500px at 90% 110%, rgba(34, 228, 255, .12), transparent 60%),
    var(--bg);
  display: flex; flex-direction: column; align-items: center; min-height: 100vh; padding: 28px 16px;
}
a { color: var(--cyan); }
.ra-title { font-family: var(--px); line-height: 1.35; text-align: center; margin: 6px 0 4px; letter-spacing: 1px; }
.ra-title .e { color: var(--cyan); text-shadow: 0 0 14px rgba(34, 228, 255, .55); }
.ra-title .a { color: var(--gold); text-shadow: 0 0 14px rgba(255, 210, 63, .5); }
.ra-title .amp { color: var(--pink); text-shadow: 0 0 14px rgba(255, 43, 214, .6); }
.ra-tag { font-family: var(--px); font-size: 10px; color: var(--pink); letter-spacing: 2px; text-align: center; }
.ra-card {
  width: min(560px, 100%); background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 2px solid var(--line); border-radius: var(--r); padding: 22px; margin-top: 18px;
  box-shadow: 0 0 0 1px rgba(34, 228, 255, .08), 0 18px 50px rgba(0, 0, 0, .5);
}
.ra-card h2 { font-family: var(--px); font-size: 12px; color: var(--gold); margin: 0 0 16px; letter-spacing: 1px; }
.ra-muted { color: var(--muted); font-size: 15px; line-height: 1.5; }
.ra-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
  font-family: var(--px); font-size: 13px; letter-spacing: 1px; text-decoration: none;
  color: #2a1700; background: linear-gradient(180deg, #ffe27a, var(--gold)); border: 0; border-radius: 12px;
  padding: 16px 26px; box-shadow: 0 4px 0 #7a4b00, 0 0 22px rgba(255, 210, 63, .35);
  transition: transform .08s ease, box-shadow .08s ease;
}
.ra-btn:hover { transform: translateY(-1px); }
.ra-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #7a4b00, 0 0 22px rgba(255, 210, 63, .35); }
.ra-btn.ghost {
  color: var(--text); background: var(--bg2); border: 2px solid var(--line); box-shadow: none;
  font-family: var(--ui); font-weight: 600; font-size: 15px; letter-spacing: 0; padding: 11px 18px;
}
.ra-btn.ghost:hover { border-color: var(--cyan); }
.ra-btn.small { font-size: 10px; padding: 10px 14px; }
.ra-hero { width: min(560px, 100%); border-radius: var(--r); overflow: hidden; border: 2px solid var(--line); margin-top: 18px; }
.ra-hero img { display: block; width: 100%; height: auto; }
.ra-empire {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px;
  background: var(--bg2); border: 2px solid var(--line); color: var(--text); text-decoration: none; cursor: pointer;
}
.ra-empire:hover { border-color: var(--cyan); box-shadow: 0 0 16px rgba(34, 228, 255, .2); }
.ra-empire img { width: 48px; height: 48px; border-radius: 10px; background: #fff; object-fit: cover; }
.ra-empire .name { font-weight: 700; font-size: 17px; }
.ra-empire .lvl { margin-left: auto; font-family: var(--px); font-size: 10px; color: var(--gold); white-space: nowrap; }
.ra-avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.ra-avatars a { display: block; border-radius: 12px; border: 2px solid var(--line); background: #fff; overflow: hidden; }
.ra-avatars a:hover { border-color: var(--gold); box-shadow: 0 0 16px rgba(255, 210, 63, .35); }
.ra-avatars img { display: block; width: 100%; height: auto; }
.ra-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center; }
.ra-foot { margin-top: 26px; color: var(--muted); font-size: 13px; text-align: center; line-height: 1.6; max-width: 620px; }
.ra-foot a { color: var(--muted); }

/* Game page */
body.ra-game { background: var(--bg); overflow: hidden; height: 100vh; }
.ra-bar {
  height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: linear-gradient(180deg, var(--bg2), var(--bg)); border-bottom: 2px solid var(--line);
}
.ra-bar .ra-title { font-size: 12px; margin: 0; white-space: nowrap; }
.ra-bar .who { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; }
.ra-bar .who img { width: 30px; height: 30px; border-radius: 8px; background: #fff; }
.ra-bar .who .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.ra-bar .who .lvl { font-family: var(--px); font-size: 9px; color: var(--gold); }
.ra-bar .ra-btn.ghost { padding: 6px 12px; font-size: 13px; }
#stage { position: relative; height: calc(100vh - 48px); display: flex; align-items: center; justify-content: center; background: #000; }
#game_object { position: relative; }
#loading_game {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background-size: cover; background-position: center; z-index: 5;
}
#loading_game::before { content: ""; position: absolute; inset: 0; background: rgba(7, 5, 26, .72); }
#loading_game > * { position: relative; }
#loading_message { font-family: var(--px); font-size: 12px; color: var(--text); text-shadow: 0 2px 6px #000; margin: 18px 0 14px; text-align: center; line-height: 1.6; }
.ra-progress { width: min(360px, 70%); height: 16px; border-radius: 10px; overflow: hidden; background: #2b2250; border: 2px solid var(--line); }
#inner_progress_bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--pink)); transition: width .6s linear; }
.ra-tip { margin-top: 16px; color: var(--muted); font-size: 14px; max-width: 420px; text-align: center; }
.ra-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(7, 5, 26, .72); padding: 16px; }
.ra-modal[hidden] { display: none; }
.ra-modal .ra-card { width: min(440px, 100%); }
