:root {
  --bg-1: #fed5e8;
  --bg-2: #ffd85f;
  --ink: #121212;
  --frame: #0f2a56;
  --frame-2: #24b7ff;
  --paper: #fff9d7;
  --accent: #ff3f8e;
  --accent-2: #35d07f;
  --cursor-cute: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%23ff4fa3' d='M16 28s-9-5.7-9-12A5 5 0 0 1 16 13a5 5 0 0 1 9 3c0 6.3-9 12-9 12z'/%3E%3Ccircle cx='23' cy='8' r='2' fill='%23ffd84d'/%3E%3C/svg%3E");
  --cursor-cute-hover: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%23ffd84d' d='M16 3l2.9 6.3 6.9.8-5.1 4.8 1.4 6.8-6.1-3.4-6.1 3.4 1.4-6.8-5.1-4.8 6.9-.8z'/%3E%3Ccircle cx='24' cy='24' r='3' fill='%23ff4fa3'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  cursor: var(--cursor-cute) 4 2, auto;
  background-color: var(--bg-1);
  background-image:
    radial-gradient(circle at 18px 18px, rgba(255, 255, 255, 0.55) 8px, transparent 9px),
    radial-gradient(circle at 4px 4px, rgba(255, 64, 143, 0.35) 3px, transparent 4px),
    linear-gradient(45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%);
  background-size: 24px 24px, 24px 24px, 16px 16px, 16px 16px;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  opacity: 0.14;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(circle, rgba(0, 0, 0, 0.55) 0.6px, transparent 0.7px),
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 0.6px, transparent 0.7px);
  background-size: 3px 3px, 4px 4px;
  animation: tv-static 0.18s steps(2) infinite;
}

.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.05) 0,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 2px,
    transparent 4px
  );
  z-index: 9;
}

.sticker-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}

.sticker {
  position: absolute;
  width: clamp(64px, 9vw, 120px);
  image-rendering: pixelated;
  filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.35));
  animation: sticker-float 4.8s ease-in-out infinite;
}

.s1 {
  top: 5%;
  left: 2%;
  transform: rotate(-8deg);
}

.s2 {
  top: 16%;
  right: 2%;
  transform: rotate(7deg);
  animation-delay: -1.2s;
}

.s3 {
  top: 42%;
  left: 3%;
  transform: rotate(10deg);
  animation-delay: -2.1s;
}

.s4 {
  top: 50%;
  right: 2%;
  transform: rotate(-10deg);
  animation-delay: -3s;
}

.s5 {
  bottom: 9%;
  left: 1.5%;
  transform: rotate(-6deg);
  animation-delay: -1.8s;
}

.s6 {
  bottom: 7%;
  right: 1.5%;
  transform: rotate(9deg);
  animation-delay: -2.7s;
}

.hero,
.layout,
.footer {
  width: min(1100px, 94vw);
  margin-inline: auto;
}

.viewer-layout {
  width: min(1100px, 94vw);
  margin: 1rem auto;
}

.viewer-shell {
  background:
    radial-gradient(circle at top right, rgba(80, 130, 255, 0.12), transparent 58%),
    var(--paper);
}

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0 0.6rem;
}

.viewer-actions a {
  display: inline-block;
  text-decoration: none;
  border: 2px solid #000;
  background: linear-gradient(180deg, #f8ffff, #70d6ff);
  color: #000;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  box-shadow: 2px 2px 0 #000;
}

.viewer-meta {
  margin: 0 0 0.7rem;
  font-family: "Courier New", monospace;
  font-size: 0.86rem;
  background: #e8f3ff;
  border: 2px dashed #0b3f7e;
  padding: 0.45rem 0.6rem;
  overflow-wrap: anywhere;
}

.viewer-code-wrap {
  border: 3px solid #0a2c62;
  box-shadow: inset 0 0 0 2px #8ecfff;
  background: #0b1631;
  border-radius: 8px;
  overflow: auto;
  max-height: 72vh;
}

.viewer-code {
  margin: 0;
  padding: 0.7rem 0;
  min-width: 620px;
}

.viewer-code code {
  font-family: "Courier New", monospace;
  font-size: 0.87rem;
  color: #d8e9ff;
  display: block;
}

.code-line {
  display: grid;
  grid-template-columns: 3.1rem 1fr;
  gap: 0.8rem;
  padding: 0 0.8rem;
  line-height: 1.45;
}

.line-no {
  user-select: none;
  color: #7ea6dd;
  text-align: right;
}

.line-code {
  white-space: pre;
}

.viewer-raw-fallback {
  display: block;
  width: 100%;
  min-height: 62vh;
  margin-top: 0.7rem;
  border: 2px solid #3b5e9d;
  background: #fff;
}

.hero {
  margin-top: 1rem;
  text-align: center;
  background: linear-gradient(160deg, #ff9ec8, #ffe36e);
}

h1,
h2,
h3 {
  font-family: "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0.2rem 0;
}

h1 {
  font-size: clamp(1.8rem, 4.5vw, 3rem);
}

marquee {
  margin: 0.5rem 0 0.25rem;
  font-weight: 700;
  color: #002450;
}

.tiny {
  font-size: 0.75rem;
  margin: 0;
  letter-spacing: 0.06em;
}

.frame {
  border: 4px solid var(--frame);
  box-shadow:
    0 0 0 4px var(--frame-2),
    6px 6px 0 rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--paper);
  position: relative;
  z-index: 10;
}

.badge-row {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.badge-row a,
.card a {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  border: 2px solid #000;
  padding: 0.35rem 0.65rem;
  background: linear-gradient(180deg, #f8ffff, #70d6ff);
  color: #000;
  box-shadow: 3px 3px 0 #000;
}

.badge-row a:hover,
.card a:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 #000;
  background: linear-gradient(180deg, #fff8d0, #ffc866);
  cursor: var(--cursor-cute-hover) 4 2, pointer;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
}

.sidebar {
  align-self: start;
  background: linear-gradient(180deg, #dff9ff, #ffd6ee);
}

.sidebar h2,
.sidebar h3 {
  margin-top: 0;
}

.sidebar ul {
  padding-left: 1rem;
  margin: 0.4rem 0 0;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.button-grid span {
  background: #000;
  color: #fff;
  text-align: center;
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  padding: 0.2rem;
}

.block {
  background:
    radial-gradient(circle at top right, rgba(255, 57, 147, 0.08), transparent 60%),
    var(--paper);
}

.project-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-top: 0.8rem;
}

.card {
  border: 2px dashed #00418a;
  background: #eaffff;
  padding: 0.8rem;
}

.card.alt {
  border-color: #87305d;
  background: #ffe9f6;
}

.card.note {
  border-color: #2a5c0a;
  background: #f3ffe1;
}

.card p {
  min-height: 3.6rem;
}

.notes-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.6rem;
  margin: 0.8rem 0 1rem;
}

.notes-summary p {
  margin: 0;
  background: #e4f7ff;
  border: 2px dashed #0b3f7e;
  padding: 0.5rem 0.6rem;
}

.notes-hub {
  border: 3px solid #1f3f7b;
  box-shadow: inset 0 0 0 2px #90d9ff;
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fdff, #eefde6);
  padding: 0.8rem;
}

.notes-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.notes-tab {
  border: 2px solid #000;
  background: linear-gradient(180deg, #fff8d2, #ffd68f);
  color: #000;
  font-family: "Courier New", monospace;
  font-weight: 700;
  padding: 0.38rem 0.7rem;
  box-shadow: 2px 2px 0 #000;
}

.notes-tab:hover {
  background: linear-gradient(180deg, #f8ffff, #7dd8ff);
}

.notes-tab.is-active {
  background: linear-gradient(180deg, #ffbfdc, #ff78b2);
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

.notes-panel {
  border: 2px dashed #31629f;
  background: #fffef4;
  padding: 0.75rem;
}

.notes-panel h3 {
  margin-top: 0;
}

.notes-panel p {
  min-height: 0;
}

.note-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.note-file-grid a {
  border: 2px solid #000;
  background: linear-gradient(180deg, #e5f9ff, #9ce3ff);
  color: #000;
  text-decoration: none;
  padding: 0.45rem 0.55rem;
  font-size: 0.86rem;
  box-shadow: 2px 2px 0 #000;
}

.note-file-grid a:hover {
  background: linear-gradient(180deg, #fff5c8, #ffc66a);
}

.note-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.note-checklist span {
  border: 2px dashed #31629f;
  background: #f3f8ff;
  padding: 0.45rem 0.55rem;
  font-size: 0.85rem;
}

.footer {
  text-align: center;
  background: linear-gradient(130deg, #dbffe8, #b8e8ff);
  margin-bottom: 1.2rem;
}

a {
  color: #052ca3;
}

a,
button,
[role="button"] {
  cursor: var(--cursor-cute-hover) 4 2, pointer;
}

@keyframes tv-static {
  0% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(-1px, 1px);
  }

  50% {
    transform: translate(1px, -1px);
  }

  75% {
    transform: translate(1px, 1px);
  }

  100% {
    transform: translate(0, 0);
  }
}

@keyframes sticker-float {
  0% {
    margin-top: 0;
  }

  50% {
    margin-top: -6px;
  }

  100% {
    margin-top: 0;
  }
}

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

  .sidebar {
    order: 2;
  }

  .sticker {
    width: clamp(56px, 14vw, 84px);
    opacity: 0.8;
  }

  .s3,
  .s4 {
    display: none;
  }

  .notes-tab {
    flex: 1 1 42%;
    text-align: center;
  }

  .viewer-code {
    min-width: 520px;
  }
}
