/* === Global === */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 110%;
  background-color: #0f172a;
  color: #e5e7eb;
  line-height: 1.6;
}

/* Fix anchor offset */
h2 {
  scroll-margin-top: 130px;
  box-shadow: 0px 12px 8px -11px rgba(56,189,248,0.4);
}

/* === Header === */
.top-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(90deg, #020617f5, #020617d3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px; /* Reduced vertical padding */
  border-bottom: 2px solid #1e293b;
  backdrop-filter: blur(2px);
  min-height: 70px; /* Ensures header has space */
}

/* Specific button spacing to prevent crowding */
.header-nav {
  display: flex;
  flex-wrap: wrap; 
  justify-content: flex-end;
  gap: 8px; /* Controlled spacing between buttons */
  max-width: 70%; /* Prevents nav from squishing the title */
}

.header-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding-left: 2%;
  gap: 15px;
}

.header-logo {
  height: 50px; /* Adjust based on your logo shape */
  width: auto;
  margin-right: 10px;
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.5));
}

.header-title div {
  display: flex;
  flex-direction: column;
}

.header-title h1 {
  text-align: center;
  margin: 0;
  color: #38bdf8;
  font-size: 1.85rem;
}

.header-title p {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 1px;
  color: #94a3b8;
}

.header-nav a {
  position: relative;
  margin-left: 5px;
  margin-right: 5px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #cbd5f5;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1px;
  background: #020617;
  border: 1px solid #1e293b;
  transition: all 0.25s ease;
}

.header-nav a:hover {
  color: #e0f2fe;
  border-color: #38bdf8;
  box-shadow: 0px 6px 6px -6px rgba(56,189,248,0.6);
}

.header-nav a.active {
  color: #38bdf8;
  background: #020617;
  border-color: #38bdf8;
  box-shadow: 0px 8px 8px -8px rgba(56,189,248,0.8);
}

.header-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  background: #38bdf8;
  transform: translateX(-50%);
  transition: width 0.6s ease;
}

.header-nav a:hover::after,
.header-nav a.active::after {
  width: 70%;
}

.header-nav a:focus-visible {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0px 0px 0px 2px rgba(56,189,248,0.5);
}

/* === Layout === */
main {
  max-width: 900px;
  margin: auto;
  padding: 20px;
}

h2 {
  color: #7dd3fc;
  font-size: 170%;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 5px;
  margin-top: 50px;
}

h3 {
  color: #a5f3fc;
  font-size: 150%;
}

/* === Current section ===*/
#current-section {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 6px;
  letter-spacing: 1px;
  text-align: right;
}

/* === Boxes === */
.box {
  background: #020617;
  border-left: 4px solid #38bdf8;
  padding: 15px;
  margin: 20px 0;
}

.box.warning {
  border-left-color: #f87171;
  background: #1f0a0a;
}

.box.success {
  border-left-color: #4ade80;
  background: #052e1a;
}

.box:hover {
  box-shadow: 0 0 15px rgba(56,189,248,0.3);
  transform: scale(1.02);
}

/* === Obtainment Section === */
.obtainment-group {
  margin-bottom: 40px;
}

.obtainment-group h3 {
  font-size: 120%;
  background-color: #050920e4;
  padding: 1.3% 1% 1.3% 2%;
  border-radius: 6px;
  margin-top: 30px;
  margin-bottom: 20px;
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* Allows icons to wrap on small screens */
  gap: 10px;
}

.obtainment-group h3::before {
  content: '◈';
  margin-right: 10px;
  font-size: 1rem;
  color: #6beca1;
}

.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: flex-start;
}

/* Tickets and box chip*/
img.ticket, img.chip {
  width: auto;      /* Remove the percentage width */
  height: 30px;     /* Set a fixed height to match text size */
  margin: 0 5px;
  vertical-align: middle;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.2));
}

/* Ensure the Obtainment section has the same anchor offset as the others */
#obtainment {
  scroll-margin-top: 130px;
}

/* Individual Card Container */
.card-container {
  position: relative;
  width: 135px; /* Standard YGO card aspect ratio */
  height: 195px;
  margin-top: 15px;
  border-radius: 6px;
  overflow: hidden;
  background: #020617;
  border: 1px solid #1e293b;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hover Animation */
.card-container:hover {
  transform: scale(1.1);
  z-index: 5;
  border-color: #38bdf8;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* Black Opaque Overlay */
.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 8px 0;
  background: rgba(0, 0, 0, 0.85);
  color: #38bdf8;
  font-size: 0.8rem;
  font-weight: bold;
  text-align: center;
  transform: translateY(100%); /* Hidden by default */
  transition: transform 0.25s ease-in-out;
}

.card-container:hover .card-overlay {
  transform: translateY(0); /* Slides up on hover */
}

.card-container-number{
  font-size: 17pt;
  color: rgba(174, 17, 17, 0.844);
  font-weight: bold;
  position: absolute;
  top: 55pt;
  left: 40pt;
}

/* === Lists === */
ul, ol {
  margin-left: 20px;
}

li {
  margin-bottom: 8px;
}

/* === Details === */
details {
  background: #020617;
  padding: 15px;
  border: 1px solid #1e293b;
  margin: 15px 0;
  border-radius: 4px;
}

summary {
  cursor: pointer;
  font-weight: bold;
  color: #38bdf8;
}

details[open] {
  animation: expand 0.4s ease;
}

@keyframes expand {
  from { opacity: 0; transform: scaleY(0.95); }
  to { opacity: 1; transform: scaleY(1); }
}

/* === Skill Card Styling === */
.skill-card {
  background: linear-gradient(145deg, #0f172a, #020617);
  border: 2px solid #38bdf8;
  border-radius: 12px;
  overflow: hidden;
  margin: 25px 0;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
  transition: transform 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.3);
}

.skill-header {
  background: #0f9bd6;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-icon {
  font-size: 1.2rem;
}

.skill-name {
  color: #020617;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.skill-body {
  padding: 20px;
  font-style: italic;
  font-size: 0.95rem;
  color: #cbd5f5;
  line-height: 1.4;
}

/* === Sub-section spacing === */
.sub-section {
  margin-top: 30px;
  padding-bottom: 20px;
}

/* Info box variation */
.box.info {
  border-left-color: #38bdf8;
  background: #0c1e33;
}

/* === Pre-Combo Briefing Layout === */
.briefing-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 25px 0;
}

.briefing-card {
  flex: 1;
  min-width: 300px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid #1e293b;
  border-top: 3px solid #f87171; /* Warning red accent only at top */
  padding: 20px;
  border-radius: 8px;
}

.briefing-card h4 {
  margin-top: 0;
  color: #f87171;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1.5px;
}

.briefing-content {
  font-size: 15px;
  color: #cbd5f5;
  line-height: 1.5;
}

.briefing-content strong {
  color: #f87171;
}

/* === Checklist Section === */
.checklist-title {
  font-size: 160%;
  border-radius: 6px;
  margin-top: 30px;
  margin-bottom: 20px;
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* Allows icons to wrap on small screens */
  gap: 10px;
}

.checklist-title::before {
  content: '◈';
  margin-right: 10px;
  font-size: 1rem;
  color: #cc0300;
}

.checklist-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.check-tile {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #1e293b;
  border-left: 3px solid #4ade80; /* Green for "Check" */
  padding: 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: transform 0.2s;
}

.check-tile:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: #38bdf8;
}

.check-icon {
  color: #4ade80;
  font-weight: bold;
  font-size: 16px;
}

.check-content{
  font-size: 16px;
}

/* Red variation for "Must NOT have" items */
.check-tile.negative {
  border-left-color: #f87171;
}

.check-tile.negative .check-icon {
  color: #f87171;
}

/* === Vertical Combo Timeline === */
.combo-timeline {
  position: relative;
  max-width: 800px;
  margin: 40px auto;
  padding-left: 30px;
}

.combo-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #38bdf8, #1e293b);
}

.step-card {
  position: relative;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  transition: border-color 0.3s;
}

.step-card:hover {
  border-color: #38bdf8;
}

.step-number {
  position: absolute;
  left: -45px;
  top: 15px;
  background: #38bdf8;
  color: #020617;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.step-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-img {
  align-self: center;
  width: 80px;
  height: auto;
  border-radius: 4px;
  border: 1px solid #1e293b;
}

.step-info h4 {
  margin: 0 0 10px 0;
  color: #38bdf8;
  text-transform: uppercase;
  font-size: 1rem;
}

.step-info p {
  margin: 0;
  font-size: 0.95rem;
  color: #cbd5f5;
  line-height: 1.5;
}

.step-info strong {
  color: #ffa931; /* Makes the card names pop */
}

/* === Technical Notes Deep Dive === */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.note-item {
  background: linear-gradient(145deg, #0f172a, #020617);
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 25px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.note-item:hover {
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
  transform: translateY(-5px);
}

.note-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #38bdf8;
  opacity: 0.5;
}

.note-item h4 {
  margin: 0 0 15px 0;
  color: #ff7f23;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.note-item p {
  margin: 0;
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.6;
}

.note-icon {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 5px #38bdf8);
}

/* === Scroll Reveal Animations === */
.reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left {
  transform: translateX(-40px) scale(0.98);
}

.reveal-right {
  transform: translateX(40px) scale(0.98);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.reveal-left.active,
.reveal-right.active {
  transform: translateX(0) scale(1);
}

/* Delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.15s; }
.delay-3 { transition-delay: 0.2s; }
.delay-4 { transition-delay: 0.25s; }
.delay-5 { transition-delay: 0.3s; }
.delay-6 { transition-delay: 0.35s; }
.delay-7 { transition-delay: 0.4s; }
.delay-8 { transition-delay: 0.45s; }
.delay-9 { transition-delay: 0.5s; }
.delay-10 { transition-delay: 0.55s; }
.delay-11 { transition-delay: 0.6s; }

/* === Side Effects === */
.side {
  position: fixed;
  top: 0;
  width: 14px;
  height: 100vh;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(56,189,248,0.8),
    transparent
  );
  animation: pulse 4s infinite ease-in-out, drift 8s infinite linear;
  z-index: -1;
}

.side.left { left: 0; width: 25px; }
.side.right { right: 0; width: 25px; }

.extender{
  margin-bottom: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

@keyframes drift {
  0% { background-position: 0% 0%; }
  100% { background-position: 0% 100%; }
}

/* === Footer & UI Extras === */
.bottom-footer {
  position: relative;
  z-index: 10;
  background: #020617; /* solid, no transparency */
  border-top: 2px solid #1e293b;
  padding: 30px 20px;
  text-align: center;
  color: #94a3b8;
  margin-top: 60px;
}

.bottom-footer strong {
  color: #38bdf8;
}

.footer-update {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 15px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

#backToTop {
  display: none;
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 1001;
  border: 1px solid #38bdf8;
  background-color: #020617;
  color: #38bdf8;
  cursor: pointer;
  padding: 12px;
  border-radius: 50%;
  font-size: 18px;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

#backToTop:hover {
  background-color: #38bdf8;
  color: #020617;
}

/* === Final Mobile Optimization === */
@media (max-width: 425px) {
  h2 {
    /* Increased offset to prevent header from covering section titles on mobile */
    scroll-margin-top: 260px; 
  }

  .top-header {
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    gap: 15px;
  }

  .header-title {
    padding-left: 0;
    justify-content: center;
    text-align: center;
    width: 100%;
  }

  .header-logo {
    height: 35px;
  }

  .header-title h1 {
    font-size: 1.4rem;
  }

  /* Force 2x3 Grid for Navigation Buttons */
  .header-nav {
    display: grid; 
    grid-template-columns: repeat(2, 1fr); /* 2 Columns */
    grid-template-rows: repeat(3, auto);   /* 3 Rows */
    gap: 8px;
    width: 95%;
    max-width: 100%;
    justify-content: center;
  }

  .header-nav a {
    margin: 0;
    padding: 10px 5px;
    font-size: 0.85rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
  }

  /* Side ambient effects thinning for small screens */
  .side.left, .side.right {
    width: 8px;
  }

  .card-row {
    justify-content: center;
  }
}

/* Specific fix for very small devices */
@media (max-width: 320px) {
  h2 {
    scroll-margin-top: 280px;
  }
}
