/* ============================================================
   Super Ankit World — Interactive Resume
   Classic Mario-inspired look: sky blue, brick red, coin gold.
   ============================================================ */

:root {
  --sky: #5c94fc;          /* classic NES sky blue */
  --sky-deep: #2662d9;
  --brick: #c84c0c;        /* brick orange-red */
  --brick-dark: #881400;
  --coin: #fbd000;         /* coin gold */
  --pipe: #00a800;         /* pipe green */
  --cream: #fff8e7;
  --ink: #202020;
  --panel: #ffffff;
  --muted: #6b6b6b;
  --shadow: rgba(0, 0, 0, 0.25);
}

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

body {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  background: var(--sky);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.35) 0 18px, transparent 19px),
    radial-gradient(circle at 70% 12%, rgba(255,255,255,0.3) 0 24px, transparent 25px),
    radial-gradient(circle at 90% 55%, rgba(255,255,255,0.25) 0 16px, transparent 17px);
  color: var(--ink);
  min-height: 100vh;
  padding: 16px;
}

.page { max-width: 1400px; margin: 0 auto; }

/* ---------- Header ---------- */
.site-header {
  text-align: center;
  padding: 18px 10px 22px;
}
.site-header h1 {
  font-size: clamp(20px, 4vw, 40px);
  color: var(--coin);
  text-shadow:
    3px 3px 0 var(--brick),
    6px 6px 0 var(--brick-dark),
    0 0 24px rgba(0,0,0,0.2);
  letter-spacing: 2px;
}
.tagline {
  margin-top: 12px;
  font-size: clamp(11px, 1.8vw, 15px);
  color: #ffffff;
  text-shadow: 2px 2px 0 var(--sky-deep);
  line-height: 1.8;
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
}

/* ---------- Game frame ---------- */
.game-frame {
  position: relative;
  background: var(--ink);
  border: 6px solid var(--brick-dark);
  border-radius: 10px;
  box-shadow: 0 10px 0 var(--brick-dark), 0 18px 30px var(--shadow);
  overflow: hidden;
}
/* Whenever an overlay (splash, milestone card, ending screens) is showing,
   let the frame grow taller than the game's own 400:240 aspect ratio so
   overlay content has real room to breathe instead of being squashed into a
   tiny scrollable box — this matters most on mobile, where the canvas
   itself is short. Automatically lifts the instant the overlay closes, so
   gameplay always renders at its normal pixel-perfect ratio. */
.game-frame:has(.overlay.active) { min-height: clamp(520px, 100vh, 960px); }

canvas#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  background: var(--sky);
}

/* ---------- HUD ---------- */
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  font-size: 12px;
  border-bottom: 4px solid var(--brick-dark);
}
.hud-item span { color: var(--coin); }
.hud-btn {
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: 2px solid #555;
  border-radius: 6px;
  color: #fff;
  padding: 4px 8px;
  cursor: pointer;
}
.hud-btn:hover { border-color: var(--coin); }

/* ---------- Overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 30, 0.82);
  z-index: 20;
  padding: 16px;
}
.overlay.active { display: flex; }

/* Splash */
.splash { background: linear-gradient(180deg, var(--sky) 0%, var(--sky-deep) 100%); }
.splash-inner {
  text-align: center;
  max-height: 100%;
  overflow-y: auto;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(5px, 1.1vh, 11px);
}
/* Themed, thin scrollbar — only ever appears on very short viewports, but
   should still look intentional instead of a bare browser-default bar. */
.splash-inner::-webkit-scrollbar { width: 8px; }
.splash-inner::-webkit-scrollbar-track { background: transparent; }
.splash-inner::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.35); border-radius: 4px; }
.splash-badge {
  display: inline-block;
  font-size: 12px;
  color: var(--ink);
  background: var(--coin);
  padding: 8px 16px;
  border-radius: 4px;
  box-shadow: 0 3px 0 var(--brick-dark);
  letter-spacing: 1px;
  animation: pulse 1.4s infinite;
}
.splash-title {
  font-size: clamp(32px, 6vw, 58px);
  color: #fff;
  line-height: 1.12;
  text-shadow: 4px 4px 0 var(--brick), 8px 8px 0 var(--brick-dark);
}
.splash-sub {
  font-size: 14px;
  color: #d8e6ff;
  line-height: 1.8;
}
.visitor-count {
  font-size: 11px;
  color: var(--coin);
  margin-top: -4px;
}
.visitor-count:empty { display: none; } /* no wasted space until a real count loads */
.splash-hero {
  display: flex;
  justify-content: center;
}
.splash-hero canvas {
  width: 68px;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.25));
}
.splash-tip {
  font-size: 12px;
  color: #bcd2ff;
  line-height: 1.6;
}
.splash-rules {
  background: rgba(0, 0, 0, 0.28);
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  padding: 14px 22px;
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
}
.splash-rules-title {
  font-size: 13px;
  color: var(--coin);
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.splash-rules-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 22px;
}
.splash-rules-list li {
  font-family: Verdana, sans-serif;
  font-size: 13px;
  color: #eaf2ff;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.rule-icon { font-size: 17px; line-height: 1.2; flex-shrink: 0; }
.splash-rules-note {
  font-family: Verdana, sans-serif;
  font-size: 12px;
  color: var(--coin);
  text-align: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.3);
}
@media (max-width: 480px) {
  .splash-rules-list { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit;
  font-size: 11px;
  display: inline-block;
  background: var(--brick);
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  padding: 14px 22px;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--brick-dark);
  transition: transform 0.06s;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 3px 0 var(--brick-dark); }
.btn:active { transform: translateY(5px); box-shadow: 0 0 0 var(--brick-dark); }
.btn-big { font-size: 16px; padding: 18px 32px; background: var(--pipe); box-shadow: 0 5px 0 #005a00; animation: pulse 1.4s infinite; }
.btn-big:hover, .btn-big:active { box-shadow: 0 2px 0 #005a00; }
.btn-alt { background: var(--sky-deep); box-shadow: 0 5px 0 #123a80; }
.btn-alt:hover, .btn-alt:active { box-shadow: 0 2px 0 #123a80; }

@keyframes pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

/* ---------- Milestone card ---------- */
.milestone-card {
  background: var(--cream);
  border: 5px solid var(--brick-dark);
  border-radius: 12px;
  box-shadow: 0 8px 0 var(--brick-dark), 0 16px 40px rgba(0,0,0,0.5);
  max-width: 660px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  text-align: center;
  animation: cardpop 0.25s ease-out;
}
@keyframes cardpop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.milestone-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.milestone-tag {
  font-size: 11px;
  background: var(--pipe);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
}
.milestone-year { font-size: 14px; color: var(--brick); }
.milestone-title { font-size: 20px; line-height: 1.5; margin-bottom: 10px; color: var(--ink); }
.milestone-inst { font-size: 12px; color: var(--sky-deep); margin-bottom: 16px; }
.milestone-stat {
  display: inline-block;
  font-size: 14px;
  background: var(--brick);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  box-shadow: 0 3px 0 var(--brick-dark);
  margin-bottom: 14px;
}
.milestone-desc {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #333;
  margin-bottom: 18px;
}
.milestone-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 20px;
}
.skill-tag {
  font-size: 11px;
  background: var(--coin);
  color: var(--ink);
  padding: 7px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 0 #b89000;
}
.milestone-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.final-card .milestone-title { font-size: 18px; }
.final-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- Touch controls ---------- */
.touch-controls {
  display: none;
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 10;
  pointer-events: none;
}
.dpad { display: flex; gap: 10px; }
.touch-btn {
  pointer-events: auto;
  font-family: inherit;
  font-size: 18px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.35);
  color: #fff;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.touch-jump { background: rgba(200, 76, 12, 0.6); }
@media (hover: none) and (pointer: coarse) {
  .touch-controls { display: flex; }
  /* keyboard hints are noise once the on-screen d-pad/jump button take over */
  .controls-note { display: none; }
}

/* ---------- Controls note ---------- */
.controls-note {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
  font-size: 11px;
  color: #fff;
  text-shadow: 1px 1px 0 var(--sky-deep);
}
kbd {
  font-family: inherit;
  background: var(--ink);
  border-radius: 4px;
  padding: 3px 6px;
  box-shadow: 0 2px 0 #000;
  color: #fff;
}

/* ---------- Sidebar ---------- */
.card {
  background: var(--panel);
  border: 4px solid var(--brick-dark);
  border-radius: 10px;
  box-shadow: 0 6px 0 var(--brick-dark);
  padding: 16px;
  margin-bottom: 16px;
}
.card h2 {
  font-size: 11px;
  color: var(--brick);
  margin-bottom: 12px;
  border-bottom: 3px dashed #eee;
  padding-bottom: 8px;
}
.profile { display: flex; gap: 12px; align-items: center; }
.avatar-box {
  background: var(--sky);
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 4px;
  line-height: 0;
}
#avatarCanvas { image-rendering: pixelated; }
.profile-name { font-size: 14px; }
.profile-title { font-family: Verdana, sans-serif; font-size: 12px; color: var(--muted); margin: 6px 0; }
.badge {
  display: inline-block;
  font-size: 9px;
  background: var(--coin);
  padding: 5px 7px;
  border-radius: 4px;
}

.quest-list { list-style: none; }
.quest {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-family: Verdana, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 6px;
  border-radius: 6px;
  color: #999;
  filter: grayscale(1);
  opacity: 0.65;
  transition: all 0.4s;
}
.quest b { font-size: 12px; }
.quest.unlocked {
  color: var(--ink);
  filter: none;
  opacity: 1;
  background: #fff6d8;
}
.quest[data-level] { cursor: pointer; }
.quest[data-level]:hover {
  filter: none;
  opacity: 1;
  background: #eef6ff;
  outline: 2px dashed var(--sky-deep);
}
.q-icon { font-size: 16px; line-height: 1.2; }
.map-hint { font-size: 9px; color: var(--muted); font-weight: normal; display: block; margin-top: 4px; }

.small { font-family: Verdana, sans-serif; font-size: 14px; line-height: 1.65; color: #444; }

/* ---------- Ending sequence: "still loading" teaser ---------- */
.teaser-card {
  background: var(--ink);
  color: #fcfcfc;
  border: 5px solid var(--coin);
  border-radius: 12px;
  padding: 30px 24px;
  text-align: center;
  max-width: 420px;
  animation: cardpop 0.25s ease-out;
}
.teaser-castle { font-size: 40px; margin-bottom: 10px; filter: grayscale(1) brightness(1.4); }
.teaser-card h3 { font-size: 16px; margin-bottom: 14px; color: var(--coin); }
.teaser-loading { font-size: 13px; margin-bottom: 10px; }
.teaser-sub { font-family: Verdana, sans-serif; font-size: 14px; color: #ccc; }
.dots span { animation: dotfade 1.2s infinite; opacity: 0; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotfade { 0%,100% { opacity: 0; } 50% { opacity: 1; } }

/* ---------- Final screen: loading-skills gag + contact row ---------- */
.loading-gag {
  background: #eef2f8;
  border: 2px dashed var(--sky-deep);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 18px;
}
.loading-gag-label { font-size: 11px; color: var(--sky-deep); margin-bottom: 8px; }
.loading-bar { background: #d8e0ec; border-radius: 6px; height: 10px; overflow: hidden; margin-bottom: 8px; }
.loading-bar-fill {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--pipe), var(--coin));
  border-radius: 6px;
  animation: loadbar 3s ease-in-out infinite;
}
@keyframes loadbar { 0% { width: 10%; } 50% { width: 85%; } 100% { width: 10%; } }
.loading-gag-list { font-family: Verdana, sans-serif; font-size: 13px; color: #444; }
.final-contact { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.mushroom-icon { font-size: 34px; flex-shrink: 0; }

/* ---------- HIRE ME CTA: flashing arcade button on the final screen ---------- */
.hire-block { text-align: center; margin-bottom: 18px; }
.hire-btn {
  font-size: 15px;
  padding: 18px 26px;
  background: #d80000;
  box-shadow: 0 5px 0 #7c0000, 0 0 0 rgba(255,60,60,0);
  animation: hireflash 0.9s infinite;
}
.hire-btn:hover { box-shadow: 0 2px 0 #7c0000; }
@keyframes hireflash {
  0%, 100% { filter: brightness(1); box-shadow: 0 5px 0 #7c0000, 0 0 10px rgba(255,80,80,0.2); }
  50% { filter: brightness(1.25); box-shadow: 0 5px 0 #7c0000, 0 0 26px rgba(255,120,120,0.85); }
}
.coin-spin { display: inline-block; animation: coinspin 1.2s linear infinite; margin-right: 4px; }
@keyframes coinspin {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}
.hire-caption {
  font-family: Verdana, sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 20px 0 8px;
  font-size: 11px;
  color: #eaf2ff;
  text-shadow: 1px 1px 0 var(--sky-deep);
}
.site-footer a { color: var(--coin); }
