/* ============================================================
   GREEN BADGER — GLOBAL CONTEXTUAL GUIDE
   Prototype: green-badger-guide-prototype/{index.html,style.css,script.js}
   Ports the bottom-nav GUIDE button + idle nudge + contextual sheet body.
   Rides on top of app-shell.css's .dm-app-nav / .dm-sheet primitives —
   consumes their tokens (--dm-black/--dm-gold/--dm-cream/--dm-hairline/
   --gutter/--dm-tap/--dm-safe-*) instead of a private palette.
   ============================================================ */

.dm-guide-btn {
	position: absolute;
	top: 0;
	left: 50%;
	z-index: 2;
	width: 74px;
	height: 88px;
	transform: translate(-50%, -20px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	border: 1px solid rgba(184, 154, 91, .55);
	border-radius: 38px 38px 16px 16px;
	background: var(--dm-black);
	color: var(--dm-gold);
	box-shadow: 0 -10px 26px rgba(0, 0, 0, .35);
	cursor: pointer;
	transition: transform .24s ease, border-color .24s ease;
	/* Same reset as the rest of this pack's touch targets — without it a
	   real/simulated tap paints Chrome's default blue tap-highlight fill. */
	-webkit-tap-highlight-color: transparent;
}

.dm-guide-btn:active {
	transform: translate(-50%, -17px) scale(.97);
}

/* Astra's theme.json `button:hover/:focus{background:var(--ast-global-color-1)}`
   ((0,1,1) specificity) outranks the plain `.dm-guide-btn{background:...}`
   rule above ((0,1,0)) on hover/focus/active — restate it here at equal
   specificity, same fight already documented on .dm-sheet__close. */
.dm-guide-btn:hover,
.dm-guide-btn:focus,
.dm-guide-btn:active {
	background: var(--dm-black);
}

.dm-guide-btn:focus {
	outline: none;
}

.dm-guide-btn:focus-visible {
	outline: 1px solid var(--dm-gold);
	outline-offset: 2px;
}

.dm-guide-btn__badge {
	display: block;
	width: 52px;
	height: 52px;
}

/* Same canonical badger asset Daily Stamp uses (control-hunger-badger-
   engraving.png) — no new/re-cropped image, only fit + idle motion here. */
.dm-guide-btn__badger {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	/* Ultra-low-amplitude "alive" idle breathing — always on, never the
	   attention-seeking nudge. Origin at the character's own centre. */
	transform-origin: 50% 55%;
	animation: dm-guide-breathe 4.6s ease-in-out infinite;
}

.dm-guide-btn__label {
	font-family: 'Noto Sans JP', system-ui, sans-serif;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: .2em;
}

@keyframes dm-guide-breathe {
	0%, 100% { transform: scale(1) rotate(0deg); }
	50%      { transform: scale(1.015) rotate(.4deg); }
}

/* One-shot idle reaction — reserved for the ~5s idle trigger, never looping
   on its own. JS adds/removes this class; it never opens the sheet. */
.dm-guide-btn.is-nudging {
	animation: dm-guide-nudge-pulse .9s ease 2;
}

.dm-guide-btn.is-nudging .dm-guide-btn__badger {
	animation: dm-guide-breathe 4.6s ease-in-out infinite, dm-guide-nudge-tilt .9s ease 2;
}

@keyframes dm-guide-nudge-pulse {
	50% { transform: translate(-50%, -24px) scale(1.035); border-color: var(--dm-gold); }
}

@keyframes dm-guide-nudge-tilt {
	50% { transform: scale(1.02) rotate(-1deg); }
}

/* --------------------------------------------------------------- nudge */

.dm-guide-nudge {
	position: absolute;
	z-index: 3;
	left: 50%;
	top: -40px;
	transform: translate(-50%, 6px);
	padding: 8px 12px;
	background: var(--dm-cream);
	color: var(--dm-black);
	font-family: 'Noto Sans JP', system-ui, sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	box-shadow: 0 7px 22px rgba(0, 0, 0, .35);
	transition: opacity .28s ease, transform .28s ease;
}

.dm-guide-nudge::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -6px;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: var(--dm-cream);
	border-bottom: 0;
}

.dm-guide-nudge.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ------------------------------------------------------------- sheet body
   Same restrained system as the rest of the pack: hairline separators, no
   pill/card chrome, no rounded SaaS button. */

.dm-guide-copy {
	margin: 0 0 18px;
	color: rgba(244, 241, 232, .68);
	font-family: 'Noto Sans JP', system-ui, sans-serif;
	font-size: 13px;
	line-height: 1.8;
}

.dm-guide-actions {
	display: grid;
	gap: 10px;
}

.dm-guide-action {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	border: 1px solid var(--dm-hairline);
	background: none;
	color: var(--dm-cream);
	padding: 15px 16px;
	font-family: 'Noto Sans JP', system-ui, sans-serif;
	font-size: 14px;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: border-color .3s ease, background-color .3s ease;
	-webkit-tap-highlight-color: transparent;
}

.dm-guide-action:hover,
.dm-guide-action:focus-visible {
	border-color: var(--dm-gold);
	background: rgba(184, 154, 91, .06);
}

.dm-guide-action:focus {
	outline: none;
}

/* :not(:focus-visible) so this never fights the gold-tint hover/focus-visible
   rule above — it only closes the gap for plain :focus (no visible ring),
   where Astra's button:focus background would otherwise still win. */
.dm-guide-action:focus:not(:focus-visible) {
	background: none;
}

.dm-guide-action:focus-visible {
	outline: 1px solid var(--dm-gold);
	outline-offset: -3px;
}

.dm-guide-action b {
	flex: none;
	color: var(--dm-gold);
	font-weight: 400;
}

.dm-guide-secondary {
	margin-top: 14px;
	width: 100%;
	border: 0;
	background: none;
	color: rgba(244, 241, 232, .5);
	padding: 12px;
	font-family: 'Noto Sans JP', system-ui, sans-serif;
	font-size: 13px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

/* Same Astra button:hover/:focus background fight as .dm-sheet__close /
   .dm-guide-btn above — restated here at equal-or-higher specificity. */
.dm-guide-secondary:hover,
.dm-guide-secondary:focus,
.dm-guide-secondary:active {
	background: none;
}

.dm-guide-secondary:focus {
	outline: none;
}

.dm-guide-secondary:focus-visible {
	outline: 1px solid var(--dm-gold);
	outline-offset: -2px;
}

/* "BADGER GUIDE" kicker, reproduced as the sheet primitive's own two-line
   title block rather than new markup in the shared .dm-sheet__head. */
#dm-guide-sheet .dm-sheet__title::before {
	content: "BADGER GUIDE";
	display: block;
	margin-bottom: 6px;
	color: var(--dm-gold);
	font-family: 'Noto Sans JP', system-ui, sans-serif;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .22em;
	text-transform: none;
}

/* Checkout must never be interrupted: idle reaction detuned to almost
   nothing, no pulse, minimal footprint. The sheet itself stays click-only
   and unaffected — this only quiets the character's own idle motion. */
.dm-guide-btn[data-dm-guide-context="checkout"] .dm-guide-btn__badger {
	animation-duration: 8s;
}

.dm-guide-btn[data-dm-guide-context="checkout"].is-nudging,
.dm-guide-btn[data-dm-guide-context="checkout"].is-nudging .dm-guide-btn__badger {
	animation: none;
}

@media (max-width: 380px) {
	.dm-guide-btn { width: 66px; height: 80px; }
	.dm-guide-btn__badge { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
	.dm-guide-btn,
	.dm-guide-btn__badger,
	.dm-guide-btn.is-nudging,
	.dm-guide-btn.is-nudging .dm-guide-btn__badger,
	.dm-guide-nudge {
		animation: none !important;
		transition: opacity .18s linear !important;
	}
}
