@font-face {
  font-family: 'ArkPixel12Mono';
  src: url('https://ark-pixel-font.takwolf.com/ark-pixel-12px-proportional-zh_cn.otf.woff2?r=0.6098677306960287') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

body {
  font-family: 'Press Start 2P', cursive;
  background: #5DADE2;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

/* ============ LOADING SCREEN ============ */
#loading {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
}

#loading.done {
  animation: fadeOut 0.8s forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    pointer-events: none;
  }
}

.starfield {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #FFF;
  animation: starMoveUp linear infinite;
}

@keyframes starMoveUp {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-110vh);
    opacity: 0;
  }
}

.pixel-grid {
  position: absolute;
  inset: 0;
  opacity: 0.1;
}

.cartridge {
  width: 280px;
  height: 180px;
  background: #E74C3C;
  border: 8px solid #C0392B;
  position: relative;
  margin-bottom: 3rem;
  box-shadow: inset 0 -20px 0 #A93226, 0 10px 0 #7B241C, 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.cartridge-label {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 100px;
  background: #F39C12;
  border: 4px solid #D68910;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.cart-title {
  font-size: 1rem;
  color: #000;
  text-align: center;
}

.cart-subtitle {
  font-size: 0.5rem;
  color: #555;
}

.cartridge-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35px;
  background: #34495E;
  border-top: 4px solid #2C3E50;
}

.cartridge-grip {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 16px;
  background: #7F8C8D;
  border: 3px solid #5D6D7E;
}

.load-text {
  color: #3498DB;
  font-size: 1.5rem;
  text-shadow: 4px 4px 0 #000;
  margin-bottom: 2.5rem;
  z-index: 1;
  animation: pulse 1s ease-in-out infinite;
}

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

.progress-wrapper {
  width: 400px;
  z-index: 1;
}

.progress-label {
  color: #3498DB;
  font-size: 0.7rem;
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 0.8rem;
  text-align: center;
}

.progress-frame {
  background: #2980B9;
  border: 8px solid #3498DB;
  padding: 8px;
  box-shadow: inset 0 0 0 4px #1F618D, 0 6px 0 #000;
}

.progress-container {
  width: 100%;
  height: 32px;
  background: #000;
  border: 4px solid #154360;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: #2ECC71;
  width: 0;
  transition: width 0.3s;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 3px #27AE60;
}

.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 8px,
    rgba(255, 255, 255, 0.3) 8px,
    rgba(255, 255, 255, 0.3) 16px
  );
}

/* ============ MAIN SCENE ============ */
#pixel-world {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.ground {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 10vh;
  background: #27AE60;
  z-index: 2;
  border-top: 6px solid #1E8449;
}

.container {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  animation: fadeIn 0.8s 0.5s forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.window {
  max-width: 650px;
  width: 100%;
  background: #FFF8DC;
  border: 6px solid #000;
  box-shadow: 0 0 0 3px #E74C3C, 0 0 0 6px #000, 0 0 0 9px #F39C12, 0 0 0 12px #000,
    0 15px 50px rgba(0, 0, 0, 0.5);
}

.title-bar {
  background: #E74C3C;
  padding: 0.8rem 1rem;
  border-bottom: 6px solid #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title {
  color: #FFF;
  font-size: clamp(0.6rem, 1.8vw, 0.9rem);
  text-shadow: 2px 2px 0 #000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.title-icon {
  width: 18px;
  height: 18px;
  background: #E91E63;
  border: 3px solid #000;
  cursor: pointer;
  transition: transform 0.1s;
}

.title-icon:active {
  transform: scale(0.9);
}

.controls {
  display: flex;
  gap: 6px;
}

.btn-control {
  width: 18px;
  height: 18px;
  border: 3px solid #000;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-control:active {
  transform: scale(0.9);
}

.btn-min {
  background: #F39C12;
}

.btn-max {
  background: #3498DB;
}

.btn-close {
  background: #E74C3C;
}

.content {
  padding: 1.8rem;
  background: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 16px,
      rgba(0, 0, 0, 0.02) 16px,
      rgba(0, 0, 0, 0.02) 17px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 16px,
      rgba(0, 0, 0, 0.02) 16px,
      rgba(0, 0, 0, 0.02) 17px
    );
}

.name {
  text-align: center;
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  color: #E74C3C;
  text-shadow: 3px 0 0 #F39C12, 0 3px 0 #3498DB, 3px 3px 0 #000;
  margin-bottom: 1.5rem;
}

.message-box {
  background: #ECF0F1;
  border: 6px solid #000;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  position: relative;
  box-shadow: inset 0 0 0 3px #BDC3C7;
}

.message-arrow {
  position: absolute;
  bottom: -18px;
  left: 35px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid #000;
}

.message-arrow::after {
  content: '';
  position: absolute;
  top: -15px;
  left: -9px;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid #ECF0F1;
}

.message {
  font-size: clamp(0.6rem, 1.4vw, 0.75rem);
  line-height: 1.8;
  color: #000;
}

.social {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.social-btn {
  padding: 1rem;
  border: 5px solid #000;
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(0.5rem, 1vw, 0.6rem);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  color: #FFF;
  transition: all 0.1s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-height: 90px;
}

.social-btn:active {
  transform: translate(3px, 3px);
}

.btn-github {
  background: #333;
  box-shadow: 0 5px 0 #1a1a1a;
}

.btn-github:active {
  box-shadow: 0 2px 0 #1a1a1a;
}

.btn-twitter {
  background: #1DA1F2;
  box-shadow: 0 5px 0 #0C7ABF;
}

.btn-twitter:active {
  box-shadow: 0 2px 0 #0C7ABF;
}

.btn-telegram {
  background: #0088cc;
  box-shadow: 0 5px 0 #006699;
}

.btn-telegram:active {
  box-shadow: 0 2px 0 #006699;
}

.btn-website {
  background: #9B59B6;
  box-shadow: 0 5px 0 #7D3C98;
}

.btn-website:active {
  box-shadow: 0 2px 0 #7D3C98;
}

/* Original icons - no processing */
.social-btn i {
  font-size: 2.2rem;
  color: #FFF;
}

/* ICP Filing Badge with pixelated Chinese font */
.icp-badge {
  font-family: 'ArkPixel12Mono', monospace !important;
  font-size: 12px;
  line-height: 12px;
  letter-spacing: 1px;
  font-weight: 400;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-rendering: geometricPrecision;

  position: fixed;
  bottom: 15px;
  right: 20px;
  z-index: 4;
  color: #2C3E50;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.4);
  padding: 10px 14px;
  background: rgba(255, 248, 220, 0.9);
  border: 4px solid #000;
  box-shadow: 0 4px 0 #7F8C8D;
  letter-spacing: 1px;
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .content {
    padding: 1rem;
  }

  .social {
    gap: 0.8rem;
  }

  .social-btn {
    padding: 0.8rem 0.5rem;
    min-height: 80px;
  }

  .social-btn i {
    font-size: 1.8rem;
  }

  .cartridge {
    width: 220px;
    height: 140px;
  }

  .cartridge-label {
    height: 75px;
    top: 15px;
    left: 15px;
    right: 15px;
  }

  .cart-title {
    font-size: 0.8rem;
  }

  .progress-wrapper {
    width: 300px;
  }

  .progress-container {
    height: 28px;
  }

  .window {
    border-width: 5px;
    box-shadow: 0 0 0 2px #E74C3C, 0 0 0 5px #000, 0 0 0 7px #F39C12, 0 0 0 10px #000,
      0 10px 30px rgba(0, 0, 0, 0.5);
  }

  .icp-badge {
    font-family: 'ArkPixel12Mono', monospace !important;
    font-size: 11px;
    line-height: 11px;
    padding: 8px 12px;
    bottom: 12px;
    right: 12px;
  }
}

@media (max-width: 480px) {
  .load-text {
    font-size: 1.2rem;
  }

  .cartridge {
    width: 200px;
    height: 120px;
  }

  .cartridge-label {
    height: 60px;
  }

  .cart-title {
    font-size: 0.7rem;
  }

  .cart-subtitle {
    font-size: 0.45rem;
  }

  .progress-wrapper {
    width: 250px;
  }

  .social-btn {
    padding: 0.7rem 0.4rem;
    min-height: 70px;
  }

  .social-btn i {
    font-size: 1.5rem;
  }

  .icp-badge {
    font-family: 'ArkPixel12Mono', monospace !important;
    font-size: 10px;
    line-height: 10px;
    padding: 6px 10px;
    bottom: 8px;
    right: 8px;
  }
}
