/* Плавающая кнопка «Отправить работу» с подсказкой (TCGC_Send, плагин 1.5.0).
   Подключается только на странице конкурса, пока форма приёма открыта (на главной кнопки нет, решение пользователя 24.11).
   Телефон и планшет: кнопка появляется после прокрутки за плитки вкладок первого экрана (send.js), поэтому подложка
   не ложится на светлую картину первого экрана и в тёмной теме.
   Телефон и планшет: крупная кнопка внизу, под большим пальцем, на мягкой подложке. ПК с мышью от 1100 px:
   компактная кнопка справа снизу, подсказка слева от неё. Кнопка «Наверх» темы поднимается над кнопкой (на телефоне
   до 600 px не показывается, пока видна наша кнопка).
   Движение: только opacity и transform, ease-out, отклик до 300 мс; при «меньше движения» мягкое проявление. */

#tcgc-send{--tcgc-send-ease:cubic-bezier(.23,1,.32,1);--tcgc-send-font:Lato,Helvetica,Arial,sans-serif;--tcgc-send-w:700;--tcgc-send-tw:calc(100vw - 32px);--tcgc-send-hex:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon points='50,8 88.1,30 88.1,70 50,92 11.9,70 11.9,30' fill='%23000' stroke='%23000' stroke-width='14' stroke-linejoin='round'/%3E%3C/svg%3E");position:fixed;left:0;right:0;bottom:0;z-index:1390;display:flex;justify-content:center;box-sizing:border-box;margin:0;padding:0 max(16px,env(safe-area-inset-right,0px)) calc(max(env(safe-area-inset-bottom,0px),8px) + 12px) max(16px,env(safe-area-inset-left,0px));pointer-events:none;visibility:hidden;font-family:var(--tcgc-send-font);font-size:16px;line-height:1.2;text-align:left;-webkit-tap-highlight-color:transparent;transition:visibility 0s linear 220ms}
#tcgc-send[hidden]{display:none!important}
#tcgc-send[data-where=land]{--tcgc-send-font:"TCGC Golos","Golos Text",Lato,system-ui,sans-serif;--tcgc-send-w:600}
#tcgc-send.is-on{visibility:visible;transition-delay:0s}

/* Подложка: градиент и лёгкое размытие, чтобы кнопка читалась поверх текста; сверху растворяется */
#tcgc-send::before{content:"";position:absolute;inset:-40px 0 0;z-index:-1;pointer-events:none;background:linear-gradient(180deg,rgba(255,255,255,0),rgba(255,255,255,.76) 56%,rgba(255,255,255,.92));-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);-webkit-mask-image:linear-gradient(transparent,#000 52%);mask-image:linear-gradient(transparent,#000 52%);opacity:0;transition:opacity 200ms linear}
#tcgc-send.is-on::before{opacity:1}

#tcgc-send .tcgc-send__in{position:relative;display:flex;justify-content:center;max-width:100%;opacity:0;transform:translateY(10px) scale(.97);transition:opacity 180ms ease-out,transform 260ms var(--tcgc-send-ease)}
#tcgc-send.is-on .tcgc-send__in{opacity:1;transform:none}

/* Кнопка: голубая пилюля, белая сота с фотоаппаратом, тёмно-синяя подпись (5,4:1) */
#tcgc-send .tcgc-send__btn{pointer-events:auto;position:relative;display:inline-flex;align-items:center;gap:12px;box-sizing:border-box;width:auto;max-width:100%;height:auto;min-width:0;min-height:60px;margin:0;padding:5px 26px 5px 7px;border:0;border-radius:999px;background:#01a0e2;color:#0b2340;font:var(--tcgc-send-w) 17px/1.15 var(--tcgc-send-font);letter-spacing:0;text-transform:none;text-decoration:none;text-shadow:none;white-space:nowrap;cursor:pointer;-webkit-appearance:none;appearance:none;touch-action:manipulation;-webkit-user-select:none;user-select:none;box-shadow:0 1px 2px rgba(1,80,120,.28),0 14px 30px -12px rgba(1,90,140,.55);transition:scale 280ms var(--tcgc-send-ease),background-color 160ms ease-out,box-shadow 200ms ease-out}
#tcgc-send .tcgc-send__btn:visited,#tcgc-send .tcgc-send__btn:hover,#tcgc-send .tcgc-send__btn:focus{color:#0b2340;text-decoration:none}
#tcgc-send .tcgc-send__btn:focus{outline:none}
#tcgc-send .tcgc-send__btn:focus-visible{outline:3px solid #0b2340;outline-offset:3px}
#tcgc-send .tcgc-send__cell{flex:none;display:grid;place-items:center;width:46px;height:50px;background:#fff;color:#0079b0;-webkit-mask:var(--tcgc-send-hex) center/100% 100% no-repeat;mask:var(--tcgc-send-hex) center/100% 100% no-repeat;transition:scale 280ms var(--tcgc-send-ease)}
#tcgc-send .tcgc-send__ic{display:block;width:22px;height:22px;fill:currentColor;stroke:none}
#tcgc-send .tcgc-send__label{display:block}
#tcgc-send .tcgc-send__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
#tcgc-send .tcgc-send__btn:active{scale:.96;transition-duration:100ms}
#tcgc-send .tcgc-send__btn:active .tcgc-send__cell{scale:.92;transition-duration:100ms}
@media (hover:hover) and (pointer:fine){
 #tcgc-send .tcgc-send__btn:hover{background:#2bb3ea;box-shadow:0 1px 2px rgba(1,80,120,.28),0 18px 34px -12px rgba(1,90,140,.6)}
}

/* Подсказка: одна строка над кнопкой, с крестиком; появляется один раз и дважды мягко кивает */
#tcgc-send .tcgc-send__tip{position:absolute;left:50%;bottom:calc(100% + 12px);z-index:1;display:flex;justify-content:center;box-sizing:border-box;width:var(--tcgc-send-tw);margin:0 0 0 calc(var(--tcgc-send-tw) / -2);padding:0;pointer-events:none}
#tcgc-send .tcgc-send__tip[hidden]{display:none}
#tcgc-send .tcgc-send__bubble{pointer-events:auto;position:relative;display:flex;align-items:center;gap:2px;box-sizing:border-box;max-width:100%;min-height:36px;margin:0;padding:0 3px 0 14px;border-radius:18px;background:#0b2340;color:#fff;font:var(--tcgc-send-w) 13.5px/1.25 var(--tcgc-send-font);white-space:nowrap;box-shadow:0 8px 18px -8px rgba(11,35,64,.55);opacity:0;transform:translateY(6px);transform-origin:50% 100%;transition:opacity 160ms linear,transform 260ms var(--tcgc-send-ease)}
#tcgc-send .tcgc-send__bubble::after{content:"";position:absolute;left:50%;top:100%;margin-left:-6px;border:6px solid transparent;border-top-color:#0b2340;border-bottom:0}
#tcgc-send .tcgc-send__tip-t{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis}
#tcgc-send .tcgc-send__tip.is-on .tcgc-send__bubble{opacity:1;transform:none;animation:tcgc-send-nod 1.2s 400ms var(--tcgc-send-ease) 2}
@keyframes tcgc-send-nod{0%,100%{translate:0 0}40%{translate:0 -4px}}
/* Под подсказкой оказались плитки вкладок первого экрана: она отходит, не закрываясь */
#tcgc-send .tcgc-send__tip.is-on.is-away .tcgc-send__bubble{opacity:0;pointer-events:none}
#tcgc-send .tcgc-send__x{position:relative;flex:none;display:grid;place-items:center;box-sizing:border-box;width:32px;height:32px;min-width:0;min-height:0;margin:2px 0;padding:0;border:0;border-radius:50%;background:none;color:inherit;font:inherit;line-height:1;cursor:pointer;-webkit-appearance:none;appearance:none;touch-action:manipulation;box-shadow:none;transition:background-color 120ms ease-out}
#tcgc-send .tcgc-send__x::after{content:"";position:absolute;inset:-6px}
#tcgc-send .tcgc-send__xi{display:block;width:18px;height:18px;fill:currentColor;stroke:none;pointer-events:none}
#tcgc-send .tcgc-send__x:active{background:rgba(255,255,255,.18)}
#tcgc-send .tcgc-send__x:focus{outline:none}
#tcgc-send .tcgc-send__x:focus-visible{outline:2px solid #fff;outline-offset:-2px}
@media (hover:hover) and (pointer:fine){#tcgc-send .tcgc-send__x:hover{background:rgba(255,255,255,.14)}}

/* Кнопка «Наверх» темы: пока видна наша кнопка, стоит над ней; пока видна подсказка (телефон), уступает */
.tcg-totop-dock{transition:translate 240ms var(--tcgm-ease,cubic-bezier(.23,1,.32,1))}
html.tcgc-send-on .tcg-totop-dock{translate:0 -72px}
@media not all and (min-width:1100px) and (hover:hover) and (pointer:fine){
 html.tcgc-send-on.tcgc-send-tip .tcg-totop-dock button.tcg-totop{opacity:0;visibility:hidden;pointer-events:none;transition:opacity 140ms ease,visibility 0s linear 140ms}
}
/* Телефон до 600 px (R2 24.11): шестигранник «Наверх» над правым концом пилюли стоял кучкой, ни по одной оси не ровно.
   Пока видна пилюля, «Наверх» не показывается и не поднимается; пилюля ушла (у формы, у подвала) - он на своём месте. */
@media (max-width:599.98px){
 html.tcgc-send-on .tcg-totop-dock{translate:0 0}
 html.tcgc-send-on .tcg-totop-dock button.tcg-totop{opacity:0;visibility:hidden;pointer-events:none;transition:opacity 140ms ease,visibility 0s linear 140ms}
}

/* Открыто меню, поиск, окно или галерея, на телефоне открыта клавиатура: кнопка уступает */
html:has(#masthead details[open]) #tcgc-send,html:has(#masthead[data-menu-open]) #tcgc-send,html:has(dialog[open]) #tcgc-send,html:has(.pswp--open) #tcgc-send{visibility:hidden;transition:visibility 0s linear 180ms}
html:has(#masthead details[open]) #tcgc-send .tcgc-send__in,html:has(#masthead[data-menu-open]) #tcgc-send .tcgc-send__in,html:has(dialog[open]) #tcgc-send .tcgc-send__in,html:has(.pswp--open) #tcgc-send .tcgc-send__in,
html:has(#masthead details[open]) #tcgc-send::before,html:has(#masthead[data-menu-open]) #tcgc-send::before,html:has(dialog[open]) #tcgc-send::before,html:has(.pswp--open) #tcgc-send::before{opacity:0}
/* Открыто окно с формой (landing.js ставит класс; отдельным правилом для браузеров без :has) */
html.tcgc-sheet-open #tcgc-send{visibility:hidden;transition:none}
html.tcgc-sheet-open #tcgc-send .tcgc-send__in,html.tcgc-sheet-open #tcgc-send::before{opacity:0}
@media (hover:none) and (pointer:coarse){
 html:has(:is(input:not([type=checkbox],[type=radio],[type=submit],[type=button],[type=reset],[type=range],[type=hidden],[type=file]),textarea,select,[contenteditable=true]):focus) #tcgc-send{visibility:hidden;transition:none}
}

/* ПК с мышью: компактная кнопка справа снизу на месте кнопки «Наверх» (та поднимается), подсказка слева */
@media (min-width:1100px) and (hover:hover) and (pointer:fine){
 #tcgc-send{--tcgc-send-gap:16px;left:auto;right:max(var(--tcgc-send-gap),calc(env(safe-area-inset-right,0px) + 12px));bottom:max(calc(var(--tcgc-send-gap) + 4px),calc(env(safe-area-inset-bottom,0px) + 12px));padding:0}
 #tcgc-send::before{content:none}
 #tcgc-send .tcgc-send__btn{min-height:56px;gap:10px;padding:4px 22px 4px 6px;font-size:16px}
 #tcgc-send .tcgc-send__cell{width:44px;height:48px}
 #tcgc-send .tcgc-send__ic{width:21px;height:21px}
 #tcgc-send .tcgc-send__tip{left:auto;right:calc(100% + 14px);top:50%;bottom:auto;width:max-content;margin:-18px 0 0}
 #tcgc-send .tcgc-send__bubble{transform:translateX(6px);transform-origin:100% 50%}
 #tcgc-send .tcgc-send__bubble::after{left:100%;top:50%;margin:-6px 0 0;border:6px solid transparent;border-left-color:#0b2340;border-right:0}
 #tcgc-send .tcgc-send__tip.is-on .tcgc-send__bubble{transform:none;animation-name:tcgc-send-nod-x}
 html.tcgc-send-on .tcg-totop-dock{translate:0 -68px}
}
@media (min-width:1121px) and (hover:hover) and (pointer:fine){#tcgc-send{--tcgc-send-gap:28px}}
@keyframes tcgc-send-nod-x{0%,100%{translate:0 0}40%{translate:4px 0}}
/* ПК 1100-1639 px (R3 25.11): поле справа от колонки уже пилюли (90 px при 1280, 170 при 1440), и пилюля ложилась на
   кнопки вопросов, призы и доску работ. Здесь кнопка - одна сота с фотоаппаратом 56 px в поле справа, под кнопкой «Наверх»;
   подпись «Отправить работу» остаётся в кнопке (её слышит диктор) и видна слева по наведению и фокусу, как подсказка.
   С 1640 px пилюля целиком помещается в поле. */
@media (min-width:1100px) and (max-width:1639.98px) and (hover:hover) and (pointer:fine){
 #tcgc-send .tcgc-send__btn{gap:0;padding:4px 6px}
 #tcgc-send .tcgc-send__label{position:absolute;top:50%;right:calc(100% + 12px);display:flex;align-items:center;box-sizing:border-box;height:36px;margin-top:-18px;padding:0 14px;border-radius:18px;background:#0b2340;color:#fff;font:var(--tcgc-send-w) 13.5px/1.25 var(--tcgc-send-font);white-space:nowrap;box-shadow:0 8px 18px -8px rgba(11,35,64,.55);pointer-events:none;opacity:0;transform:translateX(6px);transition:opacity 140ms ease-out,transform 200ms var(--tcgc-send-ease)}
 #tcgc-send .tcgc-send__btn:is(:hover,:focus-visible) .tcgc-send__label{opacity:1;transform:none}
 html.tcgc-send-tip #tcgc-send .tcgc-send__btn .tcgc-send__label{opacity:0;transform:translateX(6px)}
}

/* Тёмная тема сайта */
@media (prefers-color-scheme:dark){
 html:has(#tcg-dark-css) #tcgc-send::before{background:linear-gradient(180deg,rgba(17,18,20,0),rgba(17,18,20,.78) 56%,rgba(17,18,20,.94))}
 html:has(#tcg-dark-css) #tcgc-send .tcgc-send__btn{box-shadow:0 1px 2px rgba(0,0,0,.5),0 14px 30px -12px rgba(0,0,0,.8)}
 html:has(#tcg-dark-css) #tcgc-send .tcgc-send__btn:focus-visible{outline-color:#4cc3f5}
 html:has(#tcg-dark-css) #tcgc-send .tcgc-send__bubble{background:#eef6fb;color:#0b2340;box-shadow:0 8px 18px -8px rgba(0,0,0,.7)}
 html:has(#tcg-dark-css) #tcgc-send .tcgc-send__bubble::after{border-top-color:#eef6fb}
 html:has(#tcg-dark-css) #tcgc-send .tcgc-send__x:active{background:rgba(11,35,64,.12)}
 html:has(#tcg-dark-css) #tcgc-send .tcgc-send__x:focus-visible{outline-color:#0b2340}
}
@media (prefers-color-scheme:dark) and (hover:hover) and (pointer:fine){
 html:has(#tcg-dark-css) #tcgc-send .tcgc-send__x:hover{background:rgba(11,35,64,.1)}
}
@media (prefers-color-scheme:dark) and (min-width:1100px) and (hover:hover) and (pointer:fine){
 html:has(#tcg-dark-css) #tcgc-send .tcgc-send__bubble::after{border-top-color:transparent;border-left-color:#eef6fb}
}
@media (prefers-color-scheme:dark) and (min-width:1100px) and (max-width:1639.98px) and (hover:hover) and (pointer:fine){
 html:has(#tcg-dark-css) #tcgc-send .tcgc-send__label{background:#eef6fb;color:#0b2340;box-shadow:0 8px 18px -8px rgba(0,0,0,.7)}
}

/* Меньше движения: мягкое проявление без сдвигов, без кивков и сжатия при нажатии */
@media (prefers-reduced-motion:reduce){
 #tcgc-send .tcgc-send__in,#tcgc-send.is-on .tcgc-send__in{transform:none;transition:opacity 200ms ease-out}
 #tcgc-send .tcgc-send__bubble,#tcgc-send .tcgc-send__tip.is-on .tcgc-send__bubble{transform:none;animation:none;transition:opacity 200ms ease-out}
 #tcgc-send .tcgc-send__btn,#tcgc-send .tcgc-send__cell{transition:background-color 160ms ease-out}
 #tcgc-send .tcgc-send__btn:active,#tcgc-send .tcgc-send__btn:active .tcgc-send__cell{scale:none}
 #tcgc-send .tcgc-send__label{transform:none!important;transition:opacity 160ms ease-out}
 .tcg-totop-dock{transition:none}
}
@media (forced-colors:active){
 #tcgc-send .tcgc-send__btn{border:2px solid ButtonText}
 #tcgc-send .tcgc-send__cell{-webkit-mask:none;mask:none;background:none;color:ButtonText}
 #tcgc-send .tcgc-send__bubble{border:1px solid CanvasText}
}
@media (forced-colors:active) and (min-width:1100px) and (max-width:1639.98px) and (hover:hover) and (pointer:fine){#tcgc-send .tcgc-send__label{border:1px solid CanvasText}}
@media print{#tcgc-send{display:none!important}}
