/* ==========================================================================
   Elderborn — portada interactiva (parts/home.php + home.js)
   ========================================================================== */
.eb-front {
	width: 100%;
	max-width: var(--max-w);
	margin: 0 auto;
	padding: 0 20px;
	display: grid;
	gap: 24px;
}
.eb-section-title {
	margin: 6px 0 14px;
	color: var(--gold-2);
	font-size: clamp(1.3rem, 2.6vw, 1.8rem);
	text-align: center;
	letter-spacing: .06em;
	text-shadow: 0 2px 10px #000;
}
.eb-section-title::before, .eb-section-title::after {
	content: "";
	display: inline-block;
	width: clamp(24px, 8vw, 90px);
	height: 1px;
	margin: 0 14px;
	vertical-align: middle;
	background: linear-gradient(90deg, transparent, var(--gold));
}
.eb-section-title::after { background: linear-gradient(90deg, var(--gold), transparent); }

/* ---------- Pulso del reino ---------- */
.eb-pulse {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	border: 1px solid rgba(201, 162, 74, .5);
	border-radius: var(--radius);
	background: linear-gradient(180deg, rgba(30, 19, 9, .92), rgba(14, 9, 5, .94));
	box-shadow: var(--shadow), inset 0 1px 0 rgba(233, 205, 124, .15);
	overflow: hidden;
}
.eb-pulse__item {
	position: relative;
	padding: 16px 10px;
	text-align: center;
	color: var(--light);
	border-left: 1px solid rgba(201, 162, 74, .2);
}
.eb-pulse__item:first-child { border-left: 0; }
.eb-pulse__item b {
	display: block;
	font-family: var(--font-title);
	font-size: clamp(1.3rem, 2.4vw, 1.9rem);
	color: var(--gold-2);
	font-variant-numeric: tabular-nums;
	transition: color .3s;
}
.eb-pulse__item span:last-child { font-size: .88rem; opacity: .85; }
.eb-pulse__item--live b { display: inline-block; }
.eb-pulse__dot {
	display: inline-block;
	width: 10px; height: 10px;
	margin-right: 8px;
	border-radius: 50%;
	background: #9b2a1c;
	vertical-align: middle;
}
.eb-pulse__dot.is-on { background: #6fc04f; animation: eb-pulse-green 1.8s infinite; }
@keyframes eb-pulse-green { 0% { box-shadow: 0 0 0 0 rgba(111, 192, 79, .7); } 70% { box-shadow: 0 0 0 10px rgba(111, 192, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(111, 192, 79, 0); } }
.is-bump { animation: eb-bump .6s ease; }
@keyframes eb-bump { 40% { transform: scale(1.18); color: #fff; } }

/* ---------- Tarjetas ---------- */
.eb-home__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.eb-card {
	position: relative;
	padding: 18px 22px 22px;
	background:
		radial-gradient(ellipse at top left, rgba(255, 255, 255, .35), transparent 55%),
		radial-gradient(ellipse at bottom right, rgba(160, 120, 60, .18), transparent 60%),
		var(--parch);
	border: 1px solid var(--parch-edge);
	border-radius: var(--radius);
	box-shadow: var(--shadow), inset 0 0 0 4px rgba(244, 232, 200, .9), inset 0 0 0 5px rgba(138, 106, 44, .45);
	min-width: 0;
}
.eb-card--dark {
	background: linear-gradient(180deg, rgba(28, 18, 9, .94), rgba(14, 9, 5, .96)), url("images/bg-1280.jpg") center / cover;
	border-color: var(--gold-dark);
	box-shadow: var(--shadow), inset 0 0 0 1px rgba(233, 205, 124, .2);
	color: var(--light);
}
.eb-card__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 14px;
	padding-bottom: 8px;
	border-bottom: 1px solid rgba(138, 106, 44, .45);
}
.eb-card__head h2 { margin: 0; font-size: 1.25rem; display: flex; align-items: center; gap: 10px; }
.eb-card--dark .eb-card__head { border-color: rgba(233, 205, 124, .25); }
.eb-card--dark .eb-card__head h2 { color: var(--gold-2); }
.eb-card--dark a { color: var(--gold-2); }
.eb-card__head > a { font-size: .95rem; }
.eb-card__hint { font-size: .85rem; color: var(--ink-soft); display: inline-flex; align-items: center; }
.eb-card__hint .eb-pulse__dot { width: 8px; height: 8px; }

/* ---------- Transmisiones ---------- */
.eb-rec { width: 12px; height: 12px; border-radius: 50%; background: #e53935; animation: eb-pulse 1.6s infinite; }
.eb-castlist { display: grid; gap: 10px; }
.eb-castcard {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	position: relative;
	padding: 10px 14px 10px 10px;
	border: 1px solid rgba(201, 162, 74, .35);
	border-radius: var(--radius);
	background: rgba(255, 240, 200, .05);
	color: var(--light) !important;
	text-decoration: none;
	transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.eb-castcard:hover { transform: translateY(-2px); background: rgba(255, 240, 200, .1); border-color: var(--gold-2); }
.eb-castcard img { width: 64px; height: 64px; image-rendering: pixelated; background: radial-gradient(circle, rgba(233, 205, 124, .2), transparent 70%); border-radius: 50%; }
.eb-castcard__body { display: flex; flex-direction: column; min-width: 0; }
.eb-castcard__body b { font-family: var(--font-title); color: var(--gold-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eb-castcard__body small { opacity: .8; }
.eb-castcard__body em { font-size: .9rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eb-castcard__viewers { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-title); color: var(--gold-2); white-space: nowrap; }
.eb-eye { width: 18px; height: 18px; }
.eb-castcard__live { position: absolute; top: 6px; left: 8px; display: flex; align-items: center; gap: 4px; font-size: .62rem; font-weight: 700; letter-spacing: .08em; color: #ff6b5e; }
.eb-castcard__live span { width: 6px; height: 6px; border-radius: 50%; background: #e53935; }
.eb-castlist__empty { text-align: center; padding: 6px 6px 4px; }
.eb-castlist__empty p { margin: 0 0 .5em; }
.eb-castlist__screen {
	position: relative;
	width: min(260px, 80%);
	aspect-ratio: 16 / 9;
	margin: 4px auto 14px;
	border: 2px solid rgba(201, 162, 74, .45);
	border-radius: 8px;
	background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .04) 0 2px, transparent 2px 4px), linear-gradient(135deg, #1d140b, #0b0704);
	display: grid;
	place-items: center;
	overflow: hidden;
}
.eb-castlist__screen::after {
	content: "";
	position: absolute;
	inset: -50% 0;
	background: linear-gradient(180deg, transparent 45%, rgba(233, 205, 124, .12) 50%, transparent 55%);
	animation: eb-scan 3.5s linear infinite;
}
@keyframes eb-scan { from { transform: translateY(-30%); } to { transform: translateY(30%); } }
.eb-castlist__screen span { font-size: 2.4rem; color: #e53935; animation: eb-blink 1.6s steps(2) infinite; }
@keyframes eb-blink { 50% { opacity: .25; } }

/* ---------- Cronica ---------- */
.eb-feed { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; scrollbar-width: thin; }
.eb-feed__item {
	display: grid;
	grid-template-columns: 30px minmax(0, 1fr) auto;
	gap: 10px;
	align-items: start;
	padding: 8px 4px;
	border-bottom: 1px dashed rgba(138, 106, 44, .35);
	font-size: .98rem;
	line-height: 1.35;
}
.eb-feed__item:last-child { border-bottom: 0; }
.eb-feed__icon {
	display: grid; place-items: center;
	width: 28px; height: 28px;
	border-radius: 50%;
	background: rgba(201, 162, 74, .22);
	color: var(--gold-dark);
	font-size: .95rem;
}
.eb-feed__item--death .eb-feed__icon { background: rgba(140, 42, 28, .15); color: var(--blood); }
.eb-feed__item--boss .eb-feed__icon { background: rgba(110, 22, 16, .85); color: #ffd9a0; }
.eb-feed__item--level .eb-feed__icon, .eb-feed__item--skill .eb-feed__icon { background: rgba(63, 107, 46, .18); color: var(--moss); }
.eb-feed__item--mission .eb-feed__icon, .eb-feed__item--guild .eb-feed__icon { background: rgba(60, 70, 140, .15); color: #3c468c; }
.eb-feed time { font-size: .8rem; color: var(--ink-soft); white-space: nowrap; padding-top: 3px; }
.eb-feed__empty { padding: 14px 4px; font-style: italic; color: var(--ink-soft); }
.eb-feed__item.is-new { animation: eb-feed-in 1.2s ease; }
@keyframes eb-feed-in { 0% { opacity: 0; transform: translateX(-12px); background: rgba(233, 205, 124, .6); } 100% { opacity: 1; transform: none; background: transparent; } }

/* ---------- Hoy en el mundo ---------- */
.eb-today__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.eb-creature {
	display: grid;
	grid-template-columns: 84px minmax(0, 1fr);
	gap: 14px;
	align-items: center;
	padding: 14px 16px;
	border: 1px solid var(--gold-dark);
	border-radius: var(--radius);
	background: linear-gradient(180deg, rgba(34, 22, 11, .92), rgba(16, 10, 5, .95));
	color: var(--light);
	box-shadow: var(--shadow);
	transition: transform .2s ease;
}
.eb-creature:hover { transform: translateY(-3px); }
.eb-creature__img {
	width: 84px; height: 84px;
	display: grid; place-items: center;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(233, 205, 124, .35), rgba(233, 205, 124, 0) 70%);
}
.eb-creature__img img { width: 64px; height: 64px; image-rendering: pixelated; transform: scale(1.25); }
.eb-creature small { color: var(--gold); letter-spacing: .12em; text-transform: uppercase; font-size: .72rem; font-family: var(--font-title); }
.eb-creature h3 { margin: 2px 0 4px; color: var(--gold-2); font-size: 1.15rem; }
.eb-creature p { margin: 0; }
.eb-creature .eb-muted { color: rgba(242, 232, 210, .7); font-size: .92rem; }
.eb-creature__stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: .95rem; }

/* ---------- Pestanas (rankings y vocaciones) ---------- */
.eb-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 12px; padding-bottom: 2px; }
.eb-tabs::-webkit-scrollbar { display: none; }
.eb-tab {
	flex: none;
	padding: 6px 12px;
	border: 1px solid var(--parch-edge);
	border-radius: 999px;
	background: rgba(255, 250, 235, .6);
	color: var(--ink);
	font-family: var(--font-title);
	font-size: .85rem;
	cursor: pointer;
	transition: background .15s;
}
.eb-tab:hover { background: rgba(233, 205, 124, .55); }
.eb-tab.is-active { background: linear-gradient(180deg, #4a3017, #2c1c0c); color: var(--gold-2); border-color: var(--gold-dark); }
.eb-tabpanel { display: none; }
.eb-tabpanel.is-active { display: block; animation: eb-fade .35s ease; }
@keyframes eb-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.eb-board { list-style: none; margin: 0; padding: 0; }
.eb-board li {
	display: grid;
	grid-template-columns: 30px 48px minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	padding: 4px 2px;
	border-bottom: 1px dashed rgba(138, 106, 44, .35);
}
.eb-board li:last-child { border-bottom: 0; }
.eb-board img { width: 48px; height: 48px; image-rendering: pixelated; }
.eb-board__rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(46, 29, 14, .12); font-family: var(--font-title); font-weight: 700; }
.eb-board__rank--1 { background: linear-gradient(180deg, #f3d77e, #b88a27); color: #3a2405; }
.eb-board__rank--2 { background: linear-gradient(180deg, #e6e6e6, #9a9a9a); color: #2b2b2b; }
.eb-board__rank--3 { background: linear-gradient(180deg, #e3a56b, #95592a); color: #2e1606; }
.eb-board__who { display: flex; flex-direction: column; min-width: 0; }
.eb-board__who a { font-family: var(--font-title); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eb-board__who small { color: var(--ink-soft); }
.eb-board__val { font-family: var(--font-title); font-variant-numeric: tabular-nums; }
.eb-board__empty { padding: 18px; text-align: center; font-style: italic; color: var(--ink-soft); border: 1px dashed var(--parch-edge); border-radius: var(--radius); }

.eb-voc { display: grid !important; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; }
.eb-voc:not(.is-active) { display: none !important; }
.eb-voc__art { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.eb-voc__art img {
	width: 110px; height: 110px;
	image-rendering: pixelated;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(201, 162, 74, .45), rgba(201, 162, 74, 0) 70%);
}
.eb-voc__art span { font-size: .9rem; color: var(--ink-soft); }
.eb-voc__share { width: 100%; height: 6px; border-radius: 3px; background: rgba(46, 29, 14, .15); overflow: hidden; }
.eb-voc__share i { display: block; height: 100%; background: linear-gradient(90deg, #9c7426, #e9cd7c); }
.eb-voc__info h3 { margin: 0 0 .3em; font-size: 1.3rem; color: var(--blood); }
.eb-voc__info p { margin: 0 0 .8em; }
.eb-voc__bars { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0 0 14px; align-items: center; font-size: .9rem; }
.eb-voc__bars dt { color: var(--ink-soft); }
.eb-voc__bars dd { margin: 0; height: 8px; border-radius: 4px; background: rgba(46, 29, 14, .12); overflow: hidden; }
.eb-voc__bars dd span { display: block; height: 100%; width: calc(var(--v) * 20%); background: linear-gradient(90deg, #8c2a1c, #d0623f); transform-origin: left; animation: eb-grow .7s ease; }
@keyframes eb-grow { from { transform: scaleX(0); } }

/* ---------- Misiones de la semana ---------- */
.eb-gmgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.eb-gm { padding: 12px 14px; border: 1px solid var(--parch-edge); border-left: 4px solid var(--gold-dark); border-radius: var(--radius); background: rgba(255, 250, 235, .6); }
.eb-gm h3 { margin: 0 0 .3em; font-size: 1.05rem; color: var(--blood); }
.eb-gm p { margin: 0 0 .5em; }
.eb-gm__reward { color: var(--moss); font-weight: 600; font-size: .92rem; }
.eb-gm__row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 8px; align-items: center; font-size: .9rem; margin-top: 4px; }
.eb-gm__row > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Solo en Elderborn ---------- */
.eb-unique__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .eb-unique__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .eb-unique__grid { grid-template-columns: minmax(0, 1fr); } }
.eb-unique__card {
	position: relative;
	padding: 18px 18px 16px;
	border: 1px solid var(--gold-dark);
	border-radius: var(--radius);
	background: linear-gradient(160deg, rgba(40, 26, 12, .94), rgba(16, 10, 5, .96));
	color: var(--light) !important;
	text-decoration: none;
	overflow: hidden;
	transition: transform .2s ease, border-color .2s ease;
}
.eb-unique__card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(115deg, transparent 30%, rgba(233, 205, 124, .18) 50%, transparent 70%);
	transform: translateX(-100%);
	transition: transform .6s ease;
}
.eb-unique__card:hover { transform: translateY(-4px); border-color: var(--gold-2); }
.eb-unique__card:hover::before { transform: translateX(100%); }
.eb-unique__icon {
	display: grid; place-items: center;
	width: 44px; height: 44px;
	margin-bottom: 8px;
	border: 1px solid var(--gold-dark);
	border-radius: 50%;
	background: radial-gradient(circle, rgba(201, 162, 74, .35), rgba(0, 0, 0, .2));
	color: var(--gold-2);
	font-size: 1.3rem;
}
.eb-unique__card h3 { margin: 0 0 .35em; color: var(--gold-2); font-size: 1.08rem; }
.eb-unique__card p { margin: 0; font-size: .95rem; opacity: .88; }

/* ---------- Calculadora ---------- */
.eb-calc__body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.eb-calc__inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 14px; }
.eb-calc__inputs label { display: flex; flex-direction: column; gap: 3px; font-size: .9rem; color: var(--ink-soft); }
.eb-calc__inputs input[type="number"], .eb-calc__inputs select { padding: 8px; border: 1px solid var(--parch-edge); border-radius: 4px; background: #fffaf0; font: inherit; color: var(--ink); min-height: 42px; }
.eb-calc__check { flex-direction: row !important; align-items: center; gap: 8px !important; align-self: end; min-height: 42px; }
.eb-calc__check input { width: 20px; height: 20px; accent-color: var(--blood); }
.eb-calc__out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; text-align: center; }
.eb-calc__out div { padding: 12px 6px; border-radius: var(--radius); background: linear-gradient(180deg, #4a3017, #2c1c0c); color: var(--light); }
.eb-calc__out b { display: block; font-family: var(--font-title); font-size: clamp(1rem, 2vw, 1.3rem); color: var(--gold-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.eb-calc__out span { font-size: .82rem; opacity: .85; }

/* ---------- Adaptable ---------- */
@media (max-width: 1100px) {
	.eb-home__grid { grid-template-columns: minmax(0, 1fr); }
	.eb-pulse { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.eb-pulse__item:nth-child(4) { border-left: 0; }
	.eb-pulse__item:nth-child(n+4) { border-top: 1px solid rgba(201, 162, 74, .2); }
	.eb-calc__body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
	.eb-front { padding: 0 16px; gap: 18px; }
	.eb-pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.eb-pulse__item { padding: 12px 6px; }
	.eb-pulse__item:nth-child(n) { border-left: 1px solid rgba(201, 162, 74, .2); border-top: 1px solid rgba(201, 162, 74, .2); }
	.eb-pulse__item:nth-child(odd) { border-left: 0; }
	.eb-pulse__item:nth-child(-n+2) { border-top: 0; }
	.eb-pulse__item:last-child { grid-column: 1 / -1; }
	.eb-card { padding: 14px 14px 16px; }
	.eb-voc { grid-template-columns: minmax(0, 1fr); }
	.eb-voc__art { flex-direction: row; justify-content: center; flex-wrap: wrap; }
	.eb-voc__share { width: 60%; }
	.eb-calc__out { grid-template-columns: minmax(0, 1fr); }
	.eb-calc__out div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 14px; text-align: left; }
	.eb-feed__item { grid-template-columns: 28px minmax(0, 1fr); }
	.eb-feed time { grid-column: 2; padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.eb-front *, .eb-front *::before, .eb-front *::after { animation: none !important; transition: none !important; }
}
