:root {
  --primary-blue: #1e3a8a;
  --dark-blue: #1e293b;
  --accent-yellow: #fffb8e;
  --light-cream: #f2f1cc;
  --scale-factor: 1.2; /* 等比例缩放因子 */
}

body {
  background: linear-gradient(135deg, #f2f1cc 0%, #fffbeb 100%) !important;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", "Poppins", system-ui, -apple-system,
               BlinkMacSystemFont, "Segoe UI", sans-serif;

}

.play-button {
  width: calc(180px * var(--scale-factor));
  height: calc(180px * var(--scale-factor));
  border-radius: 50%;
  background: linear-gradient(135deg, #fffb8e 0%, #fef08a 100%);
  color: #1e3a8a;
  border: 3px solid #1e3a8a;
  cursor: pointer;
  font-size: calc(1.5rem * var(--scale-factor));
  font-weight: bold;
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.3);
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-button:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 30px rgba(30, 58, 138, 0.4);
  background: linear-gradient(135deg, #fef08a 0%, #fde047 100%);
}

.play-button:active {
  transform: scale(0.95);
}

.semi-circle-button {
  width: calc(100px * var(--scale-factor));
  height: calc(100px * var(--scale-factor));
  border-radius: 50%;
  border: 2px solid #1e3a8a;
  cursor: pointer;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.2);
  transition: all 0.3s ease;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e3a8a;
  font-weight: 600;
  font-size: calc(0.75rem * var(--scale-factor));
  text-align: center;
  padding: calc(8px * var(--scale-factor));
}

.semi-circle-button:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 8px 25px rgba(30, 58, 138, 0.3);
  background: linear-gradient(135deg, #fef3c7 0%, #fde047 100%);
  border-color: #1e3a8a;
}

.semi-circle-button:active {
  transform: scale(0.95);
}

.achievements-btn {
  bottom: calc(60px * var(--scale-factor));
  left: calc(-50px * var(--scale-factor));
  animation: float-achievements 3s ease-in-out infinite;
}

.info-btn {
  bottom: calc(-80px * var(--scale-factor));
  left: 50%;
  transform: translateX(-50%);
  animation: float-info 3s ease-in-out infinite 0.1s;
}

.settings-btn {
  bottom: calc(60px * var(--scale-factor));
  right: calc(-50px * var(--scale-factor));
  animation: float-settings 3s ease-in-out infinite 0.2s;
}

@keyframes float-achievements {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes float-info {
  0%, 100% { transform: translateX(-50%) translateY(0px); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

@keyframes float-settings {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.3s ease;
}

.modal.hidden {
  display: none;
}

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

.modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 2px solid #fffbeb;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-radius: 16px 16px 0 0;
}

.modal-header h2 {
  color: var(--primary-blue);
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #64748b;
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--primary-blue);
}

.modal-body {
  padding: 24px;
}

.stats-section {
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde047 100%);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  border: 2px solid #fffbeb;
}

.stat-number {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-blue);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: #64748b;
}

.badges-section h3 {
  color: var(--primary-blue);
}

.world-badge {
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  border: 2px solid #fbbf24;
  transition: all 0.3s ease;
  cursor: default;
}

.world-badge:hover {
  border-color: #1e3a8a;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
  transform: translateY(-2px);
}

.w1-badge {
  background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
  border-color: #fbbf24;
}

.w2-badge {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fbbf24;
}

.w3-badge {
  background: linear-gradient(135deg, #fecaca 0%, #fed7aa 100%);
  border-color: #1e3a8a;
}

.w4-badge {
  background: linear-gradient(135deg, #fde047 0%, #fbbf24 100%);
  border-color: #1e3a8a;
}

.badge-emoji {
  font-size: 36px;
  margin-bottom: 8px;
}

.badge-title {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
  font-size: 14px;
}

.badge-progress {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.info-section {
  margin-bottom: 20px;
}

.info-section h3 {
  color: var(--primary-blue);
  margin-bottom: 12px;
}

.info-section p {
  line-height: 1.6;
  color: #475569;
}

.mechanics-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mechanic-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #fffbeb;
  border-radius: 8px;
  border-left: 4px solid #1e3a8a;
}

.mechanic-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.mechanic-title {
  font-weight: 600;
  color: #1e293b;
  font-size: 14px;
}

.mechanic-desc {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  color: var(--primary-blue);
}

.setting-item {
  margin-bottom: 16px;
}

.setting-label {
  display: block;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 8px;
  cursor: pointer;
}

.setting-item input[type="range"] {
  cursor: pointer;
}

.setting-item input[type="checkbox"] {
  cursor: pointer;
}

@media (max-width: 768px) {
  .play-button {
    width: 140px;
    height: 140px;
    font-size: 1.2rem;
  }

  .semi-circle-button {
    width: 80px;
    height: 80px;
    font-size: 0.65rem;
  }

  .modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .modal-header h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .play-button {
    width: 120px;
    height: 120px;
    font-size: 1rem;
  }

  .semi-circle-button {
    width: 70px;
    height: 70px;
    font-size: 0.6rem;
  }

  h1 {
    font-size: 3rem;
  }
}

/* ===== 每一个 cube 的基础样式（默认几乎看不见）===== */
#bg-cubes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -10;

  display: grid;
  grid-template-columns: repeat(var(--bg-cols, 24), 1fr);
  grid-template-rows: repeat(var(--bg-rows, 14), 1fr);

  opacity: 0.9;
}

/* ===== 每一个 cube 的基础样式（默认是很淡几乎看不见） ===== */
.bg-cube {
  background: rgba(148, 163, 184, 0.0);       /* 默认几乎透明 */
  border-radius: 10px;                        /* 圆角 */
  border: 0px solid rgba(148, 163, 184, 0.15);
  box-shadow: none;

  transform: scale(0.82);
  opacity: 0;
  transition:
    opacity 0.9s ease-out,
    transform 1.5s ease-out,
    background 0.9s ease-out,
    box-shadow 0.9s ease-out,
    border-color 0.9s ease-out;
}

/* ===== 光标附近被激活的 cube 样式 ===== */
.bg-cube.active {
  opacity: 1;
  transform: scale(1);

  background: rgba(23, 37, 84, 1);
  border-color: rgba(23, 37, 84, 1)
;

  box-shadow:
    0 0 0 1px rgba(248, 250, 252, 0.6),
    0 10px 24px rgba(15, 23, 42, 0.38);
}

/* ===== Title: OverSyntaxed ===== */
.home-title {
  color: #172554;   /* 深蓝字体 */
  font-family: "Plus Jakarta Sans", "Poppins", sans-serif;
  position: relative;
  display: inline-block;
  font-size: calc(3rem * var(--scale-factor));
  -webkit-text-stroke: 1px #FACC15D9;   /* 黄色描边 */
  text-stroke: 1px #FACC15D9;

  transition:
    color 0.25s ease,
    -webkit-text-stroke 1s ease,
    transform 1s ease;
}

/* Hover：字体颜色与描边颜色反转 */
.home-title:hover {
  color: #FACC15;                 /* 字体变黄 */
  -webkit-text-stroke: 3px #172554; /* 描边变深蓝 */
  transform: scale(1.015);
}
