/* ========== BASE ========== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;

  /* ✨ SERIF PARA TEXTO */
  font-family: "Share Tech Mono", "Times New Roman", serif;

  font-size: 15px;
  color: #333333;

  background-color: #ffedfe;
  background-image:
    linear-gradient(rgba(255,255,255,0.4), rgba(255,255,255,0.4)),
    repeating-linear-gradient(
      45deg,
      #ffedfe 0px,
      #ffedfe 12px,
      #eddcff 12px,
      #eddcff 24px
    );
}

/* ========== LAYOUT ========== */
.container,
.layout {
  width: 1200px;
  margin: 0 auto;
}

.container {
  margin-top: 24px;
}

.layout > * {
  min-height: 0;
}

.layout {
  display: grid;
  grid-template-columns: 230px 1fr 230px;
  gap: 18px;
  margin-top: 18px;
  margin-bottom: 30px;
  height: 75vh;
}

aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ========== MAIN SCROLL SYSTEM ========== */
main {
  height: 100%;
}

.main-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.main-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.main-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  padding-right: 6px;

  background: #ffffff;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #7a7a7a;
  border-bottom: 1px solid #7a7a7a;
}

/* ========== WINDOWS 95 PANEL ========== */
header,
nav,
.main-card,
.mini-card {
  background: #eddcff;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #7a7a7a;
  border-bottom: 2px solid #7a7a7a;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #cfcfcf;
}

/* ========== HEADER ========== */
header {
  padding: 14px 16px;
  margin-bottom: 10px;
}

.title-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rat-icon {
  width: 42px;
  height: 42px;
  image-rendering: pixelated;
}

/* ✨ PIXEL TITULO */
header h1 {
  margin: 0;
  font-size: 20px;
  font-family: "Silkscreen", monospace;
  color: #333333;
  text-shadow: 1px 1px 0 #ffffff;
}

.header-sub {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: #7a7a7a;
}

/* ========== NAV ========== */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  background: #e2fbf9;
}

/* ✨ PIXEL BOTONES */
nav a {
  display: inline-block;
  padding: 6px 10px;
  text-decoration: none;
  color: #333333;
  background: #ffedfe;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #7a7a7a;
  border-bottom: 2px solid #7a7a7a;

  font-family: "Silkscreen", monospace;
  font-size: 10px;
}

nav a:hover {
  background: #eddcff;
}

nav a:active {
  border-top: 2px solid #7a7a7a;
  border-left: 2px solid #7a7a7a;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  background: #e2fbf9;
}

/* ========== CARDS ========== */
.main-inner,
.mini-card-inner {
  padding: 3px;
}

/* ✨ PIXEL BARRAS */
.main-bar,
.mini-card-bar {
  padding: 5px 8px;
  font-weight: normal;
  color: #333333;
  background: linear-gradient(90deg, #eddcff 0%, #e2fbf9 100%);
  border-bottom: 1px solid #7a7a7a;

  font-family: "Silkscreen", monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: lowercase;
}

.main-bar h2 {
  margin: 0;
  font-size: 10px;
  font-family: "Silkscreen", monospace;
}

/* sidebar bodies */
.mini-card-body {
  background: #ffffff;
  padding: 12px;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #7a7a7a;
  border-bottom: 1px solid #7a7a7a;
  font-size: 14px;
}

/* ========== TEXT ========== */
.main-body,
.mini-card-body {
  font-family: "Times New Roman", serif;
}

.main-body p,
.mini-card-body p {
  margin-top: 0;
  line-height: 1.6;
}

/* ========== IFRAMES ========== */
iframe {
  max-width: 100%;
}

.mini-card-body iframe[title="Last.fm Status"] {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  background: #ffedfe;
  border: 1px solid #7a7a7a;
}

.mini-card-body iframe[src*="timeanddate"] {
  display: block;
  margin: 0 auto;
}

/* ========== SCROLLBAR ========== */
.main-body::-webkit-scrollbar {
  width: 12px;
}

.main-body::-webkit-scrollbar-track {
  background: #ffedfe;
  border-left: 1px solid #7a7a7a;
}

.main-body::-webkit-scrollbar-thumb {
  background: #eddcff;
  border: 2px solid #ffffff;
  border-right: 2px solid #7a7a7a;
  border-bottom: 2px solid #7a7a7a;
}

.main-body::-webkit-scrollbar-thumb:hover {
  background: #e2fbf9;
}

/* ========== DETAILS ========== */
.main-card::after,
.mini-card::after {
  content: "✦";
  position: absolute;
  right: 10px;
  top: 8px;
  font-size: 11px;
  color: #eddcff;
}

/* ========== SELECTION ========== */
::selection {
  background: #eddcff;
  color: #333333;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1260px) {
  .container,
  .layout {
    width: 95%;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  main {
    height: auto;
  }

  .main-card {
    height: auto;
  }

  .main-body {
    overflow: visible;
  }
}

/* ===== MUSIC CARD PERFECT FIX ===== */

/* CONTENEDOR */
.music-card {
  display: flex;
  flex-direction: column;
  align-items: center;

  gap: 6px;

  padding: 6px 6px;

  height: auto;
}

/* CD */
.music-card .cd {
  width:30px;
  height: 30px;

  display: block;

  image-rendering: pixelated;
}

/* 🔥 HACER QUE EL IFRAME NO OCUPE ESPACIO DE MÁS */
.music-card iframe {
  display: block;

  width: auto;
  height: 20px; /* 👈 CLAVE: limita altura */

  border: none;
  background: transparent;

  margin: 0;
  padding: 0;
}

/* 🔥 ELIMINAR ESTILO GLOBAL QUE TE ESTÁ ROMPIENDO TODO */
.mini-card-body iframe[title="Last.Fm Status"] {
  min-height: 0 !important;
  height:35px !important; /* 👈 fuerza altura real */
  border: none !important;
  background: transparent !important;
  margin-top: 0!important;
  padding-bottom: 1px; !important;
}

/* 🌙 MOON WIDGET FIX (scoped correctamente) */

.moon-card .mini-card-body table {
  margin: 0 auto;
  transform: scale(0.85);
  transform-origin: top center;
}

.moon-card .mini-card-body table td {
  filter: brightness(1.1) contrast(0.9);
}

.moon-card .mini-card-body table a span {
  color: #bfa7d6 !important;
  font-size: 9px !important;
  letter-spacing: 0.5px;
}

.moon-card .mini-card-body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  padding-bottom: 0;
}
