* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #111; color: #eee; font: 13px/1.35 "Segoe UI", system-ui, sans-serif; user-select: none; }
#game { position: absolute; top: 36px; left: 0; display: block; cursor: default; }
#hud2d { position: absolute; top: 36px; left: 0; pointer-events: none; z-index: 1; }

#top { position: absolute; top: 0; left: 0; right: 0; height: 36px; display: flex; align-items: center; gap: 18px; padding: 0 14px;
  background: linear-gradient(#3a2f22, #241c14); border-bottom: 2px solid #8a6d3b; z-index: 5; }
#top .res { display: flex; align-items: center; gap: 6px; font-size: 15px; }
#top .res b { min-width: 42px; }
#age { color: #f3d27a; font-weight: 600; }
#god { color: #cdb98d; }
#clock { font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.btn-s { padding: 3px 9px; border: 1px solid #8a6d3b; border-radius: 3px; background: #4a3b28; cursor: pointer; }
.btn-s:hover { background: #5d4a31; }

#bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 180px; display: flex; gap: 10px; padding: 6px;
  background: linear-gradient(#2c241a, #1b1610); border-top: 2px solid #8a6d3b; z-index: 5; }
#mini { border: 2px solid #8a6d3b; background: #000; cursor: pointer; flex: none; }
#info { width: 330px; flex: none; padding: 6px 10px; background: #0003; border: 1px solid #5a4728; overflow: hidden; }
#info h3 { margin: 0 0 4px; font-size: 15px; color: #f3d27a; }
#info .stat { color: #cbbfa8; }
.hp { height: 8px; background: #400; border: 1px solid #000; margin: 4px 0; }
.hp i { display: block; height: 100%; background: #4c4; }
.prog { height: 6px; background: #222; margin-top: 2px; } .prog i { display: block; height: 100%; background: #f3d27a; }
.queue { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.qi { width: 54px; padding: 2px; font-size: 10px; background: #3d3223; border: 1px solid #7a6038; cursor: pointer; text-align: center; }
.qi:hover { border-color: #e55; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip { padding: 2px 6px; background: #3d3223; border: 1px solid #7a6038; border-radius: 3px; }

#cmds { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, 92px); grid-auto-rows: 52px; gap: 5px; align-content: start; }
.cmd, .pw { position: relative; background: linear-gradient(#5a4830, #3b2f1f); border: 1px solid #a07f45; border-radius: 4px; padding: 4px 5px;
  cursor: pointer; font-size: 11.5px; overflow: hidden; }
.cmd:hover, .pw:hover { border-color: #ffd98a; }
.cmd .k, .pw .k { position: absolute; right: 4px; top: 2px; font-size: 10px; color: #ffd98a; }
.cmd .c { display: block; font-size: 10px; color: #cbbfa8; margin-top: 3px; }
.cmd.poor .c { color: #ff8a7a; }
.cmd.locked, .pw.locked, .pw.used { opacity: .38; }
#powers { width: 160px; flex: none; display: flex; flex-direction: column; gap: 5px; }
.pw { height: 50px; background: linear-gradient(#2f4a66, #1c2c40); border-color: #6da0d8; }
.pw b { display: block; color: #cfe6ff; }
.pw.armed { border-color: #fff; box-shadow: 0 0 8px #9cf; }

#msgs { position: absolute; top: 46px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; z-index: 6; }
.msg { padding: 4px 14px; background: #000a; border-radius: 3px; font-size: 14px; transition: opacity .6s; }
.msg.warn { color: #ff9a7a; } .msg.good { color: #b6f59a; } .msg.god { color: #9fd8ff; }

#tip { position: absolute; display: none; max-width: 280px; padding: 6px 9px; background: #1d1711f0; border: 1px solid #a07f45; z-index: 20; pointer-events: none; font-size: 12px; }
#tip .cost { color: #f3d27a; }

.overlay { position: absolute; inset: 0; background: radial-gradient(#2a2216ee, #0d0a07f5); z-index: 30; display: flex; align-items: center; justify-content: center; }
.overlay.hidden { display: none; }
.panel { width: min(1000px, 94vw); padding: 24px 30px; background: #1f1912; border: 2px solid #8a6d3b; border-radius: 6px; }
.panel h1 { margin: 0; font-size: 34px; color: #f3d27a; letter-spacing: 2px; font-family: Georgia, serif; }
.sub { color: #cbbfa8; margin-top: 2px; }
#pantheons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px 0; }
.card { padding: 12px; border: 2px solid #5a4728; border-radius: 5px; background: #2a2218; cursor: pointer; }
.card:hover { border-color: #a07f45; }
.card.on { border-color: #ffd98a; box-shadow: 0 0 12px #ffd98a55; }
.card h2 { margin: 0; font-size: 18px; font-family: Georgia, serif; }
.card .g { color: #cbbfa8; font-style: italic; margin-bottom: 6px; }
.card ul { padding-left: 16px; margin: 4px 0; }
.row { display: flex; align-items: center; justify-content: space-between; }
select, button { font: inherit; padding: 6px 10px; background: #3b2f1f; color: #eee; border: 1px solid #a07f45; border-radius: 3px; }
button { padding: 8px 26px; font-size: 16px; cursor: pointer; background: #6a4f22; }
button:hover { background: #81622b; }
.help { margin-top: 16px; color: #b8ab92; font-size: 12px; line-height: 1.6; }
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 14px 0; }

/* ---- icons */
img { -webkit-user-drag: none; }
.ri { width: 20px; height: 20px; vertical-align: middle; }
#top .res .ri { width: 24px; height: 24px; }
#idle { display: flex; align-items: center; gap: 4px; }
#idle.alert { color: #ffd860; border-color: #ffd860; box-shadow: 0 0 6px #ffd86088; }
.cst { display: inline-flex; align-items: center; margin-right: 5px; }
.cst .ri { width: 14px; height: 14px; margin-right: 1px; }
#tip .cst .ri { width: 16px; height: 16px; }

#cmds { grid-template-columns: repeat(auto-fill, 128px); grid-auto-rows: 54px; }
.cmd { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 5px; align-items: center; padding: 3px 5px 3px 3px; }
.cmd .ci { grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 4px; background: radial-gradient(circle at 50% 40%, #6a7a8a, #26303a); border: 1px solid #00000088; }
.cmd .nm { font-size: 11.5px; line-height: 1.1; padding-right: 10px; }
.cmd .c { margin-top: 1px; font-size: 10.5px; }

.pw { display: grid; grid-template-columns: 40px 1fr; column-gap: 6px; align-items: center; padding: 3px 5px 3px 3px; }
.pw .pi { grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(#3a5a7a, #101c2a); border: 1px solid #9fd8ff66; }
.pw b { font-size: 12px; } .pw .sub { font-size: 11px; color: #b8cde0; }
.pw.locked .pi, .pw.used .pi { filter: grayscale(1); }

.ihead { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.ihead .grow { flex: 1; }
.portrait { width: 76px; height: 76px; flex: none; border-radius: 5px; background: radial-gradient(circle at 50% 40%, #6a7a8a, #222a32); border: 1px solid #a07f45; }
.portrait.emblem { background: radial-gradient(#3a3020, #15110c); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.chip { position: relative; width: 48px; height: 48px; padding: 0; border-radius: 4px; background: radial-gradient(circle at 50% 40%, #6a7a8a, #222a32); border: 1px solid #a07f45; cursor: pointer; }
.chip:hover { border-color: #ffd98a; }
.chip .chi { width: 46px; height: 46px; }
.chip b { position: absolute; right: 2px; bottom: 0; font-size: 12px; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.qi { width: 44px; padding: 2px; }
.qi .qic { width: 38px; height: 38px; display: block; margin: 0 auto; }
.qi.blocked { border-color: #e55; }

.chead { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.chead .emblem { width: 56px; height: 56px; }
.myth { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.mythi { width: 64px; height: 64px; border-radius: 5px; background: radial-gradient(circle at 50% 40%, #6a7a8a, #222a32); border: 1px solid #5a4728; }
.plist { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.prow { display: flex; gap: 8px; align-items: flex-start; }
.ppi { width: 34px; height: 34px; flex: none; border-radius: 50%; background: radial-gradient(#3a5a7a, #101c2a); }
#cmds { grid-template-columns: repeat(auto-fill, 138px); }
.cmd .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cmds { grid-template-columns: repeat(auto-fill, 132px); grid-auto-rows: 51px; }
.cmd .ci { width: 42px; height: 42px; }
.cmd { grid-template-columns: 42px 1fr; }
.btn-s.ib { padding: 2px 5px; display: flex; align-items: center; }
#god { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 1; }

/* ---- Embers Online */
button.alt { background: #3b2f1f; }
.panel.narrow { width: min(520px, 94vw); }
.panel .form { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 8px; }
.panel .form label, #ol-join label { display: flex; align-items: center; gap: 10px; color: #cbbfa8; }
.panel .form label input { flex: 1; }
input { font: inherit; padding: 6px 9px; background: #120e09; color: #eee; border: 1px solid #a07f45; border-radius: 3px; user-select: text; }
input[type=range] { padding: 0; accent-color: #d8b060; }
.err { min-height: 20px; color: #ff9a7a; margin: 6px 0; }
.pans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px 0; }
#start .row { gap: 10px; } #start .row label { margin-right: auto; }
body.online #idle { display: none; }
#ol-nav { position: absolute; top: 44px; left: 8px; display: flex; gap: 4px; z-index: 7; }
#ol-nav.hidden, #ol-side.hidden, #ol-map.hidden, #ol-banner.hidden { display: none; }
#ol-nav .nb { padding: 5px 12px; background: #2a2218e8; border: 1px solid #8a6d3b; border-radius: 3px; cursor: pointer; position: relative; font-size: 13px; }
#ol-nav .nb:hover, #ol-nav .nb.on { background: #5d4a31; border-color: #ffd98a; }
#ol-rdot { display: none; position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: #ff5a4a; }
#ol-rdot.on { display: block; }
#ol-banner { position: absolute; top: 80px; left: 8px; max-width: calc(100vw - 380px); padding: 5px 10px; background: #1a120cee; border: 1px solid #a07f45; border-radius: 3px; z-index: 7; font-size: 13px; }
#ol-banner .alarm { color: #ff9a7a; font-weight: 600; } #ol-banner .ally, .ally { color: #8fef9a; } #ol-banner .sep { margin: 0 8px; color: #8a6d3b; }
button.sm { padding: 3px 10px; font-size: 12px; margin: 3px 4px 0 0; }
#ol-map { position: absolute; top: 36px; left: 0; width: 100%; height: calc(100% - 216px); z-index: 4; cursor: grab; }
#ol-side { position: absolute; top: 36px; right: 0; width: 340px; bottom: 180px; background: #1d1711f4; border-left: 2px solid #8a6d3b; z-index: 8; display: flex; flex-direction: column; }
#ol-side .sh { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid #5a4728; color: #f3d27a; font-size: 15px; }
#ol-sclose { cursor: pointer; padding: 0 4px; } #ol-sclose:hover { color: #fff; }
#ol-sbody { padding: 8px 12px; overflow-y: auto; flex: 1; user-select: text; }
#ol-sbody h4 { margin: 12px 0 4px; color: #f3d27a; }
#ol-sbody .item { padding: 6px 8px; margin-bottom: 6px; background: #2a2218; border: 1px solid #4a3a24; border-radius: 3px; }
#ol-sbody .item.bad { border-color: #c0503a; } #ol-sbody .item.new { border-color: #d8b060; }
#ol-sbody .col { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
#ol-sbody .col button { font-size: 14px; padding: 6px; }
#ol-sbody button:disabled { opacity: .4; cursor: default; }
#ol-sbody table { width: 100%; border-collapse: collapse; } #ol-sbody td { padding: 2px 4px; border-bottom: 1px solid #3a2e1e; }
#ol-sbody tr[data-card] { cursor: pointer; } #ol-sbody tr[data-card]:hover { background: #3a2e1e; }
.urow { display: grid; grid-template-columns: 36px 1fr 110px 44px; align-items: center; gap: 6px; margin: 4px 0; }
.urow .ui { width: 34px; height: 34px; border-radius: 4px; background: radial-gradient(circle at 50% 40%, #6a7a8a, #222a32); }
.urow input[type=number] { width: 100%; }
.addrow { display: flex; gap: 6px; margin-bottom: 8px; } .addrow input { flex: 1; }
.g { color: #a89c84; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #555; margin-right: 6px; } .dot.on { background: #5fe07a; }
.lv { font-size: 12px; color: #cbbfa8; font-weight: normal; }
#ol-respanel .big { font-size: 40px; color: #ffd860; letter-spacing: 6px; margin: 8px 0; }
#ol-respanel div { margin: 3px 0; }
/* ---- controls screen */
#ctl-ov { z-index: 40; }
.panel.ctl { max-height: 92vh; display: flex; flex-direction: column; }
#ctl-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; margin: 12px 0; color: #cbbfa8; }
#ctl-opts label { display: flex; align-items: center; gap: 8px; }
#ctl-list { overflow-y: auto; columns: 3 260px; column-gap: 22px; padding-right: 6px; margin-bottom: 12px; }
#ctl-list .cg { break-inside: avoid; margin-bottom: 10px; }
#ctl-list h4 { margin: 4px 0; color: #f3d27a; }
.cr { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 6px; border-radius: 3px; cursor: pointer; font-size: 12.5px; }
.cr:hover { background: #3a2e1e; } .cr.wait { background: #5d4a31; }
kbd { min-width: 42px; text-align: center; padding: 2px 6px; background: #120e09; border: 1px solid #a07f45; border-radius: 3px; font: 12px monospace; color: #ffe7a8; white-space: nowrap; }
kbd.changed { color: #8fef9a; } kbd.clash { border-color: #ff6a5a; color: #ff9a7a; }
#sky { color: #cdd8e8; white-space: nowrap; font-size: 12.5px; }

/* start-screen description and the no-JavaScript page */
.lede { color: #e6d8bc; margin: 6px 0 4px; line-height: 1.45; max-width: 820px; }
.nojs { max-width: 760px; margin: 40px auto; padding: 0 20px; color: #e6d8bc; font: 16px/1.55 Georgia, serif; }
.nojs h1 { color: #ffd27a; } .nojs h2 { color: #e9c98a; font-size: 20px; margin-top: 22px; }
