:root {
  --grass-green: #4CAF50;
  --grass-light: #7BC67E;
  --road-gray: #5A5A5A;
  --road-dark: #3A3A3A;
  --sky-blue: #87CEEB;
  --sign-red: #D32F2F;
  --sign-yellow: #FFC107;
  --building-blue: #1976D2;
  --tree-green: #2E7D32;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background-color: #5daa3f;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.05) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%234a9e36' fill-opacity='0.4'%3E%3Ccircle cx='5' cy='5' r='1.5'/%3E%3Ccircle cx='25' cy='15' r='1'/%3E%3Ccircle cx='15' cy='30' r='1.2'/%3E%3Ccircle cx='35' cy='35' r='0.8'/%3E%3C/g%3E%3C/svg%3E");
  min-height: 100vh;
}

.font-display { font-family: 'Lilita One', cursive; }
.font-body { font-family: 'Nunito', sans-serif; }

/* Road border pattern */
.road-border {
  background: var(--road-gray);
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 20px,
    #fff 20px,
    #fff 40px
  );
  background-size: 60px 4px;
  background-repeat: repeat-x;
  background-position: center;
  height: 12px;
}

.road-border-vertical {
  background: var(--road-gray);
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 20px,
    #fff 20px,
    #fff 40px
  );
  background-size: 4px 60px;
  background-repeat: repeat-y;
  background-position: center;
  width: 12px;
}

/* Header road animation */
.header-road {
  background: linear-gradient(180deg, #484848 0%, #5a5a5a 50%, #484848 100%);
  position: relative;
  overflow: hidden;
}

.header-road::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 200%;
  height: 4px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(
    90deg,
    #fff 0px,
    #fff 20px,
    transparent 20px,
    transparent 40px
  );
  animation: roadScroll 2s linear infinite;
}

@keyframes roadScroll {
  from { transform: translateY(-50%) translateX(0); }
  to { transform: translateY(-50%) translateX(-40px); }
}

/* Rug frame with tassels */
.rug-frame {
  position: relative;
  border: 8px solid #8B4513;
  border-radius: 4px;
  box-shadow: 
    inset 0 0 0 3px #A0522D,
    0 8px 32px rgba(0,0,0,0.3);
}

.rug-tassels-top, .rug-tassels-bottom {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0 20px;
}

.tassel {
  width: 4px;
  height: 18px;
  background: linear-gradient(180deg, #8B4513, #D2691E);
  border-radius: 0 0 2px 2px;
  animation: tasselSway 3s ease-in-out infinite;
}

.rug-tassels-top .tassel {
  border-radius: 2px 2px 0 0;
  animation: tasselSwayTop 3s ease-in-out infinite;
}

@keyframes tasselSway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

@keyframes tasselSwayTop {
  0%, 100% { transform: rotate(3deg); }
  50% { transform: rotate(-3deg); }
}

.tassel:nth-child(2n) { animation-delay: 0.5s; }
.tassel:nth-child(3n) { animation-delay: 1s; }
.tassel:nth-child(5n) { animation-delay: 1.5s; }

/* Loading car animation */
.loading-car {
  animation: driveCircle 2s linear infinite;
}

@keyframes driveCircle {
  0% { transform: rotate(0deg) translateX(40px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(40px) rotate(-360deg); }
}

/* Driving car in footer */
.footer-car {
  animation: driveAcross 8s linear infinite;
}

@keyframes driveAcross {
  0% { transform: translateX(-50px); }
  100% { transform: translateX(calc(100vw + 50px)); }
}

/* Tree sway */
.tree-sway {
  animation: treeSway 4s ease-in-out infinite;
  transform-origin: bottom center;
}

@keyframes treeSway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

/* Button hover effects */
.btn-generate {
  background: linear-gradient(135deg, #D32F2F, #F44336);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4);
}

.btn-generate:active {
  transform: translateY(0);
}

.btn-city-quick {
  transition: all 0.2s ease;
}

.btn-city-quick:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Road sign style badge */
.road-sign {
  background: linear-gradient(135deg, #1B5E20, #2E7D32);
  border: 3px solid #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  padding: 6px 20px;
  color: white;
  font-family: 'Lilita One', cursive;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Gallery card */
.gallery-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* Roundabout loading */
.roundabout {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 8px solid var(--road-gray);
  position: relative;
  background: #6ab74a;
}

.roundabout::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px dashed #fff;
}

/* Print mode */
@media print {
  .no-print { display: none !important; }
  body { background: white !important; }
  .rug-frame { box-shadow: none; border-width: 4px; }
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #3d8a2a; }
::-webkit-scrollbar-thumb { background: #8B4513; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #A0522D; }

/* Pulse animation for generate button */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(244, 67, 54, 0); }
}

.pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }