* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #050507; overflow: hidden; user-select: none; }
body { font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif; color: #e8dcc0; }

#stage { position: absolute; left: 50%; top: 50%; width: 1536px; height: 1024px; transform-origin: 0 0; background: #000; overflow: hidden; }
#game { position: absolute; left: 0; top: 0; width: 1536px; height: 1024px; display: block; cursor: default; }

.screen { position: absolute; inset: 0; }
.hidden { display: none !important; }
.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* loading */
#loading { background: radial-gradient(circle at 50% 45%, #1b1d29, #050507 70%); display: flex; align-items: center; justify-content: center; }
.load-box { text-align: center; }
.load-title { font-size: 64px; letter-spacing: 12px; color: #c9a45c; text-shadow: 0 0 24px rgba(255, 140, 40, .35); margin-bottom: 30px; }
.bar { width: 520px; height: 14px; border: 2px solid #6b5332; border-radius: 8px; overflow: hidden; background: #111; }
#loadbar { height: 100%; width: 0; background: linear-gradient(90deg, #7a3510, #f0a040); transition: width .15s; }

/* buttons */
.btn { font-family: inherit; font-weight: bold; color: #f6e6c0; cursor: pointer; border: 2px solid #9a7440; border-radius: 10px;
  background: linear-gradient(#5a2e1c, #2c140c); box-shadow: 0 4px 0 #120804, 0 0 18px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,220,160,.25);
  padding: 12px 30px; font-size: 22px; text-shadow: 0 2px 2px #000; transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.2); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #120804; }
.btn.big { font-size: 32px; padding: 16px 54px; }
.btn.small { font-size: 16px; padding: 8px 18px; }
.btn.ghost { background: rgba(10,10,14,.6); border-color: #5c4a33; color: #c8b690; }
.btn.green { background: linear-gradient(#2d5a22, #12290c); border-color: #7c9a52; }
.btn:disabled { filter: grayscale(1) brightness(.6); cursor: default; transform: none; }
.iconbtn { width: 64px; height: 64px; border: none; background: none; padding: 0; cursor: pointer; transition: transform .1s; }
.iconbtn img { width: 100%; height: 100%; filter: drop-shadow(0 3px 4px #000); }
.iconbtn:hover { transform: scale(1.08); }

/* title */
#logo { position: absolute; left: 50%; top: 14px; width: 620px; transform: translateX(-50%); filter: drop-shadow(0 10px 20px rgba(0,0,0,.8)); animation: logoIn 1.2s ease-out; }
@keyframes logoIn { from { opacity: 0; transform: translate(-50%, -20px) scale(.96); } to { opacity: 1; transform: translateX(-50%); } }
.title-menu { position: absolute; left: 50%; top: 820px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.title-foot { position: absolute; bottom: 14px; width: 100%; text-align: center; color: rgba(230,215,180,.55); font-size: 15px; text-shadow: 0 1px 3px #000; }

/* world map */
#worldmap .bg { filter: brightness(.92); }
.map-top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.starcount { display: flex; align-items: center; gap: 8px; background: rgba(10,10,14,.75); border: 2px solid #8a6a3a; border-radius: 30px; padding: 4px 22px 4px 8px; font-size: 30px; font-weight: bold; color: #f2c14e; text-shadow: 0 2px 2px #000; }
.starcount img { width: 46px; height: 46px; }
.node { position: absolute; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 40% 35%, #8a3a1a, #3a120a 70%); border: 4px solid #c9a45c; box-shadow: 0 0 0 3px #1a0c06, 0 6px 14px rgba(0,0,0,.8);
  display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: bold; color: #ffe9b8; text-shadow: 0 2px 3px #000; transition: transform .12s; }
.node:hover { transform: scale(1.12); }
.node.locked { background: radial-gradient(circle at 40% 35%, #444, #161616 70%); border-color: #555; color: #777; cursor: default; }
.node.locked:hover { transform: none; }
.node.next { animation: pulse 1.4s infinite; }
.node.boss { border-color: #ff5a3a; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px #1a0c06, 0 0 10px 2px rgba(255,170,60,.5); } 50% { box-shadow: 0 0 0 3px #1a0c06, 0 0 28px 10px rgba(255,170,60,.85); } }
.node .stars { position: absolute; top: 54px; left: 50%; transform: translateX(-50%); display: flex; gap: 0; }
.node .stars img { width: 22px; height: 22px; filter: drop-shadow(0 2px 2px #000); }
.node .label { position: absolute; top: -34px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 17px; color: #f1dfb0; background: rgba(8,8,12,.75); padding: 2px 10px; border-radius: 8px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.node:hover .label { opacity: 1; }

/* modal + panel */
.modal { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 10; }
.panel { min-width: 520px; max-width: 1200px; padding: 40px 50px; border: 34px solid transparent; border-image: url(assets/ui_panel.png) 64 fill stretch;
  box-shadow: 0 20px 60px rgba(0,0,0,.8); text-align: center; animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.panel h1 { margin: 0 0 6px; font-size: 44px; color: #f2c14e; text-shadow: 0 3px 4px #000; letter-spacing: 1px; }
.panel h2 { margin: 0 0 18px; font-size: 20px; color: #b9a27a; font-weight: normal; font-style: italic; }
.panel p { font-size: 20px; line-height: 1.45; margin: 10px 0; color: #e6dcc6; }
.panel .row { display: flex; gap: 18px; justify-content: center; margin-top: 26px; }
.panel .bigstars { display: flex; justify-content: center; gap: 6px; margin: 10px 0 6px; }
.panel .bigstars img { width: 96px; height: 96px; filter: drop-shadow(0 4px 6px #000); }
.panel .bigstars img.on { animation: starIn .4s ease-out both; }
@keyframes starIn { from { transform: scale(0) rotate(-40deg); } to { transform: none; } }
.unlocks { margin: 14px auto 0; max-width: 560px; text-align: left; background: rgba(0,0,0,.3); border: 1px solid rgba(201,164,92,.4); border-radius: 8px; padding: 10px 16px; font-size: 18px; }
.unlocks b { color: #f2c14e; }
.newfoes { display: flex; justify-content: center; gap: 14px; margin-top: 12px; }
.newfoes img { height: 70px; filter: drop-shadow(0 3px 3px #000); }

/* grimoire */
.grim { display: grid; grid-template-columns: repeat(6, 160px); gap: 14px; margin-top: 18px; }
.gcol { background: rgba(0,0,0,.3); border: 1px solid rgba(201,164,92,.35); border-radius: 10px; padding: 10px 8px; }
.gcol img.gi { width: 72px; height: 72px; }
.gcol .gn { font-size: 19px; font-weight: bold; color: #f2c14e; margin: 4px 0 8px; }
.rank { display: block; width: 100%; margin: 6px 0; padding: 8px 6px; border-radius: 8px; border: 2px solid #4a3a26; background: rgba(20,14,10,.85); color: #cbbd9f; font-family: inherit; font-size: 14px; cursor: pointer; line-height: 1.25; min-height: 66px; }
.rank .cost { display: block; color: #f2c14e; font-weight: bold; margin-top: 4px; }
.rank.owned { border-color: #7c9a52; background: rgba(40,70,30,.75); color: #e9f5d8; cursor: default; }
.rank.owned .cost { color: #b9e08a; }
.rank.avail:hover { border-color: #f2c14e; filter: brightness(1.2); }
.rank.na { opacity: .45; cursor: default; }

.node .badges { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.node .badges img { width: 20px; height: 20px; filter: drop-shadow(0 2px 2px #000); }
.chal { display: flex; gap: 14px; justify-content: center; margin-top: 16px; }
.chal .btn { display: flex; flex-direction: column; align-items: center; width: 250px; padding: 10px 12px; background: linear-gradient(#3a2a40, #1a1020); border-color: #7a5a8a; }
.chal .btn img { width: 40px; height: 40px; margin-bottom: 2px; }
.chal .btn span { font-weight: normal; font-size: 13px; color: #d8c8e0; margin-top: 4px; line-height: 1.25; }
.newfoes .foe { background-repeat: no-repeat; background-position: 0 0; filter: drop-shadow(0 3px 3px #000); }

/* world map: continent labels + hero picker */
.region-tag { position: absolute; transform: translate(-50%, -50%); font-size: 20px; letter-spacing: 2px; text-transform: uppercase; color: #f1dfb0; text-shadow: 0 2px 4px #000, 0 0 12px #000; pointer-events: none; opacity: .85; white-space: nowrap; }
.heroes { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.hero-pick { width: 108px; padding: 6px 4px 6px; border-radius: 10px; border: 2px solid rgba(201,164,92,.35); background: rgba(0,0,0,.35); cursor: pointer; color: #d9c9a0; font-size: 13px; line-height: 1.2; }
.hero-pick:hover { border-color: rgba(242,193,78,.8); }
.hero-pick.on { border-color: #f2c14e; background: rgba(90,60,20,.55); color: #fff2c8; box-shadow: 0 0 14px rgba(242,193,78,.4); }
.hero-pick .foe { margin: 0 auto 4px; }
.hero-desc { max-width: 600px; margin: 8px auto 0; font-size: 15px; color: #c9b98f; min-height: 20px; }

/* title screen (Wardens of the Hollow Crown) */
.title-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,.55)); pointer-events: none; }
.title-row { display: flex; gap: 12px; }
.map-right { display: flex; gap: 10px; }
.iconbtn.face img { border-radius: 50%; box-shadow: 0 0 0 3px #8a6a3a, 0 0 10px rgba(0,0,0,.8); }
/* champion cards */
.hero-pick { width: 118px; padding: 0 0 6px; overflow: hidden; }
.hero-pick img.card { display: block; width: 100%; height: 150px; object-fit: cover; object-position: center 18%; margin-bottom: 5px; }
.hero-pick .lvl { display: block; color: #f2c14e; font-size: 12px; margin-top: 2px; }
.wardens { display: flex; gap: 12px; justify-content: center; margin-top: 10px; }
.warden-card { width: 220px; border-radius: 12px; border: 2px solid rgba(201,164,92,.45); background: rgba(0,0,0,.4); overflow: hidden; text-align: left; }
.warden-card.locked img.card { filter: grayscale(1) brightness(.25); }
.warden-card img.card { display: block; width: 100%; height: 300px; object-fit: cover; object-position: center 15%; }
.warden-card .wc-body { padding: 8px 10px 10px; font-size: 13px; color: #d8c8a0; line-height: 1.3; }
.warden-card .wc-name { font-size: 16px; color: #f2c14e; font-weight: bold; }
.warden-card .xpbar { height: 6px; background: #2a2420; border-radius: 3px; margin: 6px 0; overflow: hidden; }
.warden-card .xpbar div { height: 100%; background: linear-gradient(90deg, #b8862a, #f2c14e); }
.warden-card .stats { color: #b9a77d; font-size: 12px; margin-top: 4px; }
.settings { display: grid; grid-template-columns: 140px 280px 60px; gap: 14px 12px; align-items: center; justify-content: center; margin: 18px auto; font-size: 18px; }
.settings input[type=range] { width: 100%; accent-color: #c9a45c; }
.credits { max-width: 760px; margin: 10px auto; text-align: left; font-size: 15px; line-height: 1.45; color: #d8c8a0; max-height: 600px; overflow-y: auto; }
.credits h3 { color: #f2c14e; margin: 12px 0 4px; font-size: 17px; }
.credits a { color: #e9c77a; }
