/* Word Builder Game Info Styles */

/* Universal styles for mobile optimization */
* {
  box-sizing: border-box;
  max-width: 100%;
}

body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  width: 100%;
}

:root {
  --word-primary: #6366f1;
  --word-secondary: #8b5cf6;
  --word-accent: #06b6d4;
  --word-success: #10b981;
  --word-warning: #f59e0b;
  --word-error: #ef4444;
  --word-dark: #1e293b;
  --word-light: #f8fafc;
  --word-book: #8b4513;
  --word-text: #0f172a;
  --word-hover: #e0e7ff;
  --word-gradient: linear-gradient(135deg, #6366f1 0%, #8B5D05 50%, #06b6d4 100%);
  --word-card-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
  --word-border-radius: 12px;
  --word-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Crimson Text', 'Georgia', serif;
}

/* Body and Layout */
.word-builder-game-info {
  background: var(--word-gradient);
  min-height: 100vh;
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--word-dark);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-x: hidden;
}

/* Word Builder Header */
.word-builder-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 2rem 0;
  text-align: center;
  border-bottom: 3px solid var(--word-secondary);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.word-builder-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 30px,
      rgba(99, 102, 241, 0.03) 30px,
      rgba(99, 102, 241, 0.03) 60px
    );
  pointer-events: none;
}

.word-builder-title {
  font-size: 3.5rem;
  font-weight: 800;
  background: var(--word-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
  font-family: var(--font-serif);
}

.word-builder-subtitle {
  font-size: 1.25rem;
  color: var(--word-dark);
  font-weight: 500;
  opacity: 0.8;
  position: relative;
  z-index: 1;
}

/* Content Wrapper */
.content-wrapper {
  max-width: min(1200px, 100vw);
  margin: 0 auto;
  padding: clamp(20px, 5vh, 50px) clamp(15px, 4vw, 20px);
  box-sizing: border-box;
  width: 100%;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--word-border-radius);
  backdrop-filter: blur(5px);
}

.breadcrumb a {
  color: var(--word-book);
  text-decoration: none;
  transition: var(--word-transition);
}

.breadcrumb a:hover {
  color: var(--word-primary);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--word-text);
  opacity: 0.5;
  font-weight: bold;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.play-btn, .back-btn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--word-border-radius);
  cursor: pointer;
  transition: var(--word-transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  box-shadow: var(--word-card-shadow);
}

.play-btn {
  background: white;
  color: var(--word-text);
  border: 2px solid var(--word-secondary);
}

.play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.3);
}

.back-btn {
  background: white;
  color: var(--word-primary);
  border: 2px solid var(--word-secondary);
}

.back-btn:hover {
  background: var(--word-hover);
  transform: translateY(-2px);
}

/* Instructions Grid */
.instructions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Instruction Cards */
.instruction-card {
  background: white;
  border-radius: var(--word-border-radius);
  box-shadow: var(--word-card-shadow);
  overflow: hidden;
  transition: var(--word-transition);
  border: 1px solid rgba(99, 102, 241, 0.1);
}

.instruction-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2);
}

.card-header {
  background: var(--word-gradient);
  color: white;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.card-icon {
  font-size: 2rem;
  opacity: 0.9;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.card-content {
  padding: 2rem;
}

.card-content p {
  margin-bottom: 1.5rem;
  color: var(--word-dark);
}

.card-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.card-content li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
  position: relative;
  padding-left: 2rem;
}

.card-content li:last-child {
  border-bottom: none;
}

.card-content li::before {
  content: '📝';
  position: absolute;
  left: 0;
  color: var(--word-secondary);
}

/* Letter Circle Demo */
.letter-demo {
  background: var(--word-light);
  border-radius: var(--word-border-radius);
  padding: 1.5rem;
  margin: 1rem 0;
}

.demo-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--word-primary);
  margin-bottom: 1rem;
  text-align: center;
}

.letter-circle-demo {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 2rem auto;
  width: 200px;
  height: 200px;
}

.demo-letter {
  position: absolute;
  width: 40px;
  height: 40px;
  background: var(--word-secondary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--word-transition);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.demo-letter:hover {
  transform: scale(1.1);
  background: var(--word-primary);
}

.demo-letter:nth-child(1) { transform: rotate(0deg) translateX(80px) rotate(0deg); }
.demo-letter:nth-child(2) { transform: rotate(60deg) translateX(80px) rotate(-60deg); }
.demo-letter:nth-child(3) { transform: rotate(120deg) translateX(80px) rotate(-120deg); }
.demo-letter:nth-child(4) { transform: rotate(180deg) translateX(80px) rotate(-180deg); }
.demo-letter:nth-child(5) { transform: rotate(240deg) translateX(80px) rotate(-240deg); }
.demo-letter:nth-child(6) { transform: rotate(300deg) translateX(80px) rotate(-300deg); }

.center-letter {
  position: absolute;
  width: 50px;
  height: 50px;
  background: var(--word-accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

/* Word Grid Demo */
.word-grid-demo {
  background: var(--word-light);
  border-radius: var(--word-border-radius);
  padding: 1.5rem;
  margin: 1rem 0;
}

.word-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

.word-slot {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  border: 2px solid var(--word-secondary);
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--word-primary);
  transition: var(--word-transition);
}

.word-slot:hover {
  transform: translateY(-2px);
  box-shadow: var(--word-card-shadow);
}

.word-slot.found {
  background: var(--word-success);
  color: white;
  border-color: var(--word-success);
}

.word-slot.partial {
  background: var(--word-warning);
  color: white;
  border-color: var(--word-warning);
}

/* Scoring System */
.scoring-showcase {
  background: var(--word-light);
  border-radius: var(--word-border-radius);
  padding: 1.5rem;
  margin: 1rem 0;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.score-card {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  border: 2px solid transparent;
  transition: var(--word-transition);
}

.score-card:hover {
  border-color: var(--word-secondary);
}

.score-points {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--word-primary);
  margin-bottom: 0.25rem;
}

.score-type {
  font-size: 0.9rem;
  color: var(--word-dark);
  opacity: 0.8;
}

/* Game Tools */
.tools-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.tool-card {
  background: var(--word-light);
  border-radius: var(--word-border-radius);
  padding: 1rem;
  text-align: center;
  border: 2px solid transparent;
  transition: var(--word-transition);
}

.tool-card:hover {
  border-color: var(--word-secondary);
  background: white;
  transform: translateY(-2px);
}

.tool-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.tool-name {
  font-weight: 600;
  color: var(--word-primary);
  margin-bottom: 0.25rem;
}

.tool-desc {
  font-size: 0.9rem;
  color: var(--word-dark);
  opacity: 0.8;
}

/* Strategy Tips */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.tip-card {
  background: var(--word-light);
  border-radius: var(--word-border-radius);
  padding: 1.5rem;
  border-left: 4px solid var(--word-secondary);
  transition: var(--word-transition);
}

.tip-card:hover {
  background: white;
  box-shadow: var(--word-card-shadow);
}

.tip-title {
  font-weight: 600;
  color: var(--word-primary);
  margin-bottom: 0.5rem;
}

.tip-description {
  font-size: 0.9rem;
  color: var(--word-dark);
  opacity: 0.8;
}

/* Word Types */
.word-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.word-type-card {
  background: var(--word-light);
  border-radius: var(--word-border-radius);
  padding: 1rem;
  border-left: 4px solid var(--word-accent);
  transition: var(--word-transition);
}

.word-type-card:hover {
  background: white;
  transform: translateY(-2px);
}

.word-type-title {
  font-weight: 600;
  color: var(--word-primary);
  margin-bottom: 0.5rem;
}

.word-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.example-word {
  background: var(--word-secondary);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: var(--font-serif);
}

/* Highlight Box */
.highlight-box {
  background: linear-gradient(135deg, var(--word-hover) 0%, white 100%);
  border: 2px solid var(--word-secondary);
  border-radius: var(--word-border-radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
  font-weight: 600;
  color: var(--word-primary);
}

/* Word Formation Demo */
.word-formation {
  background: var(--word-dark);
  color: white;
  padding: 1.5rem;
  border-radius: var(--word-border-radius);
  margin: 1rem 0;
  text-align: center;
}

.formation-step {
  margin: 1rem 0;
  font-family: var(--font-serif);
  font-size: 1.2rem;
}

.formation-letters {
  display: inline-flex;
  gap: 0.5rem;
  margin: 0 1rem;
}

.formation-letter {
  background: var(--word-secondary);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.formation-arrow {
  font-size: 1.5rem;
  margin: 0 1rem;
  color: var(--word-accent);
}

/* Responsive Design */
@media (max-width: 768px) {
  .word-builder-title {
    font-size: 2.5rem;
  }
  
  .word-builder-subtitle {
    font-size: 1rem;
  }
  
  .instructions-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .action-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .play-btn, .back-btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
  
  .letter-circle-demo {
    width: 150px;
    height: 150px;
  }
  
  .demo-letter:nth-child(1) { transform: rotate(0deg) translateX(60px) rotate(0deg); }
  .demo-letter:nth-child(2) { transform: rotate(60deg) translateX(60px) rotate(-60deg); }
  .demo-letter:nth-child(3) { transform: rotate(120deg) translateX(60px) rotate(-120deg); }
  .demo-letter:nth-child(4) { transform: rotate(180deg) translateX(60px) rotate(-180deg); }
  .demo-letter:nth-child(5) { transform: rotate(240deg) translateX(60px) rotate(-240deg); }
  .demo-letter:nth-child(6) { transform: rotate(300deg) translateX(60px) rotate(-300deg); }
  
  .word-slots, .score-grid, .tools-showcase, .tips-grid, .word-types {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .content-wrapper {
    padding: 0 0.5rem;
  }
  
  .word-builder-header {
    padding: 1.5rem 1rem;
  }
  
  .word-builder-title {
    font-size: 2rem;
  }
  
  .card-header {
    padding: 1rem;
  }
  
  .card-content {
    padding: 1.5rem;
  }
  
  .word-slots, .score-grid, .tools-showcase, .tips-grid, .word-types {
    grid-template-columns: 1fr;
  }
  
  .letter-circle-demo {
    width: 120px;
    height: 120px;
  }
  
  .demo-letter:nth-child(1) { transform: rotate(0deg) translateX(45px) rotate(0deg); }
  .demo-letter:nth-child(2) { transform: rotate(60deg) translateX(45px) rotate(-60deg); }
  .demo-letter:nth-child(3) { transform: rotate(120deg) translateX(45px) rotate(-120deg); }
  .demo-letter:nth-child(4) { transform: rotate(180deg) translateX(45px) rotate(-180deg); }
  .demo-letter:nth-child(5) { transform: rotate(240deg) translateX(45px) rotate(-240deg); }
  .demo-letter:nth-child(6) { transform: rotate(300deg) translateX(45px) rotate(-300deg); }
}

/* Additional breakpoint for screens under 400px */
@media (max-width: 399px) {
  .instructions-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .content-wrapper {
    max-width: 100%;
    padding: 1rem 0.5rem;
  }
  
  .instruction-card {
    margin: 0;
    padding: 1rem;
    border-radius: 12px;
  }
  
  .card-header {
    flex-direction: column;
    text-align: center;
    margin-bottom: 1rem;
  }
  
  .card-icon {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
  }
  
  .card-title {
    font-size: 1.2rem;
  }
  
  .breadcrumb {
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }
  
  .action-buttons {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .play-btn, .back-btn {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
  
  .word-builder-header {
    padding: 1.5rem 0;
  }
  
  .word-builder-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }
  
  .word-builder-subtitle {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
  }
  
  .letter-circle-demo {
    width: 100px;
    height: 100px;
  }
  
  .demo-letter {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
  
  .word-slots, .score-grid, .tools-showcase, .tips-grid, .word-types {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Animations */
@keyframes letterPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.demo-letter:hover {
  animation: letterPulse 0.6s ease-in-out;
}

@keyframes wordForm {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.word-slot:hover {
  animation: wordForm 0.3s ease-out;
}

/* Letter selection effect */
.demo-letter.selected {
  background: var(--word-success);
  transform: scale(1.2);
}
