:root {
  --primary-color: #00d2ff;
  --danger: #ff4757;
  --bg-dark: #0f172a;
  --glass: rgba(255, 255, 255, 0.05);
}
body {
  margin: 0;
  background: radial-gradient(circle at center, #1e293b 0%, var(--bg-dark) 100%);
  /*		background-color: var(--bg-dark);*/
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  /*overflow: hidden;*/
  user-select: none;
  text-transform: uppercase;
  /*		padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) 0;*/
}
.brand-header {
  width: 100%;
  padding: 15px 0;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 10px;
}
.logo{
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: white;  text-transform: uppercase;
}
.logo span{
  color: var(--primary-color);
  font-weight: 300;
  letter-spacing: 12px;
  margin-left: 5px;
}
.version{
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 1.5px;
  font-weight: 300;
  margin-top: 8px;
  font-style: italic;
}
.hud {
  width: 90vw;
  max-width: 500px;
  /*		height: 60px;*/
  display: flex;
  justify-content: space-between;
  padding: 15px;
  box-sizing: border-box;
  flex-shrink: 0;
  font-size: 1.2rem;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-bottom: 20px;
  width: 85vw;
  max-width: 450px;
  padding: 15px 25px;
/*  margin: 15px 0;*/
  background: var(--glass);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hud-item{
	display: flex;
	flex-direction: column;
	align-items: center;
}

#pause-btn:active .pause-pill{
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--primary-color);
}

@media (hover: hover){
  #pause-btn:hover .pause-pill{
    background: rgba(0, 210, 255, 0.2);
    border-color: var(--primary-color);
  }
}

.pause-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
/*  margin-top: 2px;*/
  transition: all 0.3s ease;
  /*position: relative;
  background: rgba(0, 210, 255, 0.15);
  border: 1px solid var(--primary-color);
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
  animation: pillPulse 2s infinite;*/
}

.pause-pill:hover {
  background: rgba(0, 210, 255, 0.1);
  border-color: rgba(0, 210, 255, 0.5);
  transform: translateY(-1px);
}

.tutorial-text {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 1px;
  margin-bottom: 10px;
  animation: fadeIn 1s ease;
}

.pause-icon {
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 1px;
}

.hud-label{
	font-size: 0.65rem;
	letter-spacing: 2px;
	color: rgba(255, 255, 255, 0.4);
	margin-bottom: 4px;
	text-transform: uppercase;
}

.hud-value{
	font-family: 'Monaca','Consolas', monospace;
	font-weight: 800;
	font-size: 1.6rem;
	display: inline-block;
	min-width: 1.2em;
	text-align: center;
}

#pause-overlay {
  z-index:200;
  backdrop-filter: blur(15px) grayscale(50%);
  background: rgba(15,23,42,0.92);
}

#timer.time-warning {
	color: var(--danger);
	text-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
	/*transform: scale(1.1);
	transition: all 0.2s;*/
	animation: heartBeat 0.5s infinite alternate;
}

#grid-container {
  display: grid;
  gap: 8px;
  padding: 10px;
  width: 95vw;
  width: 95vmin;
  height: 65vh;
  height: 65dvh;
  max-width: 600px;
  margin: auto 0;
  /*		align-items: center;*/
  /*		background: rgba(255, 255, 255, 0.1);*/
  /*		border-radius: 12px;*/
  /*		flex-grow: 1;*/
  /*		max-height: 70vh;*/
  /*		max-height: calc(100vh - 100px);*/
  box-sizing: border-box;
  align-content: center;
  justify-content: center;
}
.cell {
  width: 100%;
  height: 100%;
  position: relative;
  /*		aspect-ratio: 1/1; */
  background-size: cover;
  background-position: center;
/*  background-repeat: no-repeat;*/
  border-radius: 10px;
  opacity: 0;
  cursor: pointer;
/*  overflow: hidden;*/
  animation: fadeIn 0.4s ease-out forwards;
/*  transition: transform 0.1s, filter 0.2s;
  image-rendering: -webkit-optimize-contrast;
  min-width: 0;
  min-height: 0;*/
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.cell::after {
  content: "";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
/*  font-size: 2rem;
  font-weight: bold;*/
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
/*  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  border-radius: 10px;*/
}

/*.cell.correct {
  cursor: default;
  filter: brightness(0.7);
}*/

.cell.correct::after {
/*  content: "";*/
  background: rgba(76, 175, 80, 0.5);
  opacity: 1;
  border: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d = 'M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z' /%3E%3C/svg%3E");
/*  background-size: 50%;
  background-repeat: no-repeat;
  background-position: center;*/
}

/*.cell.wrong {
  cursor: default;
  pointer-events: none;
}
*/

.cell.wrong {
  filter: grayscale(0.8) brightness(0.6);
  transition: filter 0.3s ease;
}

.cell.wrong::after {
  background: rgba(244, 67, 54, 0.4);
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d = 'M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z' /%3E%3C/svg%3E");
}

/*.cell:active {
  transform: scale(0.95);
}*/

/* 选错时的视觉反馈*/
.error-shake {
	opacity: 1 !important;
  animation: shake 0.3s cubic-bezier(.36,.07,.19,.97) both !important;
  filter: brightness(0.8) sepia(1) hue-rotate(-50deg);
/*  filter: grayscale(1) sepia(1) hue-rotate(-50deg);*/
}

@keyframes heartBeat {
	from {transform: scale(1);}
	to {transform: scale(1.1);}
}


@keyframes pillPulse {
  0%,100% {box-shadow: 0 0 5px rgba(0, 210, 255, 0.2);}
  50% {box-shadow: 0 0 15px rgba(0, 210, 255, 0.5);}
}

.dot{
/*  width: 6px;*/
  height: 6px;
  color: var(--primary-color);
  /*background: var(--primary-color);
  border-radius: 50%;*/
  display: inline-block;
  margin-right: 5px;
  opacity: 0.5;
/*  animation: blink 1s infinite;*/
}

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


@keyframes shake {
/*  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }*/
  10%, 90% {transform: translate3d(-1px,0,0);}
  20%, 80% {transform: translate3d(2px,0,0);}
  30%, 50%, 70% {transform: translate3d(-4px,0,0);}
  40%, 60% {transform: translate3d(4px,0,0);}
}

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

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  text-transform: uppercase;
}

.overlay .logo{
  font-size: 2rem;
  margin-bottom: 60px;
  letter-spacing: 10px;
}



.btn-start {
  padding: 15px 40px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,210,255,0.3);
  text-transform: uppercase;
}

.game-footer {
  width: 100%;
  margin-top: auto;
  padding: 20px 0 30px;
  background: rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.footer-line{
  width: 50px;
  height: 2px;
  background: var(--primary-color);
  margin-bottom: 15px;
  opacity: 0.3;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.copyright {
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 2px;
}

.author {
  color: rgba(255, 255, 255, 0.6);
  font-weight: bold;
}

.footer-links{
  display: flex;
  gap: 15px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  font-size: 0.6rem;
  letter-spacing: 1px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.dev-tag{
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 1px;
  margin-top: 5px;
}

.dev-tag .name {
  color: rgba(0, 210, 255, 0.4);
  font-weight: bold;
}

#overlay-title {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
  letter-spacing: 4px;
  margin-bottom: 10px;
  font-weight: 400;
}

#final-score {
  font-size: 4rem;
  line-height: 1;
  margin: 10px 0 30px 0;
  font-weight: 900;
  text-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: none;
}

#best-score-tag {
  font-size: 0.8rem;
  color: var(--primary-color);
  letter-spacing: 3px;
  margin-bottom: 30px;
  font-weight: bold;
  opacity: 0.8;
  transition: all 0.4s ease;
}

#confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

@keyframes pulse-gold {
  0%,100% { transform: scale(1); text-shadow: 0 0 0px rgba(241,196,15,0); }
  50% { transform: scale(1.1); text-shadow: 0 0 15px rgba(241,196,15,0.6); }
}

.new-record-active{
  font-size: 1rem !important;
  background: rgba(241,196,15,0.1);
  padding: 4px 15px;
  border-radius: 20px;
  border: 1px solid rgba(241,196,15,0.3);
  color: #f1c40f !important;
/*  font-weight: 900 !important;*/
  animation: pulse-gold 0.8s ease-in-out infinite;
/*  display: inline-block;*/
}

.action-zone{
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hud-item:hover #pause-text {
  color: rgba(255,255,255,0.9);
}

.hud-item:hover .hud-label {
  color: rgba(255,255,255,0.8);
}

.pause-title {
  font-size: 0.8rem;
  letter-spacing: 10px;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 15px;
  font-weight: 400;
  animation: slow-breathe 4s ease-in-out infinite;
}

@keyframes slow-breathe {
  0%,100% { opacity: 0.2; }
  50% { opacity: 0.4; }
}

.pause-hint {
  font-size: 1.1rem;
  letter-spacing: 2px;
  margin-bottom: 80px;
  font-weight: 300;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 60px 0 30px;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-decoration: none;
  transition: 0.3s;
}

.site-footer a:hover {
  color: var(--primary-color);
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  text-transform: capitalize;
  background: #1e293b;
  padding: 40px;
  border-radius: 20px;
  max-width: 450px;
  width: 90%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.modal-content h3 {
  text-transform: uppercase;
  color: #00d2ff;
  letter-spacing: 4px;
  margin-bottom: 20px;
  font-size: 1rem;
}

.modal-content p {
  text-transform: none;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.8;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.support-links {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.support-links a {
  color: white;
  font-size: 0.8rem;
  text-decoration: underline;
}

.close-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 25px;
  border-radius: 30px;
  cursor: pointer;
  margin-top: 10px;
  transition: 0.3s;
}

.close-btn:hover{
  color: black;
  background: white;
}

.pro-preview-container {
  position: relative;
  width: 280px;
  height: 120px;
  margin: 20px auto 40px;
  border: 1px dashed rgba(0,210,255,0.2);
  border-radius: 15px;
  overflow: hidden;
  display: flex;
}

.blur-overlay {
  position: absolute;
  inset:0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  background: rgba(15,23,42,0.6);
}

.blur-overlay p {
  font-size: 0.8rem;
  /* color: #00d2ff; */
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 15px;
  letter-spacing: 2px;
}

.placeholder-chart{
  width: 100%;
  height: 100%;
  background: linear-gradient(-45deg, #0f172a, #1e293b, #005a70, #0f172a);
  background-size: 200% 200%;
  animation: gradientMove 5s ease infinite;
  /* opacity: 0.3; */
}

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

.unlock-btn {
  background: transparent;
  border: 1px solid #00d2ff;
  color: #00d2ff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1px;
  box-shadow: 0 0 10px rgba(0,210,255,0.2);
}
.unlock-btn:hover {
  background: #00d2ff;
  color: #0f172a;
  box-shadow: 0 0 20px rgba(0,210,255,0.5);
  transform: scale(1.05);
}

.modal-vision{
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
  margin-bottom: 25px;
}

.pro-features {
  text-align: left;
  background: rgba(0, 210, 255, 0.05);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.pro-features h4{
  font-size: 0.8rem;
  color: #00d2ff;
  margin-bottom: 10px;
}

.pro-features ul{
  font-size: 0.8rem;
  list-style: none;
  padding: 0;
  color: #fff;
}

.pro-features li{
  margin-bottom: 8px;
}

.highlight{
  color: #00d2ff;
  font-weight: bold;
  text-decoration: underline;
}

.payment-area {
  margin: 20px 0;
}

.qr-code {
  width: 150px;
  height: 150px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.post-payment-tip {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 10px;
}

/* .support-link {
  display: block;
  margin-bottom: 15px;
  color: #fff;
  font-size: 0.8rem;
  text-decoration: underline;
} */

/* .support-link {
  display: block;
  margin-top: 10px;
  background: #00d2ff;
  color: #000;
  font-size: 0.8rem;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
} */

.limit-notice {
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255, 107, 107, 0.3); 
  padding: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.limit-notice p {
  color: #ff6b6b;
  font-size: 0.85rem;
  margin: 0;
  font-weight: bold;
}

/* .manual-process-tip {
  font-size: 0.75rem;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 6px;
  margin: 15px 0;
  color: #ffd700;
} */

.trust-note {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 5px;
  font-style: italic;
}

.price-box{
  margin-bottom: 15px;
}

.amount{
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffd700;
}

.tag{
  font-size: 0.7rem;
  background: rgba(255, 215, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
}

.cta-btn {
  display: block;
  background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5);
  color: white;
  text-decoration: none;
  padding: 16px;
  border-radius: 50px;
  font-weight: bold;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
  transition: transform 0.2s;
  animation: pulse 2s infinite;
}
.cta-btn:active {
  transform: scale(0.98);
}

.footer-note {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 15px;
  line-height: 1.4;
}

.secondary-btn{
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  text-decoration: underline;
  font-size: 0.8rem;
  margin-top: 20px;
  cursor: pointer;
}

@keyframes pulse{
  0% {box-shadow: 0 0 0 0 rgba(0,210,255,0.4);}
  70% {box-shadow: 0 0 0 10px rgba(0,210,255,0);}
  100% {box-shadow: 0 0 0 0 rgba(0,210,255,0);}
}

.lang-switch-btn{
  position: absolute;
  top: 20px;
  right: 20px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  z-index: 9999;
}