html, body {
  min-height: 100%;
}

body {
  font-family: "Georgia", "Times New Roman", serif;
  background-image: url("./assets/tegel.jpg");
  background-repeat: repeat;
  background-size: 240px 240px;
  background-position: center top;
  background-attachment: fixed;
  color: #222;
  margin: 0;
  text-align: center;
}

.hidden { display: none !important; }

.brand-logo-wrap {
  margin: 14px auto 8px auto;
}

.brand-logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 rgba(0,0,0,0.2);
  object-fit: cover;
  background: #fff;
}

.hero, .header, .buy-img {
  max-width: 100%;
  border-bottom: 6px solid #000;
}

.title-card {
  margin: 20px auto 30px auto;
  padding: 24px;
  max-width: 1800px;
  background: #463618;
  border: 5px solid #000;
  border-radius: 16px;
  box-shadow: 10px 10px 0 rgba(255, 216, 0, 0.35);
}

.login-card {
  margin: 20px auto 24px auto;
  max-width: 620px;
  background: #b4a9f1;
  border: 4px solid #000;
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.15), 10px 10px 0 rgba(255, 216, 0, 0.3);
}

.lang-picker {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px auto 16px;
}

.lang-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #000;
  background: #fff8e1;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
}

.lang-btn.active {
  background: #ffe79c;
  box-shadow: 0 0 0 3px #000 inset;
}

.info-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 10px auto 30px auto;
  padding: 20px 26px;
  max-width: 1100px;
  background: #f7edd7;
  border: 5px solid #000;
  border-radius: 16px;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.15), 10px 10px 0 rgba(255, 216, 0, 0.3);
}

.cartoon-title {
  text-align: center;
  font-size: 52px;
  color: #ffd000;
  font-weight: bold;
  margin: 30px 0 40px 0;
  text-shadow:
    -3px 3px 0 #000,
    -6px 6px 0 #000,
    4px -2px 0 rgba(0,0,0,0.35);
}

.btn {
  padding: 12px 20px;
  margin: 8px;
  border-radius: 12px;
  border: 3px solid #000;
  background: #fff;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-yellow {
  background: #ffeb3b;
}

.btn-rainbow {
  padding: 24px 46px;
  font-size: 22px;
  font-weight: 900;
  color: #000;
  background: linear-gradient(120deg, #ff0040, #ffa800, #ffee00, #00d86c, #00a8ff, #c100ff, #ff0040);
  background-size: 300% 300%;
  animation: rainbow-shine 4s linear infinite;
  box-shadow:
    0 0 0 4px #000 inset,
    6px 6px 0 rgba(0,0,0,0.2);
}

.btn-buy {
  background: #ff9800;
  font-size: 1.2em;
}

.btn-icon {
  height: 20px;
  vertical-align: middle;
}

.warning {
  margin: 20px;
  padding: 16px;
  border: 4px dashed red;
  background: #fff0f0;
}

.warning-text {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #8b0000;
  background: #fff3cd;
  padding: 8px;
  border: 2px dashed #ff9800;
  border-radius: 8px;
}

.principal-info {
  font-size: 20px;
  font-weight: bold;
  text-align: left;
}

.tax-status {
  text-align: center;
  font-size: 18px;
}

.tax-line, .status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
}

.tax-label { font-weight: 800; }

.light-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.light {
  display: inline-block;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c0ffcc 0%, #4cff63 40%, #0c8c18 70%, #07530f 100%);
  box-shadow:
    0 0 0 4px #053b0a,
    0 0 20px 8px rgba(0, 255, 0, 0.45),
    inset 0 -10px 15px rgba(0,0,0,0.45);
  position: relative;
  animation: pulse 1.5s ease-in-out infinite;
}

.light::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 18px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #9fffae 70%, transparent 100%);
  opacity: 0.9;
}

.light-caption {
  font-weight: 700;
  letter-spacing: 0.4px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 20px;
  margin: 20px;
  align-items: stretch;
}

.card {
  background: #f1a2a2;
  border: 4px solid #000;
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  height: 100%;
  box-shadow: 6px 6px 0 rgba(255,248,230,0.95);
  box-sizing: border-box;
}

.weekly-card {
  background: #eef6ff;
}

.weekly-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.weekly-pay-btn {
  margin-top: 8px;
}

.weekly-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.buy-card {
  background: #e9f7e9;
}

.presale-card {
  background: #abf8fd;
}

.help-card {
  background: #f7b9b9;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.comic-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.comic-card-text {
  margin: 0;
  font-weight: 700;
}

.comic-card-img {
  width: 100%;
  max-width: 420px;
  height: auto;
  border: 3px solid #000;
  border-radius: 12px;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.15);
}

.login-comic-card {
  margin: 16px auto 0 auto;
  max-width: 620px;
}

.btn-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.big-buy {
  width: 100%;
  margin-top: 20px;
  font-size: 28px;
  padding: 20px 40px;
}

.big-icon {
  width: 32px;
  height: 32px;
  margin-left: 10px;
}

.buy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.buy-img {
  display: block;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.buy-box {
  background: #d9f7c6;
  padding: 20px;
  border-radius: 20px;
  text-align: center;
  font-size: 1.2em;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.15);
  border: 3px solid #000;
}

.buy-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}

#buy-tokens {
  width: 140px;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid rgba(0,0,0,0.15);
  font-size: 18px;
  text-align: center;
}

.buy-status {
  min-height: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

.buy-box input {
  font-size: 1.1em;
  padding: 8px;
  border-radius: 10px;
  border: 2px solid #333;
  margin-top: 5px;
  width: 70%;
  box-sizing: border-box;
}

.photo-frame {
  width: 100%;
  height: 100%;
  background: #3a2b12;
  border: 8px solid #241707;
  border-radius: 18px;
  padding: 14px;
  box-shadow:
    0 0 0 6px #7d5b2c inset,
    6px 6px 0 rgba(0,0,0,0.35),
    12px 12px 0 rgba(53,35,12,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.framed-img {
  border-radius: 10px;
  border: 3px solid #f9e3b0;
  width: 80%;
  max-width: 420px;
  height: auto;
  object-fit: contain;
  box-shadow:
    0 0 0 6px rgba(255,255,255,0.2) inset,
    0 8px 14px rgba(0,0,0,0.4);
}

.icpswap-details code {
  font-size: 0.9em;
  word-break: break-all;
}

.small {
  font-size: 0.9em;
  opacity: 0.85;
}

.light.green {
  background: radial-gradient(circle at 35% 30%, #c0ffcc 0%, #4cff63 40%, #0c8c18 70%, #07530f 100%);
  box-shadow:
    0 0 0 4px #053b0a,
    0 0 20px 8px rgba(0, 255, 0, 0.45),
    inset 0 -10px 15px rgba(0,0,0,0.45);
}

.light.red {
  background: radial-gradient(circle at 35% 30%, #ffd1d1 0%, #ff5c5c 40%, #b30000 75%, #7a0000 100%);
  box-shadow:
    0 0 0 4px #5a0000,
    0 0 20px 8px rgba(255, 0, 0, 0.45),
    inset 0 -10px 15px rgba(0,0,0,0.45);
  animation: blink 1s infinite;
}

.light.orange {
  background: radial-gradient(circle at 35% 30%, #ffe6c4 0%, #ffb347 40%, #cc6b00 75%, #9c4b00 100%);
  box-shadow:
    0 0 0 4px #7a3600,
    0 0 20px 8px rgba(255, 145, 0, 0.45),
    inset 0 -10px 15px rgba(0,0,0,0.45);
  animation: blink 1s infinite;
}

.light.blue {
  background: radial-gradient(circle at 35% 30%, #d2f0ff 0%, #66c0ff 40%, #0a65c0 75%, #073c73 100%);
  box-shadow:
    0 0 0 4px #06345f,
    0 0 20px 8px rgba(0, 140, 255, 0.45),
    inset 0 -10px 15px rgba(0,0,0,0.45);
  animation: blink 1s infinite;
}

@keyframes pulse {
  0% {
    box-shadow:
      0 0 0 4px #053b0a,
      0 0 16px 6px rgba(0, 255, 0, 0.35),
      inset 0 -10px 15px rgba(0,0,0,0.45);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 0 4px #053b0a,
      0 0 26px 12px rgba(0, 255, 0, 0.55),
      inset 0 -10px 15px rgba(0,0,0,0.45);
    transform: scale(1.04);
  }
  100% {
    box-shadow:
      0 0 0 4px #053b0a,
      0 0 16px 6px rgba(0, 255, 0, 0.35),
      inset 0 -10px 15px rgba(0,0,0,0.45);
    transform: scale(1);
  }
}

@keyframes rainbow-shine {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes blink { 50% { opacity: 0.3; } }

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
}

.comic-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
  z-index: 9999;
}

.comic-image {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  order: 2;
  border: 4px solid #000;
  border-radius: 14px;
  box-shadow: 10px 10px 0 rgba(0,0,0,0.35);
  background: #fff;
  touch-action: none;
  transition: transform 0.05s linear;
}

.comic-stage {
  order: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.comic-caption {
  margin: 0;
  max-width: min(90vw, 980px);
  padding: 12px 14px;
  border: 3px solid #000;
  border-radius: 12px;
  background: #fff6cf;
  color: #000;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 720px) {
  .comic-caption {
    font-size: 1.25rem;
  }
}

.comic-nav,
.comic-close {
  border: 4px solid #000;
  background: #fff3d1;
  color: #000;
  cursor: pointer;
  font-weight: 700;
}

.comic-nav {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 36px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.25);
}

.comic-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.25);
}

.comic-nav:hover,
.comic-close:hover {
  transform: translate(-1px, -1px);
}

.comic-nav:active,
.comic-close:active {
  transform: translate(1px, 1px);
}

.comic-prev {
  order: 1;
}

.comic-next {
  order: 3;
}

@media (max-width: 720px) {
  .comic-viewer {
    gap: 10px;
    padding: 12px;
  }

  .comic-nav {
    width: 46px;
    height: 46px;
    font-size: 28px;
  }
}

@media (max-width: 900px) {
  .info-card {
    flex-direction: column;
    text-align: center;
  }

  .grid {
    grid-template-columns: 1fr;
    margin: 16px;
  }

  .photo-frame {
    height: auto;
  }

  .title-card {
    margin: 16px;
  }
}

.modal-content {
  background: white;
  margin: 10% auto;
  padding: 20px;
  width: 300px;
  border: 5px solid black;
}

.receive-address {
  display: block;
  margin: 6px 0 8px;
  padding: 6px;
  font-size: 12px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.receive-warning {
  margin: 6px 0 10px;
  font-size: 12px;
  color: #8b0000;
}

.receive-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.modal-content input,
.modal-content select {
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
}

footer {
  margin: 40px 0;
}

.referral-card code {
  font-size: 12px;
  background: #f8f8f8;
  border: 1px solid #ddd;
  padding: 3px 6px;
  border-radius: 5px;
}

.referral-leaderboard {
  margin: 10px 0 0;
  padding-left: 20px;
  max-height: 220px;
  overflow: auto;
}

.referral-leaderboard li {
  margin: 4px 0;
  font-size: 13px;
}

.referral-leaderboard li.me {
  background: #fff2a8;
  border: 1px solid #e9d268;
  border-radius: 6px;
  padding: 2px 6px;
}
