/* RPE - shared styles. Colors and sizes live in the tokens below. */
:root {
	--bg: #0d1016;
	--panel: rgba(20, 24, 33, 0.94);
	--panel-solid: #161a23;
	--panel-raised: #1e2330;
	--line: #323a4e;
	--line-soft: #262d3d;
	--text: #edf0f6;
	--muted: #98a1b4;
	--faint: #646d80;
	--gold: #f2c14e;
	--gold-deep: #c8962a;
	--hp: #e2585b;
	--hp-deep: #9e2f35;
	--mp: #4f8cf0;
	--mp-deep: #2a56a8;
	--xp: #a07cf5;
	--good: #5cc584;
	--bad: #ef6464;
	--focus: #f2c14e;
	--radius: 10px;
	--radius-sm: 6px;
	--shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35);
	--font: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-pixel: "Pixelify Sans", "Nunito Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
	background: var(--bg);
	color: var(--text);
	font: 15px/1.45 var(--font);
	-webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
[hidden], .hidden { display: none !important; }
canvas { image-rendering: pixelated; }

/* ---------------------------------------------------------------- panels */
.panel {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
	backdrop-filter: blur(6px);
}
.panel-title {
	font: 600 13px/1 var(--font-pixel);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
}
.pixel { font-family: var(--font-pixel); }

/* ---------------------------------------------------------------- buttons & inputs */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 9px 16px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line);
	background: var(--panel-raised);
	color: var(--text);
	text-decoration: none;
	cursor: pointer;
	font-weight: 700;
	transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover { background: #262c3c; border-color: #44506a; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
	background: linear-gradient(180deg, #f6cf6a, var(--gold-deep));
	border-color: #e2b143;
	color: #2a1d05;
}
.btn-primary:hover { background: linear-gradient(180deg, #ffd977, #d3a032); border-color: #f2c14e; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.icon-btn {
	color: var(--text); text-decoration: none;
	width: 38px; height: 38px; padding: 0;
	display: inline-grid; place-items: center;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line); background: var(--panel);
	cursor: pointer; position: relative;
}
.icon-btn:hover { border-color: #4a5672; background: var(--panel-raised); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn kbd {
	position: absolute; right: -4px; bottom: -6px;
	font: 600 10px/1 var(--font-pixel); padding: 2px 4px; border-radius: 4px;
	background: var(--panel-solid); border: 1px solid var(--line); color: var(--muted);
}

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.input {
	width: 100%;
	padding: 10px 12px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line);
	background: #0f131b;
	outline: none;
	transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.18); }
.input::placeholder { color: var(--faint); }

.error { color: var(--bad); font-size: 14px; min-height: 20px; }

/* ---------------------------------------------------------------- bars */
.bar {
	position: relative; height: 14px; border-radius: 4px; overflow: hidden;
	background: #0b0e14; border: 1px solid #2a3142;
}
.bar > i {
	position: absolute; inset: 0 auto 0 0; width: 100%;
	transition: width 0.35s ease;
}
.bar > span {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end;
	padding: 0 6px; font: 600 11px/1 var(--font-pixel); color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8);
}
.bar > b {
	position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
	font: 700 10px/1 var(--font-pixel); color: rgba(255, 255, 255, 0.85); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8);
}
.bar.hp > i { background: linear-gradient(180deg, #ff7a7c, var(--hp) 55%, var(--hp-deep)); }
.bar.mp > i { background: linear-gradient(180deg, #7fb0ff, var(--mp) 55%, var(--mp-deep)); }
.bar.xp { height: 6px; }
.bar.xp > i { background: linear-gradient(90deg, #7b5ae0, var(--xp)); }
.bar.low > i { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { filter: brightness(1.5); } }

/* ---------------------------------------------------------------- misc */
.gold-text { color: var(--gold); }
.muted { color: var(--muted); }
.coin {
	display: inline-block; width: 14px; height: 14px; border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #fff2b8, var(--gold) 45%, var(--gold-deep));
	box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.3); vertical-align: -2px;
}
.scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #39415a transparent; }
