:root {
  --primary-color: #00eaff;
  --secondary-color: #008cff;
  --box-bg: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 255, 255, 0.15);
  --shadow-glow: rgba(0, 234, 255, 0.2);
}

body.theme-purple {
  --primary-color: #d946ef;
  --secondary-color: #8b5cf6;
  --shadow-glow: rgba(217, 70, 239, 0.25);
}

* {
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  color: white;
  background: linear-gradient(135deg, #030303, #151515, #222);
  padding: 20px 0;
}

.box {
  width: 95%;
  max-width: 430px;
  padding: 20px;
  background: var(--box-bg);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 0 25px var(--shadow-glow);
  text-align: center;
  position: relative;
  z-index: 1;
}

.theme-toggle-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: var(--primary-color);
  padding: 5px 10px;
  font-size: 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}
.theme-toggle-btn:hover { background: var(--primary-color); color: #000; }

.logo-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-color);
  box-shadow: 0 0 15px var(--primary-color);
}

h1 {
  margin: 8px 0 2px 0;
  font-size: 24px;
  color: var(--primary-color);
  text-shadow: 0 0 10px var(--primary-color);
}

.subtitle {
  color: #aaa;
  font-size: 12px;
  margin-top: 0;
  margin-bottom: 12px;
}

.checkin-banner {
  background: rgba(0, 255, 136, 0.1);
  border: 1px dashed #00ff88;
  padding: 8px;
  border-radius: 10px;
  font-size: 11px;
  color: #00ff88;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkin-btn {
  background: #00ff88;
  color: #000;
  border: none;
  padding: 4px 8px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  font-size: 10px;
}

.tab-navigation {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 15px;
}

.tab-btn {
  flex: 1;
  padding: 8px 2px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #aaa;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0;
  box-shadow: none;
}

.tab-btn.active {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 0 10px var(--shadow-glow);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-action {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 15px var(--shadow-glow);
  transition: transform 0.2s;
  color: white;
}

.btn-action:hover { transform: scale(1.02); }
.btn-action:active { transform: scale(0.98); }

.shortlink-box {
  margin-top: 15px;
  background: rgba(0, 234, 255, 0.05);
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--primary-color);
}

.shortlink-title {
  font-size: 12px;
  margin: 0 0 8px 0;
  color: #00ff88;
}

.btn-shortlink {
  background: linear-gradient(45deg, #ff9900, #ff5500);
  font-size: 13px;
  padding: 10px;
}

.result {
  display: none;
  margin-top: 15px;
  padding: 15px;
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--primary-color);
}

.result p {
  background: #111;
  padding: 10px;
  border-radius: 8px;
  color: white;
  word-break: break-all;
  margin: 8px 0;
}

.copy {
  background: linear-gradient(45deg, #00ff88, #00cc55);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.stats-container {
  margin-top: 15px;
  display: flex;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 10px;
  font-size: 12px;
}

#count { color: #00ff88; font-weight: bold; }
#remaining { color: var(--primary-color); font-weight: bold; }
#totalVisits { color: #ff9900; font-weight: bold; }

.reset-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #aaa;
  font-size: 12px;
  padding: 6px 12px;
  margin-top: 12px;
  box-shadow: none;
  width: auto;
  border-radius: 8px;
  cursor: pointer;
}

.game-container {
  position: relative;
  width: 100%;             /* Tự động mở rộng bằng chiều rộng khung web */
  max-width: 100%;          /* Không giới hạn 320px nữa */
  aspect-ratio: 1 / 1;     /* Giữ ô game luôn là hình vuông chuẩn */
  margin: 0 auto 12px auto;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--primary-color);
  background: #1a2332;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}


.btn-game {
  background: linear-gradient(45deg, #ff9900, #ff5500);
  box-shadow: 0 0 15px rgba(255, 153, 0, 0.4);
}

.game-hint {
  font-size: 11px;
  color: #aaa;
  margin-top: 8px;
}

.script-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #00ff88;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  text-align: left;
}

.script-title {
  font-size: 13px;
  font-weight: 600;
  color: #00ff88;
  margin-bottom: 6px;
}

.script-code {
  background: #111;
  padding: 10px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--primary-color);
  word-break: break-all;
  font-family: monospace;
  max-height: 90px;
  overflow-y: auto;
  margin: 0 0 10px 0;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.btn-script {
  background: linear-gradient(45deg, #00ff88, #00cc55);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
  font-size: 13px;
  padding: 10px;
}

.mb-15 {
  margin-bottom: 15px;
}

.script-hint {
  font-size: 11px;
  color: #aaa;
  margin-top: 10px;
}

.donate-section {
  padding: 12px;
  background: rgba(0, 234, 255, 0.03);
  border-radius: 15px;
  border: 1px solid var(--border-color);
  margin-bottom: 15px;
}

.donate-title {
  font-size: 14px;
  font-weight: 600;
  color: #00ff88;
  margin-bottom: 5px;
}

.donate-desc {
  font-size: 11px;
  color: #ccc;
  margin-bottom: 10px;
}

.qr-img {
  width: 140px;
  border-radius: 10px;
  border: 2px solid var(--primary-color);
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: transform 0.2s;
}

.social-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.social-btn.youtube { background: linear-gradient(45deg, #ff0000, #cc0000); color: white; }
.social-btn.tiktok { background: #000000; color: #ffffff; }
.social-btn.gmail { background: #ffffff; color: #000000; }
.social-btn.discord { background: linear-gradient(45deg, #5865F2, #4752C4); color: white; }
.social-btn.rutgonvuong {  background: #ffffff;color: #000000;
}
.social-btn.kiemtien { background: linear-gradient(45deg, #00f3ff, #39ff14); }
    

.notice-text {
  font-size: 11px;
  color: #888;
  margin-top: 15px;
  line-height: 1.4;
}

.copyright-text {
  font-size: 11px;
  color: #888;
}

#toast {
  visibility: hidden;
  min-width: 250px;
  background: rgba(15, 15, 15, 0.95);
  color: #fff;
  text-align: center;
  border-radius: 12px;
  padding: 12px 20px;
  position: fixed;
  z-index: 9999;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(50px);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #00ff88;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

#toast.show {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.btn-music-toggle {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 9999;
  padding: 6px 12px;
  font-size: 12px;
  background: #ff4757;
  color: white;
  border: none;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  width: auto;
  }

input, textarea {
  -webkit-user-select: text;
  user-select: text;
}
.result p, .hist-item {
  -webkit-user-select: text;
  user-select: text;
}

.theme-toggle-btn {
  right: auto;
  left: 15px;
}

/* Optimized layout for Tablet & PC */
@media (min-width: 768px) {
  body {
    padding: 40px 20px;
    background: radial-gradient(circle at 50% 30%, #1a1c2e 0%, #08090e 100%);
  }

  .box {
    max-width: 650px; /* Tăng chiều rộng khung trên PC lên 650px */
    padding: 35px 30px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 240, 255, 0.15);
  }

  h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 14px;
    margin-bottom: 20px;
  }

  /* Định dạng các nút Tab to rõ hơn trên PC */
  .tab-navigation {
    padding: 8px;
    gap: 8px;
  }

  .tab-btn {
    padding: 12px 8px;
    font-size: 13.5px;
  }

  .btn-action {
    padding: 16px;
    font-size: 16px;
  }

  /* Định dạng danh sách link Donate / Mạng xã hội chia thành 2 cột trên PC */
  .social-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}


