/* ==========================================================
   PAGAN.DEV — SIMPLE RETRO MONSTER-RPG PROFILE
   Pure HTML / CSS / JS
   ========================================================== */

:root {
  --bg: #e9e5c9;
  --paper: #f7f1d4;
  --paper2: #eee6b9;
  --ink: #182c25;
  --green: #316a46;
  --green2: #72a359;
  --lime: #a7ca67;
  --red: #cc5447;
  --blue: #527dab;
  --purple: #7466a2;
  --yellow: #dfc95f;
  --muted: #68766c;
  --shadow: #b7ac84;
  --line: #294438;
  --white: #fff9de;
  --max: 1120px;
  --pixel: 4px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(24,44,37,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24,44,37,.025) 1px, transparent 1px),
    var(--bg);
  background-size: 24px 24px;
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
}

::selection {
  color: var(--ink);
  background: var(--yellow);
}

a { color: inherit; }
img { display: block; max-width: 100%; }

.crt {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .09;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    #000 4px
  );
}

/* NAVIGATION */
.nav-shell {
  position: sticky;
  top: 0;
  z-index: 100;
  width: min(calc(100% - 28px), var(--max));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: var(--pixel) solid var(--line);
  background: rgba(233,229,201,.94);
  backdrop-filter: blur(10px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-p {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--green);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
  font-size: 18px;
}

.logo-text {
  font-size: 15px;
  letter-spacing: .04em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  transition: color .1s linear;
}

.nav a span {
  margin-right: 4px;
  color: var(--shadow);
}

.nav a:hover,
.nav a.active {
  color: var(--red);
}

.nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 4px;
  background: var(--red);
}

.mobile-nav { display: none; }

/* HERO */
.hero {
  width: min(calc(100% - 28px), var(--max));
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: 58px 0 72px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: clamp(36px, 6vw, 72px);
}

.eyebrow {
  width: max-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  padding: 6px 9px;
  border: 3px solid var(--ink);
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--shadow);
  font-size: 10px;
}

.eyebrow i {
  width: 8px;
  height: 8px;
  background: var(--green);
  animation: statusBlink 1.5s steps(1) infinite;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 18px;
  font-size: clamp(54px, 8vw, 96px);
  line-height: .82;
  letter-spacing: -.08em;
  text-shadow: 5px 5px 0 var(--shadow);
}

h1 span {
  display: block;
  color: var(--green);
}

.hero-text {
  max-width: 610px;
  margin-bottom: 27px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.7;
}

.hero-text strong {
  color: var(--ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

.pixel-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 9px 16px;
  border: 3px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--shadow);
  text-decoration: none;
  font-size: 11px;
  transition: transform .08s linear, box-shadow .08s linear;
}

.pixel-btn.primary {
  color: var(--white);
  background: var(--green);
}

.pixel-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--shadow);
}

.pixel-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--shadow);
}

.game-dialog {
  max-width: 590px;
  min-height: 50px;
  margin-top: 27px;
  padding: 12px 14px;
  border: 4px solid var(--ink);
  color: var(--white);
  background: var(--ink);
  box-shadow: 5px 5px 0 var(--shadow);
  font-size: 11px;
}

.dialog-cursor {
  margin-right: 8px;
  color: var(--lime);
}

.blink {
  margin-left: 4px;
  color: var(--lime);
  animation: textBlink .8s steps(1) infinite;
}

/* PROFILE GAME WINDOW */
.hero-game {
  position: relative;
}

.game-window {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--shadow);
}

.game-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-bottom: 4px solid var(--ink);
  color: var(--white);
  background: var(--green);
  font-size: 10px;
}

.game-top span:last-child {
  color: #d9f2a7;
}

.game-screen {
  position: relative;
  height: 315px;
  overflow: hidden;
  background: #cfe0a1;
}

.pixel-sky {
  position: absolute;
  inset: 0 0 74px;
  overflow: hidden;
  background:
    linear-gradient(#bfdbac 0%, #dce7ad 100%);
}

.star {
  position: absolute;
  color: var(--yellow);
  font-size: 18px;
  animation: starBlink 1.6s steps(1) infinite;
}
.star-1 { left: 12%; top: 16%; }
.star-2 { right: 14%; top: 25%; animation-delay: -.7s; }
.star-3 { right: 33%; top: 11%; color: var(--white); animation-delay: -.3s; }

.cloud {
  position: absolute;
  width: 48px;
  height: 12px;
  background: rgba(255,249,222,.8);
  box-shadow:
    12px 0 0 rgba(255,249,222,.8),
    24px 0 0 rgba(255,249,222,.8),
    8px -8px 0 rgba(255,249,222,.8);
}
.cloud-1 {
  top: 66px;
  left: -90px;
  animation: cloudMove 13s linear infinite;
}
.cloud-2 {
  top: 120px;
  left: -140px;
  transform: scale(.75);
  animation: cloudMove 17s linear infinite -7s;
}

.profile-sprite {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 43px;
  width: min(58%, 225px);
  transform: translateX(-50%);
  animation: spriteBob 1.8s steps(2) infinite;
}

.sprite-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 4px solid var(--ink);
  background: var(--paper2);
  box-shadow: 5px 5px 0 rgba(24,44,37,.35);
}

.sprite-frame::before,
.sprite-frame::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.sprite-frame::before {
  left: 7px;
  top: 7px;
  border-top: 4px solid var(--yellow);
  border-left: 4px solid var(--yellow);
}

.sprite-frame::after {
  right: 7px;
  bottom: 7px;
  border-right: 4px solid var(--yellow);
  border-bottom: 4px solid var(--yellow);
}

.sprite-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.8) contrast(1.04);
}

.sprite-shadow {
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: -15px;
  width: 80%;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(24,44,37,.25);
}

.pixel-field {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 78px;
  border-top: 4px solid var(--ink);
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 28px,
      rgba(24,44,37,.06) 28px 32px
    ),
    #7fab59;
}

.grass {
  position: absolute;
  bottom: 10px;
  color: var(--green);
  font-size: 25px;
  line-height: 1;
  animation: grassMove 1.8s steps(2) infinite;
}
.grass-1 { left: 5%; }
.grass-2 { left: 22%; animation-delay: -.6s; }
.grass-3 { left: 72%; animation-delay: -.3s; }
.grass-4 { left: 86%; animation-delay: -.9s; }
.grass-5 { left: 54%; bottom: 3px; animation-delay: -.4s; }

.player-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 14px;
  gap: 8px 20px;
  font-size: 10px;
}

.player-stats > div {
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 2px dotted var(--shadow);
}

.player-stats span { color: var(--muted); }
.player-stats strong { color: var(--ink); }
.player-stats strong.online { color: var(--green); }

.player-stats .xp {
  display: grid;
  grid-template-columns: auto 1fr;
}

.xp i {
  height: 8px;
  display: block;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--paper2);
}

.xp i b {
  display: block;
  width: 88%;
  height: 100%;
  background: var(--green2);
  animation: xpPulse 2.3s steps(5) infinite;
}

.float-pixel {
  position: absolute;
  width: 10px;
  height: 10px;
  z-index: 1;
  background: var(--red);
  box-shadow:
    14px 0 0 var(--yellow),
    0 14px 0 var(--green);
  animation: floatPixel 2.7s steps(3) infinite;
}

.fp-1 { top: -24px; right: -12px; }
.fp-2 { left: -22px; bottom: 90px; animation-delay: -.8s; }
.fp-3 { right: 35px; bottom: -26px; animation-delay: -1.5s; }

/* SECTIONS */
.section {
  width: min(calc(100% - 28px), var(--max));
  margin: 0 auto;
  padding: 96px 0 18px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.section-head > div > p {
  margin: 8px 0 4px;
  color: var(--green);
  font-size: 10px;
}

.section-number {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 3px solid var(--ink);
  background: var(--yellow);
  font-size: 10px;
}

.section-number.light {
  border-color: var(--white);
  color: var(--ink);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(34px, 6vw, 58px);
  line-height: .9;
  letter-spacing: -.06em;
}

.section-description {
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}

/* SKILLS */
.skill-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.skill {
  min-height: 118px;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 17px;
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform .08s linear;
}

.skill:hover { transform: translateY(-3px); }

.skill-symbol {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  color: var(--white);
  background: var(--green);
  box-shadow: 3px 3px 0 var(--shadow);
}

.skill.blue .skill-symbol { background: var(--blue); }
.skill.purple .skill-symbol { background: var(--purple); }
.skill.red .skill-symbol { background: var(--red); }

.skill h3 {
  margin-bottom: 6px;
  font-size: 14px;
}

.skill p {
  margin: 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.skill-level {
  color: var(--green);
  font-size: 9px;
}

/* WORK */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.work-card {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  padding: 19px;
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--shadow);
  transition: transform .08s linear;
}

.work-card:hover {
  transform: translateY(-4px);
}

.work-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 38px;
  font-size: 9px;
}

.work-top > span { color: var(--red); }

.work-top i {
  padding: 2px 5px;
  border: 2px solid var(--ink);
  color: var(--green);
  background: #dfe8b7;
  font-style: normal;
}

.work-icon {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border: 3px solid var(--ink);
  color: var(--white);
  background: var(--green);
  box-shadow: 3px 3px 0 var(--shadow);
}

.work-card:nth-child(2) .work-icon { background: var(--blue); }
.work-card:nth-child(3) .work-icon { background: var(--purple); }

.work-card h3 {
  margin-bottom: 11px;
  font-size: 15px;
}

.work-card p {
  margin-bottom: 20px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tags span {
  padding: 4px 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper2);
  font-size: 8px;
}

/* CONTACT */
.contact-section {
  padding-bottom: 96px;
}

.contact-card {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 40px;
  padding: clamp(28px, 5vw, 54px);
  border: 4px solid var(--ink);
  color: var(--white);
  background: var(--green);
  box-shadow: 8px 8px 0 var(--shadow);
}

.contact-copy > p {
  margin: 16px 0 8px;
  color: #d8e7ad;
  font-size: 10px;
}

.contact-copy h2 {
  margin-bottom: 25px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: .82;
  letter-spacing: -.07em;
}

.contact-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
}

.contact-status i {
  width: 8px;
  height: 8px;
  background: #c7e56f;
  animation: statusBlink 1.4s steps(1) infinite;
}

.contact-links {
  display: grid;
  align-content: center;
}

.contact-links a {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 2px dashed rgba(255,249,222,.38);
  color: var(--white);
  text-decoration: none;
}

.contact-links a:first-child {
  border-top: 2px dashed rgba(255,249,222,.38);
}

.contact-links a:hover {
  color: var(--yellow);
}

.contact-links span { font-size: 9px; opacity: .72; }
.contact-links strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}
.contact-links b { font-size: 18px; }

/* FOOTER */
footer {
  width: min(calc(100% - 28px), var(--max));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: var(--pixel) solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

footer a {
  color: var(--green);
  text-decoration: none;
}

/* ANIMATIONS */
@keyframes textBlink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@keyframes statusBlink {
  0%, 70% { opacity: 1; }
  71%, 100% { opacity: .25; }
}

@keyframes starBlink {
  0%, 48% { opacity: 1; transform: scale(1); }
  49%, 100% { opacity: .15; transform: scale(.75); }
}

@keyframes cloudMove {
  from { transform: translateX(0); }
  to { transform: translateX(600px); }
}

@keyframes spriteBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes grassMove {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes xpPulse {
  0%, 100% { opacity: .75; }
  50% { opacity: 1; }
}

@keyframes floatPixel {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* TABLET */
@media (max-width: 900px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-content {
    max-width: 760px;
  }

  .hero-game {
    width: min(100%, 580px);
    margin: 0 auto;
  }

  .skill-list {
    grid-template-columns: 1fr;
  }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .work-card {
    min-height: 260px;
  }

  .contact-card {
    grid-template-columns: 1fr;
  }
}

/* MOBILE */
@media (max-width: 640px) {
  html { scroll-padding-top: 20px; }

  body {
    padding-bottom: 76px;
  }

  .crt { opacity: .065; }

  .nav-shell {
    position: relative;
    min-height: 60px;
  }

  .logo-text { font-size: 13px; }

  .nav { display: none; }

  .mobile-nav {
    position: fixed;
    z-index: 1000;
    left: 8px;
    right: 8px;
    bottom: 8px;
    min-height: 62px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 3px solid var(--ink);
    background: rgba(247,241,212,.96);
    box-shadow: 4px 4px 0 rgba(24,44,37,.25);
    backdrop-filter: blur(8px);
  }

  .mobile-nav a {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    color: var(--muted);
    text-decoration: none;
    font-size: 8px;
  }

  .mobile-nav a + a {
    border-left: 1px solid var(--shadow);
  }

  .mobile-nav b {
    color: var(--ink);
    font-size: 15px;
  }

  .mobile-nav a.active {
    color: var(--red);
    background: var(--paper2);
  }

  .mobile-nav a.active b {
    color: var(--red);
  }

  .hero,
  .section,
  footer,
  .nav-shell {
    width: min(calc(100% - 20px), var(--max));
  }

  .hero {
    padding: 44px 0 58px;
    gap: 42px;
  }

  h1 {
    font-size: clamp(50px, 18vw, 76px);
    text-shadow: 3px 3px 0 var(--shadow);
  }

  .hero-text {
    font-size: 15px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .pixel-btn {
    padding-left: 8px;
    padding-right: 8px;
  }

  .game-screen {
    height: 270px;
  }

  .profile-sprite {
    width: min(60%, 190px);
  }

  .player-stats {
    grid-template-columns: 1fr;
  }

  .section {
    padding-top: 76px;
  }

  .section-head {
    display: block;
  }

  .section-description {
    margin-top: 16px;
  }

  .skill {
    grid-template-columns: 48px 1fr;
  }

  .skill-symbol {
    width: 44px;
    height: 44px;
  }

  .skill-level {
    grid-column: 2;
  }

  .work-card {
    min-height: 290px;
  }

  .contact-card {
    padding: 26px 19px;
  }

  .contact-links a {
    grid-template-columns: 68px 1fr auto;
    gap: 8px;
  }

  .contact-links strong {
    font-size: 10px;
  }

  footer {
    min-height: 105px;
    padding: 18px 0;
    display: grid;
    justify-items: start;
    gap: 7px;
  }

  .float-pixel {
    display: none;
  }
}

@media (max-width: 370px) {
  .hero-actions {
    grid-template-columns: 1fr;
  }

  .game-dialog {
    font-size: 10px;
  }

  .contact-links a {
    grid-template-columns: 1fr auto;
  }

  .contact-links a span {
    grid-column: 1 / -1;
  }
}



/* ==========================================================
   DESKTOP MOTION FIX V2
   Animasi utama sengaja tetap aktif di desktop dan mobile.
   Hanya transform + opacity agar ringan dan GPU-friendly.
   ========================================================== */

@media (min-width: 641px) {
  .game-window {
    animation: windowIdle 4.2s steps(4, end) infinite;
  }

  .logo-p {
    animation: logoPulse 2.4s steps(2, end) infinite;
  }

  .work-card:nth-child(1) .work-icon {
    animation: iconIdle 2.2s steps(2, end) infinite;
  }

  .work-card:nth-child(2) .work-icon {
    animation: iconIdle 2.2s steps(2, end) infinite -.7s;
  }

  .work-card:nth-child(3) .work-icon {
    animation: iconIdle 2.2s steps(2, end) infinite -1.4s;
  }
}

@keyframes windowIdle {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(0, -4px); }
}

@keyframes logoPulse {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-2px, -2px); }
}

@keyframes iconIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}


/* ==========================================================
   V3 — HTML5 CANVAS ANIMATION
   Avatar stays completely static.
   ========================================================== */

.retro-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.profile-sprite {
  z-index: 3;
  animation: none !important;
  transform: translateX(-50%) !important;
}

.sprite-frame,
.sprite-frame img,
.sprite-shadow {
  animation: none !important;
}

.pixel-sky,
.pixel-field,
.star,
.cloud,
.grass {
  display: none !important;
}

/* The complete game card no longer moves up/down either. */
.game-window {
  animation: none !important;
  transform: none !important;
}

/* Keep only small decorative UI animations outside the avatar. */
@media (min-width: 641px) {
  .game-window {
    animation: none !important;
  }
}


/* ==========================================================
   V4 — MORE TERMINAL + MORE RETRO MONSTER BATTLE
   Avatar remains completely static.
   ========================================================== */

/* TERMINAL */
.retro-terminal {
  max-width: 620px;
  margin-top: 27px;
  overflow: hidden;
  border: 4px solid var(--ink);
  background: #0d1c16;
  box-shadow: 5px 5px 0 var(--shadow);
}

.terminal-bar {
  min-height: 34px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 3px solid var(--ink);
  color: var(--ink);
  background: var(--paper2);
  font-size: 9px;
}

.terminal-lights {
  display: flex;
  gap: 5px;
}

.terminal-lights i {
  width: 7px;
  height: 7px;
  display: block;
  background: var(--red);
  border: 1px solid var(--ink);
}

.terminal-lights i:nth-child(2) { background: var(--yellow); }
.terminal-lights i:nth-child(3) { background: var(--lime); }

.terminal-screen {
  height: 168px;
  overflow: hidden;
  padding: 11px 12px;
  color: #d7e9b2;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  line-height: 1.55;
}

.terminal-history {
  min-height: 124px;
}

.terminal-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.terminal-line.command { color: #f3e69e; }
.terminal-line.success { color: #a7ca67; }
.terminal-line.info { color: #92b8d9; }
.terminal-line.dim { color: #789083; }
.terminal-line.alert { color: #e98573; }

.terminal-input {
  display: flex;
  gap: 7px;
  white-space: nowrap;
}

.terminal-prompt {
  color: #a7ca67;
}

.terminal-cursor {
  color: #dfc95f;
  animation: terminalCursor .72s steps(1) infinite;
}

.terminal-progress {
  display: inline-block;
  width: 96px;
  height: 7px;
  margin: 0 5px;
  vertical-align: 0;
  border: 1px solid #a7ca67;
}

.terminal-progress b {
  display: block;
  height: 100%;
  background: #a7ca67;
  animation: terminalLoad 1.8s steps(8) infinite;
}

@keyframes terminalCursor {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@keyframes terminalLoad {
  0% { width: 8%; }
  70%, 100% { width: 92%; }
}

/* BATTLE / MONSTER LAYER */
.game-screen {
  isolation: isolate;
}

.retro-canvas {
  z-index: 1;
}

.battle-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.profile-sprite {
  /* Static avatar remains above environmental canvas but below battle HUD. */
  z-index: 3 !important;
  animation: none !important;
}

.battle-hud {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.monster-status {
  position: absolute;
  left: 12px;
  top: 12px;
  width: min(48%, 172px);
  padding: 7px 8px;
  border: 3px solid var(--ink);
  background: rgba(247,241,212,.95);
  box-shadow: 3px 3px 0 rgba(24,44,37,.28);
  font-size: 8px;
}

.monster-status > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.hp-line {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 4px;
  color: var(--green);
}

.hp-line i {
  height: 7px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: #d7cc9c;
}

.hp-line em {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--green2);
  transition: width .25s steps(4);
}

.battle-message {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  min-height: 31px;
  padding: 8px 10px;
  border: 3px solid var(--ink);
  color: var(--white);
  background: rgba(24,44,37,.94);
  box-shadow: 3px 3px 0 rgba(24,44,37,.24);
  font-size: 8px;
  letter-spacing: .01em;
}

/* Keep portrait clear and calm. Battle sprite activity happens mainly on right/top. */
.sprite-frame,
.sprite-frame img,
.sprite-shadow,
.game-window {
  animation: none !important;
}

@media (max-width: 640px) {
  .terminal-screen {
    height: 150px;
    font-size: 9px;
  }

  .terminal-history {
    min-height: 108px;
  }

  .monster-status {
    width: 45%;
    font-size: 7px;
  }

  .battle-message {
    font-size: 7px;
  }
}


/* ==========================================================
   V5 — BATTLE MONSTER USES PNG SPRITE SHEET
   ========================================================== */

.battle-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.battle-message {
  font-size: 9px;
}

@media (max-width: 640px) {
  .battle-message {
    font-size: 8px;
  }
}


/* ==========================================================
   V6 — LINUX PENGUINMON PNG AS MAIN BATTLE CREATURE
   ========================================================== */

.battle-message {
  font-size: 9px;
  letter-spacing: .02em;
}

.terminal-screen {
  background:
    linear-gradient(rgba(167,202,103,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167,202,103,.025) 1px, transparent 1px),
    #0d1c16;
  background-size: 10px 10px;
}

@media (max-width: 640px) {
  .battle-message {
    font-size: 8px;
  }
}


/* ==========================================================
   V7 — layout fix + avatar interaction
   ========================================================== */

/* Hidden preload image should never appear on page */
#penguinmonImage {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  left: -99999px !important;
  top: -99999px !important;
}

/* Position avatar on the LEFT and make it more proportional */
.profile-sprite {
  left: 24px !important;
  bottom: 46px !important;
  width: min(44%, 175px) !important;
  transform: none !important;
  transform-origin: center bottom !important;
  transition: transform .22s steps(3), filter .18s linear;
}

.sprite-frame {
  box-shadow: 5px 5px 0 rgba(24,44,37,.30);
}

.sprite-frame img {
  object-position: center center;
}

/* Slightly wider message because sprite now sits left */
.battle-message {
  right: 10px;
}

/* Interaction states are subtle, not dizzy-inducing */
.profile-sprite.interact-lock {
  transform: translate(6px, 0) scale(0.985) !important;
  filter: brightness(1.02);
}

.profile-sprite.interact-throw {
  transform: translate(12px, -3px) rotate(-2deg) scale(0.985) !important;
  filter: brightness(1.05);
}

.profile-sprite.interact-shake {
  transform: translate(4px, 0) scale(0.99) !important;
}

.profile-sprite.interact-breakout {
  transform: translate(9px, -2px) scale(1.01) !important;
  filter: brightness(1.05);
}

/* Reposition battle object more to the right so avatar and penguin feel separated */
.monster-status {
  left: 12px;
  top: 12px;
  width: min(44%, 164px);
}

@media (max-width: 900px) {
  .profile-sprite {
    width: min(42%, 168px) !important;
    left: 18px !important;
    bottom: 42px !important;
  }
}

@media (max-width: 640px) {
  .profile-sprite {
    width: min(42%, 150px) !important;
    left: 14px !important;
    bottom: 40px !important;
  }

  .profile-sprite.interact-lock {
    transform: translate(4px, 0) scale(0.99) !important;
  }

  .profile-sprite.interact-throw {
    transform: translate(8px, -2px) rotate(-2deg) scale(0.99) !important;
  }

  .profile-sprite.interact-breakout {
    transform: translate(6px, -1px) scale(1.01) !important;
  }
}


/* ==========================================================
   V8 — penguin resistance / fight-back states
   ========================================================== */
.profile-sprite.interact-aim {
  transform: translate(5px, 0) scale(0.99) !important;
  filter: brightness(1.02);
}

.profile-sprite.interact-hit {
  transform: translate(-5px, 1px) scale(0.982) !important;
  filter: brightness(.97);
}

.profile-sprite.interact-defend {
  transform: translate(4px, 0) scale(0.99) !important;
  filter: brightness(1.04);
}

.profile-sprite.interact-throw {
  transform: translate(12px, -3px) rotate(-2deg) scale(0.985) !important;
  filter: brightness(1.05);
}

.profile-sprite.interact-shake {
  transform: translate(4px, 0) scale(0.99) !important;
}

.profile-sprite.interact-breakout {
  transform: translate(-3px, -2px) scale(1.012) !important;
  filter: brightness(1.08);
}

.profile-sprite.interact-recover {
  transform: translate(2px, 0) scale(1) !important;
  filter: brightness(1.01);
}

@media (max-width: 640px) {
  .profile-sprite.interact-aim { transform: translate(4px, 0) scale(0.992) !important; }
  .profile-sprite.interact-hit { transform: translate(-4px, 1px) scale(0.986) !important; }
  .profile-sprite.interact-defend { transform: translate(3px, 0) scale(0.992) !important; }
  .profile-sprite.interact-throw { transform: translate(8px, -2px) rotate(-2deg) scale(0.99) !important; }
  .profile-sprite.interact-breakout { transform: translate(-2px, -1px) scale(1.01) !important; }
}


/* ==========================================================
   V9 — DRAMATIC BATTLE UI
   Player HP + monster HP + stronger phase feedback.
   ========================================================== */

.player-battle-status,
.monster-status {
  position: absolute;
  top: 10px;
  width: 42%;
  max-width: 160px;
  padding: 7px 8px;
  border: 3px solid var(--ink);
  background: rgba(247,241,212,.96);
  box-shadow: 3px 3px 0 rgba(24,44,37,.28);
  font-size: 8px;
}

.player-battle-status {
  left: 10px;
}

.monster-status {
  left: auto !important;
  right: 10px;
}

.player-battle-status > div:first-child,
.monster-status > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.player-battle-status .hp-line,
.monster-status .hp-line {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 4px;
  color: var(--green);
}

.player-battle-status .hp-line i,
.monster-status .hp-line i {
  height: 7px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: #d7cc9c;
}

.player-battle-status .hp-line em,
.monster-status .hp-line em {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--green2);
  transition: width .22s steps(5), background .15s linear;
}

.battle-turn {
  position: absolute;
  top: 55px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 6px;
  border: 2px solid var(--ink);
  color: var(--white);
  background: rgba(24,44,37,.88);
  font-size: 7px;
  letter-spacing: .08em;
}

.battle-message {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding-right: 34px;
}

.battle-message::after {
  content: "▼";
  position: absolute;
  right: 10px;
  color: var(--yellow);
  animation: terminalCursor .75s steps(1) infinite;
}

/* Avatar only reacts on battle beats. No idle bobbing. */
.profile-sprite.interact-charge {
  transform: translate(4px, 0) scale(.99) !important;
}

.profile-sprite.interact-hit {
  transform: translate(-7px, 2px) rotate(1deg) scale(.975) !important;
  filter: brightness(.93) contrast(1.03);
}

.profile-sprite.interact-defend {
  transform: translate(5px, 0) scale(.992) !important;
  filter: brightness(1.05);
}

.profile-sprite.interact-counter {
  transform: translate(11px, -2px) rotate(-1deg) scale(.99) !important;
  filter: brightness(1.07);
}

.profile-sprite.interact-throw {
  transform: translate(14px, -4px) rotate(-2deg) scale(.982) !important;
  filter: brightness(1.07);
}

.profile-sprite.interact-shake {
  transform: translate(3px, 0) scale(.99) !important;
}

.profile-sprite.interact-breakout {
  transform: translate(-6px, 2px) rotate(1deg) scale(.978) !important;
  filter: brightness(.96);
}

.profile-sprite.interact-recover {
  transform: translate(1px, 0) scale(1) !important;
  filter: none;
}

@media (max-width: 640px) {
  .player-battle-status,
  .monster-status {
    width: 41%;
    padding: 5px 6px;
    font-size: 6px;
  }

  .battle-turn {
    top: 49px;
    font-size: 6px;
  }

  .profile-sprite.interact-hit {
    transform: translate(-4px, 1px) scale(.982) !important;
  }

  .profile-sprite.interact-counter {
    transform: translate(7px, -1px) scale(.99) !important;
  }

  .profile-sprite.interact-throw {
    transform: translate(8px, -2px) rotate(-2deg) scale(.99) !important;
  }

  .profile-sprite.interact-breakout {
    transform: translate(-4px, 1px) scale(.985) !important;
  }
}


/* ==========================================================
   V10 — INTERACTIVE SKILLS / QUEST LOG / CONTACT TERMINAL
   ========================================================== */

/* ---------- SKILLS ---------- */
.skill-console {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 14px;
}

.skill-console .skill-list {
  grid-template-columns: 1fr;
  gap: 9px;
}

.skill-console .skill {
  position: relative;
  width: 100%;
  min-height: 78px;
  grid-template-columns: 16px 46px 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  transition: transform .08s linear, background .08s linear;
}

.skill-console .skill:hover,
.skill-console .skill:focus-visible {
  transform: translateX(4px);
  outline: none;
  background: #fff7d7;
}

.skill-console .skill.selected {
  border-color: var(--green);
  background: var(--paper2);
  transform: translateX(7px);
}

.select-cursor {
  visibility: hidden;
  color: var(--red);
  animation: textBlink .85s steps(1) infinite;
}

.skill.selected .select-cursor {
  visibility: visible;
}

.skill-main {
  display: grid;
  gap: 3px;
}

.skill-main strong {
  font-size: 13px;
}

.skill-main small {
  color: var(--muted);
  font-size: 8px;
}

.skill-detail {
  min-height: 344px;
  overflow: hidden;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--shadow);
}

.skill-detail-top {
  display: flex;
  justify-content: space-between;
  padding: 9px 11px;
  border-bottom: 4px solid var(--ink);
  color: var(--white);
  background: var(--green);
  font-size: 9px;
}

.skill-detail-body {
  min-height: 298px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  position: relative;
}

.skill-detail-body::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 120px;
  height: 120px;
  opacity: .05;
  background:
    linear-gradient(45deg, transparent 43%, var(--ink) 43% 57%, transparent 57%);
  transform: rotate(15deg);
}

.skill-orb {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border: 4px solid var(--ink);
  color: var(--white);
  background: var(--green);
  box-shadow: 4px 4px 0 var(--shadow);
  font-size: 22px;
  transition: transform .16s steps(3), background .15s linear;
}

.skill-detail.pulse .skill-orb {
  transform: scale(1.08) rotate(-2deg);
}

.skill-status {
  margin-bottom: 5px;
  color: var(--red);
  font-size: 8px;
}

.skill-detail h3 {
  margin-bottom: 11px;
  font-size: 20px;
}

.skill-detail-body > p:not(.skill-status) {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
}

.skill-exp {
  display: grid;
  grid-template-columns: 28px 1fr 35px;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  font-size: 8px;
}

.skill-exp i {
  height: 10px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: #d7cc9c;
}

.skill-exp i b {
  display: block;
  height: 100%;
  background: var(--green2);
  transition: width .48s steps(8);
}

.skill-command {
  margin-top: 14px;
  padding: 8px 9px;
  border: 2px solid var(--ink);
  color: #d7e9b2;
  background: #0d1c16;
  font-size: 8px;
}

.skill-command > span { color: var(--lime); }

/* ---------- WORK / QUEST LOG ---------- */
.quest-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 3px solid var(--ink);
  background: var(--paper2);
  box-shadow: 3px 3px 0 var(--shadow);
  font-size: 8px;
}

.quest-toolbar span:last-child {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
}

.quest-toolbar i {
  width: 7px;
  height: 7px;
  background: var(--lime);
  animation: statusBlink 1.3s steps(1) infinite;
}

.quest-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.quest-card {
  min-height: 0;
  cursor: pointer;
  transition: transform .08s linear, border-color .08s linear;
}

.quest-card:hover,
.quest-card:focus-visible {
  transform: translateX(4px);
  border-color: var(--green);
  outline: none;
}

.quest-card.open {
  border-color: var(--green);
  background: #faf3d3;
}

.quest-card .work-top {
  margin-bottom: 12px;
}

.quest-summary {
  display: grid;
  grid-template-columns: 52px 1fr 25px;
  align-items: center;
  gap: 15px;
}

.quest-summary .work-icon {
  margin: 0;
}

.quest-summary h3 {
  margin-bottom: 5px;
}

.quest-summary p {
  margin: 0;
}

.quest-arrow {
  color: var(--red);
  font-size: 12px;
}

.quest-progress {
  display: grid;
  grid-template-columns: 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  font-size: 8px;
}

.quest-progress i {
  height: 8px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: #ddd2a4;
}

.quest-progress b {
  display: block;
  height: 100%;
  background: var(--green2);
  transform-origin: left;
}

.quest-card:not(.open) .quest-progress b {
  animation: questPulse 2.2s steps(4) infinite;
}

.quest-detail {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: 0 dashed var(--shadow);
  transition:
    max-height .28s steps(5),
    opacity .18s linear,
    margin-top .18s linear,
    padding-top .18s linear;
}

.quest-card.open .quest-detail {
  max-height: 180px;
  opacity: 1;
  margin-top: 14px;
  padding-top: 14px;
  border-top-width: 2px;
}

.quest-detail p {
  margin-bottom: 12px;
  font-size: 12px;
}

.quest-detail p strong {
  color: var(--red);
  font-family: "Courier New", Courier, monospace;
  font-size: 9px;
}

.quest-reward {
  display: inline-block;
  margin-top: 12px;
  color: var(--green);
  font-size: 8px;
}

@keyframes questPulse {
  0%, 100% { opacity: .65; }
  50% { opacity: 1; }
}

/* ---------- CONTACT / COMMUNICATION TERMINAL ---------- */
.comm-console {
  align-items: stretch;
}

.connection-monitor {
  margin-top: 24px;
  font-size: 8px;
}

.connection-monitor > span {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}

.connection-monitor > span i {
  width: 8px;
  height: 8px;
  background: var(--lime);
  animation: statusBlink 1.3s steps(1) infinite;
}

.connection-monitor > div {
  display: grid;
  grid-template-columns: 32px 1fr 38px;
  align-items: center;
  gap: 7px;
}

.connection-monitor em {
  height: 8px;
  overflow: hidden;
  border: 2px solid var(--white);
  background: rgba(24,44,37,.28);
}

.connection-monitor em strong {
  width: 92%;
  height: 100%;
  display: block;
  background: var(--lime);
  animation: connectionPulse 2.2s steps(6) infinite;
}

.connection-monitor small {
  color: var(--yellow);
  font-size: 7px;
}

@keyframes connectionPulse {
  0%, 100% { width: 88%; }
  50% { width: 100%; }
}

.contact-terminal-panel {
  overflow: hidden;
  border: 4px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 5px 5px 0 rgba(24,44,37,.28);
}

.contact-terminal-head {
  display: flex;
  justify-content: space-between;
  padding: 9px 11px;
  border-bottom: 4px solid var(--ink);
  color: var(--white);
  background: #18352a;
  font-size: 8px;
}

.interactive-contact {
  display: grid;
}

.contact-links .contact-option {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 15px 76px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 12px 13px;
  border: 0;
  border-bottom: 2px dashed var(--shadow);
  color: var(--ink);
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.contact-links .contact-option:first-child {
  border-top: 0;
}

.contact-links .contact-option:hover,
.contact-links .contact-option:focus-visible,
.contact-links .contact-option.selected {
  color: var(--ink);
  background: var(--paper2);
  outline: none;
}

.contact-selector {
  visibility: hidden;
  color: var(--red);
  animation: textBlink .85s steps(1) infinite;
}

.contact-option.selected .contact-selector,
.contact-option:hover .contact-selector,
.contact-option:focus-visible .contact-selector {
  visibility: visible;
}

.contact-option > span:nth-child(2) {
  color: var(--muted);
  font-size: 8px;
}

.contact-option strong {
  overflow-wrap: anywhere;
  font-size: 10px;
}

.contact-option b {
  color: var(--green);
  font-size: 8px;
}

.contact-console-status {
  min-height: 43px;
  padding: 11px 12px;
  color: #d7e9b2;
  background:
    linear-gradient(rgba(167,202,103,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167,202,103,.025) 1px, transparent 1px),
    #0d1c16;
  background-size: 10px 10px;
  font-size: 8px;
}

.contact-console-status > span {
  margin-right: 6px;
  color: var(--lime);
}

.contact-console-status strong {
  font-weight: 700;
}

@media (max-width: 900px) {
  .skill-console {
    grid-template-columns: 1fr;
  }

  .skill-detail {
    min-height: 270px;
  }

  .skill-detail-body {
    min-height: 225px;
  }
}

@media (max-width: 640px) {
  .skill-console .skill {
    grid-template-columns: 13px 42px 1fr auto;
    padding: 10px;
  }

  .skill-main strong {
    font-size: 11px;
  }

  .quest-summary {
    grid-template-columns: 45px 1fr 18px;
    gap: 10px;
  }

  .quest-card.open .quest-detail {
    max-height: 230px;
  }

  .quest-toolbar {
    font-size: 7px;
  }

  .contact-links .contact-option {
    grid-template-columns: 12px 62px 1fr;
    gap: 7px;
    min-height: 63px;
  }

  .contact-option b {
    grid-column: 3;
  }

  .contact-option strong {
    font-size: 9px;
  }
}


/* ==========================================================
   V11 — ACTUAL MINI-GAME WORLDS
   Skills, Work and Contact are rendered as navigable game maps.
   ========================================================== */

.game-section {
  position: relative;
}

.world-console {
  width: 100%;
}

.world-window {
  overflow: hidden;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--shadow);
}

.world-titlebar {
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border-bottom: 4px solid var(--ink);
  color: var(--white);
  background: var(--green);
  font-size: 9px;
}

.quest-titlebar { background: var(--blue); }
.contact-titlebar { background: var(--purple); }

.world-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  min-height: 270px;
  max-height: 440px;
  overflow: hidden;
  border-bottom: 4px solid var(--ink);
  background: #b9d7aa;
}

.contact-world-screen {
  aspect-ratio: 640 / 300;
}

.world-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
}

.world-hud,
.quest-count,
.comm-online {
  position: absolute;
  z-index: 3;
  padding: 5px 7px;
  border: 2px solid var(--ink);
  background: rgba(247,241,212,.91);
  box-shadow: 2px 2px 0 rgba(24,44,37,.18);
  font-size: 7px;
  pointer-events: none;
}

.world-hud {
  display: grid;
  gap: 1px;
}

.world-hud span { color: var(--muted); }
.world-hud strong { color: var(--ink); }

.world-hud.top-left {
  left: 9px;
  top: 9px;
}

.world-hud.top-right {
  right: 9px;
  top: 9px;
}

.quest-count {
  left: 9px;
  top: 9px;
  display: flex;
  gap: 9px;
}

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

.comm-online {
  right: 9px;
  top: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
}

.comm-online i {
  width: 7px;
  height: 7px;
  background: var(--lime);
  animation: statusBlink 1.2s steps(1) infinite;
}

.game-dialogue {
  position: relative;
  min-height: 116px;
  display: grid;
  grid-template-columns: 56px 1fr 18px;
  align-items: start;
  gap: 15px;
  padding: 16px;
  background: var(--paper);
}

.dialog-face {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  color: var(--white);
  background: var(--green);
  box-shadow: 3px 3px 0 var(--shadow);
  font-size: 18px;
}

.quest-dialogue .dialog-face { background: var(--blue); }
.contact-game-dialogue .dialog-face { background: var(--purple); }

.game-dialogue small {
  display: block;
  margin-bottom: 3px;
  color: var(--red);
  font-size: 7px;
}

.game-dialogue strong {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
}

.game-dialogue p {
  margin: 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.dialog-next {
  align-self: end;
  color: var(--red);
  font-size: 10px;
  animation: textBlink .8s steps(1) infinite;
}

.world-exp {
  display: grid;
  grid-template-columns: 25px 1fr 35px;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-size: 7px;
}

.world-exp i {
  height: 8px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: #d7cc9c;
}

.world-exp i b {
  display: block;
  height: 100%;
  background: var(--green2);
  transition: width .5s steps(8);
}

.world-exp em {
  font-style: normal;
}

.world-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.world-tags span {
  padding: 3px 5px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper2);
  font-size: 7px;
}

.action-hint {
  display: inline-block;
  margin-top: 9px;
  padding: 4px 6px;
  border: 2px solid var(--ink);
  color: var(--green);
  background: var(--paper2);
  font-size: 7px;
}

.game-controller {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  padding: 10px 13px;
  border: 3px solid var(--ink);
  background: var(--paper2);
  box-shadow: 4px 4px 0 var(--shadow);
}

.controller-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.controller-buttons button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--shadow);
  font: inherit;
  cursor: pointer;
}

.controller-buttons button:hover,
.controller-buttons button:focus-visible {
  transform: translate(-1px, -1px);
  outline: none;
  box-shadow: 4px 4px 0 var(--shadow);
}

.controller-buttons button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}

.controller-buttons .btn-a {
  width: 48px;
  height: 48px;
  color: var(--white);
  background: var(--red);
}

.controller-help {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 7px;
}

.controller-help strong {
  color: var(--ink);
}

.controller-help.right {
  justify-items: end;
  text-align: right;
}

.game-quick-menu {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 10px;
}

#workQuickMenu,
#contactQuickMenu {
  grid-template-columns: repeat(3, 1fr);
}

.game-quick-menu button {
  min-height: 40px;
  padding: 7px 5px;
  border: 2px solid var(--ink);
  color: var(--muted);
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--shadow);
  font: inherit;
  font-size: 8px;
  cursor: pointer;
}

.game-quick-menu button span {
  display: block;
  margin-bottom: 2px;
  color: var(--shadow2, #968f6f);
  font-size: 6px;
}

.game-quick-menu button:hover,
.game-quick-menu button:focus-visible,
.game-quick-menu button.selected {
  color: var(--ink);
  background: var(--yellow);
  outline: none;
}

.game-quick-menu button.selected::before {
  content: "▶ ";
  color: var(--red);
}

.contact-fallback-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 13px;
}

.contact-fallback-links a {
  color: var(--muted);
  font-size: 7px;
  text-decoration: none;
}

.contact-fallback-links a:hover {
  color: var(--green);
}

/* Section becomes visually "active" when keyboard controls target it. */
.game-section.game-active .world-window {
  box-shadow: 8px 8px 0 var(--shadow), 0 0 0 3px rgba(223,201,95,.22);
}

.game-section.game-active .world-titlebar::before {
  content: "▶";
  margin-right: 7px;
  color: var(--yellow);
  animation: textBlink .8s steps(1) infinite;
}

@media (max-width: 640px) {
  .world-screen {
    min-height: 230px;
    aspect-ratio: 1.5 / 1;
  }

  .contact-world-screen {
    min-height: 220px;
    aspect-ratio: 1.5 / 1;
  }

  .game-dialogue {
    min-height: 130px;
    grid-template-columns: 44px 1fr 12px;
    gap: 10px;
    padding: 13px 11px;
  }

  .dialog-face {
    width: 42px;
    height: 42px;
    font-size: 14px;
  }

  .game-dialogue strong {
    font-size: 11px;
  }

  .game-dialogue p {
    font-size: 11px;
  }

  .game-controller {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 7px;
  }

  .controller-help {
    display: none;
  }

  .controller-buttons button {
    width: 45px;
    height: 45px;
  }

  .controller-buttons .btn-a {
    width: 52px;
    height: 52px;
  }

  .game-quick-menu {
    grid-template-columns: repeat(2, 1fr);
  }

  #workQuickMenu,
  #contactQuickMenu {
    grid-template-columns: repeat(3, 1fr);
  }

  .game-quick-menu button {
    min-height: 44px;
    font-size: 7px;
  }
}


/* ==========================================================
   V12 — ZSH-FIRST INTERACTION
   Skills / Work / Contact now behave as intuitive terminals.
   ========================================================== */

.zsh-shell {
  overflow: hidden;
  border: 4px solid var(--ink);
  background: #0b1612;
  box-shadow: 8px 8px 0 var(--shadow);
}

.zsh-titlebar {
  min-height: 39px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 7px 10px;
  border-bottom: 3px solid var(--ink);
  color: var(--ink);
  background: var(--paper2);
  font-size: 8px;
}

.zsh-titlebar > div {
  display: flex;
  gap: 5px;
}

.zsh-titlebar i {
  width: 8px;
  height: 8px;
  display: block;
  border: 1px solid var(--ink);
  background: var(--red);
}

.zsh-titlebar i:nth-child(2) { background: var(--yellow); }
.zsh-titlebar i:nth-child(3) { background: var(--lime); }

.zsh-titlebar strong {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8px;
}

.zsh-titlebar > span:last-child {
  color: var(--muted);
  white-space: nowrap;
}

.zsh-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 2px solid #263b33;
  background: #102019;
  scrollbar-width: thin;
}

.zsh-tabs button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 8px 11px;
  border: 0;
  border-right: 1px solid #263b33;
  color: #789083;
  background: transparent;
  font-family: "Courier New", Courier, monospace;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.zsh-tabs button:hover,
.zsh-tabs button:focus-visible {
  color: #d7e9b2;
  background: #172b22;
  outline: none;
}

.zsh-tabs button.active {
  color: #f3e69e;
  background: #18352a;
  box-shadow: inset 0 -3px #a7ca67;
}

.zsh-screen {
  min-height: 410px;
  padding: 18px;
  color: #d7e9b2;
  background:
    linear-gradient(rgba(167,202,103,.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167,202,103,.024) 1px, transparent 1px),
    #0b1612;
  background-size: 12px 12px;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  line-height: 1.55;
}

.zsh-neofetch {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 17px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #345044;
}

.ascii-logo {
  color: #a7ca67;
  line-height: 1.05;
}

.ascii-logo span {
  display: block;
  white-space: pre;
}

.zsh-neofetch > div:last-child {
  display: grid;
  align-content: center;
}

.zsh-neofetch b {
  margin-bottom: 4px;
  color: #f3e69e;
}

.zsh-neofetch span {
  color: #789083;
}

.zsh-pathline {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 15px;
  padding-bottom: 11px;
  border-bottom: 1px dashed #345044;
}

.zsh-pathline span { color: #92b8d9; }
.zsh-pathline strong { color: #c3a8d5; }
.zsh-pathline em {
  color: #a7ca67;
  font-style: normal;
}

.zsh-pathline i {
  width: 5px;
  height: 5px;
  background: #dfc95f;
}

.zsh-history {
  min-height: 220px;
  max-height: 260px;
  overflow: hidden;
  padding-bottom: 12px;
}

.zsh-output {
  min-height: 17px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.zsh-output.command { color: #f3e69e; }
.zsh-output.success { color: #a7ca67; }
.zsh-output.info { color: #92b8d9; }
.zsh-output.dim { color: #789083; }
.zsh-output.alert { color: #e98573; }
.zsh-output.directory { color: #8eb4df; }
.zsh-output.heading {
  margin-top: 4px;
  color: #f3e69e;
  font-weight: 700;
}
.zsh-output.stat strong { color: #a7ca67; }
.zsh-output.stat em {
  color: #789083;
  font-style: normal;
}
.zsh-output .badge {
  display: inline-block;
  min-width: 30px;
  margin-right: 7px;
  padding: 0 3px;
  color: #0b1612;
  background: #a7ca67;
  text-align: center;
  font-weight: 700;
}
.zsh-output .badge.blue { background: #92b8d9; }
.zsh-output .badge.purple { background: #c3a8d5; }
.zsh-output .badge.red { background: #e98573; }

.zsh-prompt-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed #345044;
}

.zsh-prompt {
  display: grid;
  white-space: nowrap;
}

.prompt-line {
  color: #789083;
  font-size: 8px;
}

.prompt-line b { color: #a7ca67; }
.prompt-line i {
  color: #92b8d9;
  font-style: normal;
}
.prompt-line strong { color: #c3a8d5; }

.prompt-arrow {
  color: #a7ca67;
  font-weight: 700;
}

.zsh-input-line {
  min-height: 21px;
  color: #f3e69e;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.zsh-cursor {
  margin-left: 2px;
  color: #dfc95f;
  animation: terminalCursor .7s steps(1) infinite;
}

.zsh-command-menu {
  padding: 12px;
  border-top: 3px solid var(--ink);
  color: var(--ink);
  background: var(--paper2);
}

.zsh-menu-label {
  display: block;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 7px;
}

.zsh-command-menu > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.work-command-menu > div,
.contact-command-menu > div {
  grid-template-columns: repeat(3, 1fr);
}

.zsh-command-menu button {
  min-height: 45px;
  padding: 7px 8px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--shadow);
  font: inherit;
  font-size: 8px;
  cursor: pointer;
}

.zsh-command-menu button:hover,
.zsh-command-menu button:focus-visible {
  transform: translate(-1px, -1px);
  color: var(--green);
  background: #fff7d7;
  outline: none;
  box-shadow: 3px 3px 0 var(--shadow);
}

.zsh-command-menu button:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--shadow);
}

.zsh-command-menu kbd {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  margin-right: 5px;
  border: 1px solid var(--ink);
  color: var(--white);
  background: var(--green);
  font: inherit;
  font-size: 7px;
}

.zsh-command-menu small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 7px;
}

.network-status {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #345044;
  font-size: 8px;
}

.network-status > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #a7ca67;
}

.network-status span i {
  width: 6px;
  height: 6px;
  background: #a7ca67;
  animation: statusBlink 1.2s steps(1) infinite;
}

.network-status > b {
  height: 8px;
  overflow: hidden;
  border: 1px solid #789083;
  background: #13251d;
}

.network-status > b em {
  width: 100%;
  height: 100%;
  display: block;
  background: #a7ca67;
  transition: width .45s steps(7);
}

.network-status > strong {
  color: #92b8d9;
  font-size: 7px;
}

.zsh-shell.executing .zsh-titlebar strong::after {
  content: " ●";
  color: #a7ca67;
  animation: textBlink .45s steps(1) infinite;
}

.zsh-shell.executing {
  box-shadow: 8px 8px 0 var(--shadow), 0 0 0 3px rgba(167,202,103,.12);
}

/* Hide old V11 game UI if stale markup ever remains cached/mixed. */
.world-console,
.game-controller,
.game-quick-menu {
  --v12-obsolete: 1;
}

@media (max-width: 760px) {
  .zsh-screen {
    min-height: 390px;
    padding: 14px 11px;
    font-size: 10px;
  }

  .zsh-neofetch {
    grid-template-columns: 84px 1fr;
    gap: 10px;
  }

  .zsh-history {
    min-height: 215px;
  }

  .zsh-prompt-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .zsh-input-line {
    padding-left: 22px;
  }

  .zsh-command-menu > div,
  .work-command-menu > div,
  .contact-command-menu > div {
    grid-template-columns: 1fr 1fr;
  }

  .zsh-titlebar {
    grid-template-columns: auto 1fr;
  }

  .zsh-titlebar > span:last-child {
    display: none;
  }

  .network-status {
    grid-template-columns: 65px 1fr;
  }

  .network-status > strong {
    grid-column: 2;
  }
}

@media (max-width: 430px) {
  .zsh-tabs button {
    min-height: 38px;
    padding: 8px 10px;
  }

  .zsh-screen {
    font-size: 9px;
  }

  .zsh-command-menu > div,
  .work-command-menu > div,
  .contact-command-menu > div {
    grid-template-columns: 1fr;
  }

  .zsh-command-menu button {
    text-align: left;
  }
}
