@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;800&display=swap');

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

body {
  font-family: 'Nunito', sans-serif;
  background: #0f1117;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: default;
}

.chess-bg {
  position: absolute; inset: 0;
  background-image: repeating-conic-gradient(#1a1d27 0% 25%, #12151e 0% 50%);
  background-size: 60px 60px;
  opacity: 0.55; z-index: 0;
}
.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, #0f1117 100%);
  z-index: 1;
}

.chess-piece {
  position: absolute;
  font-size: 2.2rem; opacity: 0.12;
  animation: floatUp linear infinite;
  z-index: 2; pointer-events: none; filter: grayscale(1);
}
@keyframes floatUp {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.12; }
  90%  { opacity: 0.12; }
  100% { transform: translateY(-100vh) rotate(20deg); opacity: 0; }
}

/* ---- THREE COLUMN LAYOUT ---- */
.layout {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1100px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.col-left, .col-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 0 0 190px;
}

.col-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Cards */
.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  padding: 12px 16px;
  backdrop-filter: blur(4px);
  animation: cardFloat ease-in-out infinite;
  width: 100%;
}
@keyframes cardFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

.card .label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 5px;
}
.card .value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #f0c040;
  font-family: 'Fredoka One', cursive;
}
.card .delta {
  font-size: 0.68rem;
  font-weight: 600;
  color: #4ade80;
  margin-top: 2px;
}

/* Tool row */
.tool-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.tool-row:last-child { margin-bottom: 0; }
.tool-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
}

/* Poring */
.poring-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: hop 1.8s cubic-bezier(0.33, 1, 0.68, 1) infinite;
  cursor: pointer;
}
@keyframes hop {
  0%   { transform: translateY(0)    scaleX(1)    scaleY(1); }
  10%  { transform: translateY(0)    scaleX(1.12) scaleY(0.82); }
  35%  { transform: translateY(-8px) scaleX(0.96) scaleY(1.04); }
  65%  { transform: translateY(-8px) scaleX(0.96) scaleY(1.04); }
  88%  { transform: translateY(0)    scaleX(1.12) scaleY(0.82); }
  100% { transform: translateY(0)    scaleX(1)    scaleY(1); }
}
.poring-shadow {
  width: 72px; height: 14px;
  background: radial-gradient(ellipse, rgba(255,180,100,0.22) 0%, transparent 70%);
  border-radius: 50%;
  animation: shadow-pulse 1.8s cubic-bezier(0.33,1,0.68,1) infinite;
  margin-top: -4px;
}
@keyframes shadow-pulse {
  0%,100% { transform: scaleX(1);    opacity: 1; }
  10%     { transform: scaleX(1.25); opacity: 0.9; }
  35%,65% { transform: scaleX(0.55); opacity: 0.4; }
  88%     { transform: scaleX(1.25); opacity: 0.9; }
}
.poring-sprite {
  width: 38px;
  height: 36px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 1px 4px rgba(255,160,80,0.35));
  transition: filter 0.2s;
}
.poring-wrapper:hover .poring-sprite {
  filter: drop-shadow(0 1px 8px rgba(255,200,60,0.6));
}

/* Speech bubble */
.bubble-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.bubble {
  background: white;
  color: #1a0a18;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.5;
  padding: 12px 18px;
  border-radius: 18px;
  max-width: 220px;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  animation: bubblePop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.bubble strong { color: #e8400c; }
.bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-top-color: white;
  border-bottom: 0;
}
@keyframes bubblePop {
  from { opacity: 0; transform: scale(0.7) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.bubble.swap {
  animation: bubbleSwap 0.3s ease both;
}
@keyframes bubbleSwap {
  0%   { opacity: 1; transform: scale(1); }
  40%  { opacity: 0; transform: scale(0.85) translateY(-6px); }
  60%  { opacity: 0; transform: scale(0.85) translateY(-6px); }
  100% { opacity: 1; transform: scale(1); }
}

/* CTA Button */
.cta-btn {
  display: inline-block;
  padding: 12px 36px;
  background: linear-gradient(135deg, #f5c518, #f59e0b);
  color: #1a1200;
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  letter-spacing: 1px;
  border: none; border-radius: 50px;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 5px 0 #a06800, 0 8px 24px rgba(245,165,24,0.35);
  transition: transform 0.12s, box-shadow 0.12s;
  position: relative; overflow: hidden;
  margin-top: 18px;
}
.cta-btn::after {
  content: '';
  position: absolute; top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2.4s infinite;
}
@keyframes shimmer { 0%{left:-60%} 100%{left:130%} }
.cta-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 0 #a06800, 0 12px 28px rgba(245,165,24,0.45); }
.cta-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #a06800; }

/* Overlay */
.overlay {
  position: fixed; inset: 0;
  background: radial-gradient(circle, #1a1500 0%, #0f1117 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 999; opacity: 0; pointer-events: none;
  transition: opacity 0.5s ease;
}
.overlay.active { opacity: 1; pointer-events: all; }
.overlay-poring-sprite {
  width: 38px;
  height: 36px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  animation: spin-hop 0.5s linear infinite;
  filter: drop-shadow(0 2px 8px rgba(245,165,24,0.5));
}
@keyframes spin-hop {
  0%  { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-40px) rotate(180deg); }
  100%{ transform: translateY(0) rotate(360deg); }
}

/* ---- MOBILE RESPONSIVE ---- */
@media (max-width: 768px) {
  body { overflow-y: auto; justify-content: flex-start; padding: 20px 0 40px; }

  .layout {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 0 16px;
  }

  /* hide side columns on mobile, show below center */
  .col-left, .col-right {
    flex: unset;
    width: 100%;
    max-width: 340px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .col-left .card,
  .col-right .card {
    flex: 1 1 140px;
    animation: none; /* stop float on mobile, saves battery */
  }

  .col-center { width: 100%; }

  /* reorder: center first, then left cards, then right cards */
  .col-center { order: 1; }
  .col-left   { order: 2; }
  .col-right  { order: 3; }

  .bubble { font-size: 0.8rem; max-width: 200px; padding: 10px 14px; }

  .cta-btn { font-size: 1rem; padding: 11px 30px; }

  /* tool row text slightly smaller */
  .tool-name { font-size: 0.72rem; }
}

@media (max-width: 420px) {
  .col-left, .col-right { flex-direction: column; }
  .col-left .card, .col-right .card { flex: unset; width: 100%; }
}
