/* ===================================
   ООО «Отмыв» 2027 — new-year skin.
   Plain CSS (no build step). Colours come from theme.json presets.
   =================================== */

:root {
	--otm-gold: var(--wp--preset--color--primary, #e8b85c);
	--otm-gold-2: var(--wp--preset--color--primary-hover, #d9963f);
	--otm-gold-3: var(--wp--preset--color--secondary, #f3d58a);
	--otm-cream: var(--wp--preset--color--cream, #f6f1e3);
	--otm-muted: var(--wp--preset--color--muted, #a9b5a5);
	--otm-pine: var(--wp--preset--color--pine, #0c2219);
	--otm-surface: color-mix(in srgb, var(--wp--preset--color--surface, #10291e) 88%, transparent);
	--otm-deep: var(--wp--preset--color--black, #06140d);
	--otm-line: color-mix(in srgb, var(--otm-gold) 30%, transparent);
	--otm-grad: linear-gradient(110deg, var(--otm-gold-3), var(--otm-gold) 45%, var(--otm-gold-2));
	--otm-display: var(--wp--preset--font-family--display, sans-serif);
	--otm-script: var(--wp--preset--font-family--script, cursive);
	--otm-glow: 0 0 60px -18px color-mix(in srgb, var(--otm-gold) 55%, transparent);
	color-scheme: dark;
}

body {
	min-height: 100vh;
	background-color: var(--otm-deep);
	background-image:
		radial-gradient(1100px 620px at 12% -8%, color-mix(in srgb, #2f6b4c 45%, transparent), transparent 70%),
		linear-gradient(180deg, #0f2d21 0%, #0a2016 45%, #08170f 75%, #16150e 100%);
	background-attachment: fixed;
	color: var(--otm-cream);
}

.wp-site-blocks { position: relative; display: flex; flex-direction: column; min-height: 100vh; }
.otm-main { flex: 1 0 auto; position: relative; z-index: 1; }

/* ---------- Layout ---------- */
.otm-wrap { width: 100%; max-width: 1240px; margin-inline: auto !important; padding-inline: clamp(16px, 4vw, 40px); box-sizing: border-box; }
.otm-wrap--narrow { max-width: 920px; }
.otm-page { padding-block: clamp(2rem, 6vw, 4rem) clamp(3rem, 8vw, 6rem); }
.otm-page__title { font-family: var(--otm-display); font-weight: 800; font-size: clamp(2rem, 5.5vw, 3.6rem); line-height: 1.08; letter-spacing: -.01em; margin: 0 0 .4em; color: var(--otm-cream); }
.otm-section-title { font-family: var(--otm-display); font-weight: 800; font-size: clamp(1.5rem, 3.4vw, 2.3rem); line-height: 1.15; margin: 0 0 .8em; color: var(--otm-cream); }
.otm-section-title--muted { color: var(--otm-muted); margin-top: 1.8em; font-size: clamp(1.25rem, 2.6vw, 1.75rem); }
.otm-gold { background: var(--otm-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.otm-script { font-family: var(--otm-script); font-weight: 600; color: var(--otm-gold); }
.otm-muted { color: var(--otm-muted); }
.otm-note { color: #f2a7a7; margin: .6em 0 0; }

/* ---------- Top bar ---------- */
header.wp-block-template-part { position: sticky; top: 0; z-index: 1000; }
.admin-bar header.wp-block-template-part { top: var(--wp-admin--admin-bar--height, 0px); }
.otm-topbar {
	background: color-mix(in srgb, #0f2c20 82%, transparent);
	-webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--otm-line);
}
.otm-topbar__in { max-width: 1240px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top, 0px)) max(clamp(16px, 4vw, 40px), env(safe-area-inset-right, 0px)) 14px max(clamp(16px, 4vw, 40px), env(safe-area-inset-left, 0px)); display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.otm-brand, .otm-brand:hover { font-family: var(--otm-display); font-weight: 800; font-size: clamp(1rem, 2.2vw, 1.4rem); text-decoration: none; background: var(--otm-grad); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.otm-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; }
.otm-nav::-webkit-scrollbar { display: none; }
.otm-nav__link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; color: var(--otm-cream); opacity: .85; text-decoration: none; font-weight: 600; white-space: nowrap; transition: background-color .2s, color .2s, opacity .2s; }
.otm-nav__link:hover { opacity: 1; color: var(--otm-cream); background: rgba(255,255,255,.05); }
.otm-nav__link[aria-current="page"] { opacity: 1; color: var(--otm-gold); background: color-mix(in srgb, #2f6b4c 45%, transparent); }
@media (max-width: 640px) {
	.otm-topbar__in { justify-content: center; padding-top: calc(10px + env(safe-area-inset-top, 0px)); padding-bottom: 10px; }
	.otm-nav__link { padding: 0 12px; font-size: .95rem; }
}

/* ---------- Buttons & fields ---------- */
.otm-btn, a.otm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .4em;
	min-height: 52px; padding: 0 1.6em; border: 0; border-radius: 999px;
	background: var(--otm-grad); color: #1d1405; font: inherit; font-weight: 700; font-size: 1.05rem;
	text-decoration: none; cursor: pointer; white-space: nowrap;
	box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--otm-gold) 80%, transparent);
	transition: transform .15s, filter .15s;
}
.otm-btn:hover, a.otm-btn:hover { filter: brightness(1.06); color: #1d1405; transform: translateY(-1px); }
.otm-btn:active { transform: translateY(0); }
.otm-btn:disabled { opacity: .55; cursor: default; transform: none; }

.otm-input, .otm-textarea {
	width: 100%; box-sizing: border-box; min-height: 56px; margin: 0; padding: 0 1.4em;
	border: 1.5px solid var(--otm-line); border-radius: 999px;
	background: color-mix(in srgb, var(--otm-deep) 55%, transparent); color: var(--otm-cream);
	font: inherit; font-size: 1.05rem;
}
.otm-textarea { border-radius: 24px; padding: 1em 1.2em; min-height: 200px; resize: vertical; line-height: 1.6; }
.otm-input::placeholder, .otm-textarea::placeholder { color: color-mix(in srgb, var(--otm-muted) 80%, transparent); }
.otm-input:focus, .otm-textarea:focus { outline: none; border-color: var(--otm-gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--otm-gold) 25%, transparent); }
:where(.otm) :focus-visible { outline: 2px solid var(--otm-gold); outline-offset: 3px; }

.otm-inline-form { display: flex; gap: 12px; align-items: center; margin: 0 0 2rem; }
.otm-inline-form--guest { justify-content: space-between; flex-wrap: wrap; padding: 14px 14px 14px 26px; border: 1.5px solid var(--otm-line); border-radius: 999px; }
.otm-inline-form--guest p { margin: 0; }
@media (max-width: 560px) {
	.otm-inline-form { flex-direction: column; align-items: stretch; }
	.otm-inline-form--guest { border-radius: 24px; padding: 18px; text-align: center; }
}

/* ---------- Cards ---------- */
.otm-card {
	background: var(--otm-surface); border: 1px solid var(--otm-line); border-radius: 32px;
	padding: clamp(1.2rem, 3vw, 2.2rem); box-shadow: var(--otm-glow);
}
.otm-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; flex-wrap: wrap; }
.otm-card__title { font-family: var(--otm-display); font-weight: 800; font-size: clamp(1.2rem, 2.4vw, 1.6rem); margin: 0 0 1rem; color: var(--otm-cream); }

/* ---------- Hero ---------- */
.otm-hero { max-width: 1440px; text-align: center; padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem); }
.otm-hero__kicker { font-size: clamp(1.6rem, 3.6vw, 2.6rem); margin: 0 0 .2em; }
.otm-hero__title { font-family: var(--otm-display); font-weight: 800; font-size: clamp(2.1rem, 6.4vw, 5.6rem); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 .5em; color: var(--otm-cream); }
.otm-countdown { display: flex; justify-content: center; gap: clamp(8px, 2vw, 24px); }
.otm-countdown__box {
	width: clamp(64px, 20vw, 180px); padding: clamp(12px, 2.4vw, 26px) 6px;
	border: 1px solid var(--otm-line); border-radius: clamp(18px, 3vw, 32px);
	background: color-mix(in srgb, var(--otm-deep) 55%, transparent);
	box-shadow: 0 0 50px -14px color-mix(in srgb, var(--otm-gold) 45%, transparent);
	display: flex; flex-direction: column; align-items: center;
}
.otm-countdown__num { font-family: var(--otm-display); font-weight: 800; font-size: clamp(1.8rem, 6vw, 4.6rem); line-height: 1; color: var(--otm-gold); font-variant-numeric: tabular-nums; }
.otm-countdown__label { margin-top: .5em; text-transform: uppercase; letter-spacing: .1em; font-size: clamp(.65rem, 1.4vw, .95rem); color: var(--otm-muted); }
.otm-countdown__done { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0; }
.otm-countdown__done[hidden] { display: none; }

/* ---------- Wishes ---------- */
.otm-wishes { padding-bottom: clamp(3rem, 8vw, 6rem); }
.otm-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; align-items: start; }
.otm-wish { position: relative; margin: 0; padding: 1.8rem 2rem 1.5rem; background: var(--otm-cream); color: #2a2216; border-radius: 28px; box-shadow: 0 18px 40px -24px rgba(0,0,0,.8); }
.otm-wish:nth-child(3n+2) { transform: rotate(.6deg); }
.otm-wish:nth-child(3n) { transform: rotate(-.5deg); }
.otm-wish__text { margin: 0 0 .6rem; padding: 0; border: 0; font-family: var(--otm-script); font-weight: 600; font-size: 1.75rem; line-height: 1.3; color: #2a2216; overflow-wrap: anywhere; }
.otm-wish__by { color: #6d6350; font-weight: 600; }
.otm-wish__del { position: absolute; top: 10px; right: 10px; margin: 0; }
.otm-wish .otm-x { color: #8a7f6a; }

/* ---------- Shopping list ---------- */
.otm-shop__count { margin: 0 0 2rem; font-size: 1.15rem; }
.otm-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 14px; }
.otm-item { display: flex; align-items: center; gap: 18px; padding: 16px 18px 16px 22px; border: 1px solid var(--otm-line); border-radius: 32px; background: var(--otm-surface); }
.otm-item form { margin: 0; display: flex; }
.otm-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.otm-item__name { font-weight: 700; font-size: 1.15rem; overflow-wrap: anywhere; }
.otm-item__meta { color: var(--otm-muted); font-size: .95rem; }
.otm-item.is-bought .otm-item__name { text-decoration: line-through; color: var(--otm-muted); }
.otm-check { width: 44px; height: 44px; flex: none; padding: 0; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--otm-gold) 65%, transparent); background: transparent; color: #1d1405; font-size: 1.2rem; font-weight: 800; cursor: pointer; transition: background-color .15s; }
.otm-check:hover { background: color-mix(in srgb, var(--otm-gold) 18%, transparent); }
.otm-check[aria-pressed="true"] { background: var(--otm-gold); border-color: var(--otm-gold); }
.otm-x { width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--otm-muted); font-size: 1.9rem; line-height: 1; cursor: pointer; }
.otm-x:hover { color: var(--otm-cream); background: rgba(255,255,255,.06); }
.otm-wish .otm-x:hover { color: #2a2216; background: rgba(0,0,0,.06); }
.otm-empty { padding: 2rem; text-align: center; border: 1.5px dashed var(--otm-line); border-radius: 28px; color: var(--otm-muted); }

/* ---------- Games ---------- */
.otm-games { display: grid; gap: clamp(16px, 3vw, 32px); grid-template-columns: 1fr; }
@media (min-width: 900px) { .otm-games { grid-template-columns: 1fr 1fr; } .otm-game--wide { grid-column: 1 / -1; } }
.otm-game { min-height: 320px; display: flex; flex-direction: column; }
.otm-fortune__text { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.3; margin: 0 0 1.2rem; min-height: 2.6em; }
.otm-fortune__text.is-new { animation: otm-pop .5s ease; }
.otm-game .otm-btn { align-self: flex-start; }
@keyframes otm-pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

.otm-arena { position: relative; flex: 1; min-height: 300px; border-radius: 24px; background: color-mix(in srgb, var(--otm-deep) 85%, transparent); overflow: hidden; touch-action: manipulation; }
.otm-arena__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 16px; }
.otm-arena .otm-btn { align-self: center; }
.otm-arena.is-playing, .otm-arena.is-playing * { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.otm-arena, .otm-flake { -webkit-tap-highlight-color: transparent; }
.otm-arena__center[hidden], .otm-arena__hud[hidden] { display: none; }
.otm-arena__msg { margin: 0; font-weight: 700; font-size: 1.15rem; }
.otm-arena__msg:empty { display: none; }
.otm-arena__hud { position: absolute; top: 12px; left: 16px; right: 16px; display: flex; justify-content: space-between; color: var(--otm-muted); z-index: 2; pointer-events: none; }
.otm-arena__hud b { color: var(--otm-gold); }
.otm-flake { position: absolute; top: -56px; width: var(--size, 48px); height: var(--size, 48px); margin-left: calc(var(--size, 48px) / -2); padding: 0; border: 0; background: none; color: #fff; font-size: calc(var(--size, 48px) * .62); line-height: var(--size, 48px); cursor: pointer; animation: otm-flake-fall linear forwards; text-shadow: 0 0 12px rgba(200,230,255,.7); }
.otm-flake.is-gold { color: #ffd76a; text-shadow: 0 0 14px rgba(255,200,80,.9), 0 0 4px #fff; }
.otm-flake.is-bad { text-shadow: 0 0 14px rgba(255,90,40,.8); }
.otm-flake.is-hit { animation: otm-flake-hit .3s ease forwards; pointer-events: none; }
.otm-pop { position: absolute; z-index: 3; transform: translate(-50%, 0); font-weight: 800; font-size: 1.2rem; color: #fff; pointer-events: none; animation: otm-pop-up .7s ease-out forwards; }
.otm-pop.is-gold { color: #ffd76a; }
.otm-pop.is-minus { color: #ff6b5b; }
.otm-arena.is-shake { animation: otm-shake .35s ease; }
.otm-gold-txt { color: #ffd76a; }
@keyframes otm-flake-fall { 0% { transform: translate(0, 0) rotate(0); } 33% { transform: translate(var(--sway, 0px), calc(var(--fall, 360px) * .33)) rotate(80deg); } 66% { transform: translate(calc(var(--sway, 0px) * -1), calc(var(--fall, 360px) * .66)) rotate(160deg); } 100% { transform: translate(0, var(--fall, 360px)) rotate(240deg); } }
@keyframes otm-flake-hit { to { opacity: 0; scale: 1.8; color: var(--otm-gold); } }
@keyframes otm-pop-up { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -40px); } }
@keyframes otm-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }

.otm-santa { display: grid; gap: 24px; }
@media (min-width: 900px) { .otm-santa { grid-template-columns: 1fr 1fr; align-items: start; } }
.otm-santa .otm-btn { margin-top: 16px; }

/* Buttons, links, rows */
.otm-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.otm-btn--ghost, a.otm-btn--ghost { background: transparent; color: var(--otm-cream); border: 1.5px solid var(--otm-line); box-shadow: none; }
.otm-btn--ghost:hover, a.otm-btn--ghost:hover { color: var(--otm-cream); border-color: var(--otm-gold); filter: none; }
.otm-btn[hidden] { display: none; }
.otm-link, a.otm-link { color: var(--otm-gold); font-weight: 600; }
.otm-link-btn { margin-top: 10px; padding: 6px 0; border: 0; background: none; color: var(--otm-muted); font: inherit; text-decoration: underline; cursor: pointer; }
.otm-link-btn:hover { color: var(--otm-cream); }
.otm-ok { margin: 0 0 1rem; color: #b9ecc8; }
.otm-label { display: block; margin: 0 0 .4em .4em; color: var(--otm-muted); font-size: .95rem; }
.otm-textarea--sm { min-height: 110px; margin-bottom: 12px; }
.otm-santa form + form { margin-top: 4px; }
.otm-santa form { margin: 0; }

/* Leaderboard */
.otm-boards { display: grid; gap: 24px; }
@media (min-width: 700px) { .otm-boards { grid-template-columns: 1fr 1fr; } }
.otm-boards__title { font-family: var(--otm-display); font-weight: 800; font-size: 1.05rem; margin: 0 0 .8rem; color: var(--otm-gold); }
.otm-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.otm-board li { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; border: 1px solid var(--otm-line); border-radius: 999px; background: color-mix(in srgb, var(--otm-deep) 45%, transparent); }
.otm-board li.is-me { border-color: var(--otm-gold); background: color-mix(in srgb, #2f6b4c 40%, transparent); }
.otm-board__pos { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.06); font-weight: 700; font-size: .9rem; }
.otm-board li:nth-child(-n+3) .otm-board__pos { background: var(--otm-grad); color: #1d1405; }
.otm-board__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otm-board b { color: var(--otm-gold); font-variant-numeric: tabular-nums; }

/* Quiz */
.otm-quiz { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.otm-quiz__q { margin: 0; font-weight: 700; font-size: 1.2rem; line-height: 1.35; }
.otm-quiz__opts { display: grid; gap: 10px; width: 100%; }
@media (min-width: 560px) { .otm-quiz__opts { grid-template-columns: 1fr 1fr; } }
.otm-quiz__opt { min-height: 52px; padding: 10px 18px; border: 1.5px solid var(--otm-line); border-radius: 22px; background: color-mix(in srgb, var(--otm-deep) 55%, transparent); color: var(--otm-cream); font: inherit; font-weight: 600; text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s; }
.otm-quiz__opt:hover:not(:disabled) { border-color: var(--otm-gold); }
.otm-quiz__opt:disabled { cursor: default; opacity: .6; }
.otm-quiz__opt.is-right { opacity: 1; border-color: #7fd39b; background: rgba(127, 211, 155, .16); }
.otm-quiz__opt.is-wrong { opacity: 1; border-color: #f08c8c; background: rgba(240, 140, 140, .14); }
.otm-quiz__score { margin: 0; font-family: var(--otm-display); font-weight: 800; font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1; color: var(--otm-gold); }
.otm-quiz .otm-fortune__text { min-height: 0; margin: 0; }
.otm-quiz .otm-muted:empty { display: none; }

/* Secret Santa */
.otm-santa p { margin: 0 0 1rem; }
.otm-game--wide { min-height: 0; }
.otm-santa__wish-text { font-size: 1.7rem; line-height: 1.3; overflow-wrap: anywhere; }
.otm-people { list-style: none; margin: 0 0 1.4rem; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.otm-people li { padding: 8px 16px; border: 1px solid var(--otm-line); border-radius: 999px; }
.otm-people li.is-me { border-color: var(--otm-gold); color: var(--otm-gold); }
.otm-admin { padding-top: 1rem; border-top: 1px dashed var(--otm-line); }
.otm-admin p { margin-bottom: .6rem; }

/* ---------- Auth & cabinet page frames ---------- */
.otm-auth { max-width: 560px; padding-block: clamp(2.5rem, 7vw, 5rem); text-align: center; }
.otm-auth__kicker { font-size: clamp(1.5rem, 3.4vw, 2.2rem); margin: 0 0 .2em; }
.otm-auth .ng-app { text-align: left; margin-top: 1.6rem; }
.otm-page .wp-block-post-content, .otm-auth .wp-block-post-content { margin: 0; }

/* ---------- Footer ---------- */
.otm-footer { position: relative; z-index: 1; padding: 2rem 16px calc(2rem + env(safe-area-inset-bottom, 0px)); color: var(--otm-muted); border-top: 1px solid color-mix(in srgb, var(--otm-gold) 15%, transparent); }
.otm-footer p { margin: 0; font-size: .95rem; }

/* ---------- Falling snow (assets/js/otmyv.js) ---------- */
.otm-snow { position: fixed; inset: 0; z-index: 900; pointer-events: none; overflow: hidden; }
.otm-snow i { position: absolute; top: -5vh; color: #fff; font-style: normal; opacity: var(--o, .5); font-size: var(--s, 14px); animation: otm-snow var(--d, 14s) linear var(--delay, 0s) infinite; will-change: transform; }
@keyframes otm-snow {
	0% { transform: translate3d(0, -5vh, 0) rotate(0); }
	50% { transform: translate3d(var(--x, 20px), 52vh, 0) rotate(180deg); }
	100% { transform: translate3d(0, 110vh, 0) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
	.otm-snow { display: none; }
	.otm-flake { animation-duration: 12s !important; }
	.otm-btn, .otm-btn:hover { transition: none; transform: none; }
}

/* ---------- Install as app (PWA) ---------- */
.otm-install {
	position: fixed; z-index: 2000; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	display: flex; align-items: center; gap: 12px; max-width: 520px; margin: 0 auto; padding: 14px 14px 14px 16px;
	border: 1px solid var(--otm-line); border-radius: 24px; background: color-mix(in srgb, #10291e 94%, transparent);
	-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--otm-cream);
	box-shadow: 0 18px 50px -12px rgba(0,0,0,.7); transform: translateY(140%); transition: transform .35s ease;
}
.otm-install.is-open { transform: none; }
.otm-install__icon { width: 52px; height: 52px; flex: none; border-radius: 12px; }
.otm-install__text { flex: 1; min-width: 0; font-size: .92rem; line-height: 1.35; }
.otm-install__text > b { display: block; font-size: 1rem; margin-bottom: 2px; }
.otm-install__text p { margin: 0; color: var(--otm-muted); }
.otm-install__text p b { color: var(--otm-cream); font-weight: 600; }
.otm-install__share { display: inline-block; width: 16px; height: 18px; vertical-align: -3px; background: currentColor; color: #4ba3ff;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 18' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 11V1M4.5 4.5 8 1l3.5 3.5M5 7H2.5v10h11V7H11'/%3E%3C/svg%3E") center/contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 18' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 11V1M4.5 4.5 8 1l3.5 3.5M5 7H2.5v10h11V7H11'/%3E%3C/svg%3E") center/contain no-repeat; }
.otm-install__go { min-height: 44px; padding: 0 1.1em; font-size: .95rem; }
.otm-install__close { width: 36px; height: 36px; flex: none; align-self: flex-start; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--otm-muted); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.otm-install__close:hover { color: var(--otm-cream); background: rgba(255,255,255,.06); }
@media (prefers-reduced-motion: reduce) { .otm-install { transition: none; } }

/* Opened from the home screen: no text selection callouts on buttons, no overscroll bounce colour gap. */
.otm-standalone body { overscroll-behavior-y: none; }

/* Footer "Install the app" link */
.otm-install-link-wrap { margin: .8rem 0 0 !important; text-align: center; }
.otm-install-link { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; padding: 0 1.1em; border: 1px solid var(--otm-line); border-radius: 999px; background: transparent; color: var(--otm-gold); font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; }
.otm-install-link:hover { border-color: var(--otm-gold); background: rgba(255,255,255,.04); }
.otm-install-link[hidden] { display: none; }

/* New documents counter on "Кабинет" */
.otm-nav__badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: #e0413b; color: #fff; font-size: .75rem; font-weight: 800; line-height: 1; box-shadow: 0 0 0 2px #0f2c20; }

/* ---------- Secret Santa: envelope + folded note ---------- */
.otm-sgift { display: flex; flex-direction: column; align-items: center; text-align: center; }
.otm-sgift__hint { margin: 0 0 1rem; color: var(--otm-muted); }
.otm-env { position: relative; display: block; width: min(100%, 300px); aspect-ratio: 1.55; margin: .5rem 0 1rem; padding: 0; border: 0; background: none; cursor: pointer; perspective: 900px; animation: otm-env-float 3s ease-in-out infinite; -webkit-tap-highlight-color: transparent; }
.otm-env:focus-visible { outline: 2px solid var(--otm-gold); outline-offset: 8px; border-radius: 12px; }
.otm-env span { position: absolute; display: block; }
.otm-env__back { inset: 0; border-radius: 10px; background: #c9a061; box-shadow: 0 22px 44px -18px rgba(0,0,0,.7); }
.otm-env__front { inset: 0; z-index: 2; border-radius: 10px; background: linear-gradient(160deg, #ecd29a, #d6ad66); clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%); }
.otm-env__flap { left: 0; right: 0; top: 0; height: 58%; z-index: 3; background: linear-gradient(180deg, #d8b474, #c39a58); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform .55s ease .1s, z-index 0s linear .4s; }
.otm-env__seal { left: 50%; top: 58%; z-index: 4; width: 24%; aspect-ratio: 1; display: grid !important; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e35b5b, #a51f1f 58%, #761212); box-shadow: 0 0 0 .3rem rgba(165,31,31,.55), 0 6px 14px rgba(0,0,0,.35); color: #fff; font-size: 1.6rem; line-height: 1; transform: translate(-50%, -50%); transition: transform .35s ease, opacity .35s ease; }
.otm-sgift.is-open .otm-env { animation: none; cursor: default; }
.otm-sgift.is-open .otm-env__seal { opacity: 0; transform: translate(-50%, -50%) scale(1.6) rotate(60deg); }
.otm-sgift.is-open .otm-env__flap { z-index: 0; transform: rotateX(180deg); }
.otm-sgift.is-out .otm-env { display: none; }

.otm-note { display: none; position: relative; width: min(100%, 340px); height: 290px; margin: 0 0 1.2rem; perspective: 1200px; cursor: pointer; transition: transform .7s ease; color: #2a2216; -webkit-tap-highlight-color: transparent; }
.otm-note:focus-visible { outline: 2px solid var(--otm-gold); outline-offset: 6px; border-radius: 10px; }
.otm-sgift.is-out .otm-note { display: block; animation: otm-note-rise .6s cubic-bezier(.2,.9,.3,1.15); }
.otm-note:not(.is-unfolded) { transform: translateY(-25%); }
.otm-note *, .otm-note *::before, .otm-note *::after, .otm-env * { box-sizing: border-box; }
.otm-note__bottom, .otm-note__face { position: absolute; left: 0; right: 0; height: 50%; padding: 16px 20px; background: #fffdf5 repeating-linear-gradient(transparent 0 27px, rgba(120,150,200,.18) 27px 28px); box-shadow: 0 14px 30px -16px rgba(0,0,0,.6); }
.otm-note__bottom { bottom: 0; border-radius: 0 0 8px 8px; overflow: auto; border-top: 1px dashed rgba(0,0,0,.18); }
.otm-note__fold { position: absolute; left: 0; right: 0; top: 0; height: 50%; z-index: 2; transform-origin: 50% 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3,.7,.2,1); }
.otm-note:not(.is-unfolded) .otm-note__fold { transform: rotateX(-180deg); }
.otm-note__face { inset: 0; height: auto; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 8px 8px 0 0; }
.otm-note__cover { display: grid; place-content: center; gap: 4px; transform: rotateX(180deg); border-radius: 0 0 8px 8px; background: #f6edd8; font-family: var(--otm-script); font-size: 1.7rem; color: #8b5a1a; }
.otm-note__cover small { font-family: inherit; font-size: 1.05rem; color: #a07a45; }
.otm-note__label { margin: 0 0 4px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: #8a7f6a; }
.otm-note__name { margin: 0; font-family: var(--otm-script); font-size: clamp(2rem, 6vw, 2.6rem); line-height: 1.1; color: #1d3d8f; overflow-wrap: anywhere; }
.otm-note__wish { margin: 0; font-family: var(--otm-script); font-size: 1.45rem; line-height: 1.25; color: #2a2216; overflow-wrap: anywhere; }
.otm-sgift__after { display: none; width: 100%; text-align: left; }
.otm-sgift.is-read .otm-sgift__after { display: block; animation: otm-fade .5s ease; }
.otm-sgift__after .otm-btn { margin-top: .4rem; }

.otm-rules { margin: 0 0 1rem; padding: 0 0 0 1.4em; display: grid; gap: .45em; line-height: 1.4; }
.otm-rules li::marker { color: var(--otm-gold); font-weight: 700; }
.otm-rules--plain { color: var(--otm-muted); font-size: .95rem; }
.otm-rules b { color: var(--otm-cream); }
.otm-budget-form { margin-top: 1rem !important; }
.otm-input--sm { min-height: 44px; max-width: 220px; padding: 0 1em; font-size: .95rem; }

@keyframes otm-env-float { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-8px) rotate(1.5deg); } }
@keyframes otm-note-rise { from { opacity: 0; transform: translateY(10%) scale(.8); } to { opacity: 1; transform: translateY(-25%) scale(1); } }
@keyframes otm-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .otm-env { animation: none; } .otm-note, .otm-note__fold, .otm-env__flap, .otm-env__seal { transition: none; } .otm-sgift.is-out .otm-note, .otm-sgift.is-read .otm-sgift__after { animation: none; } }

/* ---------- Midnight show (assets/js/midnight.js) ---------- */
.otm-ny-lock, .otm-ny-lock body { overflow: hidden; }
.otm-ny {
	position: fixed; inset: 0; z-index: 1000000; display: grid; place-items: center; overflow: hidden;
	padding: calc(env(safe-area-inset-top, 0px) + 24px) 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
	background: radial-gradient(900px 640px at 50% 40%, rgba(26, 74, 51, .96), rgba(4, 12, 8, .985));
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	color: var(--otm-cream); text-align: center; outline: none;
	opacity: 0; transition: opacity .4s ease; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.otm-ny.is-open { opacity: 1; }
.otm-ny.is-happy { background: radial-gradient(1000px 700px at 50% 110%, rgba(40, 30, 8, .9), rgba(3, 8, 6, .99) 70%); }
.otm-ny__sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.otm-ny__x { position: absolute; z-index: 3; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; width: 44px; height: 44px; border: 1px solid var(--otm-line); border-radius: 50%; background: rgba(0, 0, 0, .25); color: var(--otm-cream); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.otm-ny__x:focus-visible { outline: 2px solid var(--otm-gold); outline-offset: 2px; }
.otm-ny__count, .otm-ny__happy { position: relative; z-index: 2; max-width: 680px; }
.otm-ny__happy { pointer-events: none; }
.otm-ny__happy .otm-ny__btns { pointer-events: auto; }
.otm-ny__kicker { margin: 0; font-family: var(--otm-script); font-weight: 600; font-size: clamp(1.6rem, 6vw, 2.4rem); color: var(--otm-gold); }
.otm-ny__num {
	font-family: var(--otm-display); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
	font-size: clamp(9rem, 48vmin, 22rem); margin: .05em 0;
	background: var(--otm-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
	filter: drop-shadow(0 0 40px color-mix(in srgb, var(--otm-gold) 45%, transparent));
}
.otm-ny__num.is-beat { animation: otm-ny-beat 1s ease-out both; }
@keyframes otm-ny-beat { 0% { transform: scale(1.35); opacity: 0; } 18% { transform: scale(1); opacity: 1; } 85% { opacity: 1; } 100% { transform: scale(.94); opacity: .85; } }
.otm-ny__hint { margin: 0; color: var(--otm-muted); font-size: 1.1rem; }
.otm-ny__title { margin: .1em 0 0; font-family: var(--otm-display); font-weight: 800; font-size: clamp(2.4rem, 10vw, 5.2rem); line-height: 1.05; color: #fff; text-shadow: 0 0 30px rgba(255, 220, 150, .45); animation: otm-ny-in .9s cubic-bezier(.2, .9, .25, 1.3) both; }
.otm-ny__year { font-family: var(--otm-display); font-weight: 800; font-size: clamp(4.5rem, 26vw, 12rem); line-height: 1; background: var(--otm-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 36px color-mix(in srgb, var(--otm-gold) 50%, transparent)); animation: otm-ny-in 1s cubic-bezier(.2, .9, .25, 1.3) .25s both; }
.otm-ny__wish { margin: .2em 0 1.2em; font-family: var(--otm-script); font-weight: 600; font-size: clamp(1.7rem, 7vw, 2.6rem); color: var(--otm-gold-3); animation: otm-ny-in .8s ease .7s both; }
.otm-ny__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; animation: otm-ny-in .8s ease 1.1s both; }
.otm-ny__tap { margin: 1.4em 0 0; color: var(--otm-muted); font-size: .9rem; animation: otm-ny-in .8s ease 2s both; }
@keyframes otm-ny-in { from { opacity: 0; transform: translateY(16px) scale(.9); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
	.otm-ny, .otm-ny__num.is-beat, .otm-ny__title, .otm-ny__year, .otm-ny__wish, .otm-ny__btns, .otm-ny__tap { animation: none; transition: none; }
}

/* ---------- Photo wall (inc/otm-photos.php, assets/js/photos.js) ---------- */
.otm-photos__lead { margin: -.2em 0 1.4em; max-width: 60ch; }
.otm-photos__note { margin: 0 0 1rem; padding: .7em 1.1em; border-radius: 16px; background: color-mix(in srgb, #2f6b4c 40%, transparent); border: 1px solid var(--otm-line); }
.otm-upload { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 1.4rem; }
.otm-upload .otm-input { flex: 1 1 240px; }
.otm-upload__pick { position: relative; cursor: pointer; gap: .4em; }
.otm-upload__file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.otm-upload.is-js .otm-upload__send { display: none; }
.otm-upload.is-busy .otm-upload__pick { opacity: .55; pointer-events: none; }
.otm-upload__progress { flex: 1 0 100%; display: flex; align-items: center; gap: 12px; color: var(--otm-muted); }
.otm-upload__progress[hidden] { display: none; }
.otm-upload__bar { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.otm-upload__bar i { display: block; width: 0; height: 100%; background: var(--otm-grad); transition: width .3s ease; }
.otm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.2rem; }
.otm-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--otm-line); color: var(--otm-cream); text-decoration: none; font-weight: 600; font-size: .95rem; }
.otm-chip:hover { color: var(--otm-cream); border-color: var(--otm-gold); }
.otm-chip[aria-current="page"] { background: var(--otm-grad); border-color: transparent; color: #1d1405; }

.otm-pwall { columns: 2 130px; column-gap: 10px; }
@media (min-width: 700px) { .otm-pwall { columns: 4 200px; column-gap: 14px; } }
.otm-ph { break-inside: avoid; margin: 0 0 10px; border-radius: 18px; overflow: hidden; background: var(--otm-surface); border: 1px solid color-mix(in srgb, var(--otm-gold) 18%, transparent); }
@media (min-width: 700px) { .otm-ph { margin-bottom: 14px; } }
.otm-ph__open { display: block; line-height: 0; }
.otm-ph__img { display: block; width: 100%; height: auto; background: rgba(255, 255, 255, .04); transition: transform .4s ease; }
.otm-ph__open:hover .otm-ph__img { transform: scale(1.03); }
.otm-ph__open:focus-visible { outline: 2px solid var(--otm-gold); outline-offset: -2px; }
.otm-ph__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 12px; font-size: .85rem; color: var(--otm-muted); }
.otm-ph__by { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otm-ph__likef { margin: 0; }
.otm-like { display: inline-flex; align-items: center; gap: .3em; min-height: 36px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--otm-muted); font: inherit; font-weight: 700; cursor: pointer; }
.otm-like span { font-size: 1.05em; filter: grayscale(1) brightness(1.6); opacity: .7; transition: transform .2s; }
.otm-like[aria-pressed="true"] { color: #ff8b8b; }
.otm-like[aria-pressed="true"] span { filter: none; opacity: 1; animation: otm-heart .35s ease; }
@keyframes otm-heart { 50% { transform: scale(1.4); } }
.otm-photos__more { text-align: center; margin: 1.4rem 0 0; }

/* Full-screen viewer */
.otm-lb-lock, .otm-lb-lock body { overflow: hidden; }
.otm-lb { position: fixed; inset: 0; z-index: 999980; display: none; flex-direction: column; background: #030906; color: var(--otm-cream); outline: none; touch-action: pan-y; }
.otm-lb.is-open { display: flex; }
.otm-lb__stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: calc(env(safe-area-inset-top, 0px) + 56px) 8px 8px; }
.otm-lb__img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 8px; user-select: none; -webkit-user-drag: none; }
.otm-lb__x, .otm-lb__nav { position: absolute; z-index: 2; display: grid; place-items: center; border: 1px solid var(--otm-line); border-radius: 50%; background: rgba(0, 0, 0, .45); color: var(--otm-cream); cursor: pointer; line-height: 1; }
.otm-lb__x { top: calc(env(safe-area-inset-top, 0px) + 10px); right: 10px; width: 44px; height: 44px; font-size: 1.6rem; }
.otm-lb__nav { top: 50%; width: 48px; height: 48px; margin-top: -24px; font-size: 2rem; padding-bottom: 4px; }
.otm-lb__nav[hidden] { display: none; }
.otm-lb__prev { left: 10px; }
.otm-lb__next { right: 10px; }
@media (hover: none) { .otm-lb__nav { display: none; } }
.otm-lb__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 12px); border-top: 1px solid color-mix(in srgb, var(--otm-gold) 15%, transparent); }
.otm-lb__info { min-width: 0; }
.otm-lb__info b { margin-right: .5em; }
.otm-lb__info small { color: var(--otm-muted); }
.otm-lb__info p { margin: .2em 0 0; }
.otm-lb__acts { display: flex; gap: 8px; flex-wrap: wrap; }
.otm-lb__acts .otm-like { min-height: 42px; padding: 0 14px; border: 1px solid var(--otm-line); }
.otm-lb__btn, a.otm-lb__btn { display: inline-flex; align-items: center; min-height: 42px; padding: 0 14px; border: 1px solid var(--otm-line); border-radius: 999px; background: transparent; color: var(--otm-cream); font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; }
.otm-lb__btn:hover { color: var(--otm-cream); border-color: var(--otm-gold); }
.otm-lb__del { color: #f2a7a7; }
.otm-lb__btn[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .otm-ph__img, .otm-like span { transition: none; animation: none; } }
.otm-photos { scroll-margin-top: 110px; }
/* Five menu items: keep them all visible on narrow phones. */
@media (max-width: 430px) {
	.otm-nav { margin-inline: -6px; gap: 0; }
	.otm-nav__link { padding: 0 8px; font-size: .88rem; }
}
