* { box-sizing: border-box; }
html, body {
	margin: 0;
	height: 100%;
	overflow: hidden;
	background: #0b0914;
	color: #fff;
	font-family: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
	font-weight: 700;
	user-select: none;
	-webkit-user-select: none;
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

#hud, #duelhud { position: fixed; inset: 0; pointer-events: none; text-shadow: 0 2px 0 #000, 0 0 6px rgba(0, 0, 0, 0.8); }

.key {
	display: inline-block;
	min-width: 1.7em;
	padding: 0.1em 0.45em;
	margin: 0 0.12em;
	border-radius: 0.35em;
	background: #f4f1ff;
	color: #1b1430;
	text-shadow: none;
	text-align: center;
	box-shadow: 0 0.18em 0 #8f88b5;
	font-size: 0.9em;
}

/* ---------- top left: hearts and the body Lincoln is wearing ---------- */
#topleft { position: absolute; left: 18px; top: 14px; }
#hearts svg { margin-right: 3px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5)); }
#hostbox { margin-top: 6px; padding: 8px 12px; background: rgba(18, 14, 38, 0.72); border: 2px solid #9fe8ff; border-radius: 12px; width: 230px; }
#hostname { font-size: 15px; color: #9fe8ff; }
#hostbar { height: 12px; margin-top: 5px; background: #2a2140; border-radius: 6px; overflow: hidden; }
#hostfill { height: 100%; width: 100%; background: linear-gradient(#8dffa8, #2fca62); transition: width 0.15s; }

/* ---------- top centre: timer and objective ---------- */
#topcenter { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); text-align: center; width: min(640px, 52vw); }
#phase { display: inline-block; padding: 5px 20px; font-size: 22px; border-radius: 999px; background: rgba(18, 14, 38, 0.72); border: 2px solid #6fd3ff; }
#phase.warn { border-color: #ffd23f; color: #ffe27a; }
#phase.danger { border-color: #ff4d4d; color: #ff8d7a; background: rgba(70, 10, 14, 0.8); animation: pulse 0.7s infinite alternate; }
#objective { margin-top: 7px; font-size: 16px; color: #f1ecff; }
@keyframes pulse { to { transform: scale(1.06); } }

/* ---------- top right: crystal and map ---------- */
#topright { position: absolute; right: 16px; top: 14px; text-align: right; }
#shards { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; background: rgba(18, 14, 38, 0.72); border-radius: 12px; border: 2px solid #58e6ff; }
#shards span { font-size: 13px; margin-right: 6px; color: #9fe8ff; letter-spacing: 1px; }
#shards i { width: 13px; height: 20px; background: #2a2140; clip-path: polygon(50% 0, 100% 35%, 50% 100%, 0 35%); }
#shards i.home { background: #58e6ff; }
#shards i.carried { background: #ffffff; animation: blink 0.3s infinite alternate; }
#shards i.stolen { background: #ff4d4d; }
@keyframes blink { to { opacity: 0.25; } }
#minimap { display: block; margin: 8px 0 0 auto; background: rgba(12, 10, 26, 0.6); border: 2px solid #474066; border-radius: 10px; image-rendering: pixelated; }

/* ---------- bottom: materials, prompt, key reminder ---------- */
#inv { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 8px; }
.mat { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: rgba(18, 14, 38, 0.72); border-radius: 12px; border: 2px solid #474066; font-size: 15px; }
.mat i { width: 16px; height: 16px; border-radius: 4px; border: 2px solid rgba(0, 0, 0, 0.45); }
.mat b { font-size: 20px; min-width: 1.1em; text-align: center; }
.mat span { color: #cfc8ee; font-size: 13px; }
.mat.bump { animation: bump 0.3s; }
@keyframes bump { 40% { transform: scale(1.25); border-color: #fff; } }

#prompt { position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%); padding: 9px 20px; font-size: 19px; white-space: nowrap; background: rgba(18, 14, 38, 0.78); border-radius: 14px; border: 2px solid #9fe8ff; }
#keys { position: absolute; left: 16px; bottom: 16px; font-size: 13px; color: #d9d2f5; opacity: 0.85; }

#toasts { position: absolute; left: 50%; top: 118px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; width: 80vw; }
.toast { padding: 7px 18px; font-size: 18px; border-radius: 12px; background: rgba(18, 14, 38, 0.8); border: 2px solid #6f67a0; animation: pop 0.25s; transition: opacity 0.45s; text-align: center; }
.toast.good { border-color: #6dff9a; color: #c9ffd8; }
.toast.bad { border-color: #ff5d5d; color: #ffc4bd; }
.toast.place { border-color: #ffd23f; color: #ffe9a3; font-size: 22px; letter-spacing: 2px; }
.toast.out { opacity: 0; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

#banner { position: absolute; left: 0; right: 0; top: 30%; text-align: center; animation: pop 0.3s; }
#bannerbig { font-size: min(84px, 9vw); font-weight: 900; letter-spacing: 3px; color: #ffe066; text-shadow: 0 5px 0 #7a2d10, 0 0 24px rgba(0, 0, 0, 0.9); }
#bannersub { font-size: 24px; margin-top: 4px; padding: 0 10vw; }

#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; }

/* ---------- menus ---------- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 6, 20, 0.55); }
#title { background: radial-gradient(ellipse at center, rgba(8, 6, 20, 0.35), rgba(8, 6, 20, 0.85)); }
.card { width: min(720px, 92vw); max-height: 96vh; overflow: auto; padding: 26px 34px; text-align: center; background: rgba(24, 18, 48, 0.94); border: 3px solid #58e6ff; border-radius: 22px; box-shadow: 0 12px 0 rgba(0, 0, 0, 0.35), 0 0 60px rgba(88, 230, 255, 0.25); }
.card.small { width: min(460px, 92vw); }
.card.wide { width: min(780px, 94vw); }
h1 { margin: 0 0 10px; font-size: min(62px, 9vw); line-height: 1; color: #ffe066; text-shadow: 0 5px 0 #7a2d10; }
h1 small { display: block; font-size: 0.34em; color: #9fe8ff; text-shadow: 0 2px 0 #123; letter-spacing: 6px; margin: 6px 0; }
h2 { margin: 0 0 14px; font-size: 34px; color: #ffe066; text-shadow: 0 3px 0 #7a2d10; }
.story { font-size: 18px; line-height: 1.4; color: #efeaff; font-weight: 400; }
.howto { margin: 16px 0 20px; padding: 14px; font-size: 15px; line-height: 2.1; background: rgba(0, 0, 0, 0.28); border-radius: 14px; font-weight: 400; }
button { font: inherit; font-size: 24px; padding: 10px 38px; color: #2a1500; background: linear-gradient(#ffe77a, #ffb52e); border: 0; border-radius: 14px; box-shadow: 0 6px 0 #a35a00; cursor: pointer; }
button:hover { filter: brightness(1.1); }
button:active { transform: translateY(4px); box-shadow: 0 2px 0 #a35a00; }
button:disabled { background: #4a4468; color: #8d87ad; box-shadow: 0 6px 0 #2a2540; cursor: default; filter: none; }

#craftinv { display: flex; justify-content: center; gap: 14px; margin-bottom: 14px; font-size: 16px; }
.cost { display: inline-flex; align-items: center; gap: 5px; }
.cost i { width: 14px; height: 14px; border-radius: 4px; border: 2px solid rgba(0, 0, 0, 0.45); }
.cost.short { color: #ff8d8d; }
#craftlist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; max-height: 58vh; overflow: auto; }
.recipe { display: flex; align-items: center; gap: 14px; padding: 10px 14px; text-align: left; background: rgba(0, 0, 0, 0.28); border-radius: 14px; border: 2px solid transparent; }
.recipe.ok { border-color: #6dff9a; }
.rinfo { flex: 1; }
.rinfo b { font-size: 19px; color: #ffe9a3; }
.rinfo em { font-style: normal; font-size: 13px; color: #a79fd0; margin-left: 6px; }
.rinfo p { margin: 2px 0 5px; font-size: 14px; font-weight: 400; color: #e4defa; }
.costs { display: flex; gap: 14px; font-size: 14px; }
.recipe button { font-size: 17px; padding: 8px 20px; }

/* ---------- boss duel ---------- */
#duelmsg { position: absolute; left: 0; right: 0; top: 24%; text-align: center; font-size: min(120px, 14vw); font-weight: 900; color: #ffe066; text-shadow: 0 6px 0 #7a2d10, 0 0 30px #000; }
#duelpanels { position: absolute; left: 0; right: 0; bottom: 58px; display: flex; justify-content: center; gap: 12vw; }
.dpanel { min-width: 210px; padding: 8px 18px 10px; text-align: center; background: rgba(18, 14, 38, 0.8); border: 3px solid #58e6ff; border-radius: 16px; }
.dpanel.boss { border-color: #ff7733; }
.dname { font-size: 16px; letter-spacing: 2px; color: #cfc8ee; text-transform: uppercase; }
.dmg { font-size: 46px; font-weight: 900; line-height: 1.05; }
.stocks { display: flex; justify-content: center; gap: 6px; height: 16px; margin-top: 2px; }
.stocks i { width: 16px; height: 16px; border-radius: 50%; background: #58e6ff; border: 2px solid #0a2030; }
.dpanel.boss .stocks i { background: #ff7733; }
.special { margin-top: 6px; font-size: 13px; color: #8d87ad; }
.special.ready { color: #6dff9a; }
#duelhelp { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; font-size: 14px; }
