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

body {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 50%, #fff8e1 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
}

#rain-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.rain-sword {
  position: absolute;
  top: -3rem;
  font-size: 1.5rem;
  animation: fall linear forwards;
  user-select: none;
}

@keyframes fall {
  to { transform: translateY(110vh) rotate(360deg); opacity: 0.2; }
}

#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  max-width: 600px;
  width: 100%;
}

header {
  text-align: center;
}

header h1 {
  font-size: clamp(2rem, 7vw, 4rem);
  color: #bf360c;
  text-shadow: 3px 3px 0 #e8a070, 6px 6px 0 rgba(0,0,0,0.1);
  letter-spacing: 0.05em;
}

.subtitle {
  color: #8d3010;
  font-size: clamp(0.7rem, 2vw, 0.95rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 0.25rem;
}

#counter-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

#big-sword {
  font-size: clamp(4rem, 15vw, 8rem);
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s ease;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
  line-height: 1;
}

#big-sword:active {
  transform: scale(0.85);
}

#big-sword.slash {
  animation: slash 0.18s ease;
}

@keyframes slash {
  0%   { transform: scale(1) rotate(0deg); }
  30%  { transform: scale(1.3) rotate(-20deg); }
  60%  { transform: scale(0.95) rotate(15deg); }
  100% { transform: scale(1) rotate(0deg); }
}

#counter-display {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#count {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  color: #bf360c;
  font-variant-numeric: tabular-nums;
}

#count-label {
  font-size: 0.8rem;
  color: #8d3010;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#sword-rate {
  font-size: 0.75rem;
  color: #8d3010;
  min-height: 1.2em;
}

#milestones {
  min-height: 1.5rem;
  font-size: 0.9rem;
  color: #6d2000;
  font-weight: 600;
  text-align: center;
  animation: fadein 0.3s ease;
}

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

#fact-box {
  background: rgba(255,255,255,0.7);
  border: 2px solid #ffb74d;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  backdrop-filter: blur(4px);
}

#fact-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #bf360c;
  font-weight: 700;
}

#fact-text {
  font-size: clamp(0.8rem, 2.2vw, 0.95rem);
  color: #5a2000;
  line-height: 1.5;
  min-height: 2.5em;
}

#next-fact {
  align-self: flex-end;
  background: none;
  border: 1.5px solid #ffb74d;
  border-radius: 0.5rem;
  padding: 0.3rem 0.75rem;
  color: #8d3010;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s, color 0.15s;
}

#next-fact:hover {
  background: #ffb74d;
  color: #fff;
  border-color: #ffb74d;
}

#ascii-section {
  background: rgba(255,255,255,0.6);
  border: 2px solid #ffb74d;
  border-radius: 1rem;
  padding: 0.75rem 1.25rem;
  backdrop-filter: blur(4px);
}

#ascii-sword {
  font-size: clamp(0.55rem, 1.5vw, 0.75rem);
  color: #8d3010;
  line-height: 1.2;
  font-family: 'Courier New', monospace;
  text-align: center;
  white-space: pre;
}
