/* Daily Challenge Styles */

/* ===== Landing Page ===== */

.daily-landing {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

.daily-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.daily-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.daily-hero h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.daily-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Challenge Card */

.daily-challenge-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
  border: 2px solid rgba(0, 150, 255, 0.1);
}

.challenge-available h2,
.challenge-completed h2 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.challenge-date {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}

.challenge-games {
  display: flex;
  gap: 0.4rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  padding: 0.25rem;
}

.game-badge {
  background: var(--primary-color);
  color: white;
  padding: 0.6rem 0.4rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  margin-top: 1rem;
}

/* Fancy Start Challenge Button */
.btn-start-challenge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1.25rem 3rem;
  font-size: 1.3rem;
  font-weight: 700;
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  margin-top: 2rem;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  text-align: center;
}

.btn-start-challenge:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-start-challenge:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

/* Completed State */

.completed-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.completed-score {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin: 1rem 0;
  font-size: 1.2rem;
}

.score-stars {
  color: var(--star-color, #ffd700);
  font-weight: 600;
}

.score-time {
  color: var(--text-secondary);
}

.next-challenge {
  color: var(--text-secondary);
  margin: 1rem 0;
  font-size: 0.95rem;
}

/* Stats Card */

.daily-stats-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.daily-stats-card h2 {
  text-align: center;
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Info Section */

/* Practice CTA card */
.daily-practice-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
  border: 2px solid rgba(102, 126, 234, 0.15);
}

.daily-practice-card .practice-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.daily-practice-card h3 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 1.2rem;
}

.daily-practice-card p {
  margin: 0 0 1.25rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.btn-practice {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
}

.btn-practice:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.45);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-practice:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.2);
}

/* ===== Game Page ===== */

.daily-game-container {
  margin: 0 auto;
  padding: 1rem;
  max-width: 100%;
  width: 100%;
}

.daily-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 12px;
}

.daily-progress {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.progress-dots {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-color);
  transition: all 0.3s;
}

.progress-dot.completed {
  background: var(--success-color, #22c55e);
}

.progress-dot.completed.wrong {
  background: var(--error-color, #ef4444);
}

.progress-dot.current {
  background: var(--primary-color);
  transform: scale(1.3);
}

.daily-timer {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

.daily-timer.timer-warning {
  color: var(--error-color, #ef4444);
  animation: pulse 1s infinite;
}

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

/* Transition Screen */

.transition-screen {
  position: fixed;
  inset: 0;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s;
}

.transition-screen.hidden {
  display: none;
}

.transition-content {
  text-align: center;
  padding: 2rem;
}

.transition-result {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.transition-result .correct {
  color: var(--success-color, #22c55e);
}

.transition-result .wrong {
  color: var(--error-color, #ef4444);
}

.transition-stars {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.transition-next {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

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

/* Hidden utility */

.hidden {
  display: none !important;
}

/* Game Area */

.game-area {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.game-title {
  text-align: center;
  font-size: 1.5rem;
  margin: 0 0 2rem 0;
  color: var(--text-primary);
}

/* Results Screen */

.results-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
  text-align: center;
}

.results-header {
  margin-bottom: 2rem;
}

.results-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.results-title {
  font-size: 2rem;
  margin: 0 0 0.5rem 0;
}

.results-rating {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin: 0;
}

.results-summary {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.summary-stars {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.2;
}

.summary-time {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.results-breakdown {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.breakdown-game {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.breakdown-game:last-child {
  border-bottom: none;
}

.game-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.game-emoji {
  font-size: 1.5rem;
}

.game-name {
  font-weight: 600;
  color: var(--text-primary);
}

.game-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.game-stars {
  font-size: 1.1rem;
}

.game-time {
  color: var(--text-secondary);
  font-size: 0.9rem;
  min-width: 40px;
  text-align: right;
}

.game-extras {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.results-streak {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.streak-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0.5rem 0;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Share notification + copy modal styles live in styles.css (shared) */

/* Responsive */

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .daily-hero h1 {
    font-size: 2rem;
  }

  .daily-icon {
    font-size: 3rem;
  }

  .game-area {
    padding: 1.5rem;
    min-height: 300px;
  }

  .results-summary {
    padding: 1.5rem;
  }

  .summary-stars {
    font-size: 2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .breakdown-game {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .game-result {
    width: 100%;
    justify-content: space-between;
  }
}

/* ===== Find Country Game Specific Styles ===== */

.game-area .card {
  display: flex;
  flex-direction: column;
}

/* Find Country map wrapper - dynamic height */
.game-area .mapwrap:has(canvas) {
  margin: 10px 0;
  height: calc(100vh - 350px);
  min-height: 250px;
  max-height: 600px;
}

@media (max-height: 800px) {
  .game-area .mapwrap:has(canvas) {
    height: calc(100vh - 320px);
  }
}

@media (max-height: 600px) {
  .game-area .mapwrap:has(canvas) {
    height: calc(100vh - 280px);
    min-height: 200px;
  }
}

/* Capitals map wrapper - auto height based on content */
.game-area .mapwrap:has(svg) {
  margin: 10px 0;
}

.game-area .mapwrap canvas {
  width: 100%;
  border-radius: 14px;
  background: var(--map-bg);
  border: 1px solid var(--map-border);
  touch-action: none;
  cursor: pointer;
}

/* ===== Outlines Game Specific Styles ===== */

.game-area .outlines-svg,
.game-area svg#dc-outlines-map {
  width: 100%;
  max-height: 400px;
  height: auto;
  border-radius: 14px;
  background: var(--map-bg);
  border: 1px solid var(--map-border);
  touch-action: none;
  cursor: grab;
}

.game-area .outlines-svg:active,
.game-area svg#dc-outlines-map:active {
  cursor: grabbing;
}

.game-area .input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  position: relative; /* For autocomplete dropdown positioning */
}

.game-area .input-row input {
  flex: 1;
}

.game-area .country {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin: 1rem 0;
  color: var(--text-primary);
}

/* Daily Connect embed: use the available width (don't inherit .wrap max-width) */
.daily-embed {
  width: 100%;
}

.daily-embed-card {
  width: 100%;
  max-width: none;   /* override page-level card max widths */
}

/* ===== Daily Find-the-Country: full-width map without resize shrink ===== */

/* Remove padding for the Find card so the map fills it entirely */
.game-area .card:has(#dc-map) {
  padding: 0;
}

/* Bleed the WRAPPER (stable height lives here), NOT the canvas */
.game-area .mapwrap:has(#dc-map) {
  margin: 0;
  height: calc(100vh - 350px);
  min-height: 250px;
  max-height: 600px;
}

/* Preserve your existing responsive height behavior */
@media (max-height: 800px) {
  .game-area .mapwrap:has(#dc-map) {
    height: calc(100vh - 320px);
  }
}
@media (max-height: 600px) {
  .game-area .mapwrap:has(#dc-map) {
    height: calc(100vh - 280px);
    min-height: 200px;
  }
}

/* Canvas just fills the wrapper */
.game-area .mapwrap:has(#dc-map) #dc-map {
  width: 100%;
  height: 100%;
  display: block;

  background: var(--map-bg);
  border: 0; /* avoid double border when bleeding */
  border-radius: 16px; /* match card rounding */

  touch-action: none;
  cursor: pointer;

  /* stop mobile tap flash */
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  outline: none;
}
