* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh; 
  overflow-x: hidden;
  overflow-y: auto;
  font-family: 'Ninja Naruto', Arial, sans-serif;
  background: url(../img/seal.jpg) no-repeat center center fixed;
  background-size: cover;
  color: white;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 80px 20px 40px;
}

/* Characters Section */
.characters-container {
  max-width: 1200px;
  margin: 0 auto;
}

.page-title {
  text-align: center;
  font-size: 3em;
  color: #ff9900;
  margin-bottom: 40px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  font-weight: bold;
  letter-spacing: 2px;
}

/* Search Bar */
.search-container {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 40px;
  overflow: hidden;
}

.search-box {
  position: relative;
  width: 350px;
  max-width: 100%;
}

.search-box input {
  width: 100%;
  padding: 15px 50px 15px 20px;
  font-size: 1.1em;
  background: rgba(26, 26, 26, 0.9);
  border: 2px solid rgba(255, 153, 0, 0.3);
  border-radius: 25px;
  color: white;
  outline: none;
  transition: all 0.3s ease;
}

.search-box input:focus {
  border-color: #ff9900;
  box-shadow: 0 0 15px rgba(255, 153, 0, 0.3);
}

.search-box input::placeholder {
  color: #999;
  font-style: italic;
}

.search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #ff9900;
  font-size: 1.2em;
  pointer-events: none;
}

/* Main Characters Section */
.main-characters-section {
  margin-bottom: 60px;
}

.section-title {
  font-size: 2.2em;
  color: #ff9900;
  margin-bottom: 30px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  font-weight: bold;
  border-bottom: 3px solid rgba(255, 153, 0, 0.3);
  padding-bottom: 10px;
}

.main-characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 20px;
}

.main-character-card {
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.95), rgba(40, 40, 40, 0.9));
  border: 2px solid rgba(255, 153, 0, 0.4);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  display: flex;
  transition: all 0.3s ease;
}

.main-character-card:hover {
  border-color: #ff9900;
  box-shadow: 0 15px 40px rgba(255, 153, 0, 0.3);
  transform: translateY(-5px);
}

.main-card-image {
  width: 180px;
  height: 200px;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.4);
  position: relative;
}

.main-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.main-card-content {
  flex: 1;
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.main-character-name {
  font-size: 1.6em;
  color: #ff9900;
  margin: 0 0 15px 0;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.main-character-description {
  font-size: 1em;
  font-family: Arial, sans-serif;
  color: #e0e0e0;
  margin: 0 0 20px 0;
  line-height: 1.6;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

.character-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat {
  background: rgba(255, 153, 0, 0.2);
  color: #ffb84d;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.85em;
  font-weight: bold;
  border: 1px solid rgba(255, 153, 0, 0.3);
}

/* All Characters Section */
.all-characters-section {
  margin-top: 40px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  padding: 20px 0;
}

/* Character Cards - Simple & Clean */
.character-card {
  background-color: rgba(26, 26, 26, 0.9);
  border: 2px solid #333;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
  transition: all 0.3s ease;
}

.character-card:hover {
  border-color: #ff9900;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
  transform: translateY(-3px);
}

.card-image {
  width: 100%;
  height: 260px;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.4);
  position: relative;
}

.card-image::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to top, rgba(26, 26, 26, 0.8), transparent);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-content {
  padding: 20px;
  text-align: center;
  background-color: rgba(26, 26, 26, 0.95);
}

.character-name {
  font-size: 1.4em;
  color: #ff9900;
  margin: 0 0 10px 0;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.character-description {
  font-size: 1em;
  font-family: Arial, sans-serif;
  color: #ccc;
  margin: 0;
  line-height: 1.4;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

/* Lore Modal Styles */
.lore-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 2000;
}

.lore-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.98), rgba(40, 40, 40, 0.95));
  border: 3px solid #ff9900;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9);
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 0;
}

.lore-modal-header {
  background: linear-gradient(135deg, #ff9900, #ffb84d);
  color: #1a1a1a;
  padding: 20px 30px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lore-modal-title {
  font-size: 1.8em;
  font-weight: bold;
  margin: 0;
  text-shadow: none;
}

.lore-close-btn {
  background: none;
  border: none;
  color: #1a1a1a;
  font-size: 2em;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.lore-close-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.lore-modal-body {
  padding: 30px;
}

.lore-character-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ff9900;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  float: left;
  margin-right: 25px;
  margin-bottom: 15px;
}

.lore-text {
  font-size: 1.1em;
  color: #e0e0e0;
  line-height: 1.7;
  text-align: justify;
  font-family: Arial, sans-serif;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

.lore-text::first-letter {
  font-size: 1.5em;
  color: #ff9900;
  font-weight: bold;
}

/* Mobile responsiveness for lore modal */
@media (max-width: 768px) {
  .main-characters-grid {
    grid-template-columns: 1fr;
  }
  
  .main-character-card {
    flex-direction: column;
  }
  
  .main-card-image {
    width: 100%;
    height: 200px;
  }
  
  .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .lore-modal-content {
    width: 95%;
    max-height: 85vh;
  }
  
  .lore-modal-header {
    padding: 15px 20px;
  }
  
  .lore-modal-title {
    font-size: 1.5em;
  }
  
  .lore-modal-body {
    padding: 20px;
  }
  
  .lore-character-image {
    width: 100px;
    height: 100px;
    margin-right: 15px;
  }
  
  .lore-text {
    font-size: 1em;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 2.5em;
  }
  
  .search-container {
    justify-content: center;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .lore-character-image {
    float: none;
    display: block;
    margin: 0 auto 20px auto;
  }
  
  .lore-text {
    text-align: left;
  }
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: -250px;
  width: 220px;
  height: 100vh;
  background-color: rgba(26, 26, 26, 0.95);
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.5);
  padding-top: 60px;
  z-index: 1000;
  overflow-y: auto;
  transition: left 0.3s ease;
}

.sidebar.active {
  left: 0;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin: 10px 0;
}

.sidebar a {
  display: block;
  padding: 12px 20px;
  color: #ff9900;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.sidebar a:hover {
  background-color: #333;
  padding-left: 30px;
  color: #ffb84d;
}

/* Hamburger */
.hamburger {
  position: fixed;
  top: 15px;
  left: 15px;
  font-size: 30px;
  background: rgba(26, 26, 26, 0.8);
  border: 2px solid #ff9900;
  color: #ff9900;
  padding: 10px 12px;
  border-radius: 6px;
  z-index: 1001;
  cursor: pointer;
  transition: all 0.3s ease;
}

.hamburger:hover {
  background-color: rgba(255, 153, 0, 0.2);
  color: #ffb84d;
}


/* Loading Screen Styles - Fixed and Fully Responsive */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
  padding: clamp(10px, 3vw, 20px);
}

.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-container {
  text-align: center;
  color: #ff9900;
  width: 100%;
  max-width: 400px;
}

/* Responsive Shuriken Design */
.shuriken-container {
  position: relative;
  width: clamp(80px, 20vw, 150px);
  height: clamp(80px, 20vw, 150px);
  margin: 0 auto clamp(20px, 5vh, 30px);
}

.shuriken-image {
  width: 100%;
  height: 100%;
  animation: shurikenSpin 1.5s linear infinite;
  filter: drop-shadow(0 0 clamp(15px, 4vw, 25px) rgba(255, 153, 0, 0.9))
          drop-shadow(0 0 clamp(30px, 8vw, 50px) rgba(255, 153, 0, 0.7));
}

/* Loading Dots - Fully Responsive */
.loading-dots {
  font-size: clamp(1.5em, 6vw, 3.5em);
  letter-spacing: clamp(0.1em, 1vw, 0.2em);
}

.loading-dots span {
  animation: dotPulse 1.8s ease-in-out infinite;
  color: #ffb84d;
  text-shadow: 0 0 clamp(8px, 2vw, 12px) rgba(255, 184, 77, 0.8);
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.4s; }
.loading-dots span:nth-child(3) { animation-delay: 0.8s; }

/* Enhanced Animations */
@keyframes shurikenSpin {
  from { 
    transform: rotate(0deg);
    filter: drop-shadow(0 0 clamp(15px, 4vw, 25px) rgba(255, 153, 0, 0.9))
            drop-shadow(0 0 clamp(30px, 8vw, 50px) rgba(255, 153, 0, 0.7));
  }
  50% {
    filter: drop-shadow(0 0 clamp(20px, 5vw, 35px) rgba(255, 153, 0, 1))
            drop-shadow(0 0 clamp(40px, 10vw, 70px) rgba(255, 153, 0, 0.9));
  }
  to { 
    transform: rotate(360deg);
    filter: drop-shadow(0 0 clamp(15px, 4vw, 25px) rgba(255, 153, 0, 0.9))
            drop-shadow(0 0 clamp(30px, 8vw, 50px) rgba(255, 153, 0, 0.7));
  }
}

@keyframes dotPulse {
  0%, 80%, 100% { 
    opacity: 0.4;
    transform: scale(1);
  }
  40% { 
    opacity: 1;
    transform: scale(1.2);
  }
}


/* Footer */
.footer {
  background-color: rgba(26, 26, 26, 0.95);
  text-align: center;
  padding: 8px 0;
  font-size: 14px;
  color: white;
  margin-top: auto;
  border-top: 1px solid rgba(255, 153, 0, 0.3);
}

.footer .social-icons {
  margin-top: 10px;
}

.footer .social-icons a {
  margin: 0 12px;
  color: #ff9900;
  text-decoration: none;
  font-size: 20px;
  padding: 8px;
  border-radius: 4px;
  background-color: rgba(255, 153, 0, 0.1);
  display: inline-block;
  transition: all 0.3s ease;
}

.footer .social-icons a:hover {
  color: #ffb84d;
  background-color: rgba(255, 153, 0, 0.2);
  transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .main-content {
    padding: 80px 15px 40px;
  }
}

@media (max-width: 992px) {
  .main-characters-grid {
    grid-template-columns: 1fr;
  }
  
  .main-character-card {
    flex-direction: column;
    max-width: 400px;
    margin: 0 auto;
  }
  
  .main-card-image {
    width: 100%;
    height: 250px;
  }
}