/* Photo Clash: what the TV and the phones share. Photos are instant prints
   (white frame, thicker at the bottom, a strip of tape), and each theme is its
   own object: a newsprint front page, a store listing, a social post. Cards
   are sized in em, so the TV scales them by its height and phones by width. */

@import url("https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Pacifico&family=UnifrakturCook:wght@700&display=swap");

:root {
	--pc: var(--cyan);
	--flash: #fffbe6;
	--paper: #f2eee3;
	--newsink: #1d1b18;
	--star: #ffb400;
	--sn-blue: #2f6fde;
	--tape: #fff6b3d9;
}

/* ---------- Logo ---------- */

.pc-logo {
	display: inline-grid;
	justify-items: center;
	line-height: 0.9;
	font-size: clamp(56px, 15vw, 96px);
}

/* "Photo" sits in a viewfinder. */
.pc-logo-photo {
	position: relative;
	z-index: 1;
	padding: 0.08em 0.28em 0.12em;
	font-size: 0.62em;
	font-stretch: 80%;
	letter-spacing: -0.02em;
	background:
		linear-gradient(var(--ink), var(--ink)) top left / 0.4em 0.07em,
		linear-gradient(var(--ink), var(--ink)) top left / 0.07em 0.4em,
		linear-gradient(var(--ink), var(--ink)) top right / 0.4em 0.07em,
		linear-gradient(var(--ink), var(--ink)) top right / 0.07em 0.4em,
		linear-gradient(var(--ink), var(--ink)) bottom left / 0.4em 0.07em,
		linear-gradient(var(--ink), var(--ink)) bottom left / 0.07em 0.4em,
		linear-gradient(var(--ink), var(--ink)) bottom right / 0.4em 0.07em,
		linear-gradient(var(--ink), var(--ink)) bottom right / 0.07em 0.4em;
	background-repeat: no-repeat;
}

.pc-logo-photo::after {
	content: "";
	position: absolute;
	top: 0.2em;
	right: -0.32em;
	width: 0.16em;
	height: 0.16em;
	border-radius: 50%;
	background: var(--coral);
	border: 0.03em solid var(--ink);
	animation: rec 1.2s steps(1) infinite;
}

@keyframes rec {
	50% {
		opacity: 0;
	}
}

/* "Clash" is stamped on a burst. */
.pc-logo-clash {
	position: relative;
	z-index: 0;
	margin-top: 0.14em;
	padding: 0.06em 0.3em 0.14em;
	color: var(--ink);
	font-weight: 800;
	font-stretch: 75%;
	letter-spacing: -0.04em;
	transform: rotate(-4deg);
	text-shadow: 0.04em 0.04em 0 var(--surface);
}

.pc-logo-clash::before {
	content: "";
	position: absolute;
	inset: -0.12em -0.1em;
	z-index: -1;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-3 -3 110 110' preserveAspectRatio='none'%3E%3Cpolygon points='0,18 9,10 6,0 20,7 32,0 40,8 54,1 61,9 76,2 82,11 97,6 94,20 100,34 93,46 100,60 94,72 99,88 85,87 80,100 66,91 52,99 42,90 27,98 20,88 4,93 7,78 0,64 6,50 0,36' transform='translate%284 4%29' fill='%23000'/%3E%3Cpolygon points='0,18 9,10 6,0 20,7 32,0 40,8 54,1 61,9 76,2 82,11 97,6 94,20 100,34 93,46 100,60 94,72 99,88 85,87 80,100 66,91 52,99 42,90 27,98 20,88 4,93 7,78 0,64 6,50 0,36' fill='%23ffe066' stroke='%23000' stroke-width='3' stroke-linejoin='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* ---------- Prints: avatars and code letters ---------- */

.pc-avatar {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 1.9em;
	height: 2.15em;
	padding: 0.14em 0.14em 0.38em;
	border: 2px solid var(--ink);
	border-radius: 3px;
	/* The colored "picture" inside the print's white frame. */
	background:
		linear-gradient(var(--av), var(--av)) 0.14em 0.14em / calc(100% - 0.28em) calc(100% - 0.52em) no-repeat,
		var(--surface);
	font-weight: 800;
	line-height: 1;
	box-shadow: 2px 2px 0 var(--ink);
}

.pc-avatar.small {
	font-size: 0.8em;
}

.pc-code-tile {
	display: inline-grid;
	place-items: center;
	width: 1.05em;
	padding: 0.06em 0 0.22em;
	border: 0.04em solid var(--ink);
	border-radius: 0.05em;
	background: var(--surface);
	box-shadow: 0.05em 0.05em 0 var(--ink);
	transform: rotate(var(--tilt, 0deg));
	animation: print-drop 0.6s var(--ease-spring) both;
	animation-delay: calc(var(--i) * 90ms);
}

.pc-code-tile:nth-child(1) { --tilt: -5deg; background: linear-gradient(var(--pink), var(--pink)) 0.06em 0.06em / calc(100% - 0.12em) 72% no-repeat, var(--surface); }
.pc-code-tile:nth-child(2) { --tilt: 3deg; background: linear-gradient(var(--yellow), var(--yellow)) 0.06em 0.06em / calc(100% - 0.12em) 72% no-repeat, var(--surface); }
.pc-code-tile:nth-child(3) { --tilt: -2deg; background: linear-gradient(var(--cyan), var(--cyan)) 0.06em 0.06em / calc(100% - 0.12em) 72% no-repeat, var(--surface); }
.pc-code-tile:nth-child(4) { --tilt: 5deg; background: linear-gradient(var(--lilac), var(--lilac)) 0.06em 0.06em / calc(100% - 0.12em) 72% no-repeat, var(--surface); }

@keyframes print-drop {
	from {
		opacity: 0;
		transform: translateY(-0.6em) rotate(calc(var(--tilt, 0deg) * -3)) scale(1.2);
	}
}

/* ---------- Theme cards ---------- */

.pc-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	border: 2px solid var(--ink);
	color: var(--ink);
	font-size: inherit;
	line-height: 1.25;
	text-align: left;
}

.pc-photo {
	position: relative;
	margin: 0;
	overflow: hidden;
	background: #ddd9cf;
}

.pc-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pc-photo.is-empty {
	display: grid;
	place-items: center;
	background:
		repeating-linear-gradient(-45deg, #0000 0 0.6em, #0000000d 0.6em 1.2em),
		var(--surface);
	outline: 2px dashed var(--ink);
	outline-offset: -0.5em;
}

.pc-photo-pick {
	display: grid;
	justify-items: center;
	gap: 0.4em;
	width: 100%;
	height: 100%;
	border: 0;
	background: none;
	color: var(--ink);
	font: inherit;
	font-weight: 800;
	font-size: 1.15em;
	cursor: pointer;
	place-content: center;
}

.pc-photo-pick-icon {
	width: 3em;
	height: 3em;
	padding: 0.5em;
	border: 2px solid var(--ink);
	border-radius: 50%;
	background: var(--yellow);
	fill: none;
	stroke: var(--ink);
	stroke-width: 2;
	box-shadow: 3px 3px 0 var(--ink);
	transition: transform 0.25s var(--ease-spring);
}

.pc-photo-pick:hover .pc-photo-pick-icon,
.pc-photo-pick:focus-visible .pc-photo-pick-icon {
	transform: rotate(-10deg) scale(1.1);
}

/* Inputs take on the printed text's look. */
.pc-input {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0.1em 0.2em;
	border: 0;
	border-radius: 0.2em;
	background: #ffe0662e;
	box-shadow: inset 0 -2px 0 currentColor;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	line-height: inherit;
	resize: none;
	overflow: hidden;
	transition: background-color 0.2s;
}

.pc-input::placeholder {
	color: currentColor;
	opacity: 0.38;
}

.pc-input:focus {
	outline: none;
	background: #ffe06666;
}

/* --- Newspaper --- */

.t-newspaper {
	gap: 0.4em;
	padding: 0.8em 1em 1em;
	background: var(--paper);
	color: var(--newsink);
	font-family: Georgia, "Times New Roman", serif;
	box-shadow: 0.35em 0.35em 0 var(--ink);
}

.news-mast {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 0.6em;
}

.news-name {
	font-family: "UnifrakturCook", Georgia, serif;
	font-weight: 700;
	font-size: 2.1em;
	font-stretch: normal;
	letter-spacing: 0;
	line-height: 1;
	white-space: nowrap;
}

.news-ear {
	justify-self: start;
	padding: 0.15em 0.4em;
	border: 1px solid currentColor;
	font-style: italic;
	font-size: 0.62em;
	line-height: 1.1;
}

.news-ear:last-child {
	justify-self: end;
	font-style: normal;
	font-weight: 700;
}

.news-date {
	padding: 0.15em 0;
	border-block: 1px solid currentColor;
	border-top: 4px double currentColor;
	font-size: 0.68em;
	text-align: center;
}

.news-headline {
	margin: 0.15em 0 0.1em;
	font-family: "Abril Fatface", Georgia, serif;
	font-weight: 400;
	font-size: 1.9em;
	font-stretch: normal;
	line-height: 1.04;
	letter-spacing: 0;
	text-transform: uppercase;
	text-wrap: balance;
}

.news-photo {
	aspect-ratio: 4 / 3;
	border: 1px solid currentColor;
}


.news-columns {
	height: 2.4em;
	background:
		linear-gradient(90deg, #0000 32%, var(--paper) 32% 34.5%, #0000 34.5% 65.5%, var(--paper) 65.5% 68%, #0000 68%),
		repeating-linear-gradient(#0000 0 0.3em, #1d1b1838 0.3em 0.48em);
}

/* --- Online review --- */

.t-review {
	border-radius: 0.7em;
	background: var(--surface);
	overflow: hidden;
	box-shadow: 0.35em 0.35em 0 var(--ink);
}

.rv-bar {
	display: flex;
	align-items: center;
	gap: 0.7em;
	padding: 0.45em 0.8em;
	background: var(--ink);
	color: var(--yellow);
}

.rv-logo {
	position: relative;
	font-weight: 800;
	font-size: 1.25em;
	font-stretch: 85%;
	letter-spacing: -0.03em;
	line-height: 1.1;
	padding-bottom: 0.25em;
}

.rv-smile {
	position: absolute;
	left: 0;
	bottom: -0.05em;
	width: 100%;
	height: 0.5em;
	fill: none;
	stroke: var(--coral);
	stroke-width: 2.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.rv-search {
	flex: 1;
	height: 1.5em;
	border-radius: 50px;
	background: var(--surface);
}

.rv-body {
	display: grid;
	grid-template-columns: 46% 1fr;
	gap: 0.8em;
	padding: 0.8em;
}

.rv-photo {
	aspect-ratio: 1;
	border: 2px solid var(--ink);
	border-radius: 0.4em;
	background: #f3f1ec;
}

.rv-photo img {
	object-fit: contain;
}

.rv-info {
	display: flex;
	flex-direction: column;
	gap: 0.35em;
	min-width: 0;
}

.rv-title {
	font-size: 1.35em;
	font-weight: 800;
	font-stretch: 90%;
	letter-spacing: -0.01em;
	line-height: 1.1;
	overflow-wrap: anywhere;
}

.rv-stars {
	display: flex;
	gap: 0.06em;
	font-size: 1.5em;
	line-height: 1;
}

/* Bigger to tap while writing. */
.rv-stars:has(button) {
	font-size: 2em;
}

.rv-stars-hint {
	margin-top: -0.2em;
	color: var(--muted);
	font-size: 0.75em;
	font-weight: 600;
}

.rv-star {
	padding: 0;
	border: 0;
	background: none;
	color: #00000022;
	font: inherit;
	line-height: 1;
}

.rv-star.is-on {
	color: var(--star);
	-webkit-text-stroke: 0.04em var(--ink);
}

button.rv-star {
	cursor: pointer;
	transition: transform 0.2s var(--ease-spring);
}

button.rv-star:hover {
	transform: scale(1.15) rotate(-8deg);
}

.rv-price {
	margin-top: auto;
	font-weight: 800;
	font-size: 1.3em;
	font-variant-numeric: tabular-nums;
}

.rv-review {
	display: flex;
	gap: 0.6em;
	padding: 0.7em 0.8em 0.9em;
	border-top: 2px dashed #0003;
}

.rv-reviewer {
	flex: none;
	width: 1.9em;
	height: 1.9em;
	border: 2px solid var(--ink);
	border-radius: 50%;
	background:
		radial-gradient(circle at 50% 38%, var(--ink) 0 0.2em, transparent 0.21em),
		radial-gradient(ellipse 0.5em 0.4em at 50% 100%, var(--ink) 0 98%, transparent),
		var(--av);
}

.rv-text {
	flex: 1;
	min-width: 0;
	font-size: 1.1em;
	font-weight: 600;
	overflow-wrap: anywhere;
}

/* --- Social media --- */

.t-social {
	border-radius: 0.9em;
	background: var(--surface);
	overflow: hidden;
	box-shadow: 0.35em 0.35em 0 var(--ink);
}

.sn-top {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.4em 0.8em;
}

.sn-logo {
	margin-right: auto;
	font-family: "Pacifico", cursive;
	font-size: 1.35em;
	line-height: 1.4;
}

.sn-top-icon {
	width: 1.3em;
	height: 1.3em;
	fill: none;
	stroke: var(--ink);
	stroke-width: 2;
	stroke-linejoin: round;
}

.sn-photo {
	aspect-ratio: 1;
	border-block: 2px solid var(--ink);
}

.sn-actions {
	display: flex;
	gap: 0.7em;
	padding: 0.55em 0.8em 0.1em;
}

.sn-actions svg {
	width: 1.45em;
	height: 1.45em;
	fill: none;
	stroke: var(--ink);
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
}

.sn-actions .sn-save {
	margin-left: auto;
}

.sn-likes {
	padding: 0 0.8em;
	font-weight: 800;
	font-size: 0.9em;
}

.sn-caption {
	padding: 0.2em 0.8em 0.9em;
	font-size: 1.2em;
	font-weight: 600;
	line-height: 1.3;
}

.sn-text {
	overflow-wrap: anywhere;
}

.sn-tag {
	color: var(--sn-blue);
	font-weight: 600;
}

/* --- Just the caption, no photo (voting on a phone) --- */

.pc-card.no-photo .news-mast,
.pc-card.no-photo .news-date,
.pc-card.no-photo .rv-bar,
.pc-card.no-photo .rv-price,
.pc-card.no-photo .sn-top {
	display: none;
}

.pc-card.no-photo .rv-body {
	display: block;
	padding-bottom: 0;
}

.pc-card.no-photo .news-headline {
	font-size: 1.5em;
	margin: 0;
}

.pc-card.no-photo .sn-caption {
	padding-top: 0.8em;
}

/* ---------- Tape, for prints and cards pinned to the wall ---------- */

.pc-tape::before {
	content: "";
	position: absolute;
	top: -0.7em;
	left: 50%;
	z-index: 2;
	width: 5em;
	height: 1.4em;
	background: var(--tape);
	border-left: 1px dashed #0002;
	border-right: 1px dashed #0002;
	transform: translateX(-50%) rotate(-3deg);
	box-shadow: 0 1px 2px #0001;
}

/* ---------- The camera flash ---------- */

.pc-flash {
	position: fixed;
	inset: 0;
	z-index: 100;
	background: var(--flash);
	pointer-events: none;
	animation: flash 0.7s ease-out forwards;
}

@keyframes flash {
	0% {
		opacity: 0;
	}
	8% {
		opacity: 0.95;
	}
	100% {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pc-flash {
		display: none;
	}

	.pc-code-tile,
	.pc-logo-photo::after {
		animation: none;
	}
}

/* A player's own picture, inside their print's frame. */
.pc-avatar {
	position: relative;
}

.pc-avatar-photo {
	position: absolute;
	top: 0.14em;
	left: 0.14em;
	width: calc(100% - 0.28em);
	height: calc(100% - 0.52em);
	object-fit: cover;
}

/* A photo the room has dealt before (shown to the Host and the TV). */
.is-used img {
	filter: saturate(0.35) brightness(0.92);
}

.pc-used {
	position: absolute;
	left: 50%;
	bottom: 0.15em;
	padding: 0 0.5em;
	border-radius: 50px;
	background: var(--ink);
	color: #fff;
	font-weight: 700;
	font-size: 0.75em;
	line-height: 1.5;
	white-space: nowrap;
	transform: translateX(-50%) rotate(-3deg);
}

/* ---------- Framing your photo (Photo Match, on a phone) ---------- */

.pc-photo.is-framing {
	touch-action: none;
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
}

.pc-photo.is-framing:active {
	cursor: grabbing;
}

/* framer.js sizes and places it; it always fills the frame. */
.pc-photo.is-framing img {
	position: absolute;
	top: 0;
	left: 0;
	max-width: none;
	object-fit: fill;
	pointer-events: none;
	-webkit-user-drag: none;
}

.pc-frame-hint {
	position: absolute;
	left: 50%;
	bottom: 0.7em;
	z-index: 2;
	padding: 0.25em 0.8em 0.3em;
	border-radius: 50px;
	background: #000000b3;
	color: #fff;
	font-family: var(--font);
	font-weight: 700;
	font-size: 0.8em;
	white-space: nowrap;
	pointer-events: none;
	transform: translateX(-50%);
	animation: hint-in 0.4s 0.6s var(--ease-out) both;
}

@keyframes hint-in {
	from {
		opacity: 0;
		transform: translate(-50%, 0.5em);
	}
}
