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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #3b82f6 100%);
  min-height: 100vh;
  padding: 25px;
  color: #1f2937;
}

.container {
  max-width: 1500px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(25px);
  border-radius: 30px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.header {
  background: linear-gradient(135deg, #1f2937 0%, #3b82f6 50%, #6366f1 100%);
  color: white;
  padding: 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 1px,
    transparent 1px
  );
  background-size: 30px 30px;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(-10px, -10px) rotate(5deg);
  }
}

.header h1 {
  font-size: 3.5rem;
  margin-bottom: 15px;
  font-weight: 900;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
  font-size: 1.3rem;
  opacity: 0.95;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.input-section {
  padding: 50px;
  background: linear-gradient(145deg, #f9fafb 0%, #f3f4f6 100%);
}

.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .input-grid {
    grid-template-columns: 1fr;
  }
}

.input-group {
  position: relative;
}

.input-group label {
  display: block;
  margin-bottom: 15px;
  font-weight: 700;
  color: #374151;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-group textarea {
  width: 100%;
  padding: 25px;
  border: 3px solid #e5e7eb;
  border-radius: 20px;
  font-size: 17px;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  resize: vertical;
  min-height: 140px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  line-height: 1.6;
}

.input-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.15);
  transform: translateY(-3px);
}

.input-group textarea:hover {
  border-color: #9ca3af;
}

.check-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  color: white;
  padding: 22px 60px;
  border: none;
  border-radius: 60px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
  box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
  position: relative;
  overflow: hidden;
}

.check-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s;
}

.check-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 20px 45px rgba(59, 130, 246, 0.5);
}

.check-btn:hover::before {
  left: 100%;
}

.check-btn:active {
  transform: translateY(-2px) scale(1.02);
}

.btn-icon {
  font-size: 22px;
}

.btn-text {
  font-weight: 700;
}

.results {
  padding: 50px;
  display: none;
  background: white;
}

.results.show {
  display: block;
  animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.accuracy-display {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 50px;
}

.accuracy-circle {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: conic-gradient(#3b82f6 0deg, #6366f1 0deg, #f3f4f6 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-right: 50px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  transition: all 0.5s ease;
}

.accuracy-circle:hover {
  transform: scale(1.05);
}

.accuracy-circle::before {
  content: "";
  width: 160px;
  height: 160px;
  background: white;
  border-radius: 50%;
  position: absolute;
  box-shadow: inset 0 8px 25px rgba(0, 0, 0, 0.08);
}

.accuracy-text {
  font-size: 36px;
  font-weight: 900;
  color: #1f2937;
  z-index: 1;
}

.accuracy-info {
  flex: 1;
}

.accuracy-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 10px;
}

.accuracy-subtitle {
  font-size: 1.2rem;
  color: #6b7280;
  margin-bottom: 25px;
}

.quick-stats {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
}

.quick-stat {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 18px 25px;
  border-radius: 18px;
  border-left: 5px solid;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.quick-stat:hover {
  transform: translateY(-3px);
}

.quick-stat.correct {
  border-left-color: #10b981;
}
.quick-stat.warning {
  border-left-color: #f59e0b;
}
.quick-stat.danger {
  border-left-color: #ef4444;
}

.quick-stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.quick-stat-label {
  font-size: 0.85rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  padding: 35px;
  border-radius: 25px;
  border: 2px solid #e5e7eb;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--accent-color, #3b82f6),
    var(--accent-color-2, #6366f1)
  );
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  border-color: var(--accent-color, #3b82f6);
}

.stat-card.correct {
  --accent-color: #10b981;
  --accent-color-2: #059669;
}
.stat-card.half {
  --accent-color: #f59e0b;
  --accent-color-2: #d97706;
}
.stat-card.full {
  --accent-color: #ef4444;
  --accent-color-2: #dc2626;
}
.stat-card.info {
  --accent-color: #06b6d4;
  --accent-color-2: #0891b2;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 12px;
  background: linear-gradient(
    135deg,
    var(--accent-color),
    var(--accent-color-2)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  color: #6b7280;
  font-size: 1.1rem;
  font-weight: 600;
}

.breakdown-section {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 30px;
  padding: 40px;
  margin-bottom: 40px;
  border: 2px solid #e5e7eb;
}

.breakdown-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 35px;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 12px;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  background: white;
  border-radius: 18px;
  border: 2px solid #e5e7eb;
  transition: all 0.3s ease;
}

.breakdown-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: #d1d5db;
}

.breakdown-label {
  font-weight: 600;
  color: #374151;
  font-size: 1rem;
}

.breakdown-value {
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 25px;
  color: white;
  font-size: 1rem;
}

.value-correct {
  background: linear-gradient(135deg, #10b981, #059669);
}
.value-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.value-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}
.value-info {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.comparison-section {
  margin-top: 50px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
  padding: 25px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 20px;
  border: 2px solid #e5e7eb;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
}

.legend-color {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 0, 0.1);
}

.legend-color.correct {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}
.legend-color.case-error {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
}
.legend-color.missing {
  background: linear-gradient(135deg, #fecaca, #fca5a5);
}
.legend-color.extra {
  background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
}
.legend-color.reversed {
  background: linear-gradient(135deg, #fed7d7, #feb2b2);
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

@media (max-width: 768px) {
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

.comparison-box {
  background: white;
  border: 3px solid #e5e7eb;
  border-radius: 25px;
  padding: 35px;
  transition: all 0.3s ease;
}

.comparison-box:hover {
  border-color: #3b82f6;
  box-shadow: 0 15px 35px rgba(59, 130, 246, 0.15);
}

.comparison-title {
  font-weight: 800;
  margin-bottom: 20px;
  color: #1f2937;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.comparison-text {
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 17px;
  line-height: 2;
  word-break: break-word;
}

.word {
  display: inline-block;
  margin: 3px;
  padding: 6px 12px;
  border-radius: 10px;
  transition: all 0.3s ease;
  font-weight: 600;
  border: 2px solid transparent;
}

.word:hover {
  transform: scale(1.05);
}

.word.correct {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  border-color: #10b981;
}

.word.case-error {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border-color: #f59e0b;
}

.word.missing {
  background: linear-gradient(135deg, #fecaca, #fca5a5);
  color: #991b1b;
  border-color: #ef4444;
  position: relative;
}

.word.missing::after {
  content: " (missing)";
  font-size: 0.75em;
  opacity: 0.8;
  font-weight: 500;
}

.word.extra {
  background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
  color: #5b21b6;
  border-color: #8b5cf6;
  position: relative;
}

.word.extra::after {
  content: " (extra)";
  font-size: 0.75em;
  opacity: 0.8;
  font-weight: 500;
}

.word.reversed {
  background: linear-gradient(135deg, #fed7d7, #feb2b2);
  color: #c53030;
  border-color: #f56565;
  position: relative;
}

.word.reversed::after {
  content: " (swapped)";
  font-size: 0.75em;
  opacity: 0.8;
  font-weight: 500;
}

.debug-info {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 2px solid #0ea5e9;
  border-radius: 20px;
  padding: 25px;
  margin-top: 40px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 13px;
  max-height: 350px;
  overflow-y: auto;
  line-height: 1.5;
}

@media (max-width: 1024px) {
  .accuracy-display {
    flex-direction: column;
    text-align: center;
  }

  .accuracy-circle {
    margin-right: 0;
    margin-bottom: 30px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  .header {
    padding: 30px;
  }

  .header h1 {
    font-size: 2.5rem;
  }

  .input-section {
    padding: 30px;
  }

  .results {
    padding: 30px;
  }

  .accuracy-circle {
    width: 150px;
    height: 150px;
  }

  .accuracy-circle::before {
    width: 120px;
    height: 120px;
  }

  .accuracy-text {
    font-size: 28px;
  }
}
