/* The phone app bar: world tiles that recolour the bar for the world you are in. Phones only; desktop is unchanged. */
@property --dja-u { syntax: "<color>"; inherits: true; initial-value: #D4FF3A; }

.dja, .dja-peek { display: none; }

@media (max-width: 760px) {
	/* The tiles take over from the old strips and chip row on phones. */
	.djx-strip, .djx-chips, .djw-strip { display: none !important; }

	.dja {
		display: block;
		position: relative;
		padding: calc(16px + env(safe-area-inset-top)) 10px 16px;
		background: linear-gradient(180deg, var(--dja-u) 0%, color-mix(in srgb, var(--dja-u) 70%, #F3F2EE) 100%);
		transition: --dja-u .45s cubic-bezier(.22, 1, .36, 1);
		view-transition-name: dja-bar;
		font-family: "DM Sans", system-ui, sans-serif;
	}
	.dja-tiles { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
	.dja-tile {
		position: relative;
		z-index: 1;
		display: grid;
		justify-items: center;
		align-content: center;
		gap: 3px;
		min-height: 58px;
		padding: 7px 0 6px;
		border-radius: 14px;
		background: rgba(255, 255, 255, .92);
		box-shadow: 0 1px 0 rgba(18, 18, 18, .06), 0 4px 10px -6px rgba(18, 18, 18, .35);
		color: #121212;
		text-decoration: none;
		-webkit-tap-highlight-color: transparent;
		transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), background .3s, color .3s;
	}
	.dja-tile:active { transform: scale(.92); }
	.dja-tile:focus-visible { outline: 2px solid #121212; outline-offset: 2px; }
	.dja-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: color-mix(in srgb, var(--c) 45%, #fff); color: #121212; transition: background .3s, transform .35s cubic-bezier(.34, 1.56, .64, 1); }
	.dja-ic svg { width: 19px; height: 19px; }
	.dja-lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
	.dja-lbl.is-long { font-size: 9.5px; letter-spacing: -.045em; text-overflow: clip; overflow: visible; }
	@media (max-width: 380px) { .dja-lbl { font-size: 10.5px; } .dja-lbl.is-long { font-size: 8.4px; } }

	/* The ink pill sits under the world you are in and glides to the one you tap. */
	.dja-glide { position: absolute; z-index: 0; top: 0; left: 0; height: 100%; border-radius: 14px; background: #121212; box-shadow: 0 0 0 2px #121212, 0 8px 18px -6px rgba(18, 18, 18, .55); transition: transform .45s cubic-bezier(.34, 1.3, .64, 1), width .45s cubic-bezier(.22, 1, .36, 1), background .35s ease; opacity: 0; }
	.dja.is-ready .dja-glide { opacity: 1; }
	.dja.is-ready .dja-tile.is-on { background: transparent; box-shadow: none; color: #121212; }
	.dja-tile.is-on .dja-ic { background: rgba(255, 255, 255, .78); transform: translateY(-1px) scale(1.06); }
	.dja.is-ready .dja-tile.is-on .dja-lbl { color: #121212; font-weight: 800; }



	/* Living header: each world has its own ambient motion behind the tiles, all year round. */
	.dja-fx { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .5s ease; }
	.dja-fx.is-on { opacity: 1; }
	/* A faint sparkle pattern drifting under everything, like a festive app header but for every day. */
	.dja::before { content: ""; position: absolute; inset: 0; z-index: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cg fill='%23fff' fill-opacity='.22'%3E%3Cpath d='M12 4q0 8 8 8-8 0-8 8 0-8-8-8 8 0 8-8z'/%3E%3Cpath d='M46 36q0 5 5 5-5 0-5 5 0-5-5-5 5 0 5-5z'/%3E%3Ccircle cx='50' cy='10' r='1.6'/%3E%3Ccircle cx='22' cy='50' r='1.3'/%3E%3C/g%3E%3C/svg%3E"); background-size: 64px 64px; animation: dja-drift 18s linear infinite; pointer-events: none; }
	@keyframes dja-drift { to { background-position: 64px -64px; } }
	/* The marketplace header carries the world colour on down, like one continuous app header. */
	body.djx .djx-header { background: color-mix(in srgb, var(--dja-u) 30%, #F3F2EE); transition: background .45s ease, top .35s cubic-bezier(.22, 1, .36, 1); }

	/* Tile icons move a little, each in its own way, taking turns so the row feels alive without being busy. */
	.dja-ic svg { transform-origin: 50% 55%; animation: 3.6s ease-in-out infinite both; }
	.dja-tile[data-world="home"] .dja-ic svg { animation-name: dja-i-home; animation-delay: 3.4s; }
	.dja-tile[data-world="shop"] .dja-ic svg { animation-name: dja-i-shop; }
	.dja-tile[data-world="nexus"] .dja-ic svg { animation-name: dja-i-nexus; animation-delay: .6s; }
	.dja-tile[data-world="studio"] .dja-ic svg { animation-name: dja-i-studio; animation-delay: 1.2s; }
	.dja-tile[data-world="quick"] .dja-ic svg { animation-name: dja-i-quick; animation-delay: 1.8s; }
	.dja-tile[data-world="renew"] .dja-ic svg { animation-name: dja-i-renew; animation-delay: 2.4s; }
	.dja-tile[data-world="hire"] .dja-ic svg { animation-name: dja-i-hire; animation-delay: 3s; }
	.dja-tile.is-on .dja-ic svg { animation-duration: 2.4s; animation-delay: 0s; }
	/* The :D turns on its side into a smiling face, then back. */
	@keyframes dja-i-home { 0%, 55%, 100% { transform: none; } 66%, 84% { transform: rotate(90deg) scale(1.05); } }
	@keyframes dja-i-shop { 0%, 62%, 100% { transform: none; } 70% { transform: translateY(-4px) rotate(-8deg); } 78% { transform: translateY(0) rotate(6deg); } 86% { transform: rotate(-3deg); } }
	@keyframes dja-i-nexus { 0%, 60%, 100% { transform: none; } 70% { transform: scaleX(.6); } 80% { transform: scaleX(1.08); } 88% { transform: scaleX(.96); } }
	@keyframes dja-i-studio { 0%, 60%, 100% { transform: none; } 72% { transform: rotate(-18deg) scale(1.08); } 84% { transform: rotate(14deg); } 92% { transform: rotate(-4deg); } }
	@keyframes dja-i-quick { 0%, 60%, 100% { transform: none; filter: none; } 66% { transform: translateY(-3px) scale(1.15); filter: drop-shadow(0 0 4px #FF7A1A); } 72% { transform: scale(.94); filter: drop-shadow(0 0 7px #FFD84D); } 80% { transform: scale(1.06); filter: none; } }
	@keyframes dja-i-renew { 0%, 55% { transform: rotate(0deg); } 85%, 100% { transform: rotate(360deg); } }
	@keyframes dja-i-hire { 0%, 60%, 100% { transform: none; } 68% { transform: rotate(10deg) translateY(-2px); } 78% { transform: rotate(-8deg); } 88% { transform: rotate(4deg); } }

	/* Tap a world: its colour floods the bar from the finger, the tile pops. */
	.dja { overflow: hidden; }
	.dja-flood { position: absolute; inset: 0; z-index: 0; pointer-events: none; clip-path: circle(0 at var(--x) var(--y)); animation: dja-flood .5s cubic-bezier(.22, 1, .36, 1) forwards; }
	@keyframes dja-flood { to { clip-path: circle(150% at var(--x) var(--y)); } }
	.dja-tiles, .dja-get, .dja-ios { position: relative; z-index: 1; }
	.dja-tile.is-pop .dja-ic { animation: dja-pop .5s cubic-bezier(.34, 1.56, .64, 1); }
	@keyframes dja-pop { 0% { transform: scale(.8) rotate(-8deg); } 55% { transform: scale(1.22) rotate(4deg); } 100% { transform: translateY(-1px) scale(1.06); } }

	/* The skeleton that stands in for the next world while it loads. */
	.dja-skel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 58; display: grid; align-content: start; gap: 14px; padding: 14px 16px; background: #F3F2EE; animation: dja-fade .2s ease both; }
	@keyframes dja-fade { from { opacity: 0; } }
	.dja-sk { display: block; border-radius: 14px; background: linear-gradient(100deg, #E6E3DC 30%, #F7F5F0 50%, #E6E3DC 70%) 0 0 / 300% 100%; animation: dja-shimmer 1.1s linear infinite; }
	@keyframes dja-shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
	.dja-sk-search { height: 46px; border-radius: 999px; }
	.dja-sk-row { display: flex; gap: 12px; }
	.dja-sk-dot { flex: 1; height: 54px; border-radius: 16px; }
	.dja-sk-hero { height: 190px; border-radius: 22px; }
	.dja-sk-card { flex: 1; height: 160px; border-radius: 18px; }

	/* Scroll back up past the tiles: a compact strip slides in from the top. */
	.dja-peek { position: fixed; top: 0; left: 0; right: 0; z-index: 70; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; background: color-mix(in srgb, var(--dja-u) 88%, #fff); box-shadow: 0 6px 18px -10px rgba(18, 18, 18, .45); transform: translateY(-110%); transition: transform .35s cubic-bezier(.22, 1, .36, 1); }
	html.dja-peek-on .dja-peek { transform: none; }
	.dja-peek-tile { display: flex; align-items: center; justify-content: center; gap: 4px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .9); color: #121212; text-decoration: none; font: 700 10px/1 "DM Sans", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; transition: transform .2s; }
	.dja-peek-tile:active { transform: scale(.92); }
	.dja-peek-tile svg { flex: none; width: 16px; height: 16px; }
	.dja-peek-tile span { display: none; }
	.dja-peek-tile.is-on { background: #121212; color: var(--c); }
	html.dja-peek-on .djx-header { top: calc(46px + env(safe-area-inset-top)); }
	.djx-header { transition: top .35s cubic-bezier(.22, 1, .36, 1); }

	/* Search hints that roll upward. */
	.dja-has-hint { position: relative; }
	.dja-hint { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; gap: .3em; overflow: hidden; color: #75726B; font: 400 15px/1 "DM Sans", system-ui, sans-serif; pointer-events: none; white-space: nowrap; }
	.dja-hint[hidden] { display: none; }
	.dja-hint-win { display: inline-block; height: 1.3em; overflow: hidden; }
	.dja-hint-word { display: inline-block; line-height: 1.3em; color: #3C3B38; font-weight: 600; }

	/* Get-the-app row and the iPhone how-to. */
	.dja-get { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 8px 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, .9); color: #121212; font-size: 13px; line-height: 1.25; animation: dja-in .4s cubic-bezier(.22, 1, .36, 1) both; }
	.dja-get[hidden], .dja-ios[hidden] { display: none; }
	.dja-get img { flex: none; border-radius: 9px; }
	.dja-get span { flex: 1; min-width: 0; }
	.dja-get strong { display: block; font-size: 14px; }
	.dja-get-go { all: unset; flex: none; padding: 9px 14px; border-radius: 999px; background: #121212; color: #D4FF3A; font-weight: 700; font-size: 13px; cursor: pointer; }
	.dja-get-x { all: unset; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #5C5A55; font-size: 20px; cursor: pointer; }
	.dja-ios { margin-top: 10px; padding: 14px 16px; border-radius: 16px; background: #fff; color: #121212; font-size: 14px; line-height: 1.45; box-shadow: 0 10px 30px -12px rgba(18, 18, 18, .4); animation: dja-in .35s cubic-bezier(.22, 1, .36, 1) both; }
	.dja-ios p { margin: 0 0 6px; font-size: 15px; }
	.dja-ios ol { margin: 0 0 12px; padding-left: 20px; }
	.dja-ios svg { vertical-align: -2px; }
	@keyframes dja-in { from { opacity: 0; transform: translateY(-6px); } }

	/* The bottom bar picks up the world colour, and clears the iPhone home indicator. */
	.djx-botnav { bottom: calc(12px + env(safe-area-inset-bottom)); }
	.djx-botnav a[aria-current] { color: var(--dja-u); }
	/* World pages are not body.djx, so the bar's own link layout is repeated here. */
	html body .djx-botnav a, html body .djx-botnav .djx-botnav-cart { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 56px; padding: 6px 0; color: #F3F2EE; font: 700 12px/1.2 "DM Sans", system-ui, sans-serif; text-decoration: none; text-indent: 0; }
	html body .djx-botnav a[aria-current] { color: var(--dja-u); }

	/* Pages slide in like an app; the tile bar stays put and morphs to the new world. */
	@view-transition { navigation: auto; }
	::view-transition-old(root) { animation: dja-out .18s ease both; }
	::view-transition-new(root) { animation: dja-new .32s cubic-bezier(.22, 1, .36, 1) both; }
	::view-transition-group(dja-bar) { animation-duration: .4s; }
	@keyframes dja-out { to { opacity: 0; } }
	@keyframes dja-new { from { opacity: 0; transform: translateY(14px); } }
}

/* Opened as the installed app: no browser bar, so give the status bar room. */
@media (display-mode: standalone) and (max-width: 760px) {
	.dja-get { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
	.dja, .dja-tile, .dja-ic, .dja-glide, .dja-peek, .djx-header { transition: none !important; }
	.dja-flood, .dja-sk, .dja-tile.is-pop .dja-ic, .dja-ic svg { animation: none !important; }
	.dja-fx { display: none !important; }
	.dja::before { animation: none !important; }
	::view-transition-old(root), ::view-transition-new(root), ::view-transition-group(dja-bar) { animation: none !important; }
}

/* Wishlist: the theme's empty state, dressed in the DEJOIY look. */
.djx-wrap .empty-wishlist-block { max-width: 560px; margin: 8px 0 56px; padding: 40px 32px; border-radius: 24px; background: #fff; text-align: center; box-sizing: border-box; }
.djx-wrap .empty-wishlist-block h1 { margin: 0 0 10px !important; font: 800 clamp(26px, 3vw, 34px)/1.1 "Bricolage Grotesque", "DM Sans", sans-serif !important; letter-spacing: -.02em !important; text-transform: none !important; color: #121212 !important; }
.djx-wrap .empty-wishlist-block p { margin: 0 0 22px !important; font: 400 17px/1.5 "DM Sans", system-ui, sans-serif !important; color: #3C3B38 !important; }
.djx-wrap .empty-wishlist-block p:last-child { margin: 0 !important; }
.djx-wrap .empty-wishlist-block .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 28px; border: 0 !important; border-radius: 999px !important; background: #121212 !important; color: #D4FF3A !important; font: 700 16px/1 "DM Sans", system-ui, sans-serif !important; letter-spacing: 0 !important; text-transform: none !important; text-decoration: none !important; transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.djx-wrap .empty-wishlist-block .btn:hover { transform: translateY(-2px); }
.djx-wrap .empty-wishlist-block .btn span { color: inherit !important; background: none !important; }
@media (max-width: 760px) { .djx-wrap .empty-wishlist-block { padding: 32px 20px; } }
