/* =========================================================
   3D-GESCHENKBOX  (basiert auf dem Code von @... CodePen,
   nach Vanilla portiert & unter .gift-stage gescoped)
   ========================================================= */

/* Bühne, in der die isometrische Box zentriert sitzt */
.gift-stage {
	position: relative;
	width: 100%;
	height: 360px;
	margin: 4px auto 0;
	perspective: 1200px;
	overflow: visible;
}

/* container for floating text */
.gift-stage .qmark {
	font-size: 3em;
	font-weight: 700;
	color: #013243;
	text-shadow: 0 0 1em 0em rgba(250,250,0,1);
	position: absolute;
	transform:
		translateZ(1em)
		translateX(.8em)
		translateY(.5em)
		rotateX(-90deg)
		rotateY(45deg);
}

/* the container for the 3d stuffs */
.gift-stage .floor {
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1;
	height: 20em;
	position: absolute;
	width: 20em;
	font-size: 13px;
	transform-origin: 50% 50%;
	transform:
		translate(-50%, -55%)
		rotateX(45deg) rotateZ(45deg);
	transform-style: preserve-3d;
	cursor: pointer;
}

/* box container and parts */
.gift-stage .box {
	z-index: 1;
	position: relative;
	transform: translateZ(6em);
	transform-style: preserve-3d;
}
.gift-stage .face {
	height: 6em;
	width: 6em;
	position: absolute;
	z-index: 1;
	box-shadow: 0 0 .5em .25em rgba(0,0,0,.2) inset;
}
.gift-stage .top {
	background-color: black;
	background-image:
		linear-gradient(-90deg, transparent 49%, rgb(50,110,160)),
		linear-gradient(0deg, transparent 49%, rgb(50,110,160));
	transform: translateZ(3em);
	box-shadow: 0 0 0 .4em rgba(50,150,200,1) inset;
}
.gift-stage .right {
	background-image: linear-gradient(
		to top,
		rgba(0,0,0,0) 33%,
		rgba(225,225,0,1) 34% 65%,
		rgba(0,0,0,0) 66%);
	background-color: rgb(20,130,170);
	transform: rotateY(90deg) translateZ(3em);
}
.gift-stage .left {
	background-image: linear-gradient(
		to right,
		rgba(0,0,0,0) 33%,
		rgba(200,200,0,1) 33% 66%,
		rgba(0,0,0,0) 66%);
	background-color: rgb(0,110,150);
	transform: rotateX(-90deg) translateZ(3em);
}

/* lid and parts */
.gift-stage .lid {
	animation: wiggle 1.5s infinite cubic-bezier(.2,1.2,.6,1.1);
	position: absolute;
	height: 6.5em;
	width: 6.5em;
	transform-style: preserve-3d;
	z-index: 2;
	cursor: pointer;
}
.gift-stage .open {
	transform: translateZ(16em);
	animation: up 1s ease-out, floaty 2s 1s infinite linear;
}
.gift-stage .close {
	transform: translateZ(4em);
	animation: down 1s ease-out, wiggle 1.5s 1s infinite cubic-bezier(.2,1.2,.6,1.1);
}
.gift-stage .ltop {
	height: 6.5em;
	width: 6.5em;
	background-color: rgb(50,150,200);
	background-image:
		linear-gradient(to right,
			rgba(0,0,0,0) 33%,
			rgba(225,225,0,1) 34% 65%,
			rgba(0,0,0,.1) 66% 68%,
			rgba(0,0,0,0) 69%),
		linear-gradient(to top,
			rgba(0,0,0,0) 33%,
			rgba(200,200,0,1) 34% 65%,
			rgba(0,0,0,0) 66%);
}
.gift-stage .lright {
	z-index: 2;
	background-color: rgb(20,130,170);
	width: 3em;
	height: 6.5em;
	transform: rotateY(90deg) translateX(1.5em) translateZ(5em);
	background-image: linear-gradient(to top,
		rgba(0,0,0,0) 33%,
		rgba(200,200,0,1) 34% 65%,
		rgba(0,0,0,0) 66%);
}
.gift-stage .lleft {
	height: 3em;
	width: 6.5em;
	background-image: linear-gradient(to right,
		rgba(0,0,0,0) 33%,
		rgba(225,225,0,1) 33% 66%,
		rgba(0,0,0,0) 66%);
	background-color: rgb(0,110,150);
	transform: rotateX(-90deg) translateY(1.5em) translateZ(5em);
}

.gift-stage .shadow {
	position: absolute;
	top: 54%;
	left: 57.3%;
	z-index: 0;
	height: 18em;
	width: 7.9em;
	border-radius: 25% 0 0 0;
	background: linear-gradient(#4446, rgba(0,0,0,0));
	transform: rotateZ(-20deg) translateZ(3em);
}
.gift-stage .shadow2 {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 0;
	height: 20em;
	width: 6em;
	background: linear-gradient(#4446, rgba(0,0,0,0));
	transform: translateZ(3em);
}
.gift-stage .shadow3 {
	position: absolute;
	top: 45%;
	left: 36.5%;
	z-index: 0;
	height: 22em;
	width: 8em;
	border-radius: 0 50% 0 0;
	background: linear-gradient(#4446, rgba(0,0,0,0));
	transform: rotateZ(13deg) translateZ(3em);
}

/* animations (aus deinem Code) */
@keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes floaty {
	0%   { transform: translateZ(16em); }
	50%  { transform: translateZ(15.5em); }
}
@keyframes wiggle {
	0%   { transform: translateZ(4em) rotateX(0deg) rotateY(0deg); }
	11%  { transform: translateZ(4em) rotateX(1deg) rotateY(-1deg); }
	22%  { transform: translateZ(4em) rotateX(1deg) rotateY(1deg); }
	33%  { transform: translateZ(4em) rotateX(1deg) rotateY(0deg); }
	44%  { transform: translateZ(4em) rotateX(-1deg) rotateY(-1deg); }
	55%  { transform: translateZ(4em) rotateX(1deg) rotateY(1deg); }
	66%  { transform: translateZ(4em) rotateX(-1deg) rotateY(0deg); }
	100% { transform: translateZ(4em) rotateX(0deg); }
}
@keyframes down { 0% { transform: translateZ(16em); } 100% { transform: translateZ(4em); } }
@keyframes up   { 0% { transform: translateZ(4em) rotateX(0deg); } 100% { transform: translateZ(16em) rotateX(0deg); } }

/* =========================================================
   KONFETTI beim Öffnen
   ========================================================= */
.confetti-piece {
	position: fixed;
	width: 9px;
	height: 14px;
	border-radius: 2px;
	pointer-events: none;
	z-index: 60;
	will-change: transform, opacity;
	transform: translate(-50%, -50%);
	animation: burst var(--dur, 900ms) cubic-bezier(.15,.7,.3,1) forwards;
}
@keyframes burst {
	0%   { transform: translate(-50%, -50%) translate(0, 0) rotate(0) scale(1);   opacity: 1; }
	100% { transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r)) scale(.5); opacity: 0; }
}

@keyframes popIn {
	0%   { transform: scale(.7); opacity: 0; }
	100% { transform: scale(1); opacity: 1; }
}

/* =========================================================
   GESCHENK-OVERLAY (3D-Box -> Ticket)
   ========================================================= */
.reveal-overlay {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(1, 50, 67, .82);
	animation: fade-in .25s ease;
}
.ov-close {
	position: fixed;
	top: max(12px, env(safe-area-inset-top, 12px));
	right: 14px;
	width: 42px;
	height: 42px;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: var(--blue);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0,0,0,.4);
	z-index: 3;
}
.gift-scene,
.ticket-scene {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
}
.ticket-scene .ticket-card {
	animation: ticketIn .6s cubic-bezier(.2,1.3,.5,1.05) both;
}
@keyframes ticketIn {
	0%   { transform: translateY(40px) scale(.4) rotate(-8deg); opacity: 0; }
	55%  { transform: translateY(0) scale(1.06) rotate(2deg);   opacity: 1; }
	100% { transform: translateY(0) scale(1) rotate(0); }
}

.ticket-card {
	width: 340px;
	max-width: 86vw;
	background: #fff;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0,0,0,.4);
	font-family: 'Segoe UI', system-ui, sans-serif;
	text-align: left;
	color: #1c1c1c;
}

.ticket-photo {
	position: relative;
	height: 200px;
	background:
		radial-gradient(circle at 65% 45%, #7a2218 0%, #2a0d0a 55%, #140605 100%);
}
.ticket-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.ticket-photo img.noimg { display: none; }
.ticket-photo .photo-fallback {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 46px;
	color: rgba(255,255,255,.85);
}
.ticket-badge {
	position: absolute;
	top: 0;
	left: 0;
	background: #2ecc71;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	padding: 7px 13px;
	border-radius: 0 0 8px 0;
	box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.ticket-body {
	padding: 16px 18px 14px;
}
.ticket-body h3 {
	margin: 0 0 8px;
	font-size: 23px;
	font-weight: 700;
	color: #111;
}
.ticket-body p { margin: 6px 0; font-size: 15px; color: #333; }
.ticket-body .t-date { color: #444; }
.ticket-body .t-label { color: #666; }
.ticket-body .t-mobile {
	font-weight: 700;
	color: #1a73e8;
	text-decoration: underline;
	cursor: pointer;
}
.ticket-body a.t-mobile:hover { color: #0c50b5; }
.ticket-body .t-mobile::before { content: '📱 '; text-decoration: none; }

.ticket-footer {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 18px;
	background: #f3f5f7;
	border-top: 1px solid #e5e8eb;
}
.t-venue-logo {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #d9dee3;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	flex: 0 0 auto;
}
.ticket-footer strong { font-size: 15px; color: #111; }
.ticket-footer .t-city { font-size: 13px; color: #777; letter-spacing: .03em; }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
	.gift-stage .lid,
	.gift-stage .open,
	.gift-stage .close { animation: none !important; }
}
