:root {
	--bg-color: #f4f1e1;
	--text-color: #2c3e2e;
	--primary-color: #1e5c43;
	--secondary-color: #8fa682;
	--accent-color: #d1563f;
	--font-main: "Georgia", serif;
	--font-heading: "Trebuchet MS", sans-serif;
}

body {
	font-family: var(--font-main);
	background-color: var(--bg-color);
	color: var(--text-color);
	margin: 0;
	padding: 20px;
	line-height: 1.6;
}

h1,
h2,
h3 {
	font-family: var(--font-heading);
	color: var(--primary-color);
	text-transform: uppercase;
	letter-spacing: 1px;
}

h1 {
	text-align: center;
	border-bottom: 2px solid var(--primary-color);
	padding-bottom: 10px;
}

.tabs {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 20px;
}

.tab-btn {
	background-color: var(--secondary-color);
	color: white;
	border: none;
	padding: 10px 20px;
	font-size: 16px;
	cursor: pointer;
	border-radius: 5px;
	font-family: var(--font-heading);
	font-weight: bold;
	transition: 0.3s;
}

.tab-btn:hover,
.tab-btn.active {
	background-color: var(--primary-color);
}

.tab-content {
	display: none;
	background: #fffdf5;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	border: 1px solid var(--secondary-color);
	margin: 0 20px 24px;
}

.tab-content.active {
	display: block;
}

.roll-btn {
	background-color: var(--primary-color);
	color: white;
	border: 2px solid var(--primary-color);
	padding: 8px 15px;
	cursor: pointer;
	font-weight: bold;
	border-radius: 4px;
	margin: 10px 0;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.roll-btn:hover {
	background-color: var(--bg-color);
	color: var(--primary-color);
}

.roll-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	background: #e9ecd9;
	padding: 15px;
	border-radius: 5px;
	margin-bottom: 15px;
	border-left: 5px solid var(--primary-color);
}

table {
	width: 100%;
	max-width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin-bottom: 20px;
	font-size: 13px;
	line-height: 20px;
}

table th,
table td {
	padding: 6px 8px;
	white-space: normal;
	overflow-wrap: break-word;
}

.flex-wrap {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
}

.flex-col {
	flex: 1;
	min-width: 280px;
}

th,
td {
	padding: 10px;
	border-bottom: 1px solid var(--secondary-color);
	text-align: left;
	vertical-align: middle;
}

th {
	background-color: var(--primary-color);
	color: white;
	font-family: var(--font-heading);
}

tr:nth-child(even) {
	background-color: #f0f2e6;
}

.table-card {
	background: #fffdf5;
	border: 1px solid var(--secondary-color);
	border-radius: 6px;
	padding: 12px;
	margin-bottom: 15px;
	overflow-x: auto;
}

.table-card h3 {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 0 0 8px 0;
	font-size: 14px;
	border-bottom: 1px solid var(--secondary-color);
	padding-bottom: 6px;
}

.table-card table {
	margin-bottom: 0;
	font-size: 12px;
	line-height: 18px;
}

.table-card table th,
.table-card table td {
	padding: 4px 6px;
}

.table-scroll {
	overflow-x: auto;
}

.table-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.table-grid > .table-card {
	flex: 1;
	min-width: 280px;
	margin-bottom: 0;
}

.table-grid > .table-card.full {
	flex: 0 0 100%;
	min-width: 100%;
}

.table-grid > .table-card.sm {
	flex: 1;
	min-width: 200px;
	max-width: 320px;
}

.table-grid > .table-card.md {
	flex: 2;
	min-width: 300px;
}

.table-grid > .table-card.lg {
	flex: 3;
	min-width: 400px;
}

.roll-title-btn {
	background: none;
	border: 1px solid var(--secondary-color);
	color: var(--primary-color);
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 3px;
	cursor: pointer;
	font-family: var(--font-heading);
	font-weight: bold;
	white-space: nowrap;
}

.roll-title-btn:hover {
	background: var(--primary-color);
	color: white;
}

.eq-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 4px 16px;
	font-size: 12px;
	padding: 4px 0;
}

.eq-item {
	display: flex;
	justify-content: space-between;
	border-bottom: 1px dotted #ddd;
	padding: 2px 0;
}

.eq-hint {
	color: var(--accent-color);
	font-weight: normal;
	text-transform: none;
	font-size: 12px;
}

.eq-price {
	color: var(--accent-color);
	font-weight: bold;
}

#result-box {
	position: fixed;
	bottom: 20px;
	right: 20px;
	background: var(--text-color);
	color: white;
	padding: 20px;
	padding-top: 10px;
	border-radius: 8px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
	width: calc(100vw - 40px);
	max-width: 460px;
	display: none;
	z-index: 1000;
	border: 2px solid var(--secondary-color);
}

#result-box h3 {
	color: #f4f1e1;
	margin-top: 0;
}

#result-title {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.dice-area {
	display: inline-flex;
	gap: 0;
}

.dice-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 26px;
	padding: 2px 7px;
	border-radius: 5px;
	background: var(--bg-color);
	color: var(--text-color);
	font-family: var(--font-heading);
	font-weight: bold;
	font-size: 13px;
	line-height: 1;
	margin-right: 4px;
}

.result-tools {
	display: flex;
	justify-content: flex-end;
	gap: 6px;
	margin-bottom: 4px;
}

.close-btn {
	background: transparent;
	border: none;
	color: #f4f1e1;
	font-size: 18px;
	cursor: pointer;
	font-weight: bold;
	line-height: 1;
	padding: 2px 6px;
	border-radius: 3px;
}

.close-btn:hover {
	background: var(--accent-color);
	color: white;
}

.copy-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	border: 1px solid rgba(244, 241, 225, 0.4);
	color: #f4f1e1;
	font-family: var(--font-heading);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	cursor: pointer;
	padding: 4px 10px;
	border-radius: 4px;
	line-height: 1;
	transition: 0.2s;
}

.copy-btn svg {
	width: 14px;
	height: 14px;
}

.copy-btn:hover {
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(244, 241, 225, 0.7);
}

.h-row-3col {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	flex-wrap: wrap;
}

.h-col-left {
	flex: 0 0 380px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.h-col-center {
	flex: 1;
	min-width: 400px;
}

.h-col-right {
	flex: 0 0 380px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.h-col-left .table-card,
.h-col-right .table-card {
	margin-bottom: 0;
}

/* ===== Header ===== */
.em-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px 20px;
	background: var(--primary-color);
	padding: 14px 20px;
	margin-bottom: 20px;
}

.em-header-logo img {
	height: 54px;
	width: auto;
	display: block;
	filter: brightness(0) invert(1);
}

.em-header-title {
	margin: 0;
	flex: 1;
	text-align: center;
	font-size: 20px;
	color: #fff;
	border: none;
	padding: 0;
}

.em-header-buy {
	background: var(--accent-color);
	color: #fff;
	text-decoration: none;
	font-family: var(--font-heading);
	font-weight: bold;
	font-size: 15px;
	padding: 10px 18px;
	border-radius: 5px;
	text-transform: uppercase;
	letter-spacing: 1px;
	transition: 0.3s;
	white-space: nowrap;
}

.em-header-buy:hover {
	background: #b84530;
}

/* ===== Footer ===== */
.em-footer {
	margin-top: 40px;
	background: var(--primary-color);
	color: #f4f1e1;
	padding: 36px 20px 0;
}

.em-footer-main,
.em-footer-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 28px 40px;
	max-width: 1100px;
	margin: 0 auto;
	align-items: flex-start;
}

.em-footer-col {
	flex: 1;
	min-width: 180px;
}

.em-footer-brand {
	flex: 1.8;
	min-width: 280px;
	display: flex;
	align-items: flex-start;
	gap: 16px;
}

.em-footer-logo {
	width: 80px;
	height: 170px;
	object-fit: contain;
	flex-shrink: 0;
	display: block;
}

.em-footer-brand p {
	font-size: 13px;
	line-height: 1.6;
	max-width: none;
	margin: 0;
	color: #e5e0cf;
}

.em-footer-title {
	font-size: 18px;
	font-weight: bold;
	display: block;
	margin-bottom: 6px;
	color: #fff;
}

.em-footer-nav,
.em-footer-fichas {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.em-footer-col h3 {
	color: #fff;
	margin: 0 0 10px 0;
	font-size: 15px;
	font-weight: bold;
	border: none;
	padding: 0;
	letter-spacing: 0.5px;
}

.em-footer-nav a,
.em-footer-fichas a {
	color: #f4f1e1;
	text-decoration: none;
	font-size: 14px;
	transition: color 0.15s ease, opacity 0.15s ease;
	display: inline-block;
}

.em-footer-nav a:hover,
.em-footer-fichas a:hover {
	color: #fff;
	text-decoration: underline;
}

.em-footer-copy {
	border-top: 1px solid rgba(244, 241, 225, 0.2);
	margin-top: 30px;
	padding: 16px 0;
	text-align: center;
	font-size: 12px;
	color: #d1cbba;
}

@media (max-width: 640px) {
	.em-header {
		justify-content: center;
		text-align: center;
	}

	.em-header-title {
		flex-basis: 100%;
	}

	.h-col-left,
	.h-col-center,
	.h-col-right {
		flex: 1 1 100%;
		min-width: 0;
	}

	.table-card {
		padding: 8px;
	}

	.table-card table {
		font-size: 11px;
		line-height: 15px;
	}

	.table-card table th,
	.table-card table td {
		padding: 3px 4px;
	}

	.em-footer-main,
	.em-footer-grid {
		flex-direction: column;
		gap: 24px;
	}

	.em-footer-brand {
		flex: 1 1 100%;
		align-items: center;
	}

	.em-footer-logo {
		width: 70px;
		height: 150px;
	}

	.em-footer-col {
		width: 100%;
		min-width: 0;
	}
}
