* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: calibri, Verdana, Arial, Helvetica, sans-serif;
}

/* Soft Pink Text Selection with darker pink shadow */
::selection {
  background-color: #ffcce0;
  color: #54343b;
  text-shadow: 1px 1px 0px #e697b1;
}
::-moz-selection {
  background-color: #ffcce0;
  color: #54343b;
  text-shadow: 1px 1px 0px #e697b1;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #fcfdfc url(https://itinerae.neocities.org/bgs/pinkblink.webp);
  padding: 32px;
  font-size: 10px;
  color: #786a6d;
  letter-spacing: 1px;
  line-height: 1.2;
  text-align: justify;
}

p {
  text-shadow: 1px 1px 0px #d5cbce;
}

a {
  color: #febfd4;
  text-decoration: none;
  cursor: pointer;
}
a:hover {
  color: #febfd4;
}

/* SVG Icon for links that open in a new tab */
a[target="_blank"]::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 4px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E")
    center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E")
    center/contain no-repeat;
  vertical-align: middle;
  opacity: 0.8;
  margin-bottom: 2px;
}

/* Format for code inputs */
code {
  background-color: #fff0f5;
  color: #f399b6;
  border: 1px dashed #ffcce0;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 0px;
}

.container {
  max-width: 660px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  position: relative;
  background: rgba(255, 250, 252, 0.96);
  border-width: 8px;
  border-style: solid;
  border-image: url("https://64.media.tumblr.com/5ff9a9d85e20892630c315cd0f203304/02a5b77b04f46187-6e/s75x75_c1/965fd167f4de4644dc593728fddedb46a37b93e7.pnj")
    8 round;
}

/* Header & Nav */
.header {
  position: relative;
  overflow: hidden;
  padding: 40px 10px 30px;
  text-align: center;
  border: 1px dashed #ffcce0;
  border-radius: 4px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.65), rgba(255, 240, 245, 0.4)),
    url("../img/amaicafebannernt.png"); /* OJO AQUÍ CON LA RUTA DE LA IMAGEN */
  background-size: cover;
  background-position: center;
}

.header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.3),
    transparent 70%
  );
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 2;
}

.navi {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 8 botones en total = 2 filas de 4 */
  gap: 6px;
}

.navi a {
  display: block;
  padding: 3px 5px;
  text-align: center;
  text-transform: uppercase;
  color: #fff;
  background: #fdc2d5;
  border: 1px solid #fdc2d5;
  border-radius: 4px;
  transition: 0.2s ease;
  font: 12px monospace;
  letter-spacing: 2px;
}

.navi a:hover {
  color: #febfd4;
  background: #fff0f5;
  transform: translateY(-1px);
}

/* Content Structure */
.content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  transition: 0.3s ease;
}

/* Toggles Sidebar Visibility via JS */
.content.no-sidebar {
  grid-template-columns: 1fr;
}
.content.no-sidebar .right {
  display: none;
}

.left,
.right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* SPA Sections */
.page-section {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.page-section.active {
  display: flex;
}

/* Box Styling with Lace Top Border */
.box {
  position: relative;
  padding: 26px 10px 10px 10px;
  border-radius: 4px;
  background-color: #fff;
  border: 1px dashed #ffcce0;
  overflow: hidden;
}

.box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background-image: url("https://files.catbox.moe/wmt6wy.png");
  background-repeat: repeat-x;
  background-position: top left;
  background-size: auto 20px;
  image-rendering: pixelated;
  z-index: 1;
}

.box > * {
  position: relative;
  z-index: 2;
}

.soft {
  background-color: #fff0f5;
}

.half-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.half-box {
  position: relative;
  padding: 26px 8px 8px 8px;
  background-color: #fff;
  border: 1px dashed #ffcce0;
  border-radius: 4px;
  overflow: hidden;
}

.half-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background-image: url("https://files.catbox.moe/wmt6wy.png");
  background-repeat: repeat-x;
  background-position: top left;
  background-size: auto 20px;
  image-rendering: pixelated;
  z-index: 1;
}

.half-box > * {
  position: relative;
  z-index: 2;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.gallery-item {
  border: 1px dashed #ffcce0;
  border-radius: 4px;
  padding: 6px;
  background: #fff0f5;
  text-align: center;
}
.gallery-item img {
  max-width: 100%;
  border-radius: 3px;
  margin-bottom: 4px;
}

/* Aesthetic Discord Button */
.discord-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff0f5;
  color: #f8adc5 !important;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px dashed #ffcce0;
  font: bold 11px monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: 0.2s ease;
  margin-top: 10px;
  text-decoration: none;
}

.discord-btn svg {
  fill: #fdc2d5;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  transition: 0.2s ease;
}

.discord-btn:hover {
  background: #fdc2d5;
  color: #fff !important;
  transform: translateY(-2px);
}

.discord-btn:hover svg {
  fill: #fff;
}

/* Rules Internal Navbar / Index */
.rules-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.rules-top .title {
  margin-bottom: 0;
  flex-grow: 1;
}

.lang-toggle-rules {
  background: #fff0f5;
  border: 1px dashed #ffcce0;
  padding: 4px 8px;
  border-radius: 4px;
  color: #febfd4;
  font: 11px monospace;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.2s ease;
}

.lang-toggle-rules:hover {
  background: #ffcce0;
  color: #fff;
}

.rules-layout {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 15px;
  margin-top: 10px;
}

.rules-index {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px dashed #ffcce0;
  padding-right: 10px;
  position: sticky;
  top: 0;
}

.rules-index a {
  font-size: 10px;
  padding: 4px;
  background: #fff0f5;
  border: 1px solid #ffcce0;
  border-radius: 4px;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
}

.rules-index a:hover {
  background: #ffcce0;
  color: #fff;
}

.rules-content-area {
  max-height: 350px;
  overflow-y: auto;
  padding-right: 10px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Custom Scrollbar for the Rules */
.rules-content-area::-webkit-scrollbar {
  width: 5px;
}
.rules-content-area::-webkit-scrollbar-track {
  background: #fff0f5;
  border-radius: 4px;
}
.rules-content-area::-webkit-scrollbar-thumb {
  background: #fdc2d5;
  border-radius: 4px;
}

.rule-section {
  padding-bottom: 15px;
}
.rule-section:last-child {
  padding-bottom: 0;
}

/* Discord Spoiler Effect */
.spoiler {
  background-color: #efe9eb;
  color: #efe9eb;
  border-radius: 3px;
  cursor: pointer;
  padding: 0 3px;
  transition: color 0.2s ease;
}
.spoiler:hover {
  color: #786a6d;
}

/* Accordions for Channel Rules */
.channel-accordion {
  border: 1px dashed #ffcce0;
  border-radius: 4px;
  margin-bottom: 8px;
  background: #fff;
}
.channel-accordion summary {
  padding: 6px 8px;
  background: #fff0f5;
  color: #f399b6;
  font: bold 9px monospace;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none; /* Hides default arrow */
  display: flex;
  align-items: center;
  border-radius: 3px;
  transition: background 0.2s ease;
}
.channel-accordion summary:hover {
  background: #ffcce0;
  color: #fff;
}
.channel-accordion summary::-webkit-details-marker {
  display: none; /* Hides default arrow in Safari/Chrome */
}
.channel-accordion summary img.acc-icon {
  margin-right: 6px;
  transition: transform 0.3s ease;
}
/* Rotate icon when accordion is open */
.channel-accordion[open] summary img.acc-icon {
  transform: rotate(90deg);
}
.channel-accordion[open] summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: 1px dashed #ffcce0;
}
.channel-accordion .accordion-content {
  padding: 10px 12px;
}

/* Shared Elements */
.title {
  font:
    bold 10px calibri,
    sans-serif;
  color: #f399b6;
  text-transform: uppercase;
  letter-spacing: 5px;
  border-bottom: 1px dashed #ffcce0;
  margin-bottom: 6px;
  padding-bottom: 4px;
}

.row {
  padding: 2px 0;
  border-bottom: 1px dotted #ffcce0;
}

.row:last-child {
  border-bottom: none;
}

.list {
  list-style: none;
}

.list li {
  padding: 2px 0;
  border-bottom: 1px dotted #ffcce0;
}

.list li:last-child {
  border-bottom: none;
}

.full {
  grid-column: span 2;
}

.footer {
  padding: 8px;
  text-align: center;
  color: #fbfbfb;
  background: #fdc2d5;
  border: 1px solid #ffcce0;
  border-radius: 4px;
}

.footer a {
  color: #f399b6;
}

.icon {
  opacity: 0.6;
}

/* Floating GIF */
.floating-gif {
  position: fixed;
  bottom: -150px;
  right: -100px;
  width: 700px;
  z-index: 1000;
  pointer-events: none; /* Previene que el gif bloquee clics en botones de abajo */
}

/* Language Toggle Logic */
.en {
  display: none;
}
body.lang-en .en {
  display: inline;
}
body.lang-en div.en {
  display: block;
}
body.lang-en .es {
  display: none;
}

@media (max-width: 768px) {
  .navi {
    grid-template-columns: repeat(
      2,
      1fr
    ); /* 2 columnas en celular (4 filas de 2) */
  }
  .content {
    grid-template-columns: 1fr;
  }
  .half-grid {
    grid-template-columns: 1fr;
  }
  .rules-layout {
    grid-template-columns: 1fr; /* Stack the index on mobile */
  }
  .rules-index {
    border-right: none;
    border-bottom: 1px dashed #ffcce0;
    padding-right: 0;
    padding-bottom: 10px;
    flex-direction: row;
    flex-wrap: wrap;
    position: relative;
  }
  .floating-gif {
    display: none;
  }
}
