@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Baloo+2:wght@500;700;800&display=swap');

:root {
  --gp-bg: #1a1033;
  --gp-bg2: #2a1750;
  --gp-surface: #2d1b54;
  --gp-surface2: #3a2268;
  --gp-text: #f1e9ff;
  --gp-muted: #b3a3d9;
  --gp-accent: #ffcc33;
  --gp-accent2: #ff5f7e;
  --gp-blue: #38bdf8;
  --gp-green: #4ade80;
  --gp-border: #4c2f8a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Baloo 2", -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--gp-text);
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 204, 51, 0.12), transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(56, 189, 248, 0.14), transparent 40%),
    linear-gradient(180deg, var(--gp-bg) 0%, var(--gp-bg2) 100%);
  min-height: 100vh;
}

a { color: var(--gp-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

@keyframes gp-bounce-in {
  0% { transform: scale(0.6) translateY(20px); opacity: 0; }
  60% { transform: scale(1.05) translateY(-4px); opacity: 1; }
  100% { transform: scale(1) translateY(0); }
}

@keyframes gp-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

@keyframes gp-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}

@keyframes gp-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

header.gp-header {
  padding: 32px 20px 24px;
  text-align: center;
}

header.gp-header h1 {
  margin: 0 0 6px;
  font-family: "Bangers", "Baloo 2", cursive;
  letter-spacing: 1px;
  font-size: 44px;
  color: var(--gp-accent);
  text-shadow: 3px 3px 0 var(--gp-accent2), 0 0 24px rgba(255, 204, 51, 0.4);
  animation: gp-float 3.5s ease-in-out infinite;
}

header.gp-header p {
  margin: 0;
  color: var(--gp-muted);
  font-weight: 600;
}

.gp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.gp-card {
  background: linear-gradient(160deg, var(--gp-surface2) 0%, var(--gp-surface) 100%);
  border: 3px solid var(--gp-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: gp-bounce-in 0.5s ease both;
}

.gp-card:hover {
  transform: translateY(-6px) rotate(-1deg);
  border-color: var(--gp-accent);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.35), 0 18px 28px rgba(0, 0, 0, 0.3);
}

.gp-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #000;
  border-bottom: 3px solid var(--gp-border);
}

.gp-card-body { padding: 14px 16px; }
.gp-card-body h2 {
  margin: 0 0 6px;
  font-family: "Bangers", "Baloo 2", cursive;
  letter-spacing: 0.5px;
  font-size: 22px;
  color: var(--gp-text);
}
.gp-card-body p { margin: 0; color: var(--gp-muted); font-size: 13px; font-weight: 600; }

.gp-back {
  display: inline-block;
  margin: 16px 20px;
  color: var(--gp-muted);
  font-weight: 700;
}

.gp-game-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 40px;
  text-align: center;
}

.gp-game-wrap h1 {
  font-family: "Bangers", "Baloo 2", cursive;
  font-size: 34px;
  letter-spacing: 1px;
  color: var(--gp-accent);
  text-shadow: 2px 2px 0 var(--gp-accent2);
  margin: 12px 0 6px;
}

.gp-game-wrap canvas,
.gp-game-wrap .gp-board {
  background: #000;
  border-radius: 12px;
  max-width: 100%;
  touch-action: none;
  border: 4px solid var(--gp-border);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 10px 24px rgba(0, 0, 0, 0.35);
}

.gp-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0;
  font-size: 15px;
  color: var(--gp-muted);
  font-weight: 700;
}

.gp-hud strong {
  font-family: "Bangers", "Baloo 2", cursive;
  font-size: 22px;
  color: var(--gp-accent);
  letter-spacing: 1px;
}

.gp-hud strong.gp-score-pop { animation: gp-pop 0.3s ease; }

.gp-btn {
  background: linear-gradient(180deg, #ffe066 0%, var(--gp-accent) 60%, #e0a800 100%);
  color: #4a2f00;
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-family: "Baloo 2", sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #a86e00, 0 6px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.gp-btn:hover { filter: brightness(1.08); }
.gp-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #a86e00, 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gp-btn-secondary {
  background: linear-gradient(180deg, var(--gp-surface2) 0%, var(--gp-surface) 100%);
  color: var(--gp-text);
  border: none;
  box-shadow: 0 4px 0 #1c1140, 0 6px 10px rgba(0, 0, 0, 0.3);
}

.gp-btn-secondary:active { box-shadow: 0 1px 0 #1c1140, 0 2px 4px rgba(0, 0, 0, 0.3); }

.gp-panel {
  background: linear-gradient(160deg, var(--gp-surface2) 0%, var(--gp-surface) 100%);
  border: 3px solid var(--gp-border);
  border-radius: 14px;
  padding: 16px;
  margin-top: 20px;
  text-align: left;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3);
}

.gp-panel h3 {
  margin: 0 0 10px;
  font-family: "Bangers", "Baloo 2", cursive;
  letter-spacing: 0.5px;
  font-size: 18px;
  color: var(--gp-accent);
}

#game-over-panel[style*="block"] { animation: gp-bounce-in 0.35s ease both; }

.gp-leaderboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.gp-leaderboard th {
  padding: 6px 8px;
  text-align: left;
  color: var(--gp-accent);
  font-family: "Bangers", "Baloo 2", cursive;
  font-size: 13px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--gp-border);
}

.gp-leaderboard td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--gp-border);
  font-weight: 600;
}

.gp-leaderboard tr:first-child td { color: var(--gp-accent); font-weight: 800; }

.gp-status { color: var(--gp-muted); font-size: 13px; font-weight: 600; }

.gp-instructions {
  color: var(--gp-muted);
  font-size: 13px;
  font-weight: 600;
  margin: 10px 0 0;
}

.gp-turnstile {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
