/* Підключаємо шрифт */
@font-face {
  font-family: 'Minecraft';
  src: url('/font/fonts/MinecraftSimple.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

body {
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}


:root {
  --tc-bg: #0e121a;
  --tc-white: #f5f6f8;
  --tc-badge: #d04848;
  --tc-shadow: 0 10px 30px rgba(0, 0, 0, .45);

  --panel-w: 600px;
  /* ширина правої частини */
  --img-dur: 400ms;
  /* швидкість анімації */
}


.tc-wrap {
  padding: 40px 16px;
  max-width: 1100px;
  margin: 40px auto;
  border-radius: 20px;
}

.tc-title {
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  margin: 0;
}

.tc-sub {
  text-align: center;
  margin: 8px 0 24px;
  color: #bfb7ff;
  font-weight: 700;
}

.tc-viewport {
  position: relative;
  margin: 0 auto;
  width: min(920px, 92vw);
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: 16px;
}

/* ===== ARROWS ===== */
.tc-arrow {
  position: relative;
  height: 56px;
  width: 56px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: #121722;
  color: #d7dcff;
  font-size: 24px;
  box-shadow: var(--tc-shadow);
  transition: transform .18s cubic-bezier(.2, .7, .2, 1), background .18s ease, box-shadow .18s ease;
  overflow: visible;
}

.tc-arrow:hover {
  background: #141a28;
  transform: translateY(-1px);
}

.tc-arrow:active {
  transform: scale(.96);
}

/* bump-анімація при кліку */
.tc-arrow.bump {
  animation: arrowBump .22s ease;
}

@keyframes arrowBump {
  0% {
    transform: scale(.96);
  }

  50% {
    transform: scale(1.06);
  }

  100% {
    transform: scale(1);
  }
}

/* світлове кільце */
.tc-arrow.bump::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(155, 140, 255, .55);
  animation: arrowRing .36s ease-out forwards;
}

@keyframes arrowRing {
  from {
    transform: scale(.7);
    opacity: .9;
  }

  to {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ===== TRACK / CARD ===== */
.tc-track {
  display: flex;
  overflow: hidden;
  height: 488px;
  transform: translateX(0);
  transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}

.card {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- ОБГОРТКА КАРТКИ --- */
.card-content {
  position: relative;
  height: 488px;
  width: min(calc(278px + var(--panel-w)), 750px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 20px;
  background: transparent;
  transition: opacity .24s ease;
  /* fade для каруселі */
}

/* --- НІКНЕЙМ --- */
.nickname {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Minecraft', monospace;
  font-size: 22px;
  color: #fff;
  z-index: 5;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  opacity: 1;
  transition: opacity .6s ease;
}

.card-content:hover .nickname {
  opacity: 0;
  transition: opacity .2s ease;
}

/* --- ТРИГЕР --- */
.hover-zone {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 278px;
  height: 488px;
  z-index: 4;
  pointer-events: auto;
}

.card-content.is-open .hover-zone {
  pointer-events: none;
}

/* --- КАРТИНКА --- */
.img-wrap {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 278px;
  height: 488px;
  border-radius: 28px;
  overflow: hidden;
  background-clip: padding-box;
  z-index: 3;

  background:
    radial-gradient(120% 40% at 50% -10%, rgba(142, 114, 255, .25) 0%, rgba(142, 114, 255, 0) 55%),
    linear-gradient(180deg, #1a1f2a 0%, #0d1118 100%);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .45), 0 2px 0 rgba(255, 255, 255, .04) inset;

  transition:
    left var(--img-dur) cubic-bezier(.25, .9, .25, 1),
    transform var(--img-dur) cubic-bezier(.25, .9, .25, 1),
    width var(--img-dur) cubic-bezier(.25, .9, .25, 1),
    box-shadow .25s ease;
}

.img-wrap img {
  width: 278px;
  height: 85%;
  object-fit: contain;
  object-position: center center;
  display: block;
  margin-top: 70px;
}

/* рамка/віньєтка */
.img-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 100% at 50% 0%, rgba(0, 0, 0, .0) 20%, rgba(0, 0, 0, .35) 70%, rgba(0, 0, 0, .55) 100%);
  pointer-events: none;
  mix-blend-mode: multiply;
  transition: opacity .25s ease;
}

.img-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
  background: linear-gradient(135deg, #454252 0%, #312b5a 50%, #1f3264 100%);
  padding: 2px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.img-wrap.is-left {
  left: 0;
  transform: none;
  box-shadow: none;
}

.img-wrap.is-left::before {
  opacity: 0;
}

.img-wrap.is-left::after {
  opacity: 0;
}

.img-wrap.is-expanded {
  width: 100%;
  max-width: 100%;
}

.img-wrap.is-expanded::after {
  opacity: 1;
}

/* --- КОНТЕНТ ПРАВОРУЧ --- */
.plate-content {
  position: absolute;
  top: 0;
  left: 278px;
  height: 100%;
  width: calc(100% - 278px);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  color: #fff;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  opacity: 0;
  transition: opacity .35s ease .05s;
  pointer-events: none;
}

.plate-content.show {
  opacity: 1;
}

.name {
  margin: 0 0 8px 0;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
}

.badge {
  margin-left: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  background: var(--tc-badge);
  color: #fff;
}

.desc {
  text-align: left; 
  margin: 10px 0 0 0;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 600;
  max-width: 48ch;
  color: var(--tc-white);
}

/* hover-підйом */
.card-content:hover .img-wrap:not(.is-left) {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 26px 48px rgba(0, 0, 0, .55);
}

/* ===== DOTS: плавна зміна + пульс без затримки ===== */
.tc-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  align-items: center;
  min-height: 16px;
}

.tc-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: #2a3040;
  opacity: .70;
  transform: scale(.9);
  transition:
    background .26s ease,
    transform .26s cubic-bezier(.25, .9, .25, 1),
    box-shadow .26s ease,
    opacity .26s ease;
  position: relative;
  will-change: transform, background, box-shadow, opacity;
}

.tc-dot.is-active {
  background: #9b8cff;
  opacity: 1;
  transform: scale(1.35);
  box-shadow:
    0 0 0 3px rgba(155, 140, 255, .16),
    inset 0 0 14px rgba(155, 140, 255, .32);
}

/* коротка пульсація при моментальному перемиканні */
.tc-dot.pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid rgba(155, 140, 255, .5);
  transform: scale(.55);
  opacity: .85;
  animation: dotPulse .34s ease-out forwards;
}

@keyframes dotPulse {
  to {
    transform: scale(1.55);
    opacity: 0;
  }
}

/* =========================================================
   АДАПТИВ (тільки оверрайди, основні стилі не чіпаємо)
   ========================================================= */

/* великі планшети / вузькі ноутбуки */
@media (max-width: 1024px) {
  :root {
    --panel-w: 480px;
  }

  .tc-viewport {
    grid-template-columns: 56px 1fr 56px;
  }

  .tc-arrow {
    height: 52px;
    width: 52px;
  }

  .tc-track,
  .card-content,
  .img-wrap {
    height: 460px;
  }

  .img-wrap img {
    height: 82%;
    margin-top: 60px;
  }

  .card-content {
    width: min(92vw, 680px);
  }
}

/* планшети / великі телефони (портрет) */
@media (max-width: 768px) {
  :root {
    --panel-w: 360px;
  }

  .tc-title {
    font-size: 28px;
  }

  .tc-sub {
    margin-top: 6px;
  }

  .tc-viewport {
    grid-template-columns: 48px 1fr 48px;
    gap: 12px;
  }

  .tc-arrow {
    height: 48px;
    width: 48px;
  }

  /* Вимикаємо ховер-анімації, залишаємо лише карусель */
  .hover-zone {
    display: none !important;
  }

  .card-content:hover .nickname {
    opacity: 1 !important;
  }

  /* навіть якщо JS встиг додати класи — фіксуємо по центру */
  .img-wrap,
  .img-wrap.is-left {
    left: 50% !important;
    transform: translateX(-50%) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .45), 0 2px 0 rgba(255, 255, 255, .04) inset !important;
  }

  .img-wrap.is-expanded {
    width: 278px !important;
  }

  .plate-content {
    display: none !important;
  }

  .tc-track,
  .card-content,
  .img-wrap {
    height: 440px;
  }

  .img-wrap {
    border-radius: 24px;
  }

  .img-wrap img {
    width: 248px;
    height: 82%;
    margin-top: 56px;
  }

  .card-content {
    width: min(88vw, 420px);
  }

  .tc-dots {
    gap: 10px;
  }
}

/* малі телефони */
@media (max-width: 480px) {
  :root {
    --panel-w: 300px;
  }

  .tc-title {
    font-size: 26px;
  }

  .tc-viewport {
    grid-template-columns: 42px 1fr 42px;
    gap: 10px;
  }

  .tc-arrow {
    height: 42px;
    width: 42px;
  }

  .tc-track,
  .card-content,
  .img-wrap {
    height: 390px;
  }

  .img-wrap {
    border-radius: 22px;
  }

  .img-wrap img {
    width: 220px;
    height: 80%;
    margin-top: 44px;
  }

  .card-content {
    width: min(90vw, 360px);
  }

  .tc-dot {
    width: 9px;
    height: 9px;
    transform: scale(.88);
  }

  .tc-dot.is-active {
    transform: scale(1.28);
  }
}

/* ультра-малі (320px) */
@media (max-width: 360px) {
  .tc-arrow {
    height: 38px;
    width: 38px;
    font-size: 20px;
  }

  .tc-track,
  .card-content,
  .img-wrap {
    height: 360px;
  }

  .img-wrap img {
    width: 208px;
    margin-top: 50px;
    margin-left: 40px;
  }

  .card-content {
    width: min(92vw, 330px);
  }
}

/* Додатково: усі пристрої без hover (тач) — блокуємо ховер-анімації */
@media (hover: none),
(pointer: coarse) {
  .hover-zone {
    display: none !important;
  }

  .card-content:hover .nickname {
    opacity: 1 !important;
  }

  .img-wrap,
  .img-wrap.is-left {
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .img-wrap.is-expanded {
    width: 278px !important;
  }

  .plate-content {
    display: none !important;
  }
}

/* ===== GLOBAL TINY FIXES ===== */
html, body { height: 100%; }
body {
  margin: 0;                 /* прибирає стандартний відступ браузера */
  overflow-x: hidden;        /* без горизонтального скролу на мобілці */
  -webkit-font-smoothing: antialiased;
}

/* safe-area для iOS (вирізи/ноти) */
:root{
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
.tc-wrap{
  padding: calc(40px + var(--safe-top)) max(16px, var(--safe-left))
           calc(24px + var(--safe-bottom)) max(16px, var(--safe-right));
}

/* центральна колонка не звужується менше 278px */
.tc-viewport{
  width: min(920px, 100%); /* щоб точно не було переповнення */
  grid-template-columns: 64px minmax(278px, 1fr) 64px;
}

/* нік нейм під мобілку: авто-розмір + обрізання */
.nickname{
  max-width: calc(100% - 32px);
  text-align: center;
  font-size: clamp(14px, 4.8vw, 22px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* зручні кліки по стрілках на мобілці */
.tc-arrow{
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ===== TABLET (≤ 768px) OVERRIDES ===== */
@media (max-width: 768px){
  /* гарантуємо мінімальну ширину колонки з карткою */
  .tc-viewport{ grid-template-columns: 48px minmax(278px, 1fr) 48px; }

  /* висота картки — відносно екрана, щоб не обрізалось по висоті */
  .tc-track, .card-content, .img-wrap{
    height: clamp(360px, 72vh, 440px);
  }

  /* ширина картки займає всю центральну колонку, без «джитеру» */
  .card-content{
    width: 100% !important;
    max-width: 420px;
    margin: 0 auto;
  }

  /* зображення не виходить за межі */
  .img-wrap img{
    max-width: 100%;
  }
}

/* ===== PHONE (≤ 480px) OVERRIDES ===== */
@media (max-width: 480px){
  .tc-viewport{ grid-template-columns: 52px minmax(140px, 1fr) 52px; }

  /* ще трохи компактніша висота під дуже маленькі екрани */
  .tc-track, .card-content, .img-wrap{
    height: clamp(340px, 74vh, 420px);
  }

  .card-content{
    width: 100% !important;
    max-width: 360px;
  }

  /* легкий запас для нікнейма */
  .nickname{ max-width: calc(100% - 24px); }
}

/* ===== VERY SMALL (≤ 360px) ===== */
@media (max-width: 360px){
  .tc-track, .card-content, .img-wrap{
    height: clamp(320px, 78vh, 380px);
  }
}
