﻿/* ==========================================================================
   canhao-precisao.css — Canhão de Precisão (Mestre do Botão Direito F5)
   Design System Oficial F5 com suporte a Canvas de alta precisão e física
   ========================================================================== */

:root {
  --cp-bg: #07111e;
  --cp-surface: #0b1a2d;
  --cp-surface-hover: #10243e;
  --cp-cyan: #38bdf8;
  --cp-cyan-glow: rgba(56, 189, 248, 0.4);
  --cp-yellow: #facc15;
  --cp-yellow-glow: rgba(250, 204, 21, 0.4);
  --cp-orange: #fb923c;
  --cp-green: #4ade80;
  --cp-green-glow: rgba(74, 222, 128, 0.4);
  --cp-red: #f87171;
  --cp-text: #f8fafc;
  --cp-text-muted: #94a3b8;
  --cp-font: 'Barlow', -apple-system, sans-serif;
  --cp-font-cond: 'Barlow Condensed', sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--cp-bg);
  font-family: var(--cp-font);
  color: var(--cp-text);
  user-select: none;
  -webkit-user-select: none;
}

.cp-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: relative;
  background: radial-gradient(circle at 50% 15%, #0e223d 0%, #050d18 100%);
}

/* ── Topbar ── */
.cp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.2rem;
  background: rgba(7, 17, 30, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
  z-index: 20;
}

.cp-back-btn {
  color: var(--cp-cyan);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  transition: all 0.2s ease;
}
.cp-back-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
  transform: translateX(-2px);
}

.cp-top-title {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cp-top-title span:first-child {
  font-family: var(--cp-font-cond);
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
}
.cp-top-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--cp-yellow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cp-top-controls {
  display: flex;
  gap: 0.5rem;
}
.cp-btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--cp-text-muted);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cp-btn-icon:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--cp-cyan);
  border-color: rgba(56, 189, 248, 0.4);
}
.cp-btn-icon svg { width: 16px; height: 16px; }

/* ── Palco Principal ── */
.cp-main-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.4rem 1.2rem 0.5rem;
  overflow: hidden;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  gap: 0.4rem;
}

/* ── HUD ── */
.cp-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cp-stat-box {
  background: rgba(11, 26, 45, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  padding: 0.25rem 0.7rem;
  display: flex;
  flex-direction: column;
  min-width: 75px;
}
.cp-stat-label {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cp-text-muted);
  letter-spacing: 0.05em;
}
.cp-stat-val {
  font-family: var(--cp-font-cond);
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.cp-stat-val.gold { color: var(--cp-yellow); text-shadow: 0 0 10px var(--cp-yellow-glow); }
.cp-stat-val.cyan { color: var(--cp-cyan); }

.cp-lives-box {
  display: flex;
  gap: 3px;
  margin-top: 1px;
}
.cp-heart {
  font-size: 0.9rem;
  transition: transform 0.2s, filter 0.2s;
}
.cp-heart.lost {
  filter: grayscale(1) opacity(0.3);
  transform: scale(0.85);
}

.cp-biome-badge {
  font-family: var(--cp-font-cond);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #fff;
  letter-spacing: 0.04em;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.cp-hud-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.cp-combo-badge {
  font-family: var(--cp-font-cond);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--cp-yellow);
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.3);
  padding: 0.15rem 0.65rem;
  border-radius: 7px;
  text-transform: uppercase;
}

.cp-power-meter-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(11, 26, 45, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 0.2rem 0.7rem;
  flex: 1;
  max-width: 320px;
}
.cp-power-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--cp-text-muted);
}
.cp-power-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.cp-power-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #facc15, #f87171);
  border-radius: 99px;
  transition: width 0.05s linear;
}
.cp-power-percent {
  font-family: var(--cp-font-cond);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--cp-yellow);
  min-width: 36px;
  text-align: right;
}

/* ── Container do Canvas ── */
.cp-canvas-wrap {
  flex: 1;
  position: relative;
  background: linear-gradient(180deg, #050d1a 0%, #0c203b 100%);
  border: 2px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0,0,0,0.6), inset 0 0 35px rgba(56, 189, 248, 0.15);
  cursor: crosshair;
  min-height: 280px;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Instrução Inferior ── */
.cp-bottom-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--cp-text-muted);
  background: rgba(11, 26, 45, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 0.35rem 0.8rem;
}
.cp-bottom-hint strong { color: var(--cp-yellow); }

/* ── Modais e Overlays ── */
.cp-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 19, 0.88);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}
.cp-overlay.hidden { display: none !important; }

.cp-card {
  background: linear-gradient(145deg, #0e223d 0%, #081628 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  padding: 1.4rem;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px var(--cp-cyan-glow);
}

.cp-card-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e3a5f, #0d2038);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: grid;
  place-items: center;
  margin: 0 auto 0.6rem;
  box-shadow: 0 0 20px var(--cp-cyan-glow);
  font-size: 1.6rem;
}

.cp-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cp-cyan);
  margin-bottom: 0.2rem;
  display: inline-block;
}

.cp-title {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.4rem;
  color: #fff;
}
.cp-title span { color: var(--cp-yellow); }

.cp-desc {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--cp-text-muted);
  margin-bottom: 1.1rem;
}

.cp-instructions {
  background: rgba(7, 17, 31, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.9rem;
  margin-bottom: 1.2rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.cp-instruction-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: #d1e8ff;
}
.cp-inst-icon {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--cp-cyan);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}

.cp-btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  background: linear-gradient(135deg, #fde047 0%, #facc15 50%, #eab308 100%);
  color: #08111e;
  border: 1px solid rgba(254, 240, 138, 0.6);
  border-radius: 12px;
  font-family: var(--cp-font);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(250, 204, 21, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.cp-btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(250, 204, 21, 0.5);
}

.cp-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}
.cp-btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 42px;
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cp-btn-share:hover { background: #16a34a; }
.cp-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 40px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--cp-text);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cp-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--cp-cyan);
}

.cp-gameover-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 1rem 0;
}
.cp-go-stat {
  background: rgba(7, 17, 31, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.6rem;
  text-align: center;
}
.cp-go-label {
  font-size: 0.62rem;
  color: var(--cp-text-muted);
  font-weight: 700;
  text-transform: uppercase;
}
.cp-go-val {
  font-family: var(--cp-font-cond);
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}
.cp-go-val.highlight { color: var(--cp-yellow); }

.cp-record-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid var(--cp-yellow);
  color: var(--cp-yellow);
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 999px;
  margin-bottom: 0.8rem;
}

/* ── Toast no Canto Superior Direito ── */
.cp-toast {
  position: absolute;
  top: 65px;
  right: 25px;
  background: rgba(14, 34, 61, 0.95);
  border: 1px solid var(--cp-yellow);
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--cp-yellow-glow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-15px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 60;
}
.cp-toast.show {
  opacity: 1;
  transform: translateY(0);
}
