/* ==========================================================================
   tetris-atalhos.css — Tetris dos Atalhos (Pratique Grátis F5)
   Visual Cyber Neon, Matrix 10x20, HUD de Produtividade e D-pad Mobile.
   ========================================================================== */

:root {
  --tt-bg: #07111f;
  --tt-bg-deep: #030811;
  --tt-cyan: #22d3ee;
  --tt-cyan-glow: rgba(34, 211, 238, 0.4);
  --tt-yellow: #facc15;
  --tt-yellow-glow: rgba(250, 204, 21, 0.45);
  --tt-red: #ef4444;
  --tt-green: #22c55e;
  --tt-purple: #c084fc;
  --tt-text: #f0f6ff;
  --tt-text-muted: #94a3b8;
  --tt-font: 'Barlow', system-ui, sans-serif;
  --tt-font-mono: 'Barlow Condensed', monospace;
}

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

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

.tt-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 20%, #0d223d 0%, var(--tt-bg-deep) 85%);
  overflow: hidden;
}

/* ── Topbar ─────────────────────────────────────────────────────────── */
.tt-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 17, 31, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  z-index: 50;
}

.tt-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tt-text-muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}
.tt-back-btn:hover {
  color: var(--tt-cyan);
  border-color: var(--tt-cyan);
  background: rgba(34, 211, 238, 0.08);
}

.tt-top-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tt-top-title span { color: var(--tt-yellow); }
.tt-top-badge {
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--tt-cyan);
}

.tt-top-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tt-btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--tt-text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tt-btn-icon:hover {
  color: var(--tt-text);
  border-color: var(--tt-cyan);
  background: rgba(34, 211, 238, 0.1);
}
.tt-btn-icon svg { width: 18px; height: 18px; }

/* ── Layout Principal do Jogo ────────────────────────────────────────── */
.tt-main-stage {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.85rem;
}

/* Painel Esquerdo (Atalho Ativo & Dicas) */
.tt-side-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 170px;
}

.tt-hud-card {
  background: rgba(7, 17, 31, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

.tt-hud-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-text-muted);
  margin-bottom: 0.3rem;
}

.tt-hud-val {
  font-family: var(--tt-font-mono);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--tt-cyan);
  line-height: 1.1;
}
.tt-hud-val.gold { color: var(--tt-yellow); }

/* Cartão de Atalho em Destaque */
.tt-active-shortcut {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(250, 204, 21, 0.1));
  border: 1.5px solid var(--tt-cyan);
  box-shadow: 0 0 20px var(--tt-cyan-glow);
  border-radius: 14px;
  padding: 0.85rem 0.6rem;
  text-align: center;
  animation: pulseShortcut 2s infinite ease-in-out;
}
@keyframes pulseShortcut {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.tt-shortcut-action {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--tt-yellow);
  margin-bottom: 0.4rem;
}

.tt-shortcut-keys {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.tt-shortcut-keys kbd {
  background: #0f274a;
  border: 1px solid var(--tt-cyan);
  border-bottom: 3px solid #0369a1;
  color: #ffffff;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-family: var(--tt-font-mono);
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Área Central do Canvas do Tetris */
.tt-board-container {
  position: relative;
  border: 2px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 0 0 30px rgba(34, 211, 238, 0.2);
  background: #040d1a;
}

#tetrisCanvas {
  display: block;
  background: transparent;
}

/* Painel Direito (Próxima Peça & Nível) */
.tt-side-panel-right {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 170px;
}

#nextCanvas {
  display: block;
  margin: 0.4rem auto 0;
  background: rgba(4, 13, 26, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Controles Touch Virtuais para Celular (D-pad) ───────────────────── */
.tt-touch-controls {
  display: none;
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  padding: 0 1.25rem;
  justify-content: space-between;
  align-items: center;
  z-index: 40;
}

.tt-touch-dpad {
  display: flex;
  gap: 8px;
}

.tt-tbtn {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(15, 39, 74, 0.85);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  color: var(--tt-cyan);
  font-size: 1.3rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
  cursor: pointer;
}
.tt-tbtn:active {
  background: var(--tt-cyan);
  color: #040d1a;
  transform: scale(0.94);
}

.tt-tbtn.drop {
  background: rgba(250, 204, 21, 0.2);
  border-color: var(--tt-yellow);
  color: var(--tt-yellow);
}
.tt-tbtn.drop:active {
  background: var(--tt-yellow);
  color: #040d1a;
}

/* ── Telas de Overlay (Intro, Game Over) ──────────────────────────────── */
.tt-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(4, 10, 20, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  animation: ttFadeIn 0.25s ease-out;
  overflow-y: auto;
  overflow-x: hidden;
}

.tt-overlay.hidden {
  display: none !important;
}

.tt-card {
  background: linear-gradient(145deg, #0e223d 0%, #081628 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 18px;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  padding: 1.3rem 1.4rem;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 35px rgba(34, 211, 238, 0.15);
  position: relative;
}

.tt-card-icon {
  width: 50px;
  height: 50px;
  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(--tt-cyan-glow);
  font-size: 1.5rem;
}

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

.tt-title {
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.4rem;
  color: var(--tt-text);
}
.tt-title span { color: var(--tt-yellow); }

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

.tt-instructions {
  background: rgba(7, 17, 31, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.9rem;
  margin-bottom: 1.15rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tt-instruction-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: #d1e8ff;
}

.tt-inst-icon {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--tt-cyan);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
}

.tt-btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 46px;
  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(--tt-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), 0 0 20px rgba(250, 204, 21, 0.2);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.tt-btn-play:hover {
  background: linear-gradient(135deg, #fef08a 0%, #fde047 50%, #facc15 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 35px rgba(250, 204, 21, 0.45);
}

/* Game Over Stats */
.tt-gameover-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.tt-go-stat {
  background: rgba(7, 17, 31, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  padding: 0.55rem 0.35rem;
  display: flex;
  flex-direction: column;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}

.tt-go-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--tt-text-muted);
  margin-bottom: 0.15rem;
  white-space: nowrap;
}

.tt-go-val {
  font-family: var(--tt-font-mono);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--tt-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tt-go-val.highlight { color: var(--tt-yellow); }

.tt-record-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fef08a;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.45);
  padding: 0.3rem 0.85rem;
  border-radius: 99px;
  margin-bottom: 0.85rem;
  animation: pulseRecord 1.5s infinite ease-in-out;
}

.tt-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tt-btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 42px;
  padding: 0.65rem 1rem;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
  border-radius: 10px;
  font-family: var(--tt-font);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tt-btn-share:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: #86efac;
  color: #ffffff;
}

.tt-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 38px;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--tt-text-muted);
  border-radius: 10px;
  font-family: var(--tt-font);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tt-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--tt-text);
  border-color: rgba(255, 255, 255, 0.25);
}

.tt-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f294a;
  border: 1px solid var(--tt-cyan);
  color: #ffffff;
  padding: 0.65rem 1.4rem;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
  pointer-events: none;
}
.tt-toast.show {
  transform: translateX(-50%) translateY(0);
}

@keyframes ttFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Responsividade para Mobile */
@media (max-width: 768px) {
  .tt-main-stage {
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 75px;
  }
  .tt-side-panel, .tt-side-panel-right {
    flex-direction: row;
    width: 100%;
    max-width: 320px;
    justify-content: space-between;
  }
  .tt-hud-card {
    flex: 1;
    padding: 0.4rem;
  }
  .tt-active-shortcut { display: none; } /* em mobile foca no dpad */
  .tt-touch-controls { display: flex; }
}
