* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 1rem;
  color: #333;
}

.container {
  max-width: 500px;
  margin: 0 auto;
  padding: 2rem 0;
}

.header {
  text-align: center;
  color: white;
  margin-bottom: 2rem;
  animation: fadeInDown 0.6s ease;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header .subtitle {
  font-size: 1rem;
  font-weight: 300;
  opacity: 0.95;
}

.install-banner {
  background: rgba(255, 255, 255, 0.95);
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  margin-bottom: 1.5rem;
  display: none;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  animation: slideDown 0.4s ease;
}

.install-banner.show {
  display: flex;
}

.install-icon {
  font-size: 2rem;
}

.install-content {
  flex: 1;
}

.install-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.2rem;
}

.install-text {
  font-size: 0.85rem;
  color: #666;
}

.install-btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
}

.install-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: white;
  border-radius: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: fadeInUp 0.6s ease;
}

.streak-banner {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  padding: 1.5rem;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.streak-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: pulse 3s ease-in-out infinite;
}

.streak-number {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.3rem;
  position: relative;
  z-index: 1;
}

.streak-label {
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.95;
  position: relative;
  z-index: 1;
}

.input-section {
  padding: 2rem;
  background: #f8f9fa;
}

.input-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

#winInput {
  width: 100%;
  padding: 1rem 1.2rem;
  border: 2px solid #e0e0e0;
  border-radius: 1rem;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background: white;
}

#winInput:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.char-count {
  position: absolute;
  right: 1rem;
  bottom: -1.5rem;
  font-size: 0.75rem;
  color: #999;
}

.add-btn {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 2rem;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.add-btn:active {
  transform: translateY(0);
}

.add-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.quote {
  text-align: center;
  padding: 1.5rem 2rem;
  font-style: italic;
  color: #667eea;
  font-size: 0.95rem;
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-top: 1px solid #f0f0f0;
}

.wins-section {
  padding: 2rem;
  background: white;
  max-height: 400px;
  overflow-y: auto;
}

.wins-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.wins-header h3 {
  font-size: 1.2rem;
  color: #333;
}

.clear-btn {
  padding: 0.4rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 0.5rem;
  background: white;
  color: #666;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.clear-btn:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

.win-item {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  padding: 1rem 1.2rem;
  border-radius: 1rem;
  margin-bottom: 0.8rem;
  animation: slideIn 0.3s ease;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.win-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.win-date {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.win-text {
  color: #333;
  font-size: 0.95rem;
  line-height: 1.5;
}

.delete-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(244, 67, 54, 0.1);
  border: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  color: #f44336;
  font-size: 1.2rem;
}

.win-item:hover .delete-btn {
  opacity: 1;
}

.delete-btn:hover {
  background: #f44336;
  color: white;
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #999;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 1rem;
  line-height: 1.6;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 0.3rem;
}

.stat-label {
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(180deg);
  }
}

.wins-section::-webkit-scrollbar {
  width: 8px;
}

.wins-section::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.wins-section::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 10px;
}

.wins-section::-webkit-scrollbar-thumb:hover {
  background: #764ba2;
}

.celebration {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 5rem;
  animation: celebrate 1s ease;
  pointer-events: none;
  z-index: 1000;
}

@keyframes celebrate {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 1rem 0;
  }

  .header h1 {
    font-size: 2rem;
  }

  .streak-number {
    font-size: 2.5rem;
  }

  .install-banner {
    flex-direction: column;
    text-align: center;
  }

  .install-btn {
    width: 100%;
  }
}

/* Standalone mode styles (when installed as PWA) */
@media all and (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .install-banner {
    display: none !important;
  }
}

.footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 2rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  line-height: 1.8;
}

.footer-text {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.footer-copyright {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.footer-credits {
  margin-bottom: 0.5rem;
}

.footer-credits a,
.footer-contact a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.footer-credits a:hover,
.footer-contact a:hover {
  border-bottom-color: white;
  opacity: 0.8;
}

.footer-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .footer {
    font-size: 0.75rem;
    padding: 1.5rem 1rem;
  }

  .footer-contact {
    flex-direction: column;
    gap: 0.3rem;
  }
}
