
    :root {
      --black: #111111;
      --dark: #222222;
      --white: #ffffff;
      --paper: #fafafa;
      --gray: #e0e0e0;
      --muted: #666666;
      --red: #ff0000;
      --orange: #ff8000;
      --yellow: #ffff00;
      --green: #00cc00;
      --blue: #0033ff;
      --purple: #9900ff;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      padding: 20px 12px;
      background: #dcdcdc;
      color: var(--dark);
      font-family: Arial, Helvetica, sans-serif;
      font-size: 13px;
      line-height: 1.65;
    }

    a {
      color: var(--blue);
      text-decoration: underline;
    }

    a:hover {
      color: var(--red);
    }

    a:focus-visible,
    button:focus-visible,
    input:focus-visible,
    audio:focus-visible {
      outline: 3px solid var(--red);
      outline-offset: 3px;
    }

    button,
    input {
      font: inherit;
    }

    #page {
      width: 100%;
      max-width: 960px;
      margin: 0 auto;
      background: var(--white);
      border: 1px solid #777777;
      box-shadow: 0 1px 4px #999999;
    }

    #header {
      position: relative;
      overflow: hidden;
      background: var(--black);
      border-bottom: 0;
    }


    #banner {
      display: block;
      width: 100%;
      height: auto;
      max-height: 340px;
      object-fit: cover;
    }

    #header-overlay {
      position: absolute;
      inset: auto 0 0;
      padding: 48px 23px 17px;
      background: linear-gradient(
        transparent,
        rgba(0, 0, 0, 0.92)
      );
      color: var(--white);
    }

    .site-label {
      margin-bottom: 3px;
      color: var(--yellow);
      font-size: 11px;
      font-weight: bold;
      letter-spacing: 1.4px;
    }

    #header h1 {
      margin: 0;
      font-size: clamp(27px, 5vw, 39px);
      line-height: 1.15;
      letter-spacing: -1.3px;
      font-weight: 900;
    }

    #header h1 a {
      color: var(--white);
      text-decoration: none;
    }

    #header h1 a:hover {
      color: var(--yellow);
    }

    #header .tagline {
      margin: 5px 0 0;
      color: #eeeeee;
      font-size: 12px;
    }

    #nav {
      padding: 0 13px;
      background: var(--black);
      border-bottom: 1px solid #000000;
    }

    #nav::before {
      content: "";
      display: block;
      height: 6px;
      margin: 0 -13px;
      background: linear-gradient(
        90deg,
        var(--red) 0%, var(--red) 16.6667%,
        var(--orange) 16.6667%, var(--orange) 33.3333%,
        var(--yellow) 33.3333%, var(--yellow) 50%,
        var(--green) 50%, var(--green) 66.6667%,
        var(--blue) 66.6667%, var(--blue) 83.3333%,
        var(--purple) 83.3333%, var(--purple) 100%
      );
    }

    #nav ul {
      display: flex;
      flex-wrap: wrap;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    #nav a {
      display: block;
      padding: 10px 13px;
      color: var(--white);
      font-size: 11px;
      font-weight: bold;
      letter-spacing: 0.5px;
      text-decoration: none;
    }

    #nav a:hover,
    #nav a[aria-current="page"] {
      color: var(--black);
    }

    #nav li:nth-child(1) a:hover,
    #nav li:nth-child(1) a[aria-current="page"] {
      background: red;
    }

    #nav li:nth-child(2) a:hover,
    #nav li:nth-child(2) a[aria-current="page"] {
      background: orange;
    }

    #nav li:nth-child(3) a:hover,
    #nav li:nth-child(3) a[aria-current="page"] {
      background: yellow;
    }

    #nav li:nth-child(4) a:hover,
    #nav li:nth-child(4) a[aria-current="page"] {
      background: #00cc00;
    }

    #nav li:nth-child(5) a:hover,
    #nav li:nth-child(5) a[aria-current="page"] {
      background: #00bfff;
    }

    #content {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 225px;
      gap: 24px;
      padding: 23px;
    }

    main {
      min-width: 0;
    }

    .welcome {
      padding: 0 0 17px;
      margin-bottom: 21px;
      border-bottom: 4px solid var(--black);
      position: relative;
    }

    .welcome::after {
      content: "";
      position: absolute;
      bottom: -4px;
      left: 0;
      width: 100%;
      height: 4px;
      background: linear-gradient(
        90deg,
        var(--red) 0%, var(--red) 16.6667%,
        var(--orange) 16.6667%, var(--orange) 33.3333%,
        var(--yellow) 33.3333%, var(--yellow) 50%,
        var(--green) 50%, var(--green) 66.6667%,
        var(--blue) 66.6667%, var(--blue) 83.3333%,
        var(--purple) 83.3333%, var(--purple) 100%
      );
      pointer-events: none;
    }

    .welcome h2 {
      margin: 0 0 7px;
      font-size: 22px;
      line-height: 1.35;
      letter-spacing: -0.5px;
    }

    .welcome p {
      margin: 6px 0;
    }

    .welcome .small {
      color: var(--muted);
      font-size: 11px;
    }

    .notice {
      padding: 11px 13px;
      margin: 0 0 24px;
      background: #ffffb3;
      border: 2px solid #d4c900;
      line-height: 1.65;
    }

    .notice strong {
      color: var(--red);
    }

    .notice-warning {
      padding: 11px 13px;
      margin: 0 0 24px;
      background: #ffb3b3;
      border: 2px solid #d40000;
      line-height: 1.65;
    }

    .notice-warning strong {
      color: var(--black);
    }

    .section-title {
      display: flex;
      align-items: baseline;
      gap: 9px;
      padding: 8px 11px;
      margin: 0;
      background: var(--black);
      border-left: 7px solid var(--red);
      color: var(--white);
      font-size: 17px;
      line-height: 1.4;
    }

    .section-title span {
      color: var(--yellow);
      font-size: 11px;
      font-weight: bold;
    }

    .post-tools {
      display: flex;
      gap: 5px;
      padding: 9px;
      background: #eeeeee;
      border: 1px solid #bbbbbb;
      border-top: 0;
    }

    .post-tools input {
      flex: 1;
      min-width: 0;
      padding: 6px 8px;
      border: 1px solid #888888;
      border-radius: 0;
      background: var(--white);
      color: var(--black);
    }

    .post-tools button {
      padding: 5px 11px;
      border: 1px solid var(--black);
      border-radius: 0;
      background: var(--yellow);
      color: var(--black);
      font-weight: bold;
      cursor: pointer;
    }

    .post-tools button:hover {
      background: var(--red);
      color: var(--white);
    }

    #post-count {
      padding: 7px 9px;
      margin: 0;
      color: var(--muted);
      font-size: 10px;
    }

    #posts {
      margin: 0;
      padding: 0;
      border: 1px solid #bbbbbb;
      list-style: none;
    }

    .post {
      padding: 12px 10px 12px 14px;
      border-bottom: 1px dotted #999999;
      border-left: 4px solid transparent;
    }

    .post:last-child {
      border-bottom: 0;
    }

    .post:nth-child(6n + 1) {
      border-left-color: var(--red);
      background: #fff0f0;
    }

    .post:nth-child(6n + 2) {
      border-left-color: var(--orange);
      background: #fff3e8;
    }

    .post:nth-child(6n + 3) {
      border-left-color: #d6d600;
      background: #fffde5;
    }

    .post:nth-child(6n + 4) {
      border-left-color: var(--green);
      background: #edffed;
    }

    .post:nth-child(6n + 5) {
      border-left-color: var(--blue);
      background: #eef3ff;
    }

    .post:nth-child(6n) {
      border-left-color: var(--purple);
      background: #f7edff;
    }

    .post h3 {
      margin: 0 0 3px;
      font-size: 14px;
      line-height: 1.5;
    }

    .post h3 a {
      color: var(--blue);
      text-decoration: none;
    }

    .post h3 a:hover {
      color: var(--red);
      text-decoration: underline;
    }

    .post p {
      margin: 0;
      color: #555555;
      font-size: 12px;
      line-height: 1.6;
    }

    .post-label {
      display: inline-block;
      margin-right: 6px;
      padding: 1px 4px;
      background: var(--yellow);
      color: var(--black);
      font-size: 9px;
      font-weight: bold;
      vertical-align: 1px;
    }

    .post.archived {
      background: #eeeeee;
      border-left-color: #999999;
    }

    .post.archived:nth-child(6n + 1) { border-left-color: #a6a6a6; }
    .post.archived:nth-child(6n + 2) { border-left-color: #929292; }
    .post.archived:nth-child(6n + 3) { border-left-color: #b5b5b5; }
    .post.archived:nth-child(6n + 4) { border-left-color: #858585; }
    .post.archived:nth-child(6n + 5) { border-left-color: #a0a0a0; }
    .post.archived:nth-child(6n) { border-left-color: #777777; }

    .post.archived h3 a {
      color: #666666;
    }

    .post.archived .post-label {
      background: #555555;
      color: var(--white);
    }

    .empty-message {
      padding: 12px;
      margin: 0;
      background: #f5f5f5;
      border: 1px solid #bbbbbb;
      border-top: 0;
    }

    #sidebar {
      min-width: 0;
    }

    .side-box {
      margin-bottom: 19px;
      border: 1px solid #999999;
      background: var(--white);
    }

    .side-title {
      padding: 7px 9px;
      background: var(--black);
      color: var(--yellow);
      font-size: 12px;
      font-weight: bold;
      letter-spacing: 0.3px;
    }

    .side-content {
      padding: 10px;
      font-size: 12px;
      line-height: 1.65;
    }

    .side-content p {
      margin: 0 0 9px;
    }

    .side-content p:last-child {
      margin-bottom: 0;
    }

    .side-content ul {
      margin: 0;
      padding-left: 17px;
    }

    .side-content li {
      margin: 4px 0;
    }

    .profile {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      margin: 3px 0 13px;
    }

    .profile img {
      display: block;
      width: 76px;
      height: 76px;
      flex-shrink: 0;
      object-fit: cover;
      border: 3px solid var(--black);
      box-shadow: 0 0 0 3px var(--yellow);
    }

    .profile-name {
      margin: 0 0 3px;
      font-size: 14px;
      font-weight: bold;
    }

    .profile-caption {
      color: var(--muted);
      font-size: 10px;
      line-height: 1.5;
    }

    .status {
      padding: 8px;
      background: #ffffb3;
      border: 2px solid #d4c900;
    }

    .status-label {
      display: block;
      margin-bottom: 3px;
      color: #555555;
      font-size: 10px;
      font-weight: bold;
      text-transform: uppercase;
    }

    .music-cover {
      display: block;
      width: 100%;
      max-width: 190px;
      aspect-ratio: 1;
      margin: 0 auto 10px;
      object-fit: cover;
      border: 3px solid var(--black);
      box-shadow: 4px 4px 0 var(--purple);
      background: #dddddd;
    }

    .music-track {
      margin: 0 0 1px;
      font-size: 14px;
      font-weight: bold;
      line-height: 1.4;
    }

    .music-artist {
      margin: 0 0 10px;
      color: var(--muted);
      font-size: 11px;
    }

    .music-controls {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 8px 0;
    }

    .music-button {
      min-width: 0;
      flex: 1 1 auto;
      padding: 6px 8px;
      border: 2px solid var(--black);
      border-radius: 0;
      background: var(--yellow);
      color: var(--black);
      font-weight: bold;
      cursor: pointer;
    }

    .music-button:hover {
      background: var(--red);
      color: var(--white);
    }

    .music-skip {
      font-size: 11px;
      white-space: nowrap;
    }

    .music-button:disabled {
      cursor: not-allowed;
      opacity: 0.5;
    }

    .music-state {
      color: #555555;
      font-size: 10px;
    }

    .music-progress {
      display: block;
      width: 100%;
      height: 12px;
      margin: 10px 0 4px;
      accent-color: var(--purple);
      cursor: pointer;
    }

    .music-time {
      display: flex;
      justify-content: space-between;
      color: var(--muted);
      font-size: 10px;
      font-variant-numeric: tabular-nums;
    }

    .music-volume {
      display: flex;
      align-items: center;
      gap: 7px;
      margin-top: 8px;
      font-size: 10px;
    }

    .music-volume input {
      width: 100%;
      min-width: 0;
      accent-color: var(--red);
      cursor: pointer;
    }

    .music-note {
      margin-top: 10px;
      padding-top: 8px;
      border-top: 1px dotted #999999;
      color: var(--muted);
      font-size: 10px;
    }

    #footer {
      padding: 16px 12px;
      background: var(--black);
      border-top: 0;
      color: #bbbbbb;
      text-align: center;
      font-size: 11px;
      line-height: 1.9;
    }

    .footer-colors {
      display: flex;
      height: 6px;
      margin: -16px -12px 13px;
    }

    .footer-colors span {
      flex: 1;
    }

    .footer-colors span:nth-child(1) {
      background: var(--red);
    }

    .footer-colors span:nth-child(2) {
      background: var(--orange);
    }

    .footer-colors span:nth-child(3) {
      background: var(--yellow);
    }

    .footer-colors span:nth-child(4) {
      background: var(--green);
    }

    .footer-colors span:nth-child(5) {
      background: var(--blue);
    }

    .footer-colors span:nth-child(6) {
      background: var(--purple);
    }

    #footer p {
      margin: 0;
    }

    #footer a {
      color: var(--yellow);
    }

    #footer a:hover {
      color: var(--white);
    }

    @media (max-width: 700px) {
      body {
        padding: 5px;
      }

      #header-overlay {
        padding: 35px 15px 13px;
      }

      #header .tagline {
        max-width: 420px;
      }

      #nav li {
        flex: 1 0 33.333%;
      }

      #nav a {
        padding: 10px 7px;
        font-size: 10px;
      }

      #content {
        grid-template-columns: minmax(0, 1fr);
        gap: 25px;
        padding: 15px;
      }

      #sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        align-items: start;
      }

      .side-box {
        margin: 0;
      }

      .music-cover {
        max-width: 150px;
      }
    }

    @media (max-width: 440px) {
      #header-overlay {
        padding: 28px 11px 10px;
      }

      .site-label {
        font-size: 9px;
        letter-spacing: 1px;
      }

      #header h1 {
        font-size: 26px;
      }

      #header .tagline {
        font-size: 10px;
      }

      #content {
        padding: 11px;
      }

      #sidebar {
        grid-template-columns: 1fr;
      }

      .post-tools {
        flex-wrap: wrap;
      }

      .post-tools input {
        width: 100%;
        flex-basis: 100%;
      }

      .music-cover {
        max-width: 190px;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
      }
    }


    /* Article pages inherit the homepage layout and use one reusable code-block system. */
    .article-shell { min-width: 0; }
    .article-heading {
      padding: 0 0 16px;
      margin: 0 0 18px;
      border-bottom: 4px solid var(--black);
      position: relative;
    }
    .article-heading::after {
      content: "";
      position: absolute;
      left: 0;
      bottom: -4px;
      width: 100%;
      height: 4px;
      background: linear-gradient(90deg,
        #ff0000 0%, #ff0000 16.6667%,
        #ff8000 16.6667%, #ff8000 33.3333%,
        #ffff00 33.3333%, #ffff00 50%,
        #00cc00 50%, #00cc00 66.6667%,
        #0033ff 66.6667%, #0033ff 83.3333%,
        #9900ff 83.3333%, #9900ff 100%);
    }
    .article-heading h2 {
      margin: 0 0 8px;
      color: var(--black);
      font-size: clamp(22px, 3.4vw, 30px);
      line-height: 1.25;
      font-weight: 900;
      letter-spacing: -0.7px;
    }
    .article-meta { color: #666; font-size: 11px; font-weight: bold; }
    .article-meta .dot { padding: 0 7px; }
    .post-content { line-height: 1.8; overflow-wrap: anywhere; }
    .post-content p { margin: 0 0 17px; }
    .post-content h3 {
      margin: 28px 0 12px;
      padding-bottom: 7px;
      border-bottom: 2px solid #d5d5d5;
      color: var(--black);
      font-size: 20px;
      line-height: 1.35;
      font-weight: 900;
    }
    .post-content a { overflow-wrap: anywhere; }
    .back-to-blog {
      display: inline-block;
      margin: 0 0 16px;
      padding: 6px 10px;
      border: 1px solid #888;
      background: #f5f5f5;
      color: #111;
      font-size: 11px;
      font-weight: bold;
      text-decoration: none;
    }
    .back-to-blog:hover { background: #fff066; color: #111; }
    pre {
      max-width: 100%;
      margin: 20px 0;
      overflow: auto;
      padding: 16px;
      border: 1px solid #454545;
      border-left: 4px solid #777;
      background: #1e1e1e;
      color: #d4d4d4;
      font: 12px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
      tab-size: 4;
      white-space: pre;
      border-radius: 0;
    }
    pre code {
      display: block;
      padding: 0;
      border: 0;
      background: transparent;
      color: inherit;
      font: inherit;
      white-space: pre;
    }
    code:not(pre code) {
      padding: 1px 4px;
      border: 1px solid #d2d2d2;
      background: #f1f1f1;
      color: #222;
      font: 0.92em "SFMono-Regular", Consolas, "Liberation Mono", monospace;
      overflow-wrap: anywhere;
    }
    /* Highlight.js themes apply tokens automatically. New blocks only need
       <pre><code class="language-cpp">...</code></pre> or language-objectivec. */
    .hljs { background: transparent !important; color: #d4d4d4; }
    .hljs-comment, .hljs-quote { color: #7ca982; font-style: italic; }
    .hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-type { color: #c586c0; }
    .hljs-string, .hljs-doctag, .hljs-regexp { color: #ce9178; }
    .hljs-number, .hljs-symbol, .hljs-bullet { color: #b5cea8; }
    .hljs-title, .hljs-title.function_, .hljs-section { color: #dcdcaa; }
    .hljs-built_in, .hljs-variable.language_ { color: #4ec9b0; }
    .hljs-attr, .hljs-attribute { color: #9cdcfe; }
    .hljs-meta, .hljs-meta .hljs-keyword { color: #569cd6; }
    .hljs-operator, .hljs-punctuation { color: #d4d4d4; }
    .diff-added { color: #8fd694; background: rgba(46,160,67,.12); }
    .diff-removed { color: #ff9993; background: rgba(248,81,73,.12); }
    @media (max-width: 760px) {
      #content { grid-template-columns: minmax(0, 1fr); }
      #sidebar { grid-template-columns: 1fr; }
      .article-heading h2 { font-size: 24px; }
      pre { padding: 12px; font-size: 11px; }
    }






/* pong player */

#chip8-player .chip8-screen-wrap {
  width: 100%;
  margin: 0 auto 12px;
  padding: 10px;
  box-sizing: border-box;
  background: #080b08;
  border: 1px solid #394839;
  border-radius: 4px;
}

#chip8-player .chip8-screen {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  background: #050805;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: none;
  touch-action: manipulation;
}

#chip8-player .chip8-screen:focus-visible {
  outline: 2px solid #8cce8c;
  outline-offset: 3px;
}

#chip8-player .chip8-game-title {
  margin: 8px 0 4px;
  text-align: center;
  font-weight: bold;
  letter-spacing: 0.18em;
}

#chip8-player .chip8-description,
#chip8-player .chip8-note {
  text-align: center;
  font-size: 0.85em;
  opacity: 0.8;
}

#chip8-player .chip8-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
}

    #chip8-player .chip8-button {
      min-width: 0;
      flex: 1 1 auto;
      padding: 6px 8px;
      border: 2px solid var(--black);
      border-radius: 0;
      background: var(--yellow);
      color: var(--black);
      font-weight: bold;
      cursor: pointer;
    }

    #chip8-player .chip8-butto:hover {
      background: var(--red);
      color: var(--white);
    }

#chip8-player .chip8-button:disabled {
  cursor: wait;
  opacity: 0.5;
}

#chip8-player .chip8-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

#chip8-player .chip8-state {
  min-height: 1.4em;
  text-align: center;
  font-size: 0.8em;
  opacity: 0.8;
}

#chip8-player .chip8-help {
  font-size: 0.78em;
  line-height: 1.8;
  text-align: center;
  overflow-wrap: anywhere;
}

#chip8-player .chip8-help kbd {
  display: inline-block;
  min-width: 1.3em;
  margin: 1px;
  padding: 0 3px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font: inherit;
  text-align: center;
}

#chip8-player .chip8-note {
  margin: 12px 0 0;
  font-size: 0.75em;
  font-style: italic;
}
