:root {
    --bg:    #f6c70c;
    --ink:   #2a1c08;     /* dark warm brown for body text */
    --ink-2: #5a4418;
    --paper: #fffaeb;     /* card cream */
    --line:  #1a1208;     /* near-black borders */
    --hi:    #ffe45c;     /* highlight yellow */
  }

  * { box-sizing: border-box; }

  html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "DotGothic16", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
  }

  body {
    min-height: 100vh;
    padding-bottom: clamp(80px, 10vh, 140px);
  }

  a { color: inherit; }

  /* ── Header ────────────────────────────────────── */
  .header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(16px, 2.4vw, 32px) clamp(20px, 3vw, 44px);
    background:
      linear-gradient(180deg, var(--bg) 0%, var(--bg) 70%, rgba(246,199,12,0.0) 100%);
  }

  .site-brand {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.1vw, 18px);
    text-decoration: none;
    filter: drop-shadow(0 4px 0 rgba(0,0,0,0.12));
    transition: transform 0.15s ease;
  }
  .site-brand:hover { transform: translate(-1px, -1px); }

  .site-brand-logo {
    height: clamp(40px, 4.4vw, 62px);
    width: auto;
    display: block;
  }

  .nav {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1vw, 18px);
    font-family: "Press Start 2P", system-ui, sans-serif;
    font-size: clamp(12px, 1.2vw, 19px);
    letter-spacing: 0.06em;
    color: #fff;
  }
  .nav a {
    color: #fff;
    text-decoration: none;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.20);
    padding: 4px 2px;
    transition: transform 0.15s ease, color 0.15s ease;
  }
  .nav a:hover { transform: translate(-1px, -1px); color: #fff8d4; }
  .nav a.active {
    color: #96580b;
    text-shadow: 2px 2px 0 var(--hi);
  }
  .nav .sep { opacity: 0.85; }

  /* ── Page layout ───────────────────────────────── */
  .page {
    max-width: 880px;
    margin: 0 auto;
    padding: clamp(20px, 4vw, 56px) clamp(20px, 4vw, 32px) 0;
  }

  .page-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: clamp(20px, 3vw, 40px);
    margin: clamp(20px, 4vw, 48px) 0 clamp(30px, 5vw, 56px);
  }

  .page-title {
    font-family: "Press Start 2P", system-ui, sans-serif;
    font-size: clamp(46px, 8.5vw, 80px);
    line-height: 0.95;
    color: #fff;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.20);
    letter-spacing: 0.02em;
    margin: 0 0 6px;
  }

  .page-sub {
    font-size: clamp(15px, 1.6vw, 20px);
    color: var(--ink);
    letter-spacing: 0.08em;
    margin: 0;
  }

  .page-doodle {
    width: clamp(110px, 14vw, 180px);
    height: auto;
    transform: rotate(-8deg) translateY(8px);
    filter: drop-shadow(0 8px 0 rgba(0,0,0,0.10));
  }

  /* ── RPG character (WASD / arrow keys to move) ─── */
  .rpg-char {
    position: fixed;
    /* JS sets --x, --y in px; start position assigned on init */
    --x: 0px;
    --y: 0px;
    --cell: 96px;            /* on-screen size (32px source × 3) */
    left: 0;
    top: 0;
    width: var(--cell);
    height: var(--cell);
    z-index: 30;
    pointer-events: none;
    /* sprite sheet: 3 cols × 4 rows of 32×32 cells */
    background-image: url('../img/rpg_chikuwa.png');
    background-repeat: no-repeat;
    background-size: calc(var(--cell) * 3) calc(var(--cell) * 4);
    background-position: 0 0;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    transform: translate(var(--x), var(--y)) translateY(var(--bob, 0px));
    filter: drop-shadow(0 6px 0 rgba(0,0,0,0.18));
    will-change: transform, background-position;
  }

  .rpg-hint {
    position: fixed;
    left: clamp(20px, 3vw, 44px);
    bottom: clamp(26px, 3vw, 44px);
    z-index: 11;
    font-family: "Press Start 2P", system-ui, sans-serif;
    font-size: 9px;
    line-height: 1.7;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.95);
    text-shadow: 2px 2px 0 rgba(0,0,0,0.20);
    pointer-events: none;
    text-align: left;
  }
  .rpg-hint .kbd {
    display: inline-block;
    border: 2px solid rgba(255,255,255,0.92);
    padding: 2px 5px;
    margin: 0 1px;
    border-radius: 3px;
    font-size: 8px;
  }

  /* ── Oden items (fixed overlay, same vibe as top) ── */
  .items {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 25;
  }
  .oden {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: clamp(36px, 3.6vw, 54px);
    line-height: 1;
    user-select: none;
    filter: drop-shadow(0 6px 6px rgba(0,0,0,0.18));
  }
  .oden .inner {
    display: inline-block;
    animation: odenBob 1.6s ease-in-out infinite;
    transform-origin: 50% 80%;
  }
  @keyframes odenBob {
    0%, 100% { transform: translateY(-4px) rotate(-4deg); }
    50%      { transform: translateY( 6px) rotate( 4deg); }
  }
  .oden.pop .inner {
    animation: odenPop 0.45s ease-out forwards;
  }
  @keyframes odenPop {
    0%   { transform: translateY(0)   scale(1)   rotate(0);    opacity: 1; }
    60%  { transform: translateY(-26px) scale(1.5) rotate(12deg); opacity: 1; }
    100% { transform: translateY(-54px) scale(1.7) rotate(20deg); opacity: 0; }
  }

  /* ── Credits (inline, end of page) ────────────────── */
  .credits {
    max-width: 880px;
    margin: clamp(20px, 2.6vw, 32px) auto 0;
    padding: 0 clamp(22px, 3vw, 38px);
    font-size: 12px;
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: rgba(42,28,8,0.70);
    text-align: left;
  }
  .credits a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(42,28,8,0.35);
    text-underline-offset: 2px;
  }
  .credits a:hover { color: var(--line); text-decoration-color: var(--line); }

  /* ── Oden items on the page ───────────────── */
  .oden-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 25;
  }
  .oden {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: clamp(34px, 3.4vw, 50px);
    line-height: 1;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.20));
  }
  .oden .inner {
    display: inline-block;
    animation: odenBob 1.6s ease-in-out infinite;
    transform-origin: 50% 80%;
  }
  @keyframes odenBob {
    0%, 100% { transform: translateY(-3px) rotate(-4deg); }
    50%      { transform: translateY( 5px) rotate( 4deg); }
  }
  .oden.pop .inner { animation: odenPop 0.45s ease-out forwards; }
  @keyframes odenPop {
    0%   { transform: translateY(0)    scale(1)   rotate(0);    opacity: 1; }
    60%  { transform: translateY(-26px) scale(1.5) rotate(14deg); opacity: 1; }
    100% { transform: translateY(-56px) scale(1.8) rotate(22deg); opacity: 0; }
  }

  /* ── Credit footer ─────────────────────────── */
  .credit {
    max-width: 880px;
    margin: clamp(40px, 6vw, 72px) auto 0;
    padding: 0 clamp(20px, 4vw, 32px);
    font-size: 12px;
    line-height: 1.8;
    letter-spacing: 0.02em;
    color: var(--ink-2);
    text-align: center;
  }
  .credit a {
    color: var(--line);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
  }

  /* ── Cards ─────────────────────────────────────── */
  .stack { display: flex; flex-direction: column; gap: clamp(20px, 2.6vw, 32px); }

  .card {
    background: var(--paper);
    border: 3px solid var(--line);
    border-radius: 8px;
    padding: clamp(20px, 2.6vw, 32px) clamp(22px, 3vw, 38px);
    box-shadow: 6px 6px 0 var(--line);
  }

  .card h2 {
    font-family: "Press Start 2P", system-ui, sans-serif;
    font-size: clamp(14px, 1.4vw, 18px);
    margin: 0 0 clamp(14px, 1.6vw, 20px);
    letter-spacing: 0.06em;
    color: var(--line);
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }
  .card h2::before {
    content: "";
    display: inline-block;
    width: 14px; height: 14px;
    background: var(--line);
    transform: rotate(45deg);
  }

  .card p,
  .card li,
  .card dd {
    font-size: clamp(15px, 1.4vw, 19px);
    line-height: 1.9;
    letter-spacing: 0.02em;
  }
  .card p { margin: 0 0 0.5em; text-wrap: pretty; }
  .card p:last-child { margin-bottom: 0; }

  /* Profile card (avatar + handle) */
  .profile {
    display: flex;
    align-items: center;
    gap: clamp(18px, 2.6vw, 32px);
  }
  .profile .avatar {
    width: clamp(96px, 10vw, 136px);
    height: clamp(96px, 10vw, 136px);
    object-fit: contain;
    image-rendering: pixelated;
    border: 3px solid var(--line);
    border-radius: 8px;
    background: var(--hi);
    padding: 6px;
    box-shadow: 4px 4px 0 var(--line);
    flex: 0 0 auto;
  }
  .profile .handle {
    font-family: "Press Start 2P", system-ui, sans-serif;
    font-size: clamp(18px, 2vw, 26px);
    letter-spacing: 0.04em;
    color: var(--line);
    margin-bottom: 6px;
  }
  .profile .tagline {
    font-size: clamp(14px, 1.3vw, 17px);
    line-height: 1.7;
    color: var(--ink-2);
    margin: 0;
  }

  /* Likes list */
  .likes {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 28px;
  }
  .likes li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 2px dotted rgba(26,18,8,0.25);
  }
  .likes .emoji {
    font-size: 1.4em;
    line-height: 1;
    flex: 0 0 auto;
  }
  .likes b {
    font-weight: normal;
    color: var(--line);
    letter-spacing: 0.04em;
  }
  .likes .desc {
    color: var(--ink-2);
    font-size: 0.92em;
  }

  /* Persona dl */
  .persona {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 12px clamp(16px, 2vw, 28px);
    margin: 0;
  }
  .persona dt {
    font-family: "Press Start 2P", system-ui, sans-serif;
    font-size: clamp(10px, 0.95vw, 13px);
    letter-spacing: 0.06em;
    color: var(--line);
    padding-top: 6px;
    white-space: nowrap;
  }
  .persona dd {
    margin: 0;
    color: var(--ink);
  }
  .badge {
    display: inline-block;
    font-family: "Press Start 2P", system-ui, sans-serif;
    font-size: clamp(13px, 1.2vw, 16px);
    background: var(--line);
    color: var(--hi);
    padding: 6px 10px;
    border-radius: 4px;
    letter-spacing: 0.08em;
    margin-right: 6px;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.20);
  }

  /* ── SNS (bottom-right) ────────────────────────── */
  .sns {
    position: fixed;
    bottom: clamp(25px, 3vw, 40px);
    right: clamp(25px, 3vw, 44px);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: clamp(14px, 1.6vw, 26px);
  }
  .sns a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s ease;
  }
  .sns a:hover { transform: translateY(-3px); }
  .sns svg {
    height: clamp(26px, 2.4vw, 38px);
    width: auto;
    fill: #fff;
    display: block;
    filter: drop-shadow(0 2px 0 rgba(0,0,0,0.18));
  }

  @media (max-width: 640px) {
    .page-head { grid-template-columns: 1fr; }
    .page-doodle { justify-self: end; }
    .profile { flex-direction: column; text-align: center; }
    .likes { grid-template-columns: 1fr; }
    .nav { font-size: 11px; gap: 8px; }
  }
