/* ==================================================
   THE INFRA RUN — MINI-GAME STYLES
   Standalone styles for the secret portfolio game.
   ================================================== */

:root {
  --game-bg: #07111f;
  --game-panel: #0a1928;
  --game-panel-raised: #102439;
  --game-border: #294b65;
  --game-text: #eaf3ff;
  --game-muted: #9db1c6;
  --game-green: #66f0ac;
  --game-cyan: #66d9ee;
  --game-gold: #f6c76b;
  --game-orange: #ff956b;
  --game-red: #ff7188;
  --game-purple: #c2a0ff;
  --game-mono: "IBM Plex Mono", monospace;
  --game-sans: Inter, system-ui, sans-serif;
}

/* --------------------------------------------------
   AVATAR GAME TRIGGER
   -------------------------------------------------- */

.avatar-scene {
  position: relative;
}

.avatar-game-trigger {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid transparent;
  border-radius: inherit;
  background: transparent;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.avatar-game-trigger:focus-visible {
  outline: 3px solid var(--game-green);
  outline-offset: -5px;
}

.avatar-play-hint {
  position: absolute;
  left: 50%;
  bottom: 13px;
  transform: translate(-50%, 7px);
  padding: 7px 10px;
  border: 1px solid rgba(102, 240, 172, 0.45);
  border-radius: 5px;
  background: rgba(4, 16, 25, 0.88);
  color: var(--game-green);
  font: 600 9px var(--game-mono);
  letter-spacing: 0.09em;
  white-space: nowrap;
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    border-color 180ms ease;
  pointer-events: none;
}

.avatar-game-trigger:hover .avatar-play-hint,
.avatar-game-trigger:focus-visible .avatar-play-hint {
  opacity: 1;
  transform: translate(-50%, 0);
}

.avatar-game-trigger:hover {
  border-color: rgba(102, 240, 172, 0.28);
}

/* --------------------------------------------------
   GAME DIALOG
   -------------------------------------------------- */

.mini-game-dialog {
  position: fixed;
  inset: 0;
  width: min(1060px, calc(100vw - 32px));
  max-width: 1060px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--game-border);
  border-radius: 13px;
  background: var(--game-bg);
  color: var(--game-text);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.68),
    0 0 0 1px rgba(102, 240, 172, 0.035),
    inset 0 1px rgba(255, 255, 255, 0.035);
  scrollbar-color: #31536c #07111f;
  scrollbar-width: thin;
}

.mini-game-dialog:not([open]) {
  display: none;
}

.mini-game-dialog[open] {
  display: block;
  animation: mini-game-enter 220ms ease-out both;
}

.mini-game-dialog::backdrop {
  background: rgba(1, 5, 12, 0.86);
  backdrop-filter: blur(9px);
}

@keyframes mini-game-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mini-game-dialog,
.mini-game-dialog * {
  box-sizing: border-box;
}

.mini-game-dialog button {
  font-family: var(--game-mono);
}

.mini-game-dialog button:focus-visible {
  outline: 2px solid var(--game-green);
  outline-offset: 3px;
}

.mini-game-shell {
  padding: 20px;
  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgba(27, 73, 102, 0.24),
      transparent 48%
    ),
    linear-gradient(180deg, #091827, #06101b 75%);
}

/* --------------------------------------------------
   GAME HEADER
   -------------------------------------------------- */

.mini-game-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 2px 2px 16px;
}

.mini-game-titleblock {
  min-width: 0;
}

.mini-game-titleblock .eyebrow {
  margin: 0 0 6px;
  color: var(--game-green);
  font: 600 9px var(--game-mono);
  letter-spacing: 0.17em;
}

.mini-game-titleblock h2 {
  margin: 0;
  color: #f0f7ff;
  font: 800 clamp(22px, 3vw, 31px) var(--game-sans);
  line-height: 1.2;
  letter-spacing: -0.045em;
}

.mini-game-subtitle {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--game-muted);
  font: 12px/1.65 var(--game-sans);
}

.mini-game-close {
  position: static;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #36546b;
  border-radius: 7px;
  background: #0b1b2a;
  color: #c8d7e7;
  font: 25px/1 var(--game-sans);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.mini-game-close:hover {
  transform: translateY(-1px);
  border-color: var(--game-red);
  background: #301b29;
  color: #fff;
}

/* --------------------------------------------------
   HUD
   -------------------------------------------------- */

.mini-game-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.mini-game-hud > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid #203c52;
  border-radius: 6px;
  background: linear-gradient(145deg, #0c1e30, #091522);
}

.mini-game-hud > div > span {
  color: #87a0b6;
  font: 600 9px var(--game-mono);
  letter-spacing: 0.07em;
}

.mini-game-hud > div > strong {
  overflow: hidden;
  color: var(--game-green);
  font: 700 12px var(--game-mono);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-game-hud > div:nth-child(2) strong {
  color: var(--game-gold);
}

.mini-game-hud > div:nth-child(3) strong {
  color: var(--game-cyan);
}

.mini-game-hud > div:nth-child(4) strong {
  color: var(--game-red);
  letter-spacing: 0.05em;
}

/* --------------------------------------------------
   CANVAS AND GAME SCREEN
   -------------------------------------------------- */

.mini-game-screen-wrap {
  position: relative;
  isolation: isolate;
  width: 100%;
  overflow: hidden;
  border: 1px solid #315a72;
  border-radius: 8px;
  background: #09172b;
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.28),
    inset 0 0 24px rgba(0, 0, 0, 0.25);
}

#platformerCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  margin: 0;
  padding: 0;
  border: 0;
  background: #09172b;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
}

#platformerCanvas:focus-visible {
  outline: 2px solid var(--game-green);
  outline-offset: -3px;
}

/* --------------------------------------------------
   WIN / LOSE OVERLAY
   -------------------------------------------------- */

.mini-game-overlay {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
  background: rgba(3, 10, 20, 0.78);
  backdrop-filter: blur(5px);
}

.mini-game-overlay[hidden] {
  display: none !important;
}

.mini-game-overlay-card {
  width: min(420px, 100%);
  padding: 25px 22px;
  border: 1px solid #38604f;
  border-radius: 10px;
  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgba(102, 240, 172, 0.1),
      transparent 58%
    ),
    linear-gradient(145deg, #0d2130, #08131f);
  text-align: center;
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.44),
    inset 0 1px rgba(255, 255, 255, 0.04);
  animation: mini-game-card-enter 220ms ease-out both;
}

@keyframes mini-game-card-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mini-game-overlay-card .eyebrow {
  margin: 0 0 9px;
  color: var(--game-green);
  font: 600 9px var(--game-mono);
  letter-spacing: 0.14em;
}

.mini-game-overlay-card h3 {
  margin: 0;
  color: #f1fff7;
  font: 800 clamp(20px, 3vw, 26px) var(--game-sans);
  letter-spacing: -0.04em;
  line-height: 1.25;
}

.mini-game-overlay-card p:not(.eyebrow) {
  margin: 12px 0 18px;
  color: #b4c8d9;
  font: 12px/1.7 var(--game-sans);
}

.mini-game-overlay-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.mini-game-overlay-actions .button {
  min-height: 40px;
  padding: 10px 13px;
  font-size: 10px;
}

/* --------------------------------------------------
   INSTRUCTIONS
   -------------------------------------------------- */

.mini-game-instructions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  margin: 13px 0;
  color: #9eb3c7;
  font: 10px/1.6 var(--game-mono);
}

.mini-game-instructions > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mini-game-instructions > span:last-child {
  color: #82b9ba;
}

.mini-game-dialog kbd {
  display: inline-grid;
  min-width: 23px;
  height: 23px;
  place-items: center;
  padding: 0 5px;
  border: 1px solid #36536a;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #102337;
  color: #e4f1ff;
  font: 600 9px var(--game-mono);
  white-space: nowrap;
}

/* --------------------------------------------------
   GAME FOOTER
   -------------------------------------------------- */

.mini-game-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 0 0;
  border-top: 1px solid #1e374c;
}

.mini-game-footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.mini-game-footer-actions .button {
  min-height: 35px;
  padding: 8px 11px;
  font-size: 10px;
}

/* --------------------------------------------------
   RUN STATUS
   -------------------------------------------------- */

.game-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid #2f5a49;
  border-radius: 5px;
  background: #0b211e;
  color: var(--game-green);
  font: 600 9px var(--game-mono);
  letter-spacing: 0.05em;
}

.game-status-pill > i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--game-green);
  box-shadow: 0 0 8px rgba(102, 240, 172, 0.55);
}

.game-status-pill[data-state="cleared"] {
  border-color: #8e7747;
  background: #2a2415;
  color: var(--game-gold);
}

.game-status-pill[data-state="cleared"] > i {
  background: var(--game-gold);
  box-shadow: 0 0 8px rgba(246, 199, 107, 0.55);
}

.game-status-pill[data-state="failed"] {
  border-color: #693a48;
  background: #2b1823;
  color: var(--game-red);
}

.game-status-pill[data-state="failed"] > i {
  background: var(--game-red);
  box-shadow: 0 0 8px rgba(255, 113, 136, 0.45);
}

/* --------------------------------------------------
   TOUCH CONTROLS
   -------------------------------------------------- */

.mini-game-touch-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-game-touch-controls button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-width: 48px;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid #345773;
  border-radius: 7px;
  background: linear-gradient(180deg, #122b40, #0b1d2e);
  color: #eaf5ff;
  font: 700 13px var(--game-mono);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  transition:
    border-color 100ms ease,
    background 100ms ease,
    transform 100ms ease;
}

.mini-game-touch-controls button:hover {
  border-color: #5b91a9;
}

.mini-game-touch-controls button:active {
  transform: translateY(1px);
  border-color: var(--game-green);
  background: #12352e;
  color: var(--game-green);
}

.mini-game-touch-controls button[data-game-control="jump"] {
  min-width: 91px;
  border-color: #416b83;
  background: linear-gradient(180deg, #153b54, #102b41);
  color: #8be8f1;
  font-size: 10px;
}

.mini-game-touch-controls button[data-game-control="jump"] span {
  font-size: 16px;
}

/* --------------------------------------------------
   FOOTER NOTE
   -------------------------------------------------- */

.mini-game-note {
  margin: 13px 0 0;
  color: #6f879c;
  font: 9px/1.6 var(--game-mono);
  text-align: center;
}

/* --------------------------------------------------
   TABLET
   -------------------------------------------------- */

@media (max-width: 760px) {
  .mini-game-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 10px;
  }

  .mini-game-shell {
    padding: 15px;
  }

  .mini-game-header {
    gap: 12px;
    padding-bottom: 12px;
  }

  .mini-game-titleblock h2 {
    font-size: 23px;
  }

  .mini-game-subtitle {
    max-width: 540px;
    font-size: 11px;
  }

  .mini-game-hud {
    gap: 6px;
  }

  .mini-game-hud > div {
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 3px;
    min-height: 48px;
    padding: 7px 9px;
  }

  .mini-game-hud > div > strong {
    max-width: 100%;
    text-align: left;
  }

  .mini-game-instructions {
    gap: 9px 13px;
    font-size: 9px;
  }

  .mini-game-footer {
    align-items: flex-start;
    gap: 10px;
  }

  .mini-game-footer-actions {
    gap: 6px;
  }
}

/* --------------------------------------------------
   MOBILE
   -------------------------------------------------- */

@media (max-width: 520px) {
  .mini-game-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 8px;
  }

  .mini-game-shell {
    padding: 10px;
  }

  .mini-game-header {
    gap: 8px;
    padding: 2px 1px 10px;
  }

  .mini-game-titleblock .eyebrow {
    font-size: 8px;
    letter-spacing: 0.11em;
  }

  .mini-game-titleblock h2 {
    font-size: 21px;
  }

  .mini-game-subtitle {
    margin-top: 5px;
    font-size: 10px;
    line-height: 1.5;
  }

  .mini-game-close {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    font-size: 22px;
  }

  .mini-game-hud {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 7px;
  }

  .mini-game-hud > div {
    min-height: 43px;
    padding: 6px 5px;
    border-radius: 4px;
  }

  .mini-game-hud > div > span {
    font-size: 7px;
    letter-spacing: 0.02em;
  }

  .mini-game-hud > div > strong {
    font-size: 10px;
  }

  .mini-game-screen-wrap {
    border-radius: 5px;
  }

  #platformerCanvas {
    aspect-ratio: 2 / 1;
  }

  .mini-game-instructions {
    justify-content: flex-start;
    gap: 7px 10px;
    margin: 10px 0;
    font-size: 9px;
  }

  .mini-game-instructions > span:last-child {
    flex-basis: 100%;
  }

  .mini-game-dialog kbd {
    min-width: 20px;
    height: 21px;
    font-size: 8px;
  }

  .mini-game-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 10px;
  }

  .mini-game-touch-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1.35fr;
    gap: 7px;
    width: 100%;
  }

  .mini-game-touch-controls button {
    width: 100%;
    min-width: 0;
    min-height: 45px;
    padding: 8px;
  }

  .mini-game-touch-controls button[data-game-control="jump"] {
    min-width: 0;
  }

  .mini-game-footer-actions {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    justify-content: stretch;
    gap: 6px;
    width: 100%;
  }

  .mini-game-footer-actions .button {
    justify-content: center;
    min-width: 0;
    padding: 8px 6px;
    font-size: 9px;
  }

  .game-status-pill {
    justify-content: center;
    padding: 6px 7px;
    font-size: 8px;
  }

  .mini-game-note {
    margin-top: 9px;
    font-size: 8px;
  }

  .mini-game-overlay {
    padding: 9px;
  }

  .mini-game-overlay-card {
    padding: 15px 12px;
    border-radius: 8px;
  }

  .mini-game-overlay-card .eyebrow {
    font-size: 8px;
  }

  .mini-game-overlay-card h3 {
    font-size: 20px;
  }

  .mini-game-overlay-card p:not(.eyebrow) {
    margin: 9px 0 13px;
    font-size: 10px;
  }

  .mini-game-overlay-actions {
    flex-direction: column;
  }

  .mini-game-overlay-actions .button {
    width: 100%;
  }
}

/* --------------------------------------------------
   SHORT SCREENS / LANDSCAPE PHONES
   -------------------------------------------------- */

@media (max-height: 650px) and (min-width: 521px) {
  .mini-game-dialog {
    max-height: calc(100vh - 14px);
    max-height: calc(100dvh - 14px);
  }

  .mini-game-shell {
    padding: 12px;
  }

  .mini-game-header {
    padding-bottom: 8px;
  }

  .mini-game-subtitle {
    margin-top: 4px;
  }

  .mini-game-hud {
    margin-bottom: 6px;
  }

  .mini-game-hud > div {
    min-height: 35px;
    padding: 5px 9px;
  }

  .mini-game-instructions {
    margin: 7px 0;
  }

  .mini-game-footer {
    padding-top: 8px;
  }

  .mini-game-note {
    margin-top: 7px;
  }
}

/* --------------------------------------------------
   ACCESSIBILITY
   -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .mini-game-dialog[open],
  .mini-game-overlay-card {
    animation: none;
  }

  .mini-game-dialog *,
  .avatar-game-trigger *,
  .mini-game-touch-controls button {
    scroll-behavior: auto;
    transition-duration: 0.01ms !important;
  }
}
/* Resume / character sheet */

.resume-panel {
  scroll-margin-top: 90px;
}

.resume-header {
  padding: 22px;
  margin-bottom: 22px;
  border: 1px solid var(--game-border, #294b65);
  border-radius: 8px;
  background: rgba(12, 30, 48, 0.55);
}

.resume-header h3 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: -0.04em;
}

.resume-role {
  margin: 7px 0 12px;
  color: var(--game-green, #66f0ac);
  font-weight: 600;
}

.resume-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--game-muted, #9db1c6);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.resume-contact a {
  color: inherit;
  text-decoration: none;
}

.resume-contact a:hover {
  color: var(--game-green, #66f0ac);
}

.resume-block {
  padding: 18px 0;
  border-bottom: 1px solid rgba(130, 165, 190, 0.16);
}

.resume-block:last-of-type {
  border-bottom: 0;
}

.resume-block > h3 {
  margin: 0 0 14px;
  color: var(--game-green, #66f0ac);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.resume-block p,
.resume-entry li {
  color: var(--game-muted, #9db1c6);
  font-size: 13px;
  line-height: 1.75;
}

.resume-entry {
  margin: 0 0 22px;
}

.resume-entry:last-child {
  margin-bottom: 0;
}

.resume-entry-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 18px;
  align-items: baseline;
}

.resume-entry h4 {
  margin: 0;
  color: var(--game-text, #eaf3ff);
  font-size: 14px;
}

.resume-entry-heading > span {
  color: var(--game-cyan, #66d9ee);
  font: 11px var(--game-mono, monospace);
}

.resume-company,
.resume-tech {
  margin: 6px 0 10px;
  font-size: 12px !important;
}

.resume-tech {
  color: var(--game-cyan, #66d9ee) !important;
}

.resume-entry ul {
  padding-left: 19px;
  margin: 8px 0 0;
}

.resume-entry li {
  padding-left: 3px;
  margin-bottom: 5px;
}

.resume-skill-row {
  display: grid;
  grid-template-columns: minmax(145px, 0.7fr) minmax(0, 2fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(130, 165, 190, 0.1);
}

.resume-skill-row:last-child {
  border-bottom: 0;
}

.resume-skill-row strong {
  color: var(--game-text, #eaf3ff);
  font-size: 12px;
}

.resume-skill-row p {
  margin: 0;
}

.resume-download {
  white-space: nowrap;
}

.resume-download-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(102, 240, 172, 0.2);
  border-radius: 8px;
  background: rgba(102, 240, 172, 0.035);
}

.resume-download-bottom p {
  margin: 0;
  color: var(--game-muted, #9db1c6);
  font-size: 13px;
}

@media (max-width: 640px) {
  .resume-header {
    padding: 16px;
  }

  .resume-entry-heading {
    flex-direction: column;
    gap: 5px;
  }

  .resume-skill-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .resume-download {
    white-space: normal;
  }

  .resume-download-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}