/* ===== Frog Stock Runner — Comic Meme Website ===== */
:root {
  --paper: #f4e6c8;
  --paper-dark: #e8d4a8;
  --ink: #2a2118;
  --ink-soft: #5c4a3a;
  --green: #3d9b4a;
  --green-deep: #2a6e34;
  --green-light: #7ecf6a;
  --lily: #a8e06a;
  --water: #5eb3c9;
  --water-deep: #3a8fa3;
  --gold: #f0b429;
  --gold-dark: #c4891a;
  --coral: #e85d4c;
  --panel: #fff8ec;
  --shadow: rgba(42, 33, 24, 0.18);
  --radius: 18px;
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-comic: "Comic Neue", "Comic Sans MS", cursive, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-comic);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 0%, #d4f0c8 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, #c8e8f0 0%, transparent 45%),
    linear-gradient(180deg, #f7edd8 0%, #e8f5d8 40%, #d4ebe8 100%);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

.bg-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(circle at 10% 80%, rgba(126, 207, 106, 0.25) 0 40px, transparent 41px),
    radial-gradient(circle at 90% 60%, rgba(94, 179, 201, 0.2) 0 50px, transparent 51px),
    radial-gradient(circle at 50% 90%, rgba(240, 180, 41, 0.15) 0 60px, transparent 61px);
}

/* ===== Header ===== */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-emoji {
  font-size: 2.6rem;
  filter: drop-shadow(2px 3px 0 var(--shadow));
  animation: hop 1.4s ease-in-out infinite;
}

.logo-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--ink);
  box-shadow: 3px 4px 0 var(--shadow);
  background: var(--paper);
  animation: hop 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes hop {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}

/* Game cover key art */
.game-cover-wrap {
  position: relative;
  margin: 0 0 1rem;
  border: 3.5px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--shadow);
  background: var(--paper);
}

.game-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  vertical-align: middle;
}

.game-cover-badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 1rem;
  background: rgba(255, 248, 236, 0.94);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink);
  max-width: min(90%, 320px);
}

.game-cover-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 3.5vw, 1.55rem);
  color: var(--green-deep);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.game-cover-sub {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.logo h1 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--green-deep);
}

.tagline {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.nav-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-pills a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.45rem 0.95rem;
  background: var(--panel);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}

.nav-pills a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
  background: var(--lily);
}

/* ===== Social / CA bar ===== */
.social-bar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 0.5rem;
}

.social-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 0.7rem 1rem;
  box-shadow: 4px 4px 0 var(--shadow);
}

.ca-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 220px;
}

.ca-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  letter-spacing: 0.06em;
}

.ca-value {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-deep);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(100%, 340px);
}

.btn-copy {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  background: var(--gold);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.12s, box-shadow 0.12s;
}

.btn-copy:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-copy.copied {
  background: var(--green-light);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  padding: 0.45rem 0.9rem;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s, box-shadow 0.12s;
}

.social-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.social-btn.x {
  background: #1a1a1a;
}

.social-btn.tg {
  background: #2aabee;
}

.social-icon {
  font-size: 1rem;
  line-height: 1;
}

/* ===== Sections ===== */
section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.section-head {
  text-align: center;
  margin-bottom: 1.5rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--green-deep);
  margin-bottom: 0.35rem;
}

.section-head p {
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ===== Comic dual vertical conveyors ===== */
.comic-section {
  padding-top: 0.5rem;
}

.comic-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}

.conveyor-wrap {
  position: relative;
  background: linear-gradient(180deg, #3a2e22 0%, #2a2118 100%);
  border: 4px solid var(--ink);
  border-radius: 24px;
  padding: 1.1rem 0 1.6rem;
  box-shadow:
    0 12px 0 rgba(42, 33, 24, 0.25),
    inset 0 0 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.conveyor-wrap.vertical {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 0.75rem 0.65rem;
  height: 560px;
}

.conveyor-rail {
  height: 10px;
  margin: 0 0.75rem;
  background: repeating-linear-gradient(
    90deg,
    #8b7355 0 18px,
    #6b5640 18px 36px
  );
  border-radius: 4px;
  border: 2px solid #1a140e;
}

.conveyor-rail.side {
  width: 10px;
  height: auto;
  margin: 0.35rem 0.4rem;
  align-self: stretch;
  background: repeating-linear-gradient(
    180deg,
    #8b7355 0 18px,
    #6b5640 18px 36px
  );
  flex-shrink: 0;
}

.conveyor {
  display: flex;
  gap: 1.1rem;
  width: max-content;
  animation: convey 42s linear infinite;
  padding: 0.25rem 0.75rem;
  will-change: transform;
}

.conveyor.vertical-track {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  height: max-content;
  padding: 0.35rem 0.25rem;
  animation: convey-down 28s linear infinite;
}

.conveyor.vertical-track.reverse-scroll {
  animation-name: convey-up;
  animation-duration: 32s;
}

.conveyor:hover,
.conveyor.vertical-track:hover {
  animation-play-state: paused;
}

@keyframes convey {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes convey-down {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

@keyframes convey-up {
  from { transform: translateY(-50%); }
  to { transform: translateY(0); }
}

.comic-panel {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  background: var(--panel);
  border: 3.5px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.45);
  transition: transform 0.2s;
}

.comic-panel:hover {
  transform: scale(1.03) rotate(-1deg);
  z-index: 2;
}

.comic-panel img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--paper);
}

.comic-panel .speech {
  font-family: var(--font-comic);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.65rem 0.75rem 0.85rem;
  background: #fff;
  border-top: 2.5px solid var(--ink);
  min-height: 3.2rem;
  line-height: 1.25;
}

.comic-panel .speech.danger {
  background: #ffe8e4;
  color: #a32d22;
}

.comic-panel .speech.sad {
  background: #e8f0ff;
  color: #2a4a7a;
}

.panel-num {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.conveyor-gears {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
  opacity: 0.7;
}

.conveyor-gears.vertical-gears {
  flex-direction: column;
  top: 0;
  bottom: 0;
  left: auto;
  right: 4px;
  width: auto;
  justify-content: space-around;
  align-items: center;
}

.gear {
  font-size: 1.1rem;
  animation: spin 3s linear infinite;
}

.gear.reverse {
  animation-direction: reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Game ===== */
.game-shell {
  background: var(--panel);
  border: 4px solid var(--ink);
  border-radius: 22px;
  padding: 1rem;
  box-shadow: 8px 8px 0 var(--shadow);
}

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.hud-item {
  flex: 1 1 100px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 0.45rem 0.7rem;
  text-align: center;
}

.hud-item.highlight {
  background: linear-gradient(135deg, #fff3c4, #ffe08a);
  border-color: var(--gold-dark);
}

.hud-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.hud-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--green-deep);
}

.canvas-wrap {
  position: relative;
  border: 3.5px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  background: #87ceeb;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.25);
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  cursor: pointer;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(42, 33, 24, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 5;
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  background: var(--panel);
  border: 4px solid var(--ink);
  border-radius: 20px;
  padding: 1.4rem 1.6rem;
  max-width: 380px;
  text-align: center;
  box-shadow: 6px 6px 0 var(--ink);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.overlay-frog {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--ink);
  margin-bottom: 0.75rem;
  background: var(--paper);
}

.overlay-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
  color: var(--green-deep);
}

.overlay-card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

kbd {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  font-family: var(--font-display);
  font-size: 0.8rem;
}

.run-stats {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.run-stats div {
  flex: 1;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 0.4rem;
}

.run-stats span {
  display: block;
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.run-stats strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--green-deep);
}

.btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 0.65rem 1.4rem;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s, box-shadow 0.12s;
}

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

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

.btn.primary {
  background: linear-gradient(180deg, var(--green-light), var(--green));
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.btn.ghost {
  background: var(--panel);
  color: var(--ink);
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

.controls-hint {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.85rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  font-weight: 700;
}

/* ===== Portfolio ===== */
.portfolio-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.summary-card {
  flex: 1 1 140px;
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  box-shadow: 4px 4px 0 var(--shadow);
}

.summary-card.gold {
  background: linear-gradient(135deg, #fff6d0, #ffd666);
}

.summary-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.summary-card strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--green-deep);
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
}

.stock-card {
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 0.9rem 0.75rem;
  text-align: center;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform 0.15s;
  position: relative;
  overflow: hidden;
}

.stock-card:hover {
  transform: translateY(-4px) rotate(-1deg);
}

.stock-card.empty {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.stock-coin {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  color: #fff;
  border: 3px solid var(--ink);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.15),
    0 3px 0 var(--shadow);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.stock-card h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.stock-card .ticker {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.stock-card .owned {
  margin-top: 0.45rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--green-deep);
}

.stock-card .price {
  font-size: 0.8rem;
  color: var(--gold-dark);
  font-weight: 700;
}

.stock-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 60%
  );
  pointer-events: none;
  animation: shine 4s ease-in-out infinite;
}

@keyframes shine {
  0%, 100% { transform: translateX(-30%) rotate(0deg); }
  50% { transform: translateX(30%) rotate(0deg); }
}

/* ===== Gallery ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.gallery-item {
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.gallery-item:hover {
  transform: translate(-3px, -3px) rotate(1deg);
  box-shadow: 7px 7px 0 var(--ink);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: var(--paper);
}

.gallery-item figcaption {
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 0.6rem;
  border-top: 2px solid var(--ink);
  text-align: center;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 8, 0.88);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  gap: 0.75rem;
}

.lightbox.hidden {
  display: none;
}

.lightbox img {
  max-width: min(90vw, 520px);
  max-height: 70vh;
  border-radius: 16px;
  border: 4px solid var(--paper);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  background: var(--paper);
}

.lightbox p {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: var(--coral);
  color: #fff;
  border: 3px solid var(--paper);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  font-family: var(--font-display);
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 2rem 1.25rem 2.5rem;
  color: var(--ink-soft);
  font-weight: 700;
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.85rem;
}

.footer-socials a {
  color: var(--green-deep);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  border-bottom: 2px solid transparent;
}

.footer-socials a:hover {
  border-bottom-color: var(--green-deep);
}

.footer-ca {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0.2rem 0.55rem;
  color: var(--ink);
}

.site-footer .tiny {
  font-size: 0.85rem;
  margin-top: 0.35rem;
  opacity: 0.8;
}

/* ===== Responsive ===== */
@media (max-width: 800px) {
  .comic-dual {
    grid-template-columns: 1fr;
  }

  .conveyor-wrap.vertical {
    height: 480px;
  }
}

@media (max-width: 640px) {
  .comic-panel img {
    height: 150px;
  }

  .conveyor.vertical-track {
    animation-duration: 22s;
  }

  .conveyor.vertical-track.reverse-scroll {
    animation-duration: 26s;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .social-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .ca-value {
    max-width: 100%;
  }
}
