/* Playhouse Bubble Letter Builder — matches the Canva design.
   Every rule is scoped under .ph-lb so theme / Elementor kit styles don't leak in.
   Change the variables below to restyle. */
.ph-lb {
	--ph-sage: #8B9E7C;
	--ph-sage-dark: #76896A;
	--ph-peach: #E8C9AE;
	--ph-cream: #FCF7F3;
	--ph-text: #5A4636;
	--ph-muted: #B79A7C;
	--ph-ring: #7F95A6;
	--ph-card: #FFFFFF;
	--ph-radius: 16px;
	--ph-font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--ph-bubble-font: "Fredoka", "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif;
	--b: 72px; /* bubble width, set by the script so the name always fits on one line */

	max-width: 660px;
	margin: 0 auto;
	color: var(--ph-text);
	font-family: var(--ph-font);
	box-sizing: border-box;
}
.ph-lb *, .ph-lb *::before, .ph-lb *::after { box-sizing: border-box; }
.ph-lb h2, .ph-lb h3, .ph-lb button, .ph-lb input, .ph-lb select, .ph-lb dt, .ph-lb dd, .ph-lb p, .ph-lb label {
	font-family: var(--ph-font);
	text-transform: none;
	letter-spacing: normal;
}

.ph-lb .ph-lb__title { margin: 0 0 .35em; font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; color: var(--ph-text); line-height: 1.2; }
.ph-lb .ph-lb__lead { margin: 0 0 1.5rem; font-size: 1.05rem; color: var(--ph-text); }

.ph-lb .ph-lb__card {
	background: var(--ph-card);
	border-radius: var(--ph-radius);
	padding: 1.25rem 1.25rem 1.4rem;
	margin-bottom: 1.25rem;
	box-shadow: 0 1px 3px rgba(90, 70, 54, .06);
}
.ph-lb .ph-lb__step { display: flex; align-items: center; gap: .55rem; margin: 0 0 1rem; font-size: 1.1rem; font-weight: 700; color: var(--ph-text); line-height: 1.3; }
.ph-lb .ph-lb__badge {
	display: inline-grid; place-items: center; flex: none;
	width: 1.6rem; height: 1.6rem; border-radius: 50%;
	background: var(--ph-sage); color: #fff; font-size: .85rem; font-weight: 700;
}
.ph-lb .ph-lb__label { display: block; margin: .9rem 0 .35rem; font-size: .95rem; font-weight: 400; color: var(--ph-text); }
.ph-lb .ph-lb__label:first-of-type { margin-top: 0; }
.ph-lb .ph-lb__hint { color: var(--ph-muted); font-size: .85rem; }
.ph-lb .ph-lb__input {
	display: block; width: 100%; height: auto; min-height: 0;
	margin: 0;
	padding: .55rem .8rem;
	border: 2px solid var(--ph-peach);
	border-radius: 10px;
	background-color: #fff;
	color: var(--ph-text);
	font-size: 1rem; line-height: 1.4;
	box-shadow: none;
}
.ph-lb select.ph-lb__input {
	-webkit-appearance: none; appearance: none;
	padding-right: 2.4rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235A4636' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .9rem center;
	cursor: pointer;
}
.ph-lb .ph-lb__name { text-transform: uppercase; letter-spacing: .06em; }
.ph-lb .ph-lb__name::placeholder { color: #C9B7A6; opacity: 1; }
.ph-lb .ph-lb__input:focus { outline: none; border-color: var(--ph-sage); box-shadow: 0 0 0 3px rgba(139, 158, 124, .25); }

/* Preview */
.ph-lb .ph-lb__preview { padding: .25rem 1.25rem 1.25rem; margin-bottom: 1.25rem; }
.ph-lb .ph-lb__subhead { margin: 0 0 1.1rem; font-size: 1.1rem; font-weight: 700; color: var(--ph-text); }
.ph-lb .ph-lb__bubbles {
	display: flex; flex-wrap: nowrap; justify-content: center; align-items: center;
	gap: calc(var(--b) * .12);
	padding: 8px 6px;
	min-height: calc(var(--b) * 1.14 + 16px);
	overflow: hidden;
}
.ph-lb .ph-lb__empty { margin: 0; color: var(--ph-muted); font-size: .95rem; text-align: center; }

/* Bubble: pale "pillow" rim + glossy raised centre, like the Canva design */
.ph-lb .ph-lb__bubble {
	--c: #3FA9E0; --hi: #A9DBF3; --lo: #2479A6; --rim1: #DCEFFA; --rim2: #A6D3EE; --fg: #fff;
	position: relative; flex: none; display: block;
	width: var(--b); height: calc(var(--b) * 1.14);
	margin: 0; padding: calc(var(--b) * .085);
	border: 0; border-radius: 34% / 30%;
	background: linear-gradient(165deg, var(--rim1) 0%, var(--rim2) 100%);
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, .7),
		0 calc(var(--b) * .06) calc(var(--b) * .14) rgba(40, 30, 20, .16);
	color: var(--fg);
	cursor: pointer;
	outline: 3px solid transparent; outline-offset: 3px;
	transition: transform .15s ease, outline-color .15s ease;
}
.ph-lb .ph-lb__bubble:hover,
.ph-lb .ph-lb__bubble:focus { background: linear-gradient(165deg, var(--rim1) 0%, var(--rim2) 100%); color: var(--fg); }
.ph-lb .ph-lb__face {
	position: relative;
	display: grid; place-items: center;
	width: 100%; height: 100%;
	border-radius: 30% / 26%;
	background: radial-gradient(120% 90% at 35% 18%, var(--hi) 0%, var(--c) 52%, var(--lo) 100%);
	box-shadow:
		inset 0 calc(var(--b) * -.05) calc(var(--b) * .09) rgba(0, 0, 0, .2),
		inset 0 calc(var(--b) * .04) calc(var(--b) * .06) rgba(255, 255, 255, .55),
		0 1px 2px rgba(0, 0, 0, .12);
	font-family: var(--ph-bubble-font);
	font-weight: 700;
	font-size: calc(var(--b) * .5);
	line-height: 1;
	overflow: hidden;
}
.ph-lb .ph-lb__face::before {
	content: ""; position: absolute; top: 5%; left: 14%; right: 14%; height: 26%;
	border-radius: 50% / 60%;
	background: linear-gradient(rgba(255, 255, 255, .8), rgba(255, 255, 255, 0));
	pointer-events: none;
}
.ph-lb .ph-lb__face span { position: relative; }
.ph-lb .ph-lb__bubble:hover { transform: translateY(-2px); }
.ph-lb .ph-lb__bubble.is-active { outline-color: var(--ph-ring); }
.ph-lb .ph-lb__bubble:focus-visible { outline-color: var(--ph-sage-dark); }
.ph-lb .ph-lb__bubble.is-placeholder { cursor: default; opacity: .9; }
.ph-lb .ph-lb__bubble.is-placeholder:hover { transform: none; }
.ph-lb .ph-lb__note { margin: 1rem 0 0; text-align: center; font-size: .8rem; color: var(--ph-muted); }

/* Colour step */
.ph-lb .ph-lb__nav { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.ph-lb .ph-lb__arrow {
	display: inline-grid; place-items: center;
	width: 2rem; height: 2rem; padding: 0; margin: 0;
	border: 0; border-radius: 50%; background: transparent;
	color: var(--ph-text); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.ph-lb .ph-lb__arrow:hover:not(:disabled),
.ph-lb .ph-lb__arrow:focus:not(:disabled) { background: var(--ph-cream); color: var(--ph-text); }
.ph-lb .ph-lb__arrow:disabled { opacity: .3; cursor: default; background: transparent; }
.ph-lb .ph-lb__current { font-weight: 600; }
.ph-lb .ph-lb__char { color: var(--ph-ring); }
.ph-lb .ph-lb__swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.ph-lb .ph-lb__swatch {
	width: 36px; height: 36px; padding: 0; margin: 0;
	border: 0; border-radius: 50%; cursor: pointer;
	outline: 2px solid transparent; outline-offset: 3px;
	transition: transform .12s ease;
}
.ph-lb .ph-lb__swatch:hover { transform: scale(1.08); }
.ph-lb .ph-lb__swatch.is-light { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.ph-lb .ph-lb__swatch[aria-pressed="true"] { outline-color: var(--ph-text); }
.ph-lb .ph-lb__swatch:focus-visible { outline-color: var(--ph-sage); }
.ph-lb .ph-lb__all {
	margin: 1rem 0 0; padding: 0; border: 0; background: none;
	color: var(--ph-sage-dark); font-size: .9rem; font-weight: 400;
	text-decoration: underline; cursor: pointer;
}
.ph-lb .ph-lb__all:hover, .ph-lb .ph-lb__all:focus { background: none; color: var(--ph-text); }
.ph-lb .ph-lb__colour-card.is-disabled { opacity: .5; pointer-events: none; }

/* Summary */
.ph-lb .ph-lb__summary { margin: 0 0 1.25rem; }
.ph-lb .ph-lb__summary > div { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; font-size: .95rem; }
.ph-lb .ph-lb__summary dt, .ph-lb .ph-lb__summary dd { margin: 0; font-weight: inherit; }
.ph-lb .ph-lb__summary dd { text-align: right; word-break: break-all; }
.ph-lb .ph-lb__summary .ph-lb__total { margin-top: .4rem; padding-top: .7rem; border-top: 1px solid #EFE6DD; font-weight: 700; font-size: 1.05rem; }
.ph-lb .ph-lb__add {
	display: block; width: 100%;
	margin: 0; padding: .85rem 1rem;
	border: 0; border-radius: 10px;
	background: var(--ph-sage); color: #fff;
	font-size: 1.05rem; font-weight: 700;
	cursor: pointer; transition: background .15s ease;
}
.ph-lb .ph-lb__add:hover:not(:disabled),
.ph-lb .ph-lb__add:focus:not(:disabled) { background: var(--ph-sage-dark); color: #fff; }
.ph-lb .ph-lb__add:disabled { opacity: .55; cursor: not-allowed; background: var(--ph-sage); color: #fff; }
.ph-lb .ph-lb__msg { margin: .8rem 0 0; min-height: 1.2em; font-size: .95rem; text-align: center; }
.ph-lb .ph-lb__msg.is-error { color: #B3261E; }
.ph-lb .ph-lb__msg.is-success { color: var(--ph-sage-dark); }
.ph-lb .ph-lb__msg a { color: inherit; font-weight: 700; }

@media (max-width: 480px) {
	.ph-lb .ph-lb__card { padding: 1rem 1rem 1.15rem; }
	.ph-lb .ph-lb__preview { padding: .25rem 0 1rem; }
	.ph-lb .ph-lb__swatch { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
	.ph-lb .ph-lb__bubble, .ph-lb .ph-lb__swatch { transition: none; }
}
