/* === КОЛЬОРИ КНОПОК СОЦМЕРЕЖ === */
a#telegram { background-color: #16428f; }
a#discord { background-color: #41489b; }
a#github { background-color: #010409; }
a#modrinth { background-color: #16181c; }
a#twitch { background-color: #5c2d91; }
a#youtube { background-color: #8d1111; }
a#steam { background-color: #1c3049; }
a#namemc { background-color: #181e24; }
a#donatello { background-color: #20466b; }
a#monobank { background-color: #0f0f0f; }

/* === АНІМАЦІЯ ПРЕДМЕТІВ (HIBISCUS) === */
/* Контейнер для декорацій - щоб не впливав на розмір картки */
#hibiscus-decorations {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Щоб можна було клікати крізь нього */
  z-index: 10;
}

#hibiscus-decorations img {
  position: absolute;
  --dx: 0;
  --dy: 0;
  --rotation: 0;
  --delay: 0s;
  --duration: 2s;
  transform: rotate(calc(var(--rotation) * 90deg));
  animation: var(--duration) ease-in-out infinite var(--delay) alternate hibiscus;
  display: block;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
  image-rendering: pixelated; 
  pointer-events: auto; /* Самі предмети можна хапати */
}

#hibiscus-decorations img.hibiscus-top { top: calc(var(--dy) * 1px + var(--x)); left: calc(var(--dx) * 1px + var(--y)); }
#hibiscus-decorations img.hibiscus-bottom { bottom: calc(var(--dy) * -1px + var(--x)); left: calc(var(--dx) * 1px + var(--y)); }
#hibiscus-decorations img.hibiscus-left { top: calc(var(--dy) * 1px + var(--y)); left: calc(var(--dx) * 1px + var(--x)); }
#hibiscus-decorations img.hibiscus-right { top: calc(var(--dy) * 1px + var(--y)); right: calc(var(--dx) * -1px + var(--x)); }

@keyframes hibiscus {
  0% { transform: rotate(calc(var(--rotation) * 90deg - 45deg)); }
  100% { transform: rotate(calc(var(--rotation) * 90deg + 45deg)); }
}

/* === ОСНОВНИЙ BODY === */
body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center; /* Центрування по горизонталі */
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%; /* Гарантуємо повну ширину */
  font-size: 12pt;
  z-index: -3;
  overflow-x: hidden;
  box-sizing: border-box;
  background-color: #f0f0f0; 
  color: #333;
}

@media screen and (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
    color: #eee;
  }
}

/* === КАРТКА ПРОФІЛЮ === */
.card {
  font-family: "Arial", "sans-serif";
  background-color: oklch(82.25% 0.102 303.59deg);
  color: #222; 
  
  padding: 0.5em;
  border: 3px solid #a142e0;
  border-radius: 1em;
  
  width: 27em; /* Базова ширина */
  max-width: 90%; /* Адаптивність: ніколи не ширше 90% екрану */
  
  box-sizing: border-box;
  position: relative;
  
  /* ВАЖЛИВО: auto по боках гарантує центрування */
  margin: 1em auto; 
  
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.card::before {
  content: "";
  display: block;
  position: absolute;
  box-sizing: border-box;
  inset: -3px;
  background: transparent;
  z-index: -1;
  border-radius: inherit;
  border: 3px solid transparent;
  box-shadow: 0em 1em 3em -1em black;
}

/* === ТЕМНА ТЕМА ДЛЯ КАРТКИ === */
@media screen and (prefers-color-scheme: dark) {
  .card {
    background-color: oklch(27.5% 0.065 299.85deg);
    color: #ffffff;
    border: 3px solid #a142e0;
  }
}

/* === HEADER === */
.card > header {
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: max-content 1fr 1fr;
  grid-template-areas: "icon" "title" "subtitle";
  margin-bottom: 1em;
}

@media screen and (min-width: 460px) {
  .card > header {
    grid-template-columns: max-content 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas: "icon title" "icon subtitle";
    gap: 1em;
  }
}

.card > header > img {
  grid-area: icon;
  margin-left: auto;
  margin-right: auto;
}

.card > header > .title,
.card > header > .subtitle {
  text-align: center;
  display: flex;
  flex-direction: column;
}

@media screen and (min-width: 460px) {
  .card > header > .title,
  .card > header > .subtitle {
    text-align: left;
  }
}

.card > header > .title {
  grid-area: title;
  justify-content: flex-end;
}

.card > header > .title > h1 {
  margin-block: 0;
}

.card > header > .subtitle {
  grid-area: subtitle;
  font-style: italic;
  justify-content: center;
  opacity: 0.9;
}

.card > header > .subtitle > p {
  margin-block: 0;
}

.card > header main {
  margin: 0.25em 0.25em;
}

/* === ПОСИЛАННЯ (КНОПКИ) === */
nav.links > ul {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-flow: wrap;
  flex-direction: row;
  justify-content: center;
  gap: 1em;
  margin: 1em 0pt;
  padding: 0; /* Прибираємо зайві відступи */
  width: 100%; /* Щоб займало всю ширину картки */
}

nav.links > ul a {
  display: flex;
  margin: 2pt;
  padding: 0.5em;
  align-items: center;
  border-radius: 8pt;
  outline: 2px solid transparent;
  box-shadow: 0 0.25em 0.5em -0.25em rgba(0, 0, 0, 0.3);
  text-decoration: none;
  transition: outline-color 0.2s, transform 0.1s;
  color: #ffffff !important; 
  font-weight: 500;
}

nav.links > ul a:active {
  transform: scale(0.98);
}

nav.links > ul a span {
  margin: 2pt;
}

nav.links > ul a:hover,
nav.links > ul a:focus {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  animation-name: trans-background;
  transition: outline-color 0.2s;
  animation-duration: 2.5s;
  animation-direction: alternate;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

nav.links > ul a:hover span:not([aria-labelledby]),
nav.links > ul a:focus span:not([aria-labelledby]) {
  text-decoration: underline;
}

@media screen and (prefers-color-scheme: dark) {
  nav.links > ul a:hover,
  nav.links > ul a:focus {
    animation-name: trans-outline;
  }
}

@media screen and (min-width: 460px) {
  nav.links > ul a {
    padding: 2pt;
  }
}

nav.links > ul .omit {
  display: none;
}

@media screen and (min-width: 460px) {
  nav.links > ul .omit {
    display: inline-block;
    padding-right: 4px;
  }
}

nav.links > ul img {
  border-radius: 16pt;
}

nav.links > ul img,
nav.links > ul png {
  max-width: 24px;
}

@media screen and (min-width: 460px) {
  nav.links > ul {
    gap: 0;
  }
}

/* === МОБІЛЬНІ СТИЛІ === */
@media screen and (max-width: 459px) {
  nav.links > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5em;
  }
  nav.links > ul a {
    justify-content: center;
    padding: 0.75em;
  }
  .card {
    padding: 1em;
    margin: 0.5em auto; /* Auto margin тут теж важливий */
    width: 95%; /* Трохи ширше на телефонах */
    max-width: none;
  }
  
  /* Ховаємо декорації на дуже маленьких екранах */
  #hibiscus-decorations {
    display: none;
  }
}

/* Дуже маленькі екрани */
@media screen and (max-width: 320px) {
  .card {
    border-radius: 0.5em;
    margin: 0.25em auto;
    width: 98%;
  }
  
  .card > header > img {
    width: 80px;
    height: 80px;
  }
  
  .card > header > .title > h1 {
    font-size: 1.5em;
  }
}

.center {
  text-align: center;
}

.content {
  margin-left: 8pt;
}

a.trans {
  transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}