@import url("https://fonts.cdnfonts.com/css/spline-sans-mono");
@import url("https://fonts.cdnfonts.com/css/eb-garamond-3");

:root {
  --primary: #ffffff;
  --minesa-brown: #ab8673;
  --link: #0c50ff;
  --background-color: #1b1b1b;

  --font-mono: "Spline Sans Mono", monospace;
  --font-garamond: "EB Garamond", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --primary: #1b1b1b;
    --background-color: #ffffff;
  }
}

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

::selection {
  background-color: #775d50;
  color: #ffffff;
}

body {
  background-color: var(--background-color);
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  color: var(--primary);
  font-family: var(--font-garamond);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  box-shadow: inset 0 0 0 rgba(255, 255, 255, 0);
  transition:
    opacity 240ms ease,
    box-shadow 240ms ease;
}

body.logo-charge::before {
  opacity: 1;
  box-shadow:
    inset 0 0 120px rgba(255, 255, 255, 0.72),
    inset 0 0 260px rgba(255, 255, 255, 0.26);
}

svg {
  width: 100px;
  height: 100px;
}

main {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 100vh;
}

section > h1 {
  font-family: var(--font-garamond);
  font-style: italic;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 400;
  text-align: center;
  margin-top: 50px;
  z-index: -1 !important;
  position: relative !important;
}

section > ul {
  margin-top: 75px;
  list-style: none;
  display: flex;
  gap: 40px;
  justify-content: center;
  align-items: center;
}

header a {
  border: none !important;
  color: var(--primary) !important;
}

header a:hover {
  border: none !important;
  background-color: transparent !important;
  transform: none !important;
  color: var(--primary) !important;
}

header a:hover svg path {
  animation-duration: 0.3s !important;
}

a {
  display: inline;
  color: var(--primary);
  text-decoration: none;
  border: 3px dotted transparent;
  border-bottom: 3px dotted var(--primary);

  &:hover {
    color: var(--minesa-brown);
    border: 3px dotted var(--minesa-brown);
  }
}

li {
  position: relative;
}

li a {
  border: 3px dotted transparent;
  padding: 5px;
  display: flex;
  width: max-content;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2.1px;
  font-size: 14px;
  transition: all 200ms cubic-bezier(0.175, 0.885, 0.32, 1.275);

  &:hover {
    color: #ffffff;
    border: 3px solid #4f4f4f98;
    border-radius: 8px;
    background-color: #4f4f4f;
    transform: rotate(3deg);
    z-index: 3;

    & ~ .list-item-image {
      visibility: visible;
      transform: translate(-50%, -101%) rotate(3deg) scale(1);
      width: 300px;
      height: 150px;
      object-fit: cover;
      pointer-events: none;
      opacity: 1;
    }
  }
}

.disabled a,
.disabled-link {
  pointer-events: none;
  opacity: 0.6;
}

.soon-badge {
  font-size: 10px;
  background-color: var(--minesa-brown);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.list-item-image {
  position: absolute;
  visibility: hidden;
  top: 0;
  left: 50%;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2);
  border: 3px solid #4f4f4ff1;
  transition: all 600ms cubic-bezier(0.075, 0.82, 0.165, 1);
}

.kaeru {
  object-fit: contain !important;
  border: none;
  height: 100px;
  width: 50px;
  top: 50%;
  z-index: -1;
}

ul .list-icon:last-child {
  width: 28px;
  height: 20px;
}

footer {
  margin-top: 50px;
}

nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

nav a {
  border: none;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2.1px;
  font-size: small;
  &:hover {
    border: none;
  }
}

#grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  --cell-size: 10px;
  transform-origin: 50% 50%;
}

body.game-smash #grid-overlay {
  animation: grid-smash 380ms cubic-bezier(0.18, 0.89, 0.3, 1.25) 1;
}

body.game-smash .game-screen-content {
  animation: content-dismiss 420ms cubic-bezier(0.18, 0.89, 0.3, 1.08) 1 forwards;
}

@keyframes grid-smash {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  35% {
    transform: scale(1.16);
    opacity: 1;
  }

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

@keyframes content-dismiss {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  55% {
    transform: scale(1.08);
    opacity: 0.18;
  }

  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

main {
  position: relative;
  z-index: 1;
}

.game-screen-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  transition:
    opacity 260ms ease,
    transform 260ms ease,
    visibility 260ms ease;
}

body.game-on .game-screen-content {
  opacity: 0;
  transform: scale(1.12);
  visibility: hidden;
  pointer-events: none;
}

.game-hud {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 3;
  display: none;
  align-items: flex-end;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.game-close {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 3;
  display: none;
  padding: 10px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(27, 27, 27, 0.7);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  cursor: pointer;
}

.game-close.visible {
  display: block;
}

.game-restart {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: none;
  transform: translate(-50%, -50%);
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  color: #ffffff;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  cursor: pointer;
}

.game-restart.visible {
  display: block;
}

.game-hud.visible {
  display: flex;
}

.game-chip {
  padding: 10px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(27, 27, 27, 0.7);
  backdrop-filter: blur(10px);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.game-timer {
  display: none;
  color: #ffffff;
  font-size: 12px;
}

.game-timer.visible {
  display: block;
}

.game-score {
  color: #ffffff;
  font-size: 13px;
}

.game-status {
  color: #b8b8b8;
  font-size: 11px;
  line-height: 1.45;
  text-align: right;
  max-width: min(42ch, 72vw);
}

.cell-instance {
  position: absolute;
  width: var(--cell-size);
  height: var(--cell-size);
  pointer-events: none;
  background: var(--minesa-brown);
  opacity: 0;
  transform: scale(0.75);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
  will-change: opacity, transform;
}

.cell-instance.show {
  opacity: 1;
  transform: scale(1);
}

.cell-instance.fade {
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity 1000ms ease,
    transform 300ms ease;
}

.cell-instance.agent {
  background: var(--link);
}

.cell-instance.agent-head {
  background: #4fd3ff;
  transform: scale(1.15);
}

.cell-instance.agent-hunter {
  background: #ff5a36;
}

.cell-instance.agent-head-hunter {
  background: #ff2f12;
  transform: scale(1.15);
}

.cell-instance.player-body {
  background: rgba(184, 188, 196, 0.72);
}

.cell-instance.player-head {
  background: #cfd3da;
  transform: scale(1.18);
}

.cell-instance.player-ghost {
  background: rgba(206, 212, 222, 0.34);
  transform: scale(0.92);
}

.cell-instance.food {
  background: var(--minesa-brown);
  transform: scale(0.82);
}

@media (prefers-reduced-motion: reduce) {
  .cell-instance {
    transition: none !important;
  }
}

/* INNERFORGE STYLES */
.innerforge-page {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
  padding: 8vh 5vw;
}

.innerforge-container {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

.if-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.if-logo-link {
  border: none !important;
  display: flex;
  color: inherit !important;
  transform-origin: center;
}
.if-logo-link:hover {
  border: none !important;
  background-color: transparent !important;
  transform: none !important;
}
.if-logo-icon {
  height: 38px;
  width: auto;
  display: block;
  transform-origin: center;
  transition: transform 220ms ease;
}

.if-logo-icon path {
  fill: currentColor;
}

.if-header .if-logo-link:hover .if-logo-icon {
  animation: playful-logo-wobble 700ms cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

@keyframes playful-logo-wobble {
  0% {
    transform: scale(1) rotate(0deg);
  }

  20% {
    transform: scale(1.12) rotate(-6deg);
  }

  40% {
    transform: scale(1.18) rotate(5deg);
  }

  60% {
    transform: scale(1.14) rotate(-3deg);
  }

  80% {
    transform: scale(1.08) rotate(2deg);
  }

  100% {
    transform: scale(1.1) rotate(0deg);
  }
}
.if-separator {
  color: #a0a0a0;
  font-size: 24px;
}

.if-title {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #a0a0a0;
  font-size: 14px;
}

.if-team-section {
  display: block;
  margin-top: 0.75rem;
  padding: 0.75rem 0.375rem 1.5rem;
}

.if-team-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.if-team-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 2px;
  color: #a0a0a0;
}

.if-team-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  transition:
    color 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.if-team-link:hover {
  color: #ffffff;
  opacity: 1;
  transform: translateY(-1px);
}

.if-team-list li img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.if-divider {
  border: none;
  border-top: 1px solid #4f4f4f;
  margin: 40px 0;
}

.if-collab-title {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 2px;
  color: #c4c4c4;
  margin-bottom: 24px;
  font-weight: 500;
}

.if-collab-title-with-icon {
  display: flex;
  align-items: center;
  gap: 14px;
}

.if-collab-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: inherit;
}

.if-collab-title-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.if-collab-title-icon-heart {
  color: #ff6fae;
}

.if-collab-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 2px;
  color: #a0a0a0;
}

.if-sponsor-empty {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 1.4px;
  color: #8a8a8a;
}

.if-sponsor-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 12px;
}

.if-sponsor-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #d2d2d2;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1.3px;
  transition:
    color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.if-sponsor-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.if-sponsor-name {
  color: inherit;
}

.if-sponsor-login {
  color: #8d8d8d;
}

.if-bot-link {
  position: fixed;
  bottom: -20px;
  right: 5vw;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10;
}

.if-bot-balloon {
  position: absolute;
  bottom: calc(100% - 18px);
  right: 78px;
  min-width: max-content;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: #1b1b1b;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.96);
  transform-origin: bottom right;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  transition:
    opacity 180ms ease,
    visibility 180ms ease,
    transform 180ms ease;
}

.if-bot-balloon::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 100%;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.94);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

.if-bot-link:hover .if-bot-balloon,
.if-bot-link:focus-within .if-bot-balloon {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.if-bot-stack {
  position: relative;
  width: 150px;
  animation: kaeru-idle-sway 4.8s ease-in-out infinite;
  transform-origin: 50% 100%;
  transition: filter 140ms ease;
}

.if-bot-decoration {
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  pointer-events: auto;
  transform-origin: 50% 100%;
  transition:
    opacity 160ms ease,
    filter 160ms ease,
    transform 160ms ease;
}

.if-bot-decoration-base {
  position: relative;
  opacity: 1;
  filter: blur(0);
}

.if-bot-decoration-hover {
  opacity: 0;
  filter: blur(12px);
  transform: scale(1.035);
}

.if-bot-link:hover .if-bot-stack,
.if-bot-link:focus-within .if-bot-stack {
  animation:
    kaeru-hover-pulse 980ms cubic-bezier(0.22, 1, 0.36, 1) 1,
    kaeru-hover-breathe 1.9s ease-in-out 980ms infinite;
  filter: blur(0.3px);
}

.if-bot-link:hover .if-bot-decoration-base,
.if-bot-link:focus-within .if-bot-decoration-base {
  opacity: 0;
  filter: blur(12px);
  transform: scale(0.965);
}

.if-bot-link:hover .if-bot-decoration-hover,
.if-bot-link:focus-within .if-bot-decoration-hover {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

.if-bot-balloon:hover {
  background: #ffffff;
}

.if-bot-balloon:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.42);
  outline-offset: 4px;
}

@keyframes kaeru-idle-sway {
  0%, 100% {
    transform: rotate(-1.6deg) translateY(0) scale(1);
  }

  12% {
    transform: rotate(-4.2deg) translateY(-1px) scale(0.992);
  }

  27% {
    transform: rotate(3.2deg) translateY(2px) scale(1.014);
  }

  41% {
    transform: rotate(5.4deg) translateY(0) scale(1.01);
  }

  56% {
    transform: rotate(-2.8deg) translateY(3px) scale(0.996);
  }

  71% {
    transform: rotate(-5.1deg) translateY(0) scale(0.99);
  }

  86% {
    transform: rotate(2.8deg) translateY(2px) scale(1.012);
  }
}

@keyframes kaeru-hover-pulse {
  0% {
    transform: rotate(-0.8deg) translateY(0) scaleX(1) scaleY(1);
  }

  22% {
    transform: rotate(2.4deg) translateY(-1px) scaleX(0.92) scaleY(1.035);
  }

  46% {
    transform: rotate(-3deg) translateY(1px) scaleX(0.88) scaleY(1.06);
  }

  72% {
    transform: rotate(1.4deg) translateY(0) scaleX(0.95) scaleY(1.02);
  }

  100% {
    transform: rotate(0deg) translateY(0) scaleX(1) scaleY(1);
  }
}

@keyframes kaeru-hover-breathe {
  0%, 100% {
    transform: rotate(0deg) translateY(0) scaleX(1) scaleY(1);
  }

  35% {
    transform: rotate(0.8deg) translateY(0) scaleX(0.965) scaleY(1.018);
  }

  65% {
    transform: rotate(-0.6deg) translateY(1px) scaleX(0.978) scaleY(1.01);
  }
}

@media (max-width: 768px) {
  body {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }
  
  .if-header {
    flex-wrap: wrap;
  }
  
  section > h1 {
    font-size: 22px;
    padding: 0 20px;
  }

  section > ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-top: 40px;
  }

  nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
  }

  .innerforge-container {
    width: calc(100% - 60px);
  }

  .if-team-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .if-team-list span {
    display: none;
  }

  .link-name {
    display: none;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .innerforge-container {
    width: calc(100% - 60px);
  }
}
