/* ============================================================
   FOOTIE FEVER — style.css
   Stadium-night UI shell around the canvas.
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: #0a0d1f;
  overflow: hidden;
  font-family: 'Arial Black', Arial, Helvetica, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game {
  display: block;
  border-radius: 6px;
  box-shadow: 0 0 80px rgba(40, 80, 255, 0.18), 0 20px 60px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  touch-action: none;
}

/* ---------------- overlays ---------------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(16, 22, 54, 0.88), rgba(5, 7, 20, 0.94));
  z-index: 10;
  transition: opacity 0.25s ease;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

/* ---------------- menu ---------------- */
#menu {
  background: url('../assets/mainmenu.png') center / cover no-repeat #0a0d1f;
}

.menu-inner {
  text-align: center;
  padding: 20px;
  width: 100%;
  align-self: flex-end;
  padding-bottom: 7vh;
}

/* column-reverse floats WORLD CUP (built second) to the top */
#diff-cards {
  display: flex;
  flex-direction: column-reverse;
  gap: 18px;
  align-items: center;
}

.diff-card {
  padding: 16px 46px;
  border: 3px solid #3d4a86;
  border-radius: 18px;
  background: rgba(12, 16, 38, 0.85);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  transition: transform 0.14s cubic-bezier(0.34, 1.8, 0.64, 1), border-color 0.14s, box-shadow 0.14s;
}
.diff-card:hover, .diff-card:focus-visible {
  transform: translateY(-7px) scale(1.05) rotate(-1deg);
  border-color: #ffe24a;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 26px rgba(255, 226, 74, 0.25);
  outline: none;
}
.diff-card:active { transform: translateY(-2px) scale(0.99); }
.diff-card.featured { border-color: #ffe24a; padding: 22px 70px; }
.diff-card.featured .diff-name { font-size: 36px; }

.diff-name { font-size: 26px; letter-spacing: 2px; }
.diff-card:nth-child(1) .diff-name { color: #6ef58f; }
.diff-card:nth-child(2) .diff-name { color: #ffe24a; }

/* ---------------- shared panel / buttons ---------------- */
.panel {
  background: linear-gradient(180deg, #1a2144, #101530);
  border: 3px solid #3d4a86;
  border-radius: 22px;
  padding: 34px 44px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  animation: panelPop 0.3s cubic-bezier(0.34, 1.7, 0.64, 1);
}
@keyframes panelPop { from { transform: scale(0.8); opacity: 0; } }

.panel h2 { color: #fff; font-size: 34px; letter-spacing: 3px; margin-bottom: 20px; }

.btn {
  display: block;
  width: 100%;
  margin: 10px auto 0;
  padding: 13px 34px;
  font-family: inherit;
  font-size: 17px;
  letter-spacing: 1px;
  color: #fff;
  background: #232c52;
  border: 3px solid #3d4a86;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.34, 1.8, 0.64, 1), border-color 0.12s;
}
.btn:hover { transform: scale(1.06) rotate(-0.5deg); border-color: #ffe24a; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: #1d5c31; border-color: #6ef58f; }

/* ---------------- results ---------------- */
.results-panel { min-width: 420px; position: relative; }

#res-rank {
  font-size: 96px;
  line-height: 1;
  margin-bottom: 4px;
  animation: rankStamp 0.5s cubic-bezier(0.34, 1.9, 0.64, 1) 0.25s backwards;
  text-shadow: 0 8px 0 rgba(10, 12, 30, 0.9);
}
@keyframes rankStamp {
  from { transform: scale(3) rotate(14deg); opacity: 0; }
}
#res-rank[data-rank="S"] { color: #ffe24a; }
#res-rank[data-rank="A"] { color: #6ef58f; }
#res-rank[data-rank="B"] { color: #6fc7ff; }
#res-rank[data-rank="C"] { color: #ffb142; }
#res-rank[data-rank="D"] { color: #ff6f6f; }

.new-best {
  color: #ffe24a;
  font-size: 15px;
  letter-spacing: 2px;
  margin-bottom: 6px;
  animation: bestBlink 0.7s ease-in-out infinite alternate;
}
.new-best.hidden { display: none; }
@keyframes bestBlink { from { opacity: 0.55; } to { opacity: 1; transform: scale(1.06); } }

#res-score { font-size: 46px; color: #fff; margin-bottom: 2px; }
.res-sub { color: #9fb4ff; font-family: Arial, sans-serif; font-weight: 700; font-size: 13px; margin-bottom: 18px; }

.res-grid { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; }
.res-cell {
  background: rgba(8, 10, 28, 0.6);
  border-radius: 12px;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.res-label { color: #55639f; font-size: 10px; letter-spacing: 1px; }
.res-val { color: #fff; font-size: 22px; }

.res-judges {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 1px;
}
.res-judges b { margin-left: 4px; }
.j.perfect { color: #ffe24a; }
.j.great { color: #6ef58f; }
.j.good { color: #6fc7ff; }
.j.miss { color: #ff6f6f; }

.res-buttons { display: flex; gap: 12px; margin-top: 14px; }
.res-buttons .btn { margin-top: 0; }
