body {
	background-color: var(--color-bg, #f2e7c9);
	font-family: 'Roboto Mono', monospace;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 90vh;
	padding: 20px;
	font-size: 0.9rem;
	background-size: cover;
	transition: background 0.3s;
}

body::before {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--custom-bg, url(bg.png)) bottom / cover no-repeat;
	background-attachment: fixed;
	opacity: 0.8;
	z-index: -1;
	filter: grayscale(1) blur(5px);
	transition: background 0.3s;
	pointer-events: none;
}

body::after {
	content: '';
	position: fixed;
	top: 0;
	left: -10rem;
	right: -10rem;
	overflow: hidden;
	height: 100%;
	z-index: 2;
	box-shadow: inset 0 0 3rem 0.4rem rgba(0, 0, 0, var(--opacity-bg, 0));
	pointer-events: none;
}

.receipt-wrapper {
	position: relative;
	max-width: 400px;
	width: 100%;
}

.picote-top::before {
	content: '';
	position: absolute;
	top: -8rem;
	height: 10rem;
	width: 100%;
	background: linear-gradient(0deg, #fff8dc 0%, transparent 100%);
	z-index: 1;
}

.picote-bottom::before {
	content: '';
	position: absolute;
	height: 5px;
	width: 100%;
	top: -4px;
	background-image: url("data:image/svg+xml,%3Csvg width='10' height='5' viewBox='0 0 10 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.00003 0L0 5H10L5.00003 0Z' fill='%23FFF8DC'/%3E%3C/svg%3E%0A");
	background-repeat: repeat-x;
}

.picote-top {
	height: 2rem;
}

.picote-bottom {
	transform: rotate(180deg);
}

.receipt {
	box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
	background-color: #fff8dc;
	color: #2c2c2c;
	padding: 2rem;
	padding-top: 0;
	display: flex;
	flex-direction: column;
	position: relative;
}

h1 {
	font-size: 1.2rem;
	text-align: center;
	margin-bottom: 1.5rem;
	color: #333;
}

label {
	font-size: 0.9rem;
	display: block;
	margin-bottom: 0.4rem;
}

input[type='text'] {
	padding: 0.5rem;
	font-family: 'Roboto Mono', monospace;
	font-size: 0.9rem;
	border: 1px solid #c4b998;
	border-radius: 5px;
	margin-bottom: 0.5rem;
	background: #fff8dc;
}

.options {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.options select {
	padding: 0.5rem;
	font-family: 'Roboto Mono', monospace;
	font-size: 0.9rem;
	border: 1px solid #c4b998;
	border-radius: 5px;
	background: #fff8dc;
}

.options button {
	flex: 1;
	padding: 0.6rem;
	background-color: #f9edc9;
	color: #333;
	font-weight: bold;
	border: 1px solid #e1c17b;
	border-radius: 5px;
	cursor: pointer;
	font-size: 0.95rem;
}

.options button:hover {
	background-color: rgba(225, 193, 123, 0.5);
	border: 1px solid #d8b65c;
}

/* Tooltip */
.tooltip {
	background: #fff8dc;
	display: inline-block;
	position: relative;
	width: 16px;
	height: 16px;
	border: 1px solid #d8b65c;
	border-radius: 50%;
	text-align: center;
	line-height: 16px;
	font-size: 12px;
	color: #333;
	cursor: default;
	margin-right: 0.8rem;
}

.tooltip .tooltiptext {
	pointer-events: none;
	width: 300px;
	font-size: 0.7rem;
	background-color: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(3px);
	color: #fff;
	text-align: center;
	border-radius: 6px;
	padding: 5px;
	position: absolute;
	z-index: 1;
	bottom: 125%;
	left: 50%;
	transform: translateX(-50%);
	opacity: 0;
	transition: opacity 0.3s;
	box-shadow: 0 5px 5px rgba(0, 0, 0, 0.2);
}

.tooltip:hover .tooltiptext {
	opacity: 1;
}

.line {
	border-top: 1px dashed #c4b998;
	margin: 0.8rem 0;
}

.data-item {
	display: flex;
	justify-content: space-between;
	padding: 0.2rem 0;
	position: relative;
	background-color: #fff8dc;
}

.data-item::before {
	content: '';
	display: block;
	width: 100%;
	position: absolute;
	bottom: 0.5rem;
	left: 0;
	border-bottom: 2px dotted rgba(44, 44, 44, 0.5);
}

.data-item span {
	background-color: #fff8dc;
	z-index: 1;
}

.data-item span:first-child {
	padding-right: 4px;
}

.data-item span:last-child {
	padding-left: 4px;
}

.data-item strong {
	font-weight: 700;
}

.total {
	font-size: 1.1rem;
	font-weight: bold;
	color: #333;
	text-align: right;
	margin-top: 1rem;
}

.total .value {
	padding-bottom: 1px;
	padding-right: 2px;
}

#result {
	margin-top: 1rem;
}

.alert {
	padding: 0.5rem;
	background-color: #ffe9e9;
	border: 1px solid #ffabab;
	color: #a70000;
	border-radius: 10px;
	font-size: 0.9rem;
}

#pirurito {
	text-align: center;
	margin-top: 1rem;
}

#pirurito svg path {
	fill: #444444;
	mix-blend-mode: exclusion;
}

#form {
	background: rgba(0, 0, 0, 0.03);
	display: flex;
	border: 1px solid #c4b998;
	flex-direction: column;
	padding: 0.5rem;
	border-radius: 10px;
	margin-bottom: 0.5rem;
}

#game-header img {
	width: 100%;
}

.thermal-print-wrapper {
	position: relative;
	display: inline-block;
}

.thermal-print {
	transition: all 0.3s;
	filter: grayscale(100%) contrast(2);
	image-rendering: pixelated;
	mix-blend-mode: multiply;
	opacity: 0.8;
}

.thermal-print-wrapper::after {
	transition: all 0.3s;
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: repeating-linear-gradient(
		to bottom,
		rgba(255, 248, 220, 0.2) -1px,
		rgba(255, 248, 220, 1) 0px,
		transparent 0px,
		transparent 16.5px
	);
	pointer-events: none;
}

.thermal-print:hover {
	filter: none;
	image-rendering: initial;
	mix-blend-mode: normal;
	opacity: 1;
}

.thermal-print-wrapper:hover::after {
	background: none;
}
