/* popcorn.css - CineHaus popcorn cursor + popcorn game
   Recovered 2026-08-23 from the styles.css snapshot. Loaded by index.html
   AFTER styles.css. Paths are relative to the site root, so this file must
   live next to index.html and styles.css. */

/* POPCORN CURSOR EFFECT */
.popcorn {
	position: absolute;
	z-index: 2;
	pointer-events: none;
	user-select: none;
	transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
	filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.4));
	will-change: transform;
}

.popcorn-inner {
	display: inline-block;
	line-height: 1;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
}

.popcorn-inner.stage-kernel {
	width: 70px;
	height: 80px;
	background-image: url("assets/popcorn/kernel.png");
	opacity: 0;
	animation:
		kernelAppear 0.15s ease forwards,
		kernelShake 0.1s ease-in-out 0.15s infinite;
}

@keyframes kernelAppear {
	from { transform: scale(0.4); opacity: 0; }
	to   { transform: scale(1);   opacity: 1; }
}

@keyframes kernelShake {
	0%, 100% { transform: translate(-3px, -2px) rotate(-3deg); }
	25%      { transform: translate(3px, -2.5px) rotate(3deg); }
	50%      { transform: translate(2.5px, 2.5px) rotate(-2deg); }
	75%      { transform: translate(-2px, 2.5px) rotate(2deg); }
}

.popcorn-inner.stage-half {
	width: 110px;
	height: 110px;
	background-image: url("assets/popcorn/popcorn-half.png");
	animation: halfPop 0.12s ease-out forwards;
}

@keyframes halfPop {
	from { transform: scale(0.75); }
	to   { transform: scale(1.1); }
}

.popcorn-inner.stage-full {
	width: var(--size, 170px);
	height: var(--size, 170px);
	animation: popcornFull 3.2s ease forwards;
}

@keyframes popcornFull {
	0%   { transform: scale(1.4); opacity: 1; }
	8%   { transform: scale(1);   opacity: 1; }
	55%  { transform: scale(1);   opacity: 1; }
	100% { transform: scale(0.95); opacity: 0; }
}


/* ===== POPCORN GAME HUD (responsive) ===== */
.pop-fixed-layer,
.pop-top-popups {
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 9999;
}

.pop-top-popups {
	display: flex;
	justify-content: flex-end;
	align-items: flex-start;
	padding: 14px;
	gap: 8px;
}

.pop-top-num {
	background: rgba(0, 22, 37, 0.8);
	border: 1px solid rgba(253, 243, 222, 0.22);
	color: var(--cosmic-latte);
	border-radius: 999px;
	padding: 6px 10px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	transform: translateY(-10px);
	opacity: 0;
	transition: transform 0.25s ease, opacity 0.25s ease;
}
.pop-top-num.is-on {
	transform: translateY(0);
	opacity: 1;
}

.pop-float-num {
	position: fixed;
	transform: translate(-50%, 0);
	background: rgba(0, 22, 37, 0.82);
	border: 1px solid rgba(253, 243, 222, 0.22);
	color: var(--cosmic-latte);
	border-radius: 999px;
	padding: 6px 10px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	z-index: 9999;
	pointer-events: none;
	opacity: 0;
	transition: transform 0.25s ease, opacity 0.25s ease;
}
.pop-float-num.is-on {
	opacity: 1;
	transform: translate(-50%, -10px);
}

.pop-hud {
	position: fixed;
	top: 10px;
	right: 10px;
	z-index: 9998;
	width: min(440px, calc(100vw - 20px));
	max-height: calc(100svh - 20px);
	pointer-events: auto;
}

.pop-hud-panel {
	background: rgba(0, 22, 37, 0.86);
	border: 1px solid rgba(253, 243, 222, 0.22);
	border-radius: 12px;
	padding: 12px;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	overflow: hidden;
}

.pop-hud-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}

.pop-hud-title {
	font-family: "Anton", "LT Energy", "Helvetica Neue", Helvetica, Arial, sans-serif;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	font-size: 16px;
}

.pop-hud-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.pop-reset {
	height: 40px;
	padding: 0 12px;
	border-radius: 999px;
	border: 1px solid rgba(253, 243, 222, 0.35);
	background: transparent;
	color: var(--cosmic-latte);
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	font-size: 11px;
}

.pop-test {
	height: 40px;
	padding: 0 12px;
	border-radius: 999px;
	border: 1px solid var(--gold);
	background: rgba(201, 161, 84, 0.18);
	color: var(--gold);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 11px;
	cursor: pointer;
}

.pop-hud-count {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.pop-hud-count span {
	max-width: 44vw;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pop-currency {
	width: 36px;
	height: 36px;
	object-fit: contain;
	flex: 0 0 auto;
}

.pop-currency--mini {
	width: 18px;
	height: 18px;
}

.pop-hud-sub {
	margin-top: 6px;
	font-size: 12px;
	opacity: 0.85;
	font-variant-numeric: tabular-nums;
}

.pop-shop {
	margin-top: 10px;
}

.pop-shop-title {
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 12px;
	margin-bottom: 8px;
}

.pop-shop-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 44svh;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	padding-right: 2px;
}

.pop-shop-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
	align-items: stretch;
}

.pop-shop-item,
.pop-upgrade-btn {
	border-radius: 12px;
	border: 1px solid rgba(253, 243, 222, 0.22);
	background: rgba(253, 243, 222, 0.06);
	color: var(--cosmic-latte);
	padding: 10px;
	text-align: left;
	min-height: 44px; /* tap target */
}

.pop-shop-item:disabled,
.pop-upgrade-btn:disabled {
	opacity: 0.55;
}

.pop-shop-left {
	min-width: 0;
}

.pop-shop-name {
	font-weight: 800;
	letter-spacing: 0.02em;
}

.pop-shop-desc {
	margin-top: 2px;
	font-size: 12px;
	opacity: 0.85;
}

.pop-shop-right {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: center;
	gap: 6px;
}

.pop-shop-cost {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.pop-shop-tag {
	font-size: 10px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	opacity: 0.85;
}

.pop-upgrade-top {
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 10px;
}

.pop-upgrade-sub {
	margin-top: 2px;
	font-size: 12px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.pop-upgrade-max {
	margin-top: 6px;
	font-size: 10px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	opacity: 0.85;
}

.pop-shop-mystery {
	border-radius: 12px;
	border: 1px dashed rgba(253, 243, 222, 0.25);
	padding: 12px;
	display: flex;
	justify-content: space-between;
	gap: 10px;
}

.pop-owned-board {
	position: fixed;
	left: 10px;
	top: 10px;
	z-index: 9997;
	width: min(220px, calc(100vw - 20px));
	pointer-events: none;
}

.pop-owned-col-items {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.pop-owned-slot {
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	background: rgba(0, 22, 37, 0.55);
	border: 1px solid rgba(253, 243, 222, 0.18);
}

.pop-owned-emoji {
	font-size: 18px;
	line-height: 1;
}

.pop-share-menu {
	position: fixed;
	inset: 0;
	z-index: 10001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}
.pop-share-menu.is-visible {
	opacity: 1;
	pointer-events: auto;
}
.pop-share-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	cursor: pointer;
}
.pop-share-card {
	position: relative;
	z-index: 1;
	width: min(380px, 100%);
	background: rgba(0, 22, 37, 0.96);
	border: 1px solid rgba(253, 243, 222, 0.22);
	border-radius: 14px;
	padding: 20px;
	text-align: center;
}
.pop-share-x {
	position: absolute;
	top: 6px;
	right: 10px;
	background: transparent;
	border: none;
	color: var(--cosmic-latte);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
}
.pop-share-x:hover { color: var(--gold); }
.pop-share-title {
	font-family: "Anton", "LT Energy", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 20px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin-bottom: 14px;
}
.pop-share-options {
	display: grid;
	gap: 8px;
}
.pop-share-opt {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	border-radius: 999px;
	border: 1px solid rgba(253, 243, 222, 0.3);
	background: rgba(253, 243, 222, 0.06);
	color: var(--cosmic-latte);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-size: 12px;
	cursor: pointer;
	text-decoration: none;
}
.pop-share-opt:hover {
	background: var(--gold);
	border-color: var(--gold);
	color: var(--rick-black);
	text-decoration: none;
}

.pop-finish-overlay {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, 0.6);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}
.pop-finish-overlay.is-visible {
	opacity: 1;
	pointer-events: auto;
}
.pop-finish-card {
	width: min(520px, 100%);
	background: rgba(0, 22, 37, 0.92);
	border: 1px solid rgba(253, 243, 222, 0.22);
	border-radius: 14px;
	padding: 18px;
	text-align: center;
}
.pop-finish-title {
	font-family: "Anton", "LT Energy", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 26px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.pop-finish-sub {
	margin-top: 8px;
	opacity: 0.85;
}
.pop-finish-time {
	margin-top: 10px;
	font-size: 34px;
	font-weight: 900;
	font-variant-numeric: tabular-nums;
}
.pop-finish-actions {
	margin-top: 14px;
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
}
.pop-finish-btn {
	height: 42px;
	padding: 0 16px;
	border-radius: 999px;
	border: 1px solid rgba(253, 243, 222, 0.35);
	background: var(--cosmic-latte);
	color: var(--rick-black);
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	font-size: 11px;
	cursor: pointer;
}
.pop-finish-btn:hover {
	background: var(--gold);
	border-color: var(--gold);
}
.pop-finish-btn-ghost {
	background: transparent;
	color: var(--cosmic-latte);
}
.pop-finish-btn-ghost:hover {
	background: rgba(253, 243, 222, 0.10);
	border-color: rgba(253, 243, 222, 0.45);
	color: var(--cosmic-latte);
}

/* Mobile tightening: prevent side clipping when numbers get big */
@media (max-width: 520px) {
	.pop-hud {
		top: 8px;
		right: 8px;
		width: calc(100vw - 16px);
	}
	.pop-owned-board {
		left: 8px;
		top: auto;
		bottom: 8px;
		width: calc(100vw - 16px);
	}
	.pop-owned-col-items {
		justify-content: flex-start;
	}
	.pop-hud-title { font-size: 14px; }
	.pop-hud-count span { max-width: 52vw; }
	.pop-shop-row { grid-template-columns: 1fr; }
	.pop-shop-right { align-items: flex-start; }
	.pop-shop-item, .pop-upgrade-btn { width: 100%; }
}


/* Reduced motion: keep the game usable, drop the flying popcorn. */
@media (prefers-reduced-motion: reduce) {
	.popcorn { display: none !important; }
	.popcorn-inner { animation: none !important; transition: none !important; }
}

/* --- Layout additions (2026-08-23) ---
   The recovered CSS never declared a layout for the shop button itself, so the
   name block and the price block stacked. These four lines put them back on
   one row. Safe to tweak. */
.pop-shop-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	cursor: pointer;
}
.pop-upgrade-btn { cursor: pointer; }
