:root {
  --face: #c0c0c0;
  --light: #ffffff;
  --shadow: #808080;
  --dark: #000000;
  --navy: #000080;
  --title-2: #1084d0;
  --link: #0000ee;
  --visited: #551a8b;
  --sky: #000033;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 16px;
  color: #000;
  font-family: Verdana, Tahoma, "Comic Sans MS", sans-serif;
  font-size: 14px;
  background-color: var(--sky);
  background-image:
    radial-gradient(#fff 1px, transparent 1.5px),
    radial-gradient(#ffff99 1px, transparent 1.5px),
    radial-gradient(#99ccff 1px, transparent 1.5px);
  background-size: 47px 47px, 83px 83px, 131px 131px;
  background-position: 0 0, 23px 41px, 61px 17px;
}

a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover { color: #ff0000; background: #ffff00; }

.px { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }

.page { max-width: 800px; margin: 0 auto; }

/* ---------- Encabezado ---------- */

.masthead { text-align: center; color: #fff; padding: 8px 0 12px; }
.welcome { margin: 0; font-family: "Comic Sans MS", "Comic Sans", cursive; color: #ffff00; font-size: 18px; }
.wordart {
  margin: 4px 0;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(40px, 9vw, 72px);
  letter-spacing: 2px;
  background: linear-gradient(90deg, #ff0000, #ff9900, #ffff00, #33ff00, #00ccff, #6633ff, #ff00cc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px #fff;
  filter: drop-shadow(3px 3px 0 #ff00ff) drop-shadow(2px 2px 0 #000);
  transform: perspective(300px) rotateX(8deg);
  cursor: pointer;
}
.handle { margin: 0; color: #99ffff; font-family: "Courier New", monospace; }
.ticker {
  display: block;
  margin-top: 10px;
  padding: 3px 0;
  color: #00ff00;
  background: #000;
  border: 2px inset var(--face);
  font-family: "Courier New", monospace;
  font-weight: bold;
}

.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { visibility: hidden; } }

/* ---------- Ventanas tipo Windows 98 ---------- */

.win {
  margin-bottom: 14px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px #dfdfdf;
  padding: 3px;
}
.win.zzz { animation: buzz .4s; }
.win-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 3px 3px 6px;
  color: #fff;
  font-family: Tahoma, "MS Sans Serif", sans-serif;
  font-weight: bold;
  font-size: 13px;
  background: linear-gradient(90deg, var(--navy), var(--title-2));
}
.win-controls { display: flex; gap: 2px; }
.win-controls button {
  width: 18px; height: 16px;
  padding: 0;
  font: bold 11px/1 Tahoma, sans-serif;
  background: var(--face);
  border: 1px solid;
  border-color: var(--light) var(--dark) var(--dark) var(--light);
  cursor: pointer;
}
.win-controls button:active { border-color: var(--dark) var(--light) var(--light) var(--dark); }
.win-body { padding: 10px; }
.win.min .win-body { display: none; }

.btn98 {
  display: inline-block;
  padding: 5px 12px;
  color: #000;
  font: 13px Tahoma, "MS Sans Serif", sans-serif;
  text-decoration: none;
  background: var(--face);
  border: 2px solid;
  border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset -1px -1px var(--shadow);
  cursor: pointer;
}
.btn98:visited { color: #000; }
.btn98:hover { background: var(--face); color: #000; }
.btn98:active { border-color: var(--dark) var(--light) var(--light) var(--dark); box-shadow: inset 1px 1px var(--shadow); }
.btn98:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }

/* ---------- Layout ---------- */

.layout { display: grid; grid-template-columns: 200px 1fr; gap: 14px; align-items: start; }

.menu { list-style: none; margin: 0; padding: 0; font-family: "Comic Sans MS", cursive; font-size: 15px; }
.menu li { padding: 2px 0; }

.status p { margin: 0 0 6px; font-size: 13px; }

.counter { text-align: center; font-size: 12px; }
.counter p { margin: 4px 0; }
.odometer { display: inline-flex; gap: 2px; padding: 3px; background: #000; border: 2px inset var(--face); }
.odometer span { width: 16px; padding: 2px 0; color: #00ff66; background: #111; font: bold 18px "Courier New", monospace; text-shadow: 0 0 4px #00ff66; }

.about { display: flex; gap: 14px; align-items: flex-start; }
.avatar { flex: none; padding: 4px; background: #fff; border: 2px inset var(--face); }
.avatar img { width: 96px; }
.about p { margin: 0 0 8px; line-height: 1.5; }
.small { font-size: 12px; }

.linklist, .posts { list-style: none; margin: 0; padding: 8px; background: #fff; border: 2px inset var(--face); }
.linklist li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px dashed #c0c0c0; }
.linklist li:last-child { border-bottom: 0; }
.linklist img { width: 32px; flex: none; }
.linklist a { font-family: "Comic Sans MS", cursive; font-size: 17px; font-weight: bold; }
.linklist .tag { display: block; color: #555; font-size: 12px; }
.new { margin-left: 6px; color: #ff0000; font: bold 10px Verdana, sans-serif; vertical-align: super; }

.posts li { padding: 6px 4px; }
.posts time { color: #008000; font-family: "Courier New", monospace; font-size: 12px; margin-right: 8px; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-grid;
  place-items: center;
  width: 88px; height: 31px;
  overflow: hidden;
  padding: 0 4px;
  font: bold 9px/1.05 Verdana, sans-serif;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid #000;
  box-shadow: inset 1px 1px rgba(255, 255, 255, .6), inset -1px -1px rgba(0, 0, 0, .4);
}
.badge:hover { filter: brightness(1.2); background-color: inherit; }

.construction { text-align: center; padding: 6px; background: #ffffcc; border: 2px inset var(--face); }
.construction p { margin: 8px 0; }
.tape { height: 14px; background: repeating-linear-gradient(45deg, #000 0 12px, #ffcc00 12px 24px); }

/* ---------- Pie ---------- */

.footer { margin-top: 6px; padding: 10px; text-align: center; color: #ccc; font-size: 12px; }
.footer a { color: #99ccff; }
.footer p { margin: 6px 0; }
.webring { font-family: "Comic Sans MS", cursive; font-size: 14px; color: #fff; }

.switch { position: fixed; right: 16px; bottom: 16px; z-index: 10; }

/* ---------- Asistente ---------- */

.assistant { position: fixed; left: 16px; bottom: 16px; z-index: 10; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 260px; }
.bubble { padding: 8px 10px; background: #ffffe1; border: 1px solid #000; border-radius: 8px; font: 12px Tahoma, sans-serif; box-shadow: 2px 2px 0 rgba(0, 0, 0, .4); }
.bubble p { margin: 0 0 6px; }
.bubble .btn98 { padding: 2px 8px; font-size: 12px; margin-right: 4px; }
.buddy img { width: 48px; animation: hop 1.2s ease-in-out infinite; cursor: pointer; }
@keyframes hop { 50% { transform: translateY(-4px); } }

/* ---------- Brillitos del cursor ---------- */

.sparkle { position: fixed; z-index: 50; pointer-events: none; font-size: 14px; animation: fall .8s ease-in forwards; }
@keyframes fall { to { transform: translateY(24px) rotate(90deg); opacity: 0; } }
@keyframes buzz { 20% { translate: -8px 2px; } 40% { translate: 8px -2px; } 60% { translate: -6px 0; } 80% { translate: 6px 2px; } }

/* ---------- Post del weblog ---------- */

.post-body { padding: 14px 18px; background: #fff; border: 2px inset var(--face); line-height: 1.6; font-family: Georgia, "Times New Roman", serif; font-size: 16px; }
.post-body h1 { margin-top: 0; font-family: "Comic Sans MS", cursive; }

@media (max-width: 700px) {
  body { padding: 10px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
  .sidebar .win:first-child { grid-column: 1 / -1; }
  .menu { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .about { flex-direction: column; align-items: center; text-align: center; }
  .assistant { max-width: calc(100vw - 32px); bottom: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  html { scroll-behavior: auto; }
}
