* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #333333;
  --text-primary: #2c2c2c;
  --text-secondary: #666666;
  --border: #e0e0e0;
  --bg: #ffffff;
  --success: #4a9d6f;
  --error: #d32f2f;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

.stars {
  display: none;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 50px;
}

.title-box {
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 30px;
  letter-spacing: -0.5px;
  display: inline-block;
  background: #2a2a2a;
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.title-box:hover {
  background-color: #333333;
}

.title {
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 30px;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.5px;
  margin-bottom: 15px;
}

/* Header Attempts */
.header-attempts {
  display: flex;
  justify-content: center;
}

/* Card */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

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

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

@keyframes popFill {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes confetti {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(400px) rotate(720deg);
    opacity: 0;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* Riddle Section */
.riddle-section {
  text-align: center;
}

.riddle-badge {
  display: inline-block;
  background: transparent;
  color: var(--text-secondary);
  padding: 0;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.riddle-text {
  font-size: 1.75rem;
  line-height: 1.9;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 30px;
  letter-spacing: 2px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-transform: uppercase;
}

/* Input Section */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.input-wrapper {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.answer-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
  outline: none;
}

.answer-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.05);
}

.answer-input::placeholder {
  color: var(--text-secondary);
}

.submit-btn {
  padding: 12px 28px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.submit-btn:hover:not(:disabled) {
  background: #1a1a1a;
}

.submit-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Attempts Section */
.attempts-section {
  display: flex;
  justify-content: center;
}

.attempts-boxes {
  display: flex;
  gap: 10px;
}

.attempt-box {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: white;
  transition: all 0.3s ease;
}

.attempt-box.used {
  background: var(--error);
  border-color: var(--error);
  animation: popFill 0.8s ease-out;
}

.attempt-box.solved {
  background: var(--success);
  border-color: var(--success);
  animation: popFill 0.8s ease-out;
}
.hint-btn {
  padding: 10px 20px;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: center;
}

.hint-btn:hover:not(.revealed) {
  background: #f5f5f5;
  border-color: var(--primary);
}

.hint-btn.revealed {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* Hint Box */
.hint-box {
  background: #f9f9f9;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
}

.hint-box.hidden {
  display: none;
}

.hint-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-style: italic;
}

/* Result Box */
.result-box {
  padding: 14px;
  border-radius: 4px;
  text-align: center;
  font-weight: 500;
  font-size: 0.95rem;
}

.result-box.hidden {
  display: none;
}

.result-box.success {
  background: #f0f7f4;
  border: 1px solid #d4edda;
}

.result-box.error {
  background: #fef5f5;
  border: 1px solid #f8d7da;
}

.result-box.success #resultText {
  color: var(--success);
}

.result-box.error #resultText {
  color: var(--error);
}

/* Solved Box */
.solved-box {
  padding: 20px;
  border-radius: 4px;
  text-align: center;
  background: #f0f7f4;
  border: 1px solid #d4edda;
}

.solved-box.hidden {
  display: none;
}

.solved-text {
  color: var(--success);
  font-weight: 600;
  font-size: 1.1rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  background: #ffffff;
  border-radius: 8px;
  padding: 40px 30px;
  text-align: center;
  position: relative;
  z-index: 1001;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 360px;
  border: none;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 32px;
  color: #666666;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-weight: 300;
}

.modal-close:hover {
  transform: scale(1.2);
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 20px 0;
}

.modal-description {
  font-size: 0.95rem;
  color: #666666;
  line-height: 1.5;
  margin: 0;
}

.modal-stats {
  font-size: 0.9rem;
  color: #666666;
  margin: 15px 0;
  line-height: 1.6;
  display: flex;
  justify-content: center;
  gap: 30px;
}

.stat-item {
  color: #000000;
  font-weight: 600;
  font-size: 1rem;
}

.reset-btn {
  margin-top: 20px;
  padding: 10px 24px;
  background: #000000;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reset-btn:hover {
  background: #333333;
}

.reset-btn:active {
  transform: scale(0.98);
}

.modal-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}

.share-btn {
  padding: 10px 24px;
  background: #1e40af;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.share-btn::after {
  content: '↗';
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.share-btn:hover {
  background: #1e3a8a;
}

.share-btn:hover::after {
  transform: translate(2px, -2px);
}

.share-btn:active {
  transform: scale(0.98);
}

.modal-attempt-boxes {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 15px 0;
  flex-wrap: wrap;
}

.modal-attempt-box {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.modal-attempt-box.correct {
  background: #10b981;
}

.modal-attempt-box.incorrect {
  background: #ef4444;
}

.timer-section {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  text-align: center;
}

.timer-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.timer {
  font-size: 1.8rem;
  font-weight: 300;
  font-family: 'Monaco', 'Courier New', monospace;
  color: var(--text-primary);
  letter-spacing: 2px;
}

/* Ad Container */
.ad-container {
  margin: 40px 0;
  text-align: center;
  min-height: 250px;
  display: none;
  align-items: center;
  justify-content: center;
}

.ad-container .adsbygoogle {
  display: block;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 40px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-link,
.privacy-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover,
.privacy-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* Confetti */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: #ff6b6b;
  pointer-events: none;
  z-index: 999;
}

.confetti.color1 {
  background: #ff6b6b;
}

.confetti.color2 {
  background: #4ecdc4;
}

.confetti.color3 {
  background: #ffe66d;
}

.confetti.color4 {
  background: #95e1d3;
}

.confetti.color5 {
  background: #f38181;
}

.confetti-fall {
  animation: confetti 3s ease-in forwards;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 40px 20px;
  }

  .title {
    font-size: 2rem;
  }

  .card {
    padding: 24px;
    gap: 20px;
  }

  .riddle-text {
    font-size: 1.4rem;
  }

  .input-wrapper {
    flex-direction: column;
  }

  .submit-btn {
    width: 100%;
  }

  .timer {
    font-size: 1.5rem;
  }
}

/* Content Pages */
.content-section {
  line-height: 1.6;
  margin-bottom: 30px;
}

.content-section h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.content-section h3 {
  font-size: 1.2rem;
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.content-section p {
  margin-bottom: 15px;
  color: var(--text-secondary);
}

.content-section ul {
  margin-left: 20px;
  margin-bottom: 15px;
  color: var(--text-secondary);
}

.content-section li {
  margin-bottom: 8px;
}

.contact-email {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.contact-email:hover {
  text-decoration: underline;
}

