/* KTC first visit: the welcome box, the sign-up bar under the chat and the sign-up forms
   (control/chat.php, system/box/guest_register.php, system/ktc/box/registration.php), plus orientation for everyone: labels under the
   sidebar icons, the room name in the header, and the side panels sliding in on a desktop. Brand values from the KTC design system
   (css/ktc/ktc-base.css): the purple-to-cyan gradient, the KTC display font for the welcome title,
   Outfit (KTC's UI font) for text, and sticker buttons whose bottom edge collapses on press. Spacing sticks to 4/8/16/24/32.
   Loaded after the theme (control/head_load.php); the extra `html` makes these win over it. */
@font-face { font-family: 'KTC'; src: url('../awesome/webfonts/ktc.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }

:where(:root) {
	--ktc-ob-gradient: linear-gradient(135deg, #c471ed, #6b9aeb, #12c2e9);
	--ktc-ob-edge: #5b3f9e;            /* sticker edge under the gradient */
	--ktc-ob-ink: #ffffff;
	--ktc-ob-muted: rgba(255, 255, 255, 0.72);
	--ktc-ob-dim: rgba(255, 255, 255, 0.55);
	--ktc-ob-font: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;   /* KTC's UI font */
}
html .ktc_ob, html .ktc_ob_form, html .ktc_ob_bar, html .ktc_ob_cta, html .ktc_ob_skip, html .ktc_ob_bar_btn,
html .ktc_ob_form .full_input, html .ktc_ob_form select, html .ktc_ob_form .selectboxit-container *, html .ktc_room_title, html .left_menu_label,
html #loginControls, html #loginControls input, html #loginControls button { font-family: var(--ktc-ob-font); }

/* ── Gradient sticker button: the one primary action on each screen ── */
html .ktc_ob_cta {
	display: block; width: 100%; padding: 12px 16px; border: 0; border-radius: 12px;
	background: var(--ktc-ob-gradient); color: var(--ktc-ob-ink);
	font-size: 16px; font-weight: 800; line-height: 1.25; cursor: pointer;
	box-shadow: 0 4px 0 var(--ktc-ob-edge), 0 8px 16px rgba(0, 0, 0, 0.3);
	transition: transform .08s, box-shadow .08s, filter .15s;
}
html .ktc_ob_cta:hover:not(:disabled) { filter: brightness(1.08); }
html .ktc_ob_cta:active { transform: translateY(4px); box-shadow: none; }
/* a second way in beside the primary one (sign-in's Continue as guest): outlined, so the primary still leads */
html .ktc_ob_cta.ktc_ob_cta_quiet { margin-top: 10px; background: none; border: 2px solid rgba(255, 255, 255, 0.28); box-shadow: none; }
html .ktc_ob_cta.ktc_ob_cta_quiet:active { transform: none; background: rgba(255, 255, 255, 0.08); }
/* the way out: text only, so it never competes with the primary action */
html .ktc_ob_skip {
	display: block; width: 100%; margin-top: 8px; padding: 8px; border: 0; background: none;
	color: var(--ktc-ob-dim); font-size: 14px; font-weight: 700; cursor: pointer;
}
html .ktc_ob_skip:hover { color: var(--ktc-ob-ink); }

/* ── Welcome box ── */
html .ktc_ob { padding: 8px 8px 0; text-align: center; }
html .ktc_ob_title { margin: 0 0 16px; font-family: 'KTC', sans-serif; font-size: 32px; line-height: 1.1; color: var(--ktc-ob-ink); }
html .ktc_ob_grad {
	background: var(--ktc-ob-gradient); -webkit-background-clip: text; background-clip: text;
	-webkit-text-fill-color: transparent; color: #12c2e9;
}
html .ktc_ob_text { max-width: 32ch; margin: 0 auto 24px; color: var(--ktc-ob-muted); font-size: 15px; line-height: 1.6; }

/* ── Welcome box: an auto-guest's first question is their name (control/chat.php) ── */
html .ktc_name { padding: 8px 4px 0; text-align: center; }
html .ktc_name .ktc_ob_title { text-wrap: balance; }
html .ktc_name .ktc_ob_field { margin-bottom: 16px; }
/* 16px, or an iPhone zooms the page into the field */
html .ktc_name .full_input { height: 52px; font-size: 18px; font-weight: 700; text-align: center; }
html .ktc_name .ktc_su_status { min-height: 18px; margin-top: 6px; text-align: center; }

/* ── Sign-up bar where guests would type ── */
html .ktc_ob_bar { display: flex; align-items: center; justify-content: center; gap: 16px; height: 40px; padding: 0 8px; }
html .ktc_ob_bar_text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ktc-ob-muted); font-size: 14px; }
html .ktc_ob_bar_btn {
	flex: none; padding: 6px 16px; border: 0; border-radius: 10px;
	background: var(--ktc-ob-gradient); color: var(--ktc-ob-ink); font-size: 14px; font-weight: 800; cursor: pointer;
	box-shadow: 0 3px 0 var(--ktc-ob-edge); transition: transform .08s, box-shadow .08s, filter .15s;
}
html .ktc_ob_bar_btn:hover { filter: brightness(1.08); }
html .ktc_ob_bar_btn:active { transform: translateY(3px); box-shadow: none; }

/* ── Sign-up forms: guest upgrade and Register (js/ktc/ktc_signup.js) ── */
html .ktc_ob_form { padding: 0; text-align: left; }
html .ktc_ob_form_title { font-family:"KTC";  text-align:center; margin: 0 0 4px; color: var(--ktc-ob-ink); font-size: 28px; font-weight: 800; line-height: 1.25; }
html .ktc_ob_form_sub { margin: 0 0 16px; color: var(--ktc-ob-muted); font-size: 14px; line-height: 1.5; }
html .ktc_ob_field { margin-bottom: 12px; }
html .ktc_ob_label { font-family: "Outfit" ;display: block; margin: 0 0 6px; color: var(--ktc-ob-dim); font-size: 12px; font-weight: 800; letter-spacing: .06em; }
html .ktc_su_req { color: #ff8a9e; }
html .ktc_ob_form .full_input { width: 100%; height: 44px; padding: 0 12px; font-size: 15px; }
html .ktc_ob_form .ktc_ob_invalid, html .ktc_ob_form .ktc_ob_invalid:focus { border-color: #ff5c7a !important; box-shadow: 0 0 0 3px rgba(255, 92, 122, 0.2); }
/* the line under each field: a hint, the live check, or what went wrong */
/* empty lines take no room, so the fields sit as close as the login form's */
html .ktc_su_status:empty { display: none; }
html .ktc_su_status { margin: 4px 0 0; color: var(--ktc-ob-dim); font-size: 12px; font-weight: 700; line-height: 1.35; }
html .ktc_su_status.is_ok { color: #8fd14f; }
html .ktc_su_status.is_bad { color: #ff8a9e; }
html .ktc_su_status.is_wait { color: var(--ktc-ob-dim); }
html .ktc_su_general.is_bad { margin: 0 0 8px; font-size: 13px; }
/* password with a show/hide button inside the field */
html .ktc_su_pass { position: relative; }
html .ktc_su_pass .full_input { padding-right: 44px; }
html .ktc_su_toggle { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border: 0; background: none; color: var(--ktc-ob-dim); font-size: 16px; cursor: pointer; }
html .ktc_su_toggle:hover, html .ktc_su_toggle:focus-visible { color: var(--ktc-ob-ink); }
/* age and gender side by side on the Register screen */
html .ktc_su_row { display: flex; gap: 12px; }
html .ktc_su_row > .ktc_ob_field { flex: 1; min-width: 0; }
html .ktc_su_legal { margin: 12px 0 0; color: var(--ktc-ob-dim); font-size: 12px; line-height: 1.5; }
html .ktc_su_legal span, html .ktc_su_switch span { color: #12c2e9; cursor: pointer; font-weight: 700; }
html .ktc_su_switch { margin: 12px 0 0; color: var(--ktc-ob-muted); font-size: 14px; text-align: center; }
html .ktc_ob_form .ktc_ob_cta { margin-top: 4px; }
/* until the form looks right the button says so, rather than failing on click */
html .ktc_ob_cta:disabled { filter: grayscale(.85) brightness(.7); box-shadow: none; transform: none; cursor: not-allowed; }
html .ktc_ob_cta.is_busy { cursor: progress; }

/* ── Orientation: the room you are in, and what the sidebar icons are ── */
/* the logo cell shrinks to the logo, so the room name sits right after it at any width */
html .chat_head_logo { width: 50px; }
html .ktc_room_title { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ktc-ob-ink); font-size: 17px; font-weight: 800; letter-spacing: .01em; }
/* the sidebar stays 50px: the panels and menus that open beside it are placed at left: 50px */
html .left_menu_item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: auto; padding: 6px 0; }
html .left_menu_icon { display: block; }
html .left_menu_label { max-width: 46px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 700; line-height: 1.2; opacity: .75; }
html .left_menu_item:hover .left_menu_label { opacity: 1; }
/* the whole strip is the hit area: an invisible square round each item reaches the strip's edges and
   halfway across the gaps, so a click beside the icon or between two items still lands on one */
html .left_menu_item::after { content: ""; position: absolute; inset: -5px; }
/* the room list marks the room you're in (system/element/room_element*.php): a tint and a solid tag.
   The tag is drawn here, not written in the name, so the list's search doesn't match "here" */
html .ktc_room_here { background: rgba(0, 219, 222, .08); box-shadow: inset 3px 0 0 #00dbde; }
html .ktc_room_here .roomtitle::after { content: "You're here"; display: inline-block; margin-left: 8px; padding: 2px 8px; border: 2px solid #14061f; border-radius: 999px; background: #00dbde; color: #14061f; font-size: 11px; font-weight: 800; line-height: 1.3; vertical-align: 1px; }
/* a desktop's Market and Leaderboards menus: each picture in the tile every menu uses, a rounded square
   with the dark edge (the Casino's icons get the same, css/ktc/ktc-casino.css). The arcade's game art
   already is one, so it stays as drawn */
@media (min-width: 769px) {
	html :is(#store_menu, #leaderboard_menu) :is(.fmenu_img, .fmenu_simg) img:not([src*="arcade/files/icons"]) { width: 32px; height: 32px; box-sizing: border-box; border: 2px solid #14061f; border-radius: 9px; }
}

/* ── Panels: on a desktop the side panels slide in from their edge when they open. Where a panel
   lies over the chat (.cleft2/.cright2) that's this animation (shown again after display: none
   restarts it). Where it sits beside the chat (.cleft/.cright) it grows from its edge and the chat
   gives way as it does, and shrinks away again on closing (js/function_ktc.js); while it moves the
   table keeps to the widths it's given rather than its contents'. Not on page load
   (html.ktc_panels_ready, set by js/function_ktc.js), and phones keep their own transitions
   (css/ktc/ktc-mobile.css) ── */
@media (min-width: 769px) {
	html.ktc_panels_ready #chat_left.cleft2 { animation: ktcPanelLeft .22s cubic-bezier(.16, 1, .3, 1); }
	html.ktc_panels_ready #chat_right.cright2 { animation: ktcPanelRight .22s cubic-bezier(.16, 1, .3, 1); }
	html #left_menu { position: relative; z-index: 202; }
	html #global_chat.ktc_panel_moving { table-layout: fixed; }
	/* top-aligned like the panels, or the side menu beside it drops to its baseline */
	html .ktc_panel_ghost { display: table-cell; vertical-align: top; overflow: hidden; pointer-events: none; }
}
@keyframes ktcPanelRight { from { transform: translateX(100%); opacity: .4; } to { transform: none; opacity: 1; } }

/* ── Sign-up prompt: what members get, when a guest tries something only members can do
   (system/ktc/element/signup_prompt.php, js/ktc/ktc_guest.js). The gradient is the button's alone;
   the icons are solid KTC colours with the dark edge KTC items have (art/README.md). The row for
   what the guest just tried is lit. The ticks land one after another: the one moving part. ── */
:where(:root) {
	--ktc-join-gradient: linear-gradient(135deg, #fc00ff, #7a5cff 50%, #00dbde);
	--ktc-join-edge: #14061f;
	--ktc-join-tick: #8fd14f;
}
html .ktc_join { padding: 8px 4px 0; color: var(--ktc-ob-ink); font-family: var(--ktc-ob-font); text-align: left; }
html .ktc_join_title { margin: 0 0 8px; font-family: 'KTC', sans-serif; font-size: 32px; line-height: 1.1; text-align: center; color: var(--ktc-ob-ink); }
html .ktc_join_lead { max-width: 34ch; margin: 0 auto 16px; color: var(--ktc-ob-muted); font-size: 15px; line-height: 1.5; text-align: center; text-wrap: balance; }
html .ktc_join_list { display: flex; flex-direction: column; gap: 4px; margin: 0 0 24px; padding: 0; list-style: none; }
html .ktc_join_row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px; border: 1px solid transparent; border-radius: 12px; box-sizing: border-box; }
html .ktc_join_row.is_now { border-color: rgba(255, 255, 255, 0.14); background: rgba(122, 92, 255, 0.18); }
html .ktc_join_icon {
	display: inline-flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; box-sizing: border-box;
	border: 2px solid var(--ktc-join-edge); border-radius: 10px; color: #ffffff; font-size: 14px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
html .ktc_join_row.is_now .ktc_join_icon { transform: rotate(-6deg) scale(1.08); }
html .ktc_join_cyan { background: #00dbde; }
html .ktc_join_magenta { background: #fc00ff; }
html .ktc_join_violet { background: #7a5cff; }
html .ktc_join_gold { background: #ffc94a; color: var(--ktc-join-edge); }
html .ktc_join_pink { background: #ff5c9a; }
html .ktc_join_green { background: #8fd14f; color: var(--ktc-join-edge); }
html .ktc_join_white { background: #e9e4f5; color: var(--ktc-join-edge); }
html .ktc_join_text { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
html .ktc_join_tick { flex: none; color: var(--ktc-join-tick); font-size: 14px; animation: ktcJoinTick .36s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(120ms + var(--i, 0) * 60ms); }
@keyframes ktcJoinTick { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
html .ktc_join_cta {
	display: block; width: 100%; min-height: 52px; padding: 14px 16px; border: 0; border-radius: 14px;
	background: var(--ktc-join-gradient); color: #ffffff; font-family: inherit; font-size: 17px; font-weight: 900; line-height: 1.2; cursor: pointer;
	box-shadow: 0 5px 0 var(--ktc-join-edge), 0 10px 20px rgba(0, 0, 0, 0.35);
	transition: transform .08s, box-shadow .08s, filter .15s; touch-action: manipulation;
}
html .ktc_join_cta:active { transform: translateY(5px); box-shadow: none; }
html .ktc_join_skip { display: block; width: 100%; min-height: 44px; margin-top: 8px; padding: 8px; border: 0; background: none; color: var(--ktc-ob-dim); font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
@media (hover: hover) and (pointer: fine) {
	html .ktc_join_cta:hover { filter: brightness(1.08); }
	html .ktc_join_skip:hover { color: var(--ktc-ob-ink); }
}
html .ktc_join_cta:focus-visible, html .ktc_join_skip:focus-visible { outline: 2px solid #00dbde; outline-offset: 3px; }
/* a desktop: the sign-up form beside the list, a line between them */
@media (min-width: 769px) {
	html .ktc_join_split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; padding: 8px 8px 0; }
	html .ktc_join_split .ktc_join_side { padding-right: 32px; }
	html .ktc_join_split .ktc_join_title, html .ktc_join_split .ktc_join_lead { margin-left: 0; text-align: left; }
	html .ktc_join_split .ktc_join_list { margin-bottom: 8px; }
	html .ktc_join_split .ktc_join_main { padding-left: 32px; border-left: 1px solid rgba(255, 255, 255, 0.1); }
	html .ktc_join_split .ktc_ob_form_title { margin-bottom: 16px; text-align: left; }
}
/* guests: what they can't use yet still looks usable; it opens the prompt */
html [data-member] { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
	html .ktc_ob_cta, html .ktc_ob_bar_btn, html .ktc_join_cta { transition: none; }
	html .ktc_join_tick { animation: none; }
	html.ktc_panels_ready #chat_left, html.ktc_panels_ready #chat_right { animation: none; }
	html .ktc_join_row.is_now .ktc_join_icon { transform: none; }
}

/* ── Ben Bot's welcome guide (js/ktc/ktc_tour.js) ── Ben beside a speech bubble, one step at a time, dots for where you
   are, Next as the one gradient button. Dark edges on Ben's tile, as KTC's objects have */
html .ktc_tour { text-align: left; }
html .ktc_tour_body { margin-top: 24px; display: flex; align-items: flex-start; gap: 16px; }
html .ktc_tour_ben { flex: none; width: 72px; height: 72px; padding: 4px; border: 3px solid #14061f; border-radius: 16px; background: #2a2340; animation: ktc_tour_bob 3s ease-in-out infinite; }
html .ktc_tour_bubble { position: relative; flex: 1; min-height: 112px; padding: 16px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); color: var(--ktc-ob-ink); }
html .ktc_tour_bubble::before { content: ""; position: absolute; top: 24px; left: -8px; border: 8px solid transparent; border-left: 0; border-right-color: rgba(255, 255, 255, 0.07); }
html .ktc_tour_step p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ktc-ob-muted); }
html .ktc_tour_step .ktc_tour_title { margin-bottom: 8px; font-size: 18px; font-weight: 800; line-height: 1.2; color: var(--ktc-ob-ink); text-wrap: balance; }
/* the dots are buttons, each a 36px target around its 8px dot; the last one is a gift while there's one waiting */
html .ktc_tour_dots { display: flex; justify-content: center; margin: 8px 0; }
html .ktc_tour_dot { position: relative; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; background: none; cursor: pointer; }
html .ktc_tour_dot:disabled { cursor: default; }
html .ktc_tour_dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); transition: background .2s, transform .2s; }
html .ktc_tour_dot.is_on::before { background: var(--ktc-ob-ink); transform: scale(1.25); }
html .ktc_tour_dot .fa { display: none; }
html .ktc_tour_dots.has_gift .ktc_tour_dot:last-child::before { display: none; }
html .ktc_tour_dots.has_gift .ktc_tour_dot:last-child .fa { display: block; font-size: 15px; color: #ffc94a; animation: ktc_tour_wiggle 2.6s ease-in-out infinite; }
html .ktc_tour_dots.has_gift .ktc_tour_dot.is_on:last-child .fa { font-size: 19px; }
html .ktc_tour_dot:focus-visible { outline: 2px solid #12c2e9; outline-offset: -4px; border-radius: 10px; }
/* clear of the screen's bottom edge (and Android's gesture bar), and both buttons at least 44px tall */
html .ktc_tour_actions { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; }
html .ktc_tour_actions .ktc_ob_skip { flex: 1; width: auto; min-height: 44px; margin: 0; white-space: nowrap; }
/* dark ink on the gradient: white was 2.1 to 3.0:1 across it */
html .ktc_tour .ktc_ob_cta { color: #14061f; }
html .ktc_tour_actions [hidden] { display: none; }
html .ktc_tour_actions .ktc_ob_cta { flex: 2; width: auto; }
html .ktc_tour_join { margin: 12px 0 0; font-size: 14px; text-align: center; color: var(--ktc-ob-dim); }
html .ktc_tour_join button { padding: 0; border: 0; background: none; color: #12c2e9; font: 700 14px/1.4 var(--ktc-ob-font); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
@keyframes ktc_tour_bob { 50% { transform: translateY(-4px); } }
/* Ben Bot's welcome gift (js/ktc/ktc_tour.js). The last step's stage keeps one size from the wrapped present to the
   gift, so nothing jumps when it opens. The present is a solid KTC box with a dark edge (gradient is for buttons); it
   shakes harder while the claim is on its way (.is_opening), bursts, and the gift takes over the step (.is_revealed):
   Ben's bubble falls away, the item in its rarity's frame over rays, a glow and a flash in the rarity's colour
   (--gift-rarity, set with the rarity), sparks, and the gold counting up */
html .ktc_tour_stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 290px; margin-top: 8px; overflow-x: clip; }
html .ktc_tour_stage p { margin: 0; }
html .ktc_tour.is_revealed .ktc_tour_stage { margin-bottom: 16px; }
/* once claimed, Ben's bubble just says "It's yours!": no room kept for a paragraph */
html .ktc_tour.is_revealed .ktc_tour_bubble { min-height: 0; }
html .ktc_tour_stage[hidden] { display: none; }
html .ktc_tour_stage::before { animation: ktc_tour_glow 2.4s ease-in-out infinite; content: ""; position: absolute; top: 50%; left: 50%; width: 280px; height: 280px; margin: -140px 0 0 -140px; border-radius: 50%; pointer-events: none;
	background: radial-gradient(circle, rgba(122, 92, 255, .28), transparent 65%); transition: background .3s; }
html .ktc_tour.is_revealed .ktc_tour_stage::before { background: radial-gradient(circle, color-mix(in srgb, var(--gift-rarity) 32%, transparent), transparent 65%); }
html .ktc_tour_present { position: relative; display: block; width: 112px; height: 108px; padding: 0; border: 0; background: none; scale: 1.35; cursor: pointer; animation: ktc_tour_wiggle 2.6s ease-in-out infinite; -webkit-tap-highlight-color: transparent; }
html .ktc_tour_present:focus-visible { outline: 3px solid #12c2e9; outline-offset: 10px; border-radius: 16px; }
html .ktc_tour_present_lid, html .ktc_tour_present_bow { animation: ktc_tour_hop 1.8s ease-in-out infinite; }
html .ktc_tour_present i { position: absolute; display: block; box-sizing: border-box; border: 3px solid #14061f; }
html .ktc_tour_present_box { left: 8px; right: 8px; bottom: 0; height: 68px; border-radius: 0 0 12px 12px; background: linear-gradient(90deg, transparent 42%, #00dbde 42% 58%, transparent 58%), #7a5cff;
	box-shadow: inset 0 -6px 0 rgba(20, 6, 31, .25), 0 10px 18px rgba(0, 0, 0, .45); }
html .ktc_tour_present_lid { left: 0; right: 0; top: 26px; height: 24px; border-radius: 8px; background: linear-gradient(90deg, transparent 40%, #00dbde 40% 60%, transparent 60%), #fc00ff;
	box-shadow: inset 0 4px 0 rgba(255, 255, 255, .25); }
html .ktc_tour_present_bow { left: 50%; top: 0; width: 56px; height: 30px; margin-left: -28px; border: 0 !important; }
html .ktc_tour_present_bow::before, html .ktc_tour_present_bow::after { content: ""; position: absolute; bottom: 0; width: 26px; height: 24px; box-sizing: border-box; border: 3px solid #14061f; border-radius: 50% 50% 4px 50%; background: #00dbde; }
html .ktc_tour_present_bow::before { left: 0; transform: rotate(-12deg); }
html .ktc_tour_present_bow::after { right: 0; border-radius: 50% 50% 50% 4px; transform: rotate(12deg); }
html .ktc_tour.is_opening .ktc_tour_present { animation: ktc_tour_shake .65s ease-in both, ktc_tour_tremble .12s linear .65s infinite; }
html .ktc_tour.is_opening .ktc_tour_present_lid, html .ktc_tour.is_opening .ktc_tour_present_bow { animation: none; }
html .ktc_tour.is_opening [data-tour-next] { transform: scale(.96); transition: transform .15s; }
html .ktc_tour.is_bursting .ktc_tour_present { animation: none; transform: scale(1.26, .78); }
html .ktc_tour.is_revealed .ktc_tour_present { position: absolute; top: 50%; left: 50%; margin: -54px 0 0 -56px; scale: 1.35; animation: none; pointer-events: none; }
html .ktc_tour.is_revealed .ktc_tour_present_lid { animation: ktc_tour_lid .55s cubic-bezier(.2, .7, .4, 1) forwards; }
html .ktc_tour.is_revealed .ktc_tour_present_bow { animation: ktc_tour_bow .55s cubic-bezier(.2, .7, .4, 1) forwards; }
html .ktc_tour.is_revealed .ktc_tour_present_box { animation: ktc_tour_box .35s ease-in forwards; }
html .ktc_tour.is_revealed .ktc_tour_stage::after { content: ""; position: absolute; top: 50%; left: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; pointer-events: none;
	background: radial-gradient(circle, #ffffff 0 28%, var(--gift-rarity) 52%, transparent 70%); animation: ktc_tour_pop .45s ease-out forwards; }
/* the sheet's copy as it slides away (KtcTour.stash): nothing in it plays again */
html .ktc_tour.is_leaving .ktc_tour_present, html .ktc_tour.is_leaving .ktc_tour_stage::after, html .ktc_tour.is_leaving .ktc_tour_gift_sparks { display: none; }
html .ktc_tour.is_leaving .ktc_tour_gift_card, html .ktc_tour.is_leaving .ktc_tour_gift_gold, html .ktc_tour.is_leaving .ktc_tour_gift_rays, html .ktc_tour.is_leaving .ktc_tour_ben { animation: none; }
/* Ben jumps for joy, then goes back to his bob */
html .ktc_tour.is_revealed .ktc_tour_ben { animation: ktc_tour_cheer .7s cubic-bezier(.3, 1.5, .5, 1) .1s, ktc_tour_bob 3s ease-in-out .9s infinite; }
/* the steps are behind them once it's claimed */
html .ktc_tour.is_revealed .ktc_tour_dots { display: none; }
html .ktc_tour p.ktc_tour_preview { padding: 6px 14px; border: 2px solid #14061f; border-radius: 999px; background: #2a2340; font-weight: 800; color: var(--ktc-ob-ink); text-align: center; }
html .ktc_tour_gift { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
html .ktc_tour_gift[hidden] { display: none; }
html .ktc_tour_gift_card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: ktc_tour_gift .6s cubic-bezier(.2, .9, .3, 1.35) both; }
html .ktc_tour_gift_rays { position: absolute; top: 86px; left: 50%; z-index: 0; width: 380px; height: 380px; margin: -190px 0 0 -190px; border-radius: 50%; opacity: .8; pointer-events: none;
	background: repeating-conic-gradient(from 0deg, var(--gift-rarity, #ffffff) 0 6deg, transparent 6deg 18deg);
	-webkit-mask-image: radial-gradient(circle closest-side, #000 0 30%, transparent 86%); mask-image: radial-gradient(circle closest-side, #000 0 30%, transparent 86%); animation: ktc_tour_rays 12s linear infinite, ktc_tour_bloom .6s ease-out both; }
html .ktc_tour_gift_frame { z-index: 1; padding: 8px; --gift-radius: 22px; border: 3px solid var(--gift-rarity, #9aa0a6); background: rgba(20, 16, 32, .92);
	box-shadow: 0 0 0 3px #14061f, 0 0 40px var(--gift-rarity, transparent), 0 14px 30px rgba(0, 0, 0, .5); }
html .ktc_tour_gift_img { width: 150px; height: 150px; object-fit: contain; animation: ktc_tour_float 3s ease-in-out .7s infinite; }
html .ktc_tour p.ktc_tour_gift_name, html .ktc_tour p.ktc_tour_gift_rarity { padding: 2px 12px; border-radius: 999px; background: rgba(20, 6, 31, .88); }
html .ktc_tour p.ktc_tour_gift_name { z-index: 1; margin-top: 6px; font-size: 20px; font-weight: 800; color: var(--ktc-ob-ink); }
/* the rarity as text: Ultra rare's and Unique's own colours are lifted to read at 13px (the frame keeps the rarity's own) */
html .ktc_tour p.ktc_tour_gift_rarity { z-index: 1; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--gift-rarity); }
html .ktc_tour.is_tier_2 p.ktc_tour_gift_rarity { color: #f87171; }
html .ktc_tour.is_tier_3 p.ktc_tour_gift_rarity { color: #c084fc; }
/* a short screen (a small phone with the browser's bars showing): a smaller stage keeps the buttons on screen */
@media (max-height: 700px) {
	html .ktc_tour_stage { min-height: 190px; margin-top: 8px; }
	html .ktc_tour_present, html .ktc_tour.is_revealed .ktc_tour_present { scale: 1.05; }
	html .ktc_tour_body { margin-top: 12px; gap: 10px; }
	html .ktc_tour_ben { width: 52px; height: 52px; }
	html .ktc_tour_bubble { min-height: 0; padding: 12px; }
	html .ktc_tour_dots { margin: 2px 0; }
	html .ktc_tour_gift_img { width: 116px; height: 116px; }
	html .ktc_tour_gift_rays, html .ktc_tour_gift_sparks { top: 70px; }
}
html .ktc_tour p.ktc_tour_gift_gold { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 2px solid #14061f; border-radius: 999px; background: #2a2340;
	font-size: 18px; font-weight: 800; color: #ffc94a; animation: ktc_tour_gift .5s cubic-bezier(.2, .9, .3, 1.35) .35s both; }
html .ktc_tour p.ktc_tour_gift_gold[hidden] { display: none; }
html .ktc_tour_gift_gold img { width: 20px; height: 20px; }
html .ktc_tour_sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html .ktc_tour_gift_sparks { position: absolute; top: 86px; left: 50%; width: 0; height: 0; pointer-events: none; }
html .ktc_tour_spark { position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 2px; opacity: 0; animation: ktc_tour_spark .9s cubic-bezier(.15, .8, .3, 1) forwards; }
/* the gift flying into the Market (KtcTour.stash), the Market as it lands, and its dot until it's opened */
.ktc_tour_flying { line-height: 0; }
.ktc_tour_flying img { width: 100%; height: 100%; object-fit: contain; }
.ktc_tour_land { transform-origin: 50% 100%; animation: ktc_tour_land .5s ease-out; }
.ktc_tour_plus { position: fixed; z-index: 100001; margin: -6px 0 0 -14px; padding: 2px 8px; border: 2px solid #14061f; border-radius: 999px; background: #ffc94a; color: #14061f;
	font: 800 13px/1.2 var(--ktc-ob-font, sans-serif); pointer-events: none; animation: ktc_tour_plus 1.1s ease-out forwards; }
.ktc_tour_new { position: relative; }
.ktc_tour_new_dot { position: absolute; top: 4px; left: calc(50% + 6px); z-index: 1; width: 10px; height: 10px; box-sizing: border-box; border: 2px solid #14061f; border-radius: 50%; background: #ffc94a; pointer-events: none; }
@keyframes ktc_tour_lid { 0% { transform: none; opacity: 1; } 100% { transform: translate(-46px, -120px) rotate(-38deg); opacity: 0; } }
@keyframes ktc_tour_bow { 0% { transform: none; opacity: 1; } 100% { transform: translate(40px, -150px) rotate(48deg); opacity: 0; } }
@keyframes ktc_tour_box { 0% { transform: none; opacity: 1; } 100% { transform: translateY(30px) scale(.7); opacity: 0; } }
@keyframes ktc_tour_pop { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(26); opacity: 0; } }
@keyframes ktc_tour_cheer { 0% { transform: none; } 30% { transform: translateY(-16px) scale(.92, 1.1) rotate(-6deg); } 55% { transform: translateY(0) scale(1.12, .88); } 75% { transform: translateY(-5px) rotate(4deg); } 100% { transform: none; } }
@keyframes ktc_tour_hop { 0%, 62%, 100% { transform: none; } 70% { transform: translateY(-12px) rotate(-4deg); } 78% { transform: none; } 84% { transform: translateY(-4px) rotate(2deg); } 90% { transform: none; } }
@keyframes ktc_tour_glow { 50% { opacity: .55; scale: 1.12; } }
@keyframes ktc_tour_tremble { 0%, 100% { transform: scale(1.22, .82) translateX(-2px) rotate(-3deg); } 50% { transform: scale(1.22, .82) translateX(2px) rotate(3deg); } }
@keyframes ktc_tour_gift { from { opacity: 0; transform: scale(.3) rotate(-10deg); } }
@keyframes ktc_tour_rays { to { transform: rotate(360deg); } }
@keyframes ktc_tour_bloom { from { scale: 1.5; opacity: 0; } }
@keyframes ktc_tour_float { 50% { transform: translateY(-5px) rotate(-2deg); } }
@keyframes ktc_tour_wiggle { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-6deg); } 82% { transform: rotate(5deg); } 88% { transform: rotate(-3deg); } 94% { transform: rotate(2deg); } }
@keyframes ktc_tour_shake { 0% { transform: none; } 20% { transform: translateX(-2px) rotate(-3deg); } 40% { transform: translateX(3px) rotate(4deg) scale(1.03); } 60% { transform: translateX(-4px) rotate(-6deg) scale(1.06); }
	80% { transform: translateX(6px) rotate(9deg) scale(1.14); } 100% { transform: scale(1.22, .82); } }
@keyframes ktc_tour_spark { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(.4); } }
/* the tab squashes as the gift lands in it, springs up, and settles, glowing gold */
@keyframes ktc_tour_land { 0% { transform: none; } 25% { transform: scale(1.18, .82); filter: drop-shadow(0 0 10px #ffc94a); } 55% { transform: scale(.94, 1.12); } 80% { transform: scale(1.03, .97); } 100% { transform: none; } }
@keyframes ktc_tour_plus { 0% { opacity: 0; transform: translateY(6px) scale(.6); } 20% { opacity: 1; transform: translateY(-8px) scale(1.1); } 100% { opacity: 0; transform: translateY(-34px); } }
@media (max-width: 400px) {
	html .ktc_tour_body { flex-direction: column; align-items: center; }
	html .ktc_tour_bubble { width: 100%; box-sizing: border-box; }
	html .ktc_tour_bubble::before { top: -8px; left: calc(50% - 8px); border: 8px solid transparent; border-top: 0; border-bottom-color: rgba(255, 255, 255, 0.07); }
}
@media (prefers-reduced-motion: reduce) {
	html .ktc_tour_ben { animation: none; }
	html .ktc_tour_dot::before { transition: none; }
	html .ktc_tour_dots.has_gift .ktc_tour_dot:last-child .fa { animation: none; }
	html .ktc_tour_gift_img, html .ktc_tour_gift_card, html .ktc_tour_gift_rays, html .ktc_tour p.ktc_tour_gift_gold, html .ktc_tour_present, html .ktc_tour.is_opening .ktc_tour_present, html .ktc_tour_present_lid, html .ktc_tour_present_bow, html .ktc_tour_stage::before { animation: none; }
	html .ktc_tour.is_revealed .ktc_tour_present { animation: none; opacity: 0; }
	html .ktc_tour.is_revealed .ktc_tour_present i, html .ktc_tour.is_revealed .ktc_tour_ben { animation: none; }
	html .ktc_tour.is_revealed .ktc_tour_stage::after { display: none; }
	html .ktc_tour.is_opening [data-tour-next] { transform: none; transition: none; }
	html .ktc_tour_stage::before { transition: none; }
}

/* Ben's nudge to say hi, over the message box once the gift is in (KtcTour.hi) */
.ktc_tour_hi { position: fixed; left: 12px; right: 12px; z-index: 150; display: flex; align-items: center; gap: 10px; max-width: 460px; margin: 0 auto; padding: 10px 10px 10px 12px;
	border: 2px solid #14061f; border-radius: 16px; background: #241c38; box-shadow: 0 4px 0 #14061f, 0 12px 28px rgba(0, 0, 0, .5); color: #ffffff;
	font: 600 14px/1.35 var(--ktc-ob-font, sans-serif); animation: ktc_tour_hi .4s cubic-bezier(.2, .9, .3, 1.3) both; }
.ktc_tour_hi img { flex: none; width: 40px; height: 40px; border: 2px solid #14061f; border-radius: 10px; background: #2a2340; }
.ktc_tour_hi p { flex: 1; min-width: 0; margin: 0; }
.ktc_tour_hi_send { flex: none; min-height: 44px; padding: 0 16px; border: 2px solid #14061f; border-radius: 999px; background: var(--ktc-ob-gradient, linear-gradient(135deg, #c471ed, #6b9aeb, #12c2e9));
	box-shadow: 0 3px 0 #14061f; color: #14061f; font: 800 14px/1 var(--ktc-ob-font, sans-serif); cursor: pointer; }
.ktc_tour_hi_send:active { transform: translateY(3px); box-shadow: none; }
.ktc_tour_hi_close { flex: none; width: 36px; height: 44px; padding: 0; border: 0; background: none; color: rgba(255, 255, 255, .6); font-size: 16px; cursor: pointer; }
@keyframes ktc_tour_hi { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@media (prefers-reduced-motion: reduce) {
	.ktc_tour_hi { animation: none; }
}
