/* ---------- FONT ----------------------------------------------- */
@font-face {
  font-family: "Minecraft";
  src: url("fonts/Minecraft.ttf") format("truetype");
}

/* ---------- THEME VARIABLES ------------------------------------ */
:root {
  --neon: #00ff95;
  --accent-pink: #ff0066;
  --bg-grad-1: #0a0a0a;
  --bg-grad-2: #1a1a1a;
  --scanline-opacity: 0.07;
}

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

/* ---------- BODY ----------------------------------------------- */
body {
  font-family: "Minecraft", monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(
    circle at center,
    var(--bg-grad-2) 0%,
    var(--bg-grad-1) 60%,
    #000 100%
  );

  &::before {
    content: "";
    position: fixed;
    inset: 0;
    /* background: url("images/ui/stars.png") repeat; */
    animation: drift 90s linear infinite;
    mix-blend-mode: screen;
    opacity: 0.15;
    pointer-events: none;
  }
}

@keyframes drift {
  to {
    background-position: 10000px 5000px;
  }
}

/* ---------- PHONE FRAME ---------------------------------------- */
.phone-frame {
  background: url("images/frame-phone.png") center/145% no-repeat;
  width: 350px;
  height: 700px;
  position: relative;
  filter: drop-shadow(0 0 12px var(--accent-pink));
  transition: filter 0.4s ease;

  &:hover {
    filter: drop-shadow(0 0 18px var(--neon));
  }
}

/* ---------- SCREEN AREA ---------------------------------------- */
.screen-overlay {
  position: absolute;
  top: 100px;
  left: 64px;
  width: 225px;
  height: 450px;
  overflow: hidden;
}

.screen {
  background: #000;
  border-radius: 28px;
  height: 100%;
  padding: 12px;
  overflow-y: auto;
  position: relative;

  &::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 1px,
      rgba(0, 0, 0, var(--scanline-opacity)) 2px
    );
    pointer-events: none;
  }
}

/* ---------- INPUT / GATE / TEXT -------------------------------- */
.input-section {
  width: 100%;
  text-align: center;
  margin-bottom: 8px;
}

.input-display {
  background: rgba(0, 255, 0, 0.1);
  border-radius: 10px;
  width: 100%;
  max-width: 100%;
  font-size: 18px;
  color: var(--neon);
  text-align: center;
  min-height: 48px;
  border: none;
  outline: none;
  font-family: "Minecraft";
  padding: 10px 12px;
  box-sizing: border-box;
  margin-bottom: 8px;
}

.terminal-prompt {
  color: var(--neon);
  font-size: 12px;
  margin-bottom: 20px;
  text-align: center;
  opacity: 0.8;
  font-family: "Minecraft";
}

.instruction-text {
  color: #888;
  font-size: 12px;
  text-align: center;
  margin-top: 12px;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 5px rgba(0, 255, 149, 0.3);
  }
  to {
    text-shadow: 0 0 15px rgba(0, 255, 149, 0.8);
  }
}

/* ---------- PARTICLES ------------------------------------------ */
.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--neon);
  border-radius: 50%;
  animation: float 3s linear infinite;
}

@keyframes float {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10%,
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) scale(1);
    opacity: 0;
  }
}

.character-display {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 12px;
  min-height: 150px; /* or whatever looks best */
}

.preview-right {
  justify-content: flex-end;
  flex: 1;
  padding-bottom: 40px;
}
.preview-left,
.preview-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.combo-preview {
  width: 50px;
  height: 50px;
  image-rendering: pixelated;
  background: #111;
  border: 1px solid #444;
  visibility: hidden;
  position: relative;

  &::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.03) 3px
    );
    animation: flicker 2s infinite;
    pointer-events: none;
  }
}

@keyframes flicker {
  0%,
  100% {
    opacity: 0.05;
  }
  50% {
    opacity: 0.15;
  }
}

/* ---------- HAT & NAME ----------------------------------------- */
.hat-container {
  position: relative;
  margin-bottom: -6px;
}

.name-on-hat {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 8px;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- CHARACTER ITEM ------------------------------------- */
.character-item {
  image-rendering: pixelated;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ---------- COMBO NAME ----------------------------------------- */
.combo-name {
  color: var(--accent-pink);
  font-size: 16px;
  margin-top: 10px;
  text-align: center;
  font-family: "Minecraft", monospace;
  letter-spacing: 0.06em;
  /* text-shadow: 0 0 4px #ff006688, 0 0 8px #ff0066aa, 0 0 2px #fff; */
  padding: 3px 0;
  border-radius: 8px;
  max-width: 70px;
  word-break: break-word;
  background: rgba(255, 0, 102, 0.06); /* subtle neon pink backdrop */
  /* box-shadow: 0 1px 8px 0 rgba(255, 0, 102, 0.11); */
}

/* ---------- CATEGORY TITLE (glitch effect) --------------------- */
.category-title {
  width: 100%;
  text-align: center;
  margin: 10px 0 5px;
  color: var(--neon);
  text-transform: uppercase;
  font-size: 8px;
  letter-spacing: 0.05em;
  position: relative;

  &::before,
  &::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    opacity: 0.6;
    animation: glitch 2s infinite;
  }

  &::before {
    clip-path: inset(0 0 70% 0);
  }

  &::after {
    clip-path: inset(70% 0 0 0);
    animation-delay: 0.8s;
  }
}

@keyframes glitch {
  0%,
  100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-1px, 1px);
  }
  40% {
    transform: translate(1px, -1px);
  }
  60% {
    transform: translate(-1px, -1px);
  }
  80% {
    transform: translate(1px, 1px);
  }
}

/* ---------- OPTIONS GRID --------------------------------------- */
.customization-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 8px 0;
  width: 100%;
}

.customization-options.choose-char {
  grid-template-columns: repeat(3, 1fr); /* 3 columns for 3 characters */
  justify-content: center; /* center grid if fewer columns than width */
  margin-left: auto;
  margin-right: auto;
  width: 80%; /* optional: make it a bit narrower for visual balance */
}

.option-item {
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;

  img {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
  }

  &:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 6px var(--accent-pink);
  }

  &.selected {
    border-color: var(--accent-pink);
    background: rgba(255, 0, 102, 0.2);
  }
}

/* ---------- DOWNLOAD FAB ---------------------------------------- */
.download-fab {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-pink);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--accent-pink);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;

  &:hover {
    transform: translateY(-2px) scale(1.07);
    background: var(--neon);
    box-shadow: 0 0 16px var(--neon);
  }
}

/* ---------- CONTENT / GATE ------------------------------------- */
.customizer-content {
  display: none;
  animation: fadeIn 0.5s ease forwards;
}

#customizerContent {
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;

  &.show {
    display: block;
    opacity: 1;
  }
}

.input-gate {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.5s ease;

  &.hidden {
    opacity: 0;
    pointer-events: none;
  }
}
.powered-by-jn {
  margin-top: 18px;
  text-align: center;
  font-family: "Minecraft";
  font-size: 20px;
  font-weight: bold;
  color: var(--accent-pink);
  letter-spacing: 0.08em;
  text-shadow: 0 0 1px #ff0066cc, 0 0 4px #ff006688;
  filter: drop-shadow(0 0 12px #ff006655);
  user-select: none;
  pointer-events: none;
  opacity: 0.95;
  position: relative;
  left: 0;
  right: 0;
  width: 100%;
  display: block;
  animation: jnNeonFlicker 4s infinite;
}
.powered-by-jn-LNK {
  margin-top: 4px;
  text-align: center;
  font-family: "Minecraft";
  font-size: 14px;
  font-weight: bold;
  color: var(--accent-pink);
  letter-spacing: 0.08em;
  text-shadow: 0 0 1px #ff0066cc, 0 0 4px #ff006688;
  filter: drop-shadow(0 0 12px #ff006655);
  user-select: none;
  pointer-events: none;
  opacity: 0.95;
  position: relative;
  left: 0;
  right: 0;
  width: 100%;
  display: block;
  animation: jnNeonFlicker 4s infinite;
}

@keyframes jnNeonFlicker {
  0%,
  100% {
    text-shadow: 0 0 2px #ff006688, 0 0 4px #ff006633;
  }
  5% {
    text-shadow: 0 0 6px #ff0066cc, 0 0 12px #ff0066aa;
  }
  7% {
    text-shadow: 0 0 2px #ff006688, 0 0 4px #ff006633;
  }
  50% {
    text-shadow: 0 0 3px #ff0066aa, 0 0 8px #ff006655;
  }
}
/* ---------- IDLE ANIMATION ------------------------------------- */
@keyframes idleWiggle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

.character-item {
  animation: idleWiggle 3s ease-in-out infinite;
}
.fab-group {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: flex-end;
  margin-top: 18px;
}

.fab-action {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fab-label {
  margin-top: 5px;
  font-size: 11px;
  color: var(--accent-pink);
  font-family: "Minecraft", monospace;

  letter-spacing: 0.05em;
  font-weight: bold;
  user-select: none;
}
.fab-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--accent-pink);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  /* box-shadow: 0 4px 12px rgba(0, 255, 65, 0.3); */
  box-shadow: 0 0 12px var(--accent-pink);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;

  &:hover {
    transform: translateY(-2px) scale(1.07);
    background: var(--neon);
    box-shadow: 0 0 16px var(--neon);
  }
}

@keyframes flicker {
  0%,
  100% {
    opacity: 1;
  }
  45% {
    opacity: 0.5;
  }
  90% {
    opacity: 0.75;
  }
}
