@font-face {
  font-family: 'power red and green';
  src: url('power red and green.ttf') format('truetype'); /* Matches file name exactly */
  font-display: swap; /* Prevents invisible text while loading */
}
/* 2. Apply it globally to the page */
body, h1, h2, p, a, span {
  font-family: 'power red and green', monospace !important;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@keyframes movingheader {
  0% {
    background-position: 0px calc(100% + 1px);
  }
  100% {
    /* 31px * 6 tiles = 186px horizontally */
    /* 184px * 1 tile = 184px vertically */
    /* Adds the 1px bottom offset to the final calculation */
    background-position: 186px calc(100% + 1px - 184px);
  }
}

@keyframes movingcard {
  0% {
    background-position: 0px 0px;
  }
  100% {
    /* 31px * 10 tiles = 310px horizontally */
    /* 446px * 1 tile = 446px vertically */
    background-position: 310px -446px; 
  }
}

@keyframes movingBackground {
  0% {
    background-position: 0 0;
  }
  100% {
    /* 1080 is exactly 36 repeats of the 30px width */
    /* 1080 is exactly 1 repeat of the 1080px height */
    background-position: 1080px -1080px; 
  }
}

@keyframes movingBackground {
  0% { background-position: 0 0; }
  100% { background-position: 1080px -1080px; }
}

body {
  /* Typography */
  font-family: "Power Red and Green", "Courier New", Courier, monospace;
  font-size: 30px;
  color: #555555;
  image-rendering: pixelated; 

  /* Layout */
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: clamp(10px, 3vw, 30px); 
  box-sizing: border-box;
  gap: 20px;
  
  /* Centering Rules */
  justify-content: center; /* Centers layout vertically */
  align-items: center;     /* Centers layout horizontally */

  /* Background setup */
  background-color: #f7eff7;
  background-image: url('img/bgcrop.png');
  background-repeat: repeat; 
  animation: movingBackground 40s linear infinite;
}

@keyframes movingBackground {
  0% { background-position: 0 0; }
  100% { background-position: 1080px -1080px; }
}

/* CRITICAL: Ensure your main structural children stretch responsively */
.main-header, 
.grid-container,
main {
  width: 100%;             /* Allows fluid shrinking on small mobile screens */
  max-width: 1500px;       /* Keeps the layout tight and centered on wide monitors */
  box-sizing: border-box;  /* Prevents border sizes from breaking the 100% width */
}


.container {
  width: 100%;
  max-width: 1500px;
}

/* From Uiverse.io by 3HugaDa3 */ 
@keyframes grid-move {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}



.button-container {
  position: relative;
  z-index: 10;
  perspective: 1000px;
}

.pixel-button {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: "power red and green", monospace;
  font-weight: 900;
  font-size: 24px;
  color: #fff;
  padding: 0;
  outline: none;
  transform-style: preserve-3d;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* CRITICAL ADDITIONS FOR WIDTH PROTECTION */
  white-space: nowrap;  /* Prevents text content from breaking onto new lines */
  width: max-content;   /* Snaps the button wrapper strictly to the dimensions of the text */
  flex-shrink: 0;       /* Prevents Flexbox containers from crushing the button width */
}

.pixel-button:hover {
  transform: rotateX(10deg) rotateY(-10deg) scale(1.05);
}

.pixel-button:active {
  transform: rotateX(5deg) rotateY(-5deg) scale(0.98);
}

.button-face {
  position: relative;
  padding: 14px 28px;
  background: linear-gradient(135deg, #ff0080, #ff8c00, #40e0d0, #ff0080);
  background-size: 400% 400%;
  animation: gradient-shift 23s ease infinite;
  clip-path: polygon(
    8px 0%,
    calc(100% - 8px) 0%,
    100% 8px,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    8px 100%,
    0% calc(100% - 8px),
    0% 8px
  );
  position: relative;
  overflow: hidden;
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Pixelated corners */
.button-face::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
      45deg,
      transparent 6px,
      rgba(255, 255, 255, 0.1) 6px,
      rgba(255, 255, 255, 0.1) 8px,
      transparent 8px
    ),
    linear-gradient(
      -45deg,
      transparent 6px,
      rgba(255, 255, 255, 0.1) 6px,
      rgba(255, 255, 255, 0.1) 8px,
      transparent 8px
    ),
    linear-gradient(
      135deg,
      transparent 6px,
      rgba(255, 255, 255, 0.1) 6px,
      rgba(255, 255, 255, 0.1) 8px,
      transparent 8px
    ),
    linear-gradient(
      -135deg,
      transparent 6px,
      rgba(255, 255, 255, 0.1) 6px,
      rgba(255, 255, 255, 0.1) 8px,
      transparent 8px
    );
  background-size: 16px 16px;
  background-position:
    0 0,
    100% 0,
    0 100%,
    100% 100%;
  background-repeat: no-repeat;
}

/* Holographic effect */
.button-face::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: holographic-sweep 55s ease-in-out infinite;
}

@keyframes holographic-sweep {
  0% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: -100%;
  }
}

/* Glitch effect */
.button-text {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.pixel-button:hover .button-text {
  animation: glitch-text 0.5s ease-in-out;
}

@keyframes glitch-text {
  0%,
  100% {
    transform: translate(0);
  }
  10% {
    transform: translate(-2px, 2px);
  }
  20% {
    transform: translate(2px, -2px);
  }
  30% {
    transform: translate(-2px, -2px);
  }
  40% {
    transform: translate(2px, 2px);
  }
  50% {
    transform: translate(-2px, 2px);
  }
  60% {
    transform: translate(2px, -2px);
  }
  70% {
    transform: translate(-2px, -2px);
  }
  80% {
    transform: translate(2px, 2px);
  }
  90% {
    transform: translate(-2px, 2px);
  }
}

/* Pixel icon */
.pixel-icon {
  width: 24px;
  height: 24px;
  background: #fff;
  position: relative;
  border-radius: 2px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}


.pixel-icon::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  background: linear-gradient(45deg, #ff0080, #40e0d0);
  border-radius: 1px;
}

.pixel-icon::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: #fff;
  border-radius: 1px;
}

/* 3D shadow effect */
.button-shadow {
  position: absolute;
  top: 8px;
  left: 8px;
  right: -8px;
  bottom: -8px;
  background: linear-gradient(
    135deg,
    rgba(255, 0, 128, 0.3),
    rgba(64, 224, 208, 0.3)
  );
  clip-path: polygon(
    8px 0%,
    calc(100% - 8px) 0%,
    100% 8px,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    8px 100%,
    0% calc(100% - 8px),
    0% 8px
  );
  z-index: -1;
  filter: blur(8px);
  transition: all 0.3s ease;
}

.pixel-button:hover .button-shadow {
  transform: translate(4px, 4px);
  filter: blur(12px);
}

.pixel-button:active .button-shadow {
  transform: translate(2px, 2px);
  filter: blur(4px);
}

/* Neon glow */
.button-glow {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: linear-gradient(135deg, #ff0080, #ff8c00, #40e0d0, #ff0080);
  background-size: 400% 400%;
  animation: gradient-shift 23s ease infinite;
  clip-path: polygon(
    12px 0%,
    calc(100% - 12px) 0%,
    100% 12px,
    100% calc(100% - 12px),
    calc(100% - 12px) 100%,
    12px 100%,
    0% calc(100% - 12px),
    0% 12px
  );
  z-index: -2;
  filter: blur(8px);
  opacity: 0.7;
}

.pixel-button:hover .button-glow {
  filter: blur(16px);
  opacity: 1;
}

/* Scanlines effect */
.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.05) 2px,
    rgba(255, 255, 255, 0.05) 4px
  );
  pointer-events: none;
  z-index: 3;
}

/* Cyberpunk border animation */
.cyber-border {
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    #ff0080,
    transparent,
    #40e0d0,
    transparent,
    #ff8c00,
    transparent
  );
  background-size: 400% 400%;
  animation: border-flow 4s linear infinite;
  clip-path: polygon(
    10px 0%,
    calc(100% - 10px) 0%,
    100% 10px,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    10px 100%,
    0% calc(100% - 10px),
    0% 10px
  );
  z-index: -3;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pixel-button:hover .cyber-border {
  opacity: 1;
}

@keyframes border-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .button-face {
    padding: 10px 30px;
  }

  .pixel-button {
    font-size: 24px;
  }

  .pixel-icon {
    width: 20px;
    height: 20px;
  }
}

/* Accessibility */
.pixel-button:focus {
  outline: 2px solid #40e0d0;
  outline-offset: 4px;
}

/* Performance optimization */
.pixel-button * {
  will-change: transform;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .button-face {
    background: linear-gradient(135deg, #ff0080, #ff8c00, #40e0d0, #8a2be2);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.5s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.5s !important;
  }
}

@keyframes typing {
  /* --- WORD 1: Pokemon (Paused ~11.4%) --- */
  0.0000%, 27.3488% { content: ""; }
  1.1395%, 26.2093% { content: "P"; }
  2.2791%, 25.0698% { content: "Po"; }
  3.4186%, 23.9302% { content: "Pok"; }
  4.5581%, 22.7907% { content: "Poke"; }
  5.6977%, 21.6512% { content: "Pokem"; }
  6.8372%, 20.5116% { content: "Pokemo"; }
  7.9767%, 19.3721% { content: "Pokemon"; }

  /* --- WORD 2: Minecraft (Paused ~11.4%) --- */
  30.7674%, 55.0000% { content: ""; }
  31.6000%, 54.1600% { content: "M"; }
  32.4326%, 53.3274% { content: "Mi"; }
  33.2652%, 52.4948% { content: "Min"; }
  34.0978%, 51.6622% { content: "Mine"; }
  34.9304%, 50.8296% { content: "Minec"; }
  35.7630%, 49.9970% { content: "Minecr"; }
  36.5956%, 49.1644% { content: "Minecra"; }
  37.4282%, 48.3318% { content: "Minecraf"; }
  38.2608%, 47.5000% { content: "Minecraft"; } /* Pauses between 38.2% and 47.5% */

  /* --- WORD 3: Palworld (Paused ~11.4%) --- */
  57.0000%, 79.0000% { content: ""; }
  58.0000%, 78.0000% { content: "P"; }
  59.0000%, 77.0000% { content: "Pa"; }
  60.0000%, 76.0000% { content: "Pal"; }
  61.0000%, 75.0000% { content: "Palw"; }
  62.0000%, 74.0000% { content: "Palwo"; }
  63.0000%, 73.0000% { content: "Palwor"; }
  64.0000%, 72.0000% { content: "Palword"; } /* Pauses between 64.0% and 72.0% */

}



@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typewriter {
  --caret: currentcolor;
}

.typewriter::before {
  content: "";
  animation: typing 13.5s infinite;
}

.typewriter::after {
  content: "";
  border-right: 1px solid var(--caret);
  animation: blink 0.5s linear infinite;
}

.typewriter.thick::after {
  border-right: 1ch solid var(--caret);
}

.typewriter.nocaret::after {
  border-right: 0;
}


@media (prefers-reduced-motion) {
  .typewriter::after {
    animation: none;
  }
  
  @keyframes sequencePopup {
    0%, 100% { content: "developer"; }
    25% { content: "writer"; }
    50% { content: "reader"; }
    75% { content: "human"; }
  }

  .typewriter::before {
    content: "developer";
    animation: sequencePopup 12s linear infinite;
  }
}

/* --- Main Header --- */
.main-header {
  /* Layout & Spacing */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 25px;
  box-sizing: border-box; /* Prevents padding from distorting dimensions */
  

  /* Borders & Shadows */
  border: 4px solid #fff;
  border-radius: 12px;
  box-shadow: 0 4px 0 #d3cbd3;
  
  /* Background setup */
  background-image: url("img/bg-h.png");
  background-color: #baafbc;
  background-repeat: repeat;
  background-size: auto; /* Changed from contain to protect the pixel grid math */
  
  /* Animation */
  animation: movingheader 10s linear infinite;
}

.logo-title {
  color: #3bd1c1;
  font-size: 3.5rem;
  text-shadow: -3px -3px 0 #b01872, 3px -3px 0 #b01872, -3px 3px 0 #b01872, 3px 3px 0 #b01872;
  letter-spacing: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 230px;
}

.avatar-placeholder {
  
  width: 198px;
  height: 212px;
  align-items: left;
  background-image: url("img/ankokuflare-gen2.png");
  border-radius: 0px;
}

.featured-on {
  display: flex;
  align-items: center;
  gap: 7px;
  background-color: #fff;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  font-size: 1.55rem;
  font-weight: bold;
}

.featured-on span {
  color: #777;
  margin-bottom: 2px;
}

.featured-on a {
  text-decoration: none;
  color: #fff;
  padding: 4px 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 1.25rem;
}

/* 1. Base Styles & Layout for the Buttons */
.btn-youtube, 
.btn-twitch, 
.btn-kofi {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px; /* Adds space between the image icon and the text */
  cursor: pointer;
  padding: 10px 20px; /* Adjust to match your design */
  border: none;
  
  /* Smooth transition for the shadow and the inner elements */
  transition: box-shadow 0.15s ease-out;
  box-shadow: 0 0 0 0px transparent; 
}

/* 2. Individual Button Colors */
.btn-youtube { background-color: #ff4a6b; }
.btn-twitch  { background-color: #a94eff; }
.btn-kofi    { background-color: #08a3ea; }

/* 3. Setup Transitions for the Internal Text and Images */
.btn-youtube span, .btn-youtube img,
.btn-twitch span, .btn-twitch img,
.btn-kofi span, .btn-kofi img {
  display: inline-block;
  transition: transform 0.15s ease-out;
  image-rendering: pixelated; /* Keeps icons perfectly crisp */
}

/* 4. Unified Button Hover Extensions (3px outward) */
.btn-youtube:hover { box-shadow: 0 0 0 3px #ff4a6b; }
.btn-twitch:hover  { box-shadow: 0 0 0 3px #a94eff; }
.btn-kofi:hover    { box-shadow: 0 0 0 3px #08a3ea; }

/* 5. Scale the Text and Images when the Button is Hovered */
.btn-youtube:hover span, .btn-youtube:hover img,
.btn-twitch:hover span, .btn-twitch:hover img,
.btn-kofi:hover span, .btn-kofi:hover img {
  /* Scales up slightly to visually match the 3px button frame growth */
  transform: scale(1.08); 
}


/* --- Intro / Subheader Bar --- */
.intro-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  border-radius: 20px;
  padding: 10px 20px;
  margin-bottom: 20px;
  font-weight: bold;
}

.intro-text {
  color: #666;
}

.btn-server {
  text-decoration: none;
  background-color: #7be5e5;
  color: #333;
  padding: 6px 16px;
  border-radius: 15px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.15);
}

.card img {
  --s: 400px;   /* the size of the image */
  --b: 14px;     /* the border thickness*/
  --g: 10px;    /* the gap */
  --c: #4ECDC4; /* the color */
  
  width: var(--s);
  aspect-ratio: 1;
  outline: calc(var(--s)/2) solid #0000;
  outline-offset: calc(var(--s)/-2);
  cursor: pointer;
  transition: .3s;
}
.card img:hover {
  outline: var(--b) solid var(--c);
  outline-offset: var(--g);
}

.card img + img {
  border-radius: 50%;
}




/* --- Main Grid Content Layout --- */
.grid-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  background-image: url("img/bg-c.png");
  background-color: #c4b9cc;
  border: 4px solid #fff;
  border-radius: 12px;
  padding: 10px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  
    /* Animation */
  background-repeat: repeat;
  animation: movingcard 20s linear infinite;
}



.card-graphic2 {
  width: 240px;
  height: 224px;
  background-image: url("img/flarepalpack.png");
  border-radius: 8px;
  opacity: 0.8;
}

.card-label {
  color: #7be5e5;
  font-weight: bold;
  font-size: 1.2rem;
  margin-top: 10px;
}

/* --- Work In Progress Card --- */
.wip-card {
	filter: brightness(0.7) grayscale(0.4);
	padding: 10px 20px;
  background-color: #d1c7d6;
  justify-content: flex-start;
  align-items: stretch;
}

.wip-title {
  color: #fff;
  text-align: center;
  font-size: 3.7rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 0px #888;
}

.wip-items {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  gap: 15px;
  height: 100%;
}

.wip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 0.85rem;
  color: #777;
  flex: 1;
}

.wip-graphic {
  width: 201px;
  height: 243px;
  background-image: url("img/metro.png");
  border-radius: 6px;
  margin-bottom: 8px;
}

.wip-graphic2 {
  width: 192px;
  height: 256px;
  background-image: url("img/saraph.png");
  border-radius: 6px;
  margin-bottom: 8px;
}

/* Accent color border for the dragon survival image */
.graphic-dragon {
  border: 2px solid #7be5e5;
}

.wip-item span {
  font-size: 0.75rem;
  color: #999;
}

/* --- Footer --- */
.main-footer {
  text-align: center;
  color: #888;
  font-size: 1.30rem;
  margin-top: 10px;
}

/* Full-screen setup for the trailing interaction canvas */
#grid-trail-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;            /* Sits directly above your bgcrop.png background */
  pointer-events: none;  /* Allows you to click items underneath it */
}

/* 1. Global Page Content Wrapper (Handles the master alignment constraint) */
.page-content {
  position: relative;
  z-index: 10;           /* Floating layer context on top of the trail canvas */
  width: 100%;
  max-width: 1200px;     /* Limits wide monitor stretching cleanly */
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

/* 2. Main structural layouts stretch naturally to fill the page container width */
.main-header, 
.grid-container,
main {
  position: relative;
  z-index: 10;
  width: 100%;
  box-sizing: border-box;
}

/* 3. PROTECTED CARD RULE: Cards must never have fixed widths or max-widths forced here */
.card {
  position: relative;
  z-index: 10;
  width: 100%;           /* Inherits fluid space allocated by the parent CSS grid wrapper */
  box-sizing: border-box;
}
