/* The Boxwit web game. Colors come from the app's Theme.swift; sizes are in rem so big text scales everything. */
.bw {
	--paper: #fff;
	--paper-edge: #d3dae6;
	--tile: #e4eaf4;
	--tile-edge: #bfc9d9;
	--ink: #211e36;
	--muted: #6b6782;
	--brick: #f6e7c6;
	--brick-lit: #fff8e6;
	--brick-edge: #c9a364;
	--gold: #ffc93c;
	--gold-lit: #fff0a8;
	--gold-edge: #b86e08;
	--gold-ink: #6e4506;
	width: min(560px, 100%);
	margin-inline: auto;
	color: var(--ink);
	font-family: var(--font, ui-rounded, 'Nunito', system-ui, sans-serif);
	text-align: left;
	-webkit-user-select: none;
	user-select: none;
}
.bw button {
	font: inherit;
	color: inherit;
	cursor: pointer;
}
.bw button:focus-visible {
	outline: 3px solid var(--blue, #007aff);
	outline-offset: 3px;
}

/* Setup chips */
.bw-setup {
	display: grid;
	gap: 0.5rem;
	margin-bottom: 1rem;
}
.bw-setup-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.bw-setup-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	width: 100%;
	min-height: 52px;
	border: 2px solid var(--paper-edge);
	background: var(--paper);
	border-radius: 18px;
	padding: 0.5rem 0.6rem 0.5rem 1rem;
	font-weight: 800;
	text-align: left;
	box-shadow: 0 3px 0 var(--paper-edge);
}
.bw-setup-toggle b {
	flex: none;
	background: var(--blue, #007aff);
	color: #fff;
	border-radius: 12px;
	padding: 0.3rem 0.8rem;
	font-weight: 900;
}
.bw-chip {
	border: 2px solid var(--paper-edge);
	background: var(--paper);
	border-radius: 999px;
	padding: 0.45rem 0.9rem;
	font-weight: 800;
	font-size: 0.95rem;
	box-shadow: 0 3px 0 var(--paper-edge);
	min-height: 44px;
}
.bw-chip.on {
	background: var(--ink);
	border-color: var(--ink);
	color: #fff;
	box-shadow: 0 3px 0 #000;
}

/* Top bar */
.bw-top {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 0.75rem;
}
.bw-label {
	flex: 1;
	font-weight: 800;
	color: var(--muted);
	font-size: 1rem;
}
.bw-clock {
	background: var(--orange, #ff9500);
	color: #fff;
	font-weight: 900;
	border-radius: 999px;
	padding: 0.45rem 0.9rem;
	box-shadow: 0 3px 0 #c66f00;
	font-variant-numeric: tabular-nums;
}

/* The meter: how many are in the right spot */
.bw-meter {
	display: flex;
	align-items: center;
	gap: 1rem;
	background: var(--c);
	color: #fff;
	border-radius: 24px;
	padding: 1rem 1.25rem;
	box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 70%, #000);
	margin-bottom: 1.25rem;
}
.bw-count {
	margin: 0;
	line-height: 1;
	white-space: nowrap;
}
.bw-count b {
	font-size: 3.2rem;
	font-weight: 900;
}
.bw-count small {
	font-size: 1.3rem;
	font-weight: 900;
	opacity: 0.85;
}
.bw-meter-text {
	flex: 1;
	min-width: 0;
}
.bw-meter-text p {
	margin: 0.4rem 0 0;
	font-weight: 800;
	font-size: 1rem;
	line-height: 1.3;
}
.bw-bars {
	display: flex;
	gap: 6px;
}
.bw-bars i {
	flex: 1;
	height: 10px;
	border-radius: 99px;
	background: rgba(255, 255, 255, 0.35);
	transition: background 0.25s;
}
.bw-bars i.on {
	background: #fff;
}
.bw-hearts {
	margin: 0;
	font-size: 1.2rem;
	line-height: 1.2;
	max-width: 4.2em;
	text-align: right;
}

.bw-clue {
	margin: 0 0 1rem;
	background: var(--paper);
	border-radius: 18px;
	padding: 0.7rem 1rem;
	font-weight: 800;
	box-shadow: 0 3px 0 var(--paper-edge);
}
.bw-clue span {
	display: inline-block;
	background: var(--purple, #af52de);
	color: #fff;
	border-radius: 99px;
	padding: 0 0.6rem;
	margin-right: 0.4rem;
	font-size: 0.85rem;
}

/* The board */
.bw-board-wrap {
	display: flex;
	gap: 0.5rem;
	align-items: stretch;
	justify-content: center;
}
.bw-board {
	display: grid;
	grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
	gap: clamp(6px, 2vw, 12px);
	width: min(100%, calc(var(--cols) * 104px));
	touch-action: none;
}
.bw-board.bw-pack-expressions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	width: 100%;
}
.bw-tile {
	--face: var(--tile);
	--edge: var(--tile-edge);
	position: relative;
	aspect-ratio: 1;
	border: 0;
	padding: 8%;
	border-radius: 18%;
	background: var(--face);
	box-shadow: 0 5px 0 var(--edge);
	display: grid;
	place-items: center;
	transition: transform 0.15s, box-shadow 0.15s;
	touch-action: none;
}
.bw-tile img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
}
/* The selection ring sits inside the tile face, so it never runs into the lip or the next tile. */
.bw-tile.selected {
	transform: translateY(-6px);
	box-shadow: inset 0 0 0 4px var(--blue, #007aff), 0 11px 0 var(--edge);
}
.bw-tile.over {
	box-shadow: inset 0 0 0 4px var(--green, #34c759), 0 5px 0 var(--edge);
}
.bw-tile.dragging {
	z-index: 5;
	transition: none;
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}
.bw-tile.hinted {
	animation: bw-glow 1s ease-in-out infinite alternate;
}
@keyframes bw-glow {
	from {
		box-shadow: inset 0 0 0 4px rgba(255, 204, 0, 0.35), 0 5px 0 var(--edge);
	}
	to {
		box-shadow: inset 0 0 0 4px var(--yellow, #ffcc00), 0 5px 0 var(--edge);
	}
}

/* Letter box: Scrabble bricks. Word play: gold ingots. */
.bw-letter {
	--face: var(--brick);
	--edge: var(--brick-edge);
	background: linear-gradient(var(--brick-lit), var(--brick));
}
.bw-letter span {
	font-size: clamp(1.6rem, 7vw, 2.6rem);
	font-weight: 900;
	color: #2a2016;
}
.bw-word {
	--face: var(--gold);
	--edge: var(--gold-edge);
	background: linear-gradient(var(--gold-lit), var(--gold) 55%);
}
.bw-board .bw-word {
	aspect-ratio: auto;
	min-height: 3.6rem;
	padding: 0.5rem 1rem;
	border-radius: 14px;
	flex: 0 1 auto;
}
.bw-word span {
	font-size: 1.25rem;
	font-weight: 900;
	color: var(--gold-ink);
}

.bw-rowhints {
	display: grid;
	gap: clamp(6px, 2vw, 12px);
	grid-auto-rows: 1fr;
}
.bw-rowhints span {
	display: grid;
	place-items: center;
	font-weight: 900;
	color: var(--muted);
	min-width: 1.6rem;
}

.bw-react {
	text-align: center;
	font-weight: 800;
	color: var(--muted);
	margin: 1.1rem 0 0.5rem;
	min-height: 1.6em;
}
.bw-react.warm {
	color: #1f9d48;
}
.bw-react.cold {
	color: #e0332a;
}
.bw-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Clue history (Easy) */
.bw-history {
	background: var(--paper);
	border-radius: 22px;
	padding: 1rem 1.1rem;
	box-shadow: 0 4px 0 var(--paper-edge);
	margin-top: 0.75rem;
}
.bw-history h3 {
	margin: 0 0 0.6rem;
	font-size: 0.85rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
}
.bw-history ol {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.45rem;
}
.bw-history li {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}
.bw-hn {
	width: 3rem;
	font-weight: 800;
	color: var(--muted);
	font-size: 0.9rem;
}
.bw-hrow {
	flex: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}
.bw-hrow > span {
	border-radius: 9px;
}
.bw-hrow > span.sw {
	box-shadow: 0 0 0 2px var(--blue, #007aff);
}
.bw-hbadge {
	min-width: 3.2rem;
	text-align: center;
	border-radius: 99px;
	font-weight: 900;
	padding: 0.15rem 0.6rem;
	color: #fff;
	background: #a3a1b4;
}
.bw-hbadge.up {
	background: var(--green, #34c759);
}
.bw-hbadge.down {
	background: var(--red, #ff3b30);
}

.bw-mini {
	--face: var(--tile);
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 8px;
	background: var(--face);
	padding: 2px;
}
.bw-mini img {
	width: 100%;
	height: 100%;
}
.bw-mini.bw-letter span {
	font-size: 1rem;
}
.bw-mini.bw-word {
	width: auto;
	padding: 0 0.4rem;
}
.bw-mini.bw-word span {
	font-size: 0.8rem;
}

.bw-foot {
	display: flex;
	justify-content: center;
	gap: 1.5rem;
	margin-top: 1rem;
}
.bw-link {
	background: none;
	border: 0;
	color: var(--blue, #007aff) !important;
	font-weight: 800;
	padding: 0.5rem;
	min-height: 44px;
}

/* Result */
.bw-result {
	display: grid;
	gap: 1rem;
}
.bw-banner {
	background: var(--blue, #007aff);
	color: #fff;
	text-align: center;
	border-radius: 26px;
	padding: 1.4rem 1rem 1.2rem;
	box-shadow: 0 6px 0 #0055d4;
}
.bw-banner.lost {
	background: #6b6782;
	box-shadow: 0 6px 0 #4b475f;
}
.bw-banner h3 {
	font-size: 2.2rem;
	margin: 0.2rem 0;
	color: #fff;
}
.bw-banner p {
	margin: 0;
	font-weight: 700;
	opacity: 0.9;
}
.bw-stars {
	display: flex;
	justify-content: center;
	gap: 0.4rem;
}
.bw-stars img {
	width: 3.4rem;
	height: 3.4rem;
	filter: grayscale(1) opacity(0.35);
}
.bw-stars img:nth-child(2) {
	transform: translateY(-8px) scale(1.15);
}
.bw-stars img.on {
	filter: none;
	animation: bw-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
	animation-delay: calc(var(--i) * 0.18s);
}
@keyframes bw-pop {
	from {
		opacity: 0;
		scale: 0.3;
	}
}
.bw-pills {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.8rem;
}
.bw-pills span {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 99px;
	padding: 0.25rem 0.8rem;
	font-weight: 800;
}
.bw-inside {
	background: var(--paper);
	border-radius: 24px;
	padding: 1rem;
	box-shadow: 0 4px 0 var(--paper-edge);
	text-align: center;
}
.bw-inside-title {
	margin: 0;
	font-weight: 900;
	color: #1f9d48;
}
.bw-answer {
	font-size: 1.5rem;
	font-weight: 900;
	margin: 0.4rem 0 0;
}
.bw-carton {
	position: relative;
	width: min(260px, 70%);
	margin: 0.5rem auto 0;
	aspect-ratio: 1;
}
.bw-carton img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}
.bw-pop {
	position: absolute;
	left: 8%;
	right: 8%;
	top: 16%;
	display: flex;
	justify-content: center;
	gap: 2px;
}
.bw-pop > span {
	animation: bw-rise 0.6s cubic-bezier(0.2, 1.3, 0.4, 1) both;
	animation-delay: calc(0.3s + var(--i) * 0.08s);
}
.bw-pop .bw-mini {
	width: 2.8rem;
	height: 2.8rem;
	background: none;
}
.bw-pop .bw-mini.bw-letter,
.bw-pop .bw-mini.bw-word {
	background: linear-gradient(var(--brick-lit), var(--brick));
}
.bw-pop .bw-mini.bw-word {
	background: linear-gradient(var(--gold-lit), var(--gold));
	height: 2rem;
}
@keyframes bw-rise {
	from {
		opacity: 0;
		transform: translateY(60%);
	}
}
.bw-answer-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin-top: 0.6rem;
}
.bw-answer-row .bw-mini {
	width: 2.6rem;
	height: 2.6rem;
}
.bw-record {
	margin: 0.6rem 0 0;
	background: #e8f7ec;
	color: #1f7a3c;
	border-radius: 14px;
	padding: 0.6rem 0.8rem;
	font-weight: 800;
}
.bw-actions {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
}
.bw-btn {
	flex: 1 1 12rem;
	min-height: 52px;
	border: 2px solid var(--paper-edge);
	background: var(--paper);
	border-radius: 18px;
	font-weight: 900 !important;
	font-size: 1.1rem;
	box-shadow: 0 4px 0 var(--paper-edge);
}
.bw-btn.primary {
	background: var(--green, #34c759);
	border-color: var(--green, #34c759);
	color: #fff !important;
	box-shadow: 0 4px 0 #24963f;
}
.bw-next-daily {
	margin: 0;
	text-align: center;
	color: var(--muted);
	font-weight: 700;
}
.bw-upsell {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	background: var(--ink);
	color: #fff;
	border-radius: 24px;
	padding: 1.1rem 1.2rem;
}
.bw-upsell img {
	width: 56px;
	height: 56px;
	border-radius: 14px;
	flex: none;
}
.bw-upsell h4 {
	margin: 0 0 0.3rem;
	font-size: 1.15rem;
	font-weight: 900;
}
.bw-upsell p {
	margin: 0 0 0.8rem;
	font-weight: 600;
	opacity: 0.85;
	font-size: 1rem;
	line-height: 1.45;
}
.bw-store {
	display: inline-block;
	background: #fff;
	color: var(--ink) !important;
	text-decoration: none;
	font-weight: 900;
	border-radius: 14px;
	padding: 0.6rem 1rem;
}
.bw-store.soon {
	opacity: 0.85;
}

@media (max-width: 420px) {
	.bw-meter {
		padding: 0.85rem 1rem;
		gap: 0.75rem;
	}
	.bw-count b {
		font-size: 2.6rem;
	}
	.bw-tile {
		border-radius: 16%;
	}
}

/* The app's painted art, sized to sit in a line of text */
.bw-art {
	width: 1.5em;
	height: 1.5em;
	object-fit: contain;
	vertical-align: middle;
	flex: none;
}
.bw-chip,
.bw-label,
.bw-setup-toggle span,
.bw-react,
.bw-record,
.bw-pills span,
.bw-inside-title {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}
.bw-react,
.bw-inside-title {
	display: flex;
	justify-content: center;
}
.bw-record {
	display: flex;
	text-align: left;
}
.bw-clock-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	background: var(--orange, #ff9500);
	border-radius: 999px;
	padding: 0.3rem 0.85rem 0.3rem 0.45rem;
	box-shadow: 0 3px 0 #c66f00;
}
.bw-clock-pill .bw-art {
	width: 1.6em;
	height: 1.6em;
}
.bw-clock-pill .bw-clock {
	background: none;
	box-shadow: none;
	padding: 0;
}
.bw-hearts {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 2px;
	max-width: 5.6rem;
}
.bw-heart {
	width: 1.6rem;
	height: 1.6rem;
}
.bw-check {
	width: 1.3em;
	height: 1.3em;
}
.bw-audio {
	display: flex;
	justify-content: center;
	gap: 0.6rem;
	margin-top: 0.5rem;
}
.bw-sound {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 44px;
	border: 2px solid var(--paper-edge);
	background: var(--paper);
	border-radius: 999px;
	padding: 0.35rem 0.9rem;
	font-weight: 800;
	font-size: 0.95rem;
}
.bw-sound svg {
	width: 1.2em;
	height: 1.2em;
	color: var(--blue, #007aff);
}
.bw-sound.off {
	color: var(--muted);
}
.bw-sound.off svg {
	color: var(--muted);
}
